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
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