3 GL_ARB_tessellation_shader
6 [vertex shader passthrough]
8 [tessellation control shader]
9 #extension GL_ARB_tessellation_shader: require
10 layout(vertices = 3) out;
12 patch out vec4 color[3];
15 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
16 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
17 gl_TessLevelInner = float[2](0.0, 0.0);
18 color[0] = vec4(0, 0.3, 0, 1);
19 color[2] = vec4(0, 0.7, 0, 1);
23 [tessellation evaluation shader]
24 #extension GL_ARB_tessellation_shader: require
27 patch in vec4 color[3];
31 gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
32 + gl_in[1].gl_Position * gl_TessCoord[1]
33 + gl_in[2].gl_Position * gl_TessCoord[2];
35 color_fs = color[0] + color[2];
44 gl_FragColor = color_fs;
57 clear color 0.1 0.1 0.1 0.1
59 patch parameter vertices 3
60 draw arrays GL_PATCHES 0 6
61 probe all rgba 0.0 1.0 0.0 1.0