March 2013
Intermediate to advanced
984 pages
26h 18m
English
The gl_in array is actually an array of structures, with each element defined as:
in gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]} gl_in[gl_PatchVerticesIn];
and for each value that you need downstream (e.g., in the tessellation evaluation shader), you’ll need to assign values similar to what we did with the gl_Position field.
The gl_out array has the same fields, but is a different size specified by gl_PatchVerticesOut, which as we saw, was set in the tessellation control shader’s out layout qualifier. Additionally, the following scalar values, described in Table 9.1 are provided for determining which primitive and output vertex invocation is being shaded:
Table 9.1. ...