March 2013
Intermediate to advanced
984 pages
26h 18m
English
The vertices output from the tessellation control shader (i.e., the gl_Position values in gl_out array) are made available in the evaluation shader in the gl_in variable, which when combined with tessellation coordinates, can be used to generate the output vertex’s position.
Tessellation coordinates are provided to the shader in the variable gl_TessCoord. In Example 9.6, we use a combination of equal-spaced quads to render a simple patch. In this case, the tessellation coordinates are used to color the surface, and illustrates how to compute the vertex’s position.
Example 9.6. A Sample Tessellation Evaluation Shader
#version 420 corelayout (quads, equal_spacing, ccw) in;out vec4 color; ...