March 2013
Intermediate to advanced
984 pages
26h 18m
English
Textures may be read by a shader by associating a sampler variable with a texture unit and using GLSL’s built-in functions to fetch texels from the texture’s image. The way in which the texels are fetched depends on a number of parameters that are contained in another object called a sampler object. Sampler objects are bound to sampler units much as texture objects are bound to texture units. For convenience, a texture object may be considered to contain a built-in sampler object of its own that will be used by default to read from it, if no sampler object is bound to the corresponding sampler unit.
To create a sampler object, as with most other object types in OpenGL, we reserve a name for the new object and bind it to a binding ...