Pass:setClear
EditSets the clear values of the pass. This controls the initial colors of the canvas texture pixels at the beginning of the render pass. For each color texture, it can be one of the following:
- A specific RGBA color value (or number for the depth texture).
true
, to do a "fast clear" to undefined values. This is useful if the pass is going to end up drawing to all of the texture's pixels.false
, to avoid clearing and load the texture's existing pixels. This can be slow on mobile GPUs.
Set the clear color for all color textures, using a hexcode.
Arguments
Name | Type | Description |
hex | number | A hexcode color to clear all color textures to. |
Returns
Nothing
Set the clear color for all color textures, using numbers.
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 | 1.0 | The alpha component of the clear color. |
Returns
Nothing
Set the clear color for all color textures, using a boolean.
Arguments
Name | Type | Description |
clear | boolean | Whether color textures should be cleared. |
Returns
Nothing
Set the clear color for all color textures using a table, or set clear values for individual textures.
Arguments
Name | Type | Description |
t | table |
A table of clear values. This can be a table of 4 numbers to use for all color textures, or it can be a list of boolean and/or RGBA tables to use for each individual color texture. It can also have a depth key with a boolean/number for the depth texture's clear.
|
Returns
Nothing
Notes
If the depth clear is not given, it will be set to 0.
All clear colors will default to transparent black (all zeros) when the Pass is created.