Library rendertarget

Render target library. Use it to create a render target texture object to draw to.

Functions

create( highRes, w, h ) Requests a new render target.
createWithSize( width, height ) Requests a new render target with the given dimensions.
getMaxMemoryMiB() Returns the maximum amount of graphics memory that can be allocated for render targets.
getMaxRTCount() Returns the maximum number of RTs that may be created.
getMaxTextureSize() Returns the maximum size along a given axis that a render target can be.
getMinTextureSize() Returns the minimum size along a given axis that a render target can be.
getRemainingMemoryMiB() Returns the remaining amount of graphics memory (in MiB) that can be allocated for render targets for the instance owner.
getRemainingRTCount() Returns the remaining number of RTs that may be created for the instance owner.

Fields

MATERIAL_FLAG_VERTEXCOLOR Flag used to apply vertex-specific colours when rendering.
MATERIAL_FLAG_VERTEXALPHA Flag used to apply vertex-specific alpha values when rendering.
MATERIAL_FLAG_SELFILLUM Flag used to apply self-illumination using the alpha channel when rendering.
MATERIAL_FLAG_ADDITIVE Flag used to render the material additively.
MATERIAL_FLAG_ALPHATEST Flag used to apply alpha testing when rendering.
MATERIAL_FLAG_NOCULL Flag used to disable backface culling when rendering.
MATERIAL_FLAG_TRANSLUCENT Flag used to apply translucency when rendering based on the alpha channel.
MATERIAL_FLAG_HALFLAMBERT Flag used to apply half-lambert shading when rendering.
SHADER_VERTEX_LIT_GENERIC Shader used to apply lighting to the render target.
SHADER_UNLIT_GENERIC Shader used to ignore lighting on the render target.


Functions

rendertarget.create( highRes, w, h )
Requests a new render target. These are limited to a fixed amount per player.

Deprecated: Use rendertarget.createWithSize() instead.

Environment:

Client

Parameters:

  • highRes: When no W/H is given: if true, the RT is the "highres" resolution. If false it is the standard screen size.
  • w: (Optional) This sets a custom width. Must be a power of 2, or it will error.
  • h: (Optional) This sets a custom height. Must be a power of 2, or it will error.

Return value:

    (RenderTarget | nil) The render target, or nil if no further render targets can be created.
rendertarget.createWithSize( width, height )
Requests a new render target with the given dimensions. These are limited to a fixed amount per player.

Environment:

Client

Parameters:

  • width: The width of the texture. Must be a power of 2.
  • height: The height of the texture. Must be a power of 2.

Return value:

    (RenderTarget | nil) The render target, or nil if no further render targets can be created.
rendertarget.getMaxMemoryMiB()
Returns the maximum amount of graphics memory that can be allocated for render targets. This applies at the player level, and is shared with screens.

Environment:

Client
rendertarget.getMaxRTCount()
Returns the maximum number of RTs that may be created. This applies at the player level.

Environment:

Client
rendertarget.getMaxTextureSize()
Returns the maximum size along a given axis that a render target can be.

Environment:

Client
rendertarget.getMinTextureSize()
Returns the minimum size along a given axis that a render target can be.

Environment:

Client
rendertarget.getRemainingMemoryMiB()
Returns the remaining amount of graphics memory (in MiB) that can be allocated for render targets for the instance owner. Note that this is shared with screens.

Environment:

Client
rendertarget.getRemainingRTCount()
Returns the remaining number of RTs that may be created for the instance owner. Note that this does not account for memory constraints. See rendertarget.getRemainingMemoryMiB() for the memory quota.

Environment:

Client

Valid XHTML 1.0!