Sends a ShaderBlock to a Shader. After the block is sent, you can update the data in the block without needing to resend the block. The block can be sent to multiple shaders and they will all see the same data from the block.
Shader:sendBlock(name, block, access)
|name||string||The name of the block to send to.|
|block||ShaderBlock||The ShaderBlock to associate with the specified block.|
|access||UniformAccess||readwrite||How the Shader will use this block (used as an optimization hint).|
The Shader does not need to be active to send it a block.
Make sure the ShaderBlock's variables line up with the block variables declared in the shader code, otherwise you'll get garbage data in the block. An easy way to do this is to use
ShaderBlock:getShaderCode to get a GLSL snippet that is compatible with the block.