Pass:clear

Clears a Buffer or Texture.


Clears a range of a Buffer, setting the values to zero.

Pass:clear(buffer, index, count)

Arguments

NameTypeDefaultDescription
bufferBuffer The Buffer to clear.
indexnumber1 The index of the first item to clear.
countnumbernil The number of items to clear. If nil, clears to the end of the Buffer.

Returns

Nothing


Clears layers and mipmap levels in a Texture to a color.

Pass:clear(texture, color, layer, layers, level, levels)

Arguments

NameTypeDefaultDescription
textureTexture The Texture to clear.
colorVec4 The color to clear the texture to. Can also be a Vec3, table of numbers, or a hexcode.
layernumber1 The index of the first layer to clear.
layersnumbernil The number of layers to clear. If nil, clears the remaining layers.
levelnumber1 The index of the first mipmap level to clear.
levelsnumbernil The number of mipmap level to clear. If nil, clears the remaining mipmaps.

Returns

Nothing

See also