ShaderBlock:getOffset

Returns the byte offset of a variable in a ShaderBlock. This is useful if you want to manually send binary data to the ShaderBlock using a Blob in ShaderBlock:send.

offset = ShaderBlock:getOffset(field)

Arguments

NameTypeDescription
fieldstringThe name of the variable to get the offset of.

Returns

NameTypeDescription
offsetnumberThe byte offset of the variable.

See also