March 2013
Intermediate to advanced
984 pages
26h 18m
English
This section of the chapter covers two output variables available in the geometry shader that can redirect rendering into different regions of the framebuffer, or to layers of array textures. These variables are gl_ViewportIndex and gl_Layer, respectively. Their values are also available as inputs to fragment shaders.9
9. As of GLSL version 4.3, gl_Layer and gl_Viewport are available as inputs to the fragment shader. In earlier versions of OpenGL (and GLSL), if you need the values of these variables in the fragment shader, you would need to pass them explicitly as a user-defined variable.