ShaderBlock:send

Updates a variable in the ShaderBlock.

ShaderBlock:send(variable, value)

Arguments

NameTypeDescription
variablestringThe name of the variable to update.
value*The new value of the uniform.

Returns

Nothing


bytes = ShaderBlock:send(blob, offset, extent)

Arguments

NameTypeDefaultDescription
blobBlobA Blob to replace the block data with.
offsetnumber0A byte offset into the Blob to start writing from.
extentnumbernilThe number of bytes to write. If nil, writes as many bytes as possible.

Returns

NameTypeDescription
bytesnumberHow many bytes were copied to the block.

Notes

For scalar or vector types, use tables of numbers or vec3s for each vector.

For matrix types, use tables of numbers or mat4 objects.

Blobs can also be used to pass arbitrary binary data to individual variables.

See also