Tessellation Control Shader Variables

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. ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.