Texture:clear
EditClears layers and mipmaps in a texture to a given color.
When a Texture is being used as a canvas for a Pass
, the clear color can be set with Pass:setClear
, which a more efficient way to clear the texture before rendering.
Clear the whole texture to zero (transparent black).
Arguments
None
Returns
Nothing
Arguments
Name | Type | Default | Description |
hex | number | The hexcode color to clear to. | |
layer | number | 1 | The index of the first layer to clear. |
layerCount | number | nil | The number of layers to clear. If nil, clears the rest of the layers. |
mipmap | number | 1 | The index of the first mipmap to clear. |
mipmapCount | number | nil | The number of mipmaps to clear. If nil, clears the rest of the mipmaps. |
Returns
Nothing
Arguments
Name | Type | Default | Description |
r | number | The red component of the clear color. | |
g | number | The green component of the clear color. | |
b | number | The blue component of the clear color. | |
a | number | The alpha component of the clear color. | |
layer | number | 1 | The index of the first layer to clear. |
layerCount | number | nil | The number of layers to clear. If nil, clears the rest of the layers. |
mipmap | number | 1 | The index of the first mipmap to clear. |
mipmapCount | number | nil | The number of mipmaps to clear. If nil, clears the rest of the mipmaps. |
Returns
Nothing
Arguments
Name | Type | Default | Description |
t | table | A table with color components. | |
layer | number | 1 | The index of the first layer to clear. |
layerCount | number | nil | The number of layers to clear. If nil, clears the rest of the layers. |
mipmap | number | 1 | The index of the first mipmap to clear. |
mipmapCount | number | nil | The number of mipmaps to clear. If nil, clears the rest of the mipmaps. |
Returns
Nothing
Arguments
Name | Type | Default | Description |
v3 | Vec3 | A vec3 with the clear color. | |
layer | number | 1 | The index of the first layer to clear. |
layerCount | number | nil | The number of layers to clear. If nil, clears the rest of the layers. |
mipmap | number | 1 | The index of the first mipmap to clear. |
mipmapCount | number | nil | The number of mipmaps to clear. If nil, clears the rest of the mipmaps. |
Returns
Nothing
Arguments
Name | Type | Default | Description |
v4 | Vec4 | A vec4 with the clear color. | |
layer | number | 1 | The index of the first layer to clear. |
layerCount | number | nil | The number of layers to clear. If nil, clears the rest of the layers. |
mipmap | number | 1 | The index of the first mipmap to clear. |
mipmapCount | number | nil | The number of mipmaps to clear. If nil, clears the rest of the mipmaps. |
Returns
Nothing
Notes
The texture must have been created with the transfer
usage to clear it.
The clear color will be interpreted as a linear color for sRGB formats.