March 2013
Intermediate to advanced
984 pages
26h 18m
English
Because uniform variables form a bridge to share data between shaders and your application, you need to find the offsets of the various uniform variables inside the named uniform blocks in your shaders. Once you know the location of those variables, you can initialize them with data, just as you would any type of buffer object (using calls such as glBufferData(), for example).
To start, let’s assume that you already know the names of the uniform blocks used inside the shaders in your application. The first step in initializing the uniform variables in your uniform block is to obtain the index of the block for a given program. Calling glGetUniformBlockIndex() returns an essential piece of information ...
Read now
Unlock full access