Shader:sendImage
Sends a Texture to a Shader for writing. This is meant to be used with compute shaders and only works with uniforms declared as image2D
, imageCube
, image2DArray
, and image3D
. The normal Shader:send
function accepts Textures and should be used most of the time.
Shader:sendImage(name, texture, slice, mipmap, access)
Arguments
Name | Type | Default | Description |
name | string | The name of the image uniform. | |
texture | Texture | The Texture to assign. | |
slice | number | nil | The slice of a cube, array, or volume texture to use, or nil for all slices.
|
mipmap | number | 1 | The mipmap of the texture to use. |
access | UniformAccess | 'readwrite' | Whether the image will be read from, written to, or both. |
Returns
Nothing
Shader:sendImage(name, index, texture, slice, mipmap, access)
Arguments
Name | Type | Default | Description |
name | string | The name of the image uniform. | |
index | number | The array index to set. | |
texture | Texture | The Texture to assign. | |
slice | number | nil | The slice of a cube, array, or volume texture to use, or nil for all slices.
|
mipmap | number | 1 | The mipmap of the texture to use. |
access | UniformAccess | 'readwrite' | Whether the image will be read from, written to, or both. |
Returns
Nothing
See also
Shader:send
ShaderBlock:send
ShaderBlock:getShaderCode
UniformAccess
ShaderBlock
Shader