March 2013
Intermediate to advanced
984 pages
26h 18m
English
Given the information from our patches, we can easily construct the tessellation control shader for our application, which is shown in Example 9.8.
Example 9.8. Tessellation Control Shader for Teapot Example
#version 420 corelayout (vertices = 16) out;void main(){ gl_TessLevelInner[0] = 4; gl_TessLevelInner[1] = 4; gl_TessLevelOuter[0] = 4; gl_TessLevelOuter[1] = 4; gl_TessLevelOuter[2] = 4; gl_TessLevelOuter[3] = 4; gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;}
Using the tessellation level factors from Example 9.8, Figure 9.5 shows the patches of the teapot (shrunk slightly to expose each individual patch). ...