ShaderBlock:send
Updates a variable in the ShaderBlock.
ShaderBlock:send(variable, value)
Arguments
Name | Type | Description |
variable | string | The name of the variable to update. |
value | * | The new value of the uniform. |
Returns
Nothing
bytes = ShaderBlock:send(blob, offset, extent)
Arguments
Name | Type | Default | Description |
blob | Blob | A Blob to replace the block data with. | |
offset | number | 0 | A byte offset into the Blob to start writing from. |
extent | number | nil | The number of bytes to write. If nil , writes as many bytes as possible.
|
Returns
Name | Type | Description |
bytes | number | How many bytes were copied to the block. |
Notes
For scalar or vector types, use tables of numbers or vec3
s for each vector.
For matrix types, use tables of numbers or mat4
objects.
Blob
s can also be used to pass arbitrary binary data to individual variables.
See also
Shader:send
Shader:sendBlock
ShaderBlock:getShaderCode
ShaderBlock:getOffset
ShaderBlock:getSize
ShaderBlock