Garry's Mod Wiki


ITexture GetRenderTargetEx( string name, number width, number height, number sizeMode, number depthMode, number textureFlags, number rtFlags, number imageFormat )


Gets (or creates if it does not exist) the rendertarget with the given name, this function allows to adjust the creation of a rendertarget more than GetRenderTarget.

See also render.PushRenderTarget and render.SetRenderTarget.


1 string name
The internal name of the render target.

The name is treated like a path and gets its extension discarded.
"name.1" and "name.2" are considered the same name and will result in the same render target being reused.
2 number width
The width of the render target, must be power of 2.
3 number height
The height of the render target, must be power of 2.
4 number sizeMode
Bitflag that influences the sizing of the render target, see Enums/RT_SIZE.
5 number depthMode
Bitflag that determines the depth buffer usage of the render target Enums/MATERIAL_RT_DEPTH.
6 number textureFlags
Bitflag that configurates the texture, see Enums/TEXTUREFLAGS.

List of flags can also be found on the Valve's Developer Wiki:

7 number rtFlags
Flags that controll the HDR behaviour of the render target, see Enums/CREATERENDERTARGETFLAGS.
8 number imageFormat
Image format, see Enums/IMAGE_FORMAT.


1 ITexture
The new render target.

Page Links

Special Pages



Render Time: 61ms

DB GetPage 4
Generate Html 27
SaveChanges (1) 17
Render Body 0
Render Sidebar 9