3 GL_ARB_tessellation_shader
5 [vertex shader passthrough]
6 [tessellation control shader]
7 #extension GL_ARB_tessellation_shader : require
8 layout(vertices = 3) out;
10 uniform sampler2D tex;
13 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
14 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
15 gl_TessLevelInner = float[2](1.0, 1.0);
16 vec2 texcoord = gl_in[gl_InvocationID].gl_Position.xy*0.25+0.5;
17 color1[gl_InvocationID] = texture(tex, texcoord);
20 [tessellation evaluation shader]
21 #extension GL_ARB_tessellation_shader : require
28 gl_in[0].gl_Position * gl_TessCoord[0] +
29 gl_in[1].gl_Position * gl_TessCoord[1] +
30 gl_in[2].gl_Position * gl_TessCoord[2];
31 color = color1[0] * gl_TessCoord[0] +
32 color1[1] * gl_TessCoord[1] +
33 color1[2] * gl_TessCoord[2];
53 clear color 0.5 0.5 0.5 1.0
55 patch parameter vertices 3
57 texture checkerboard 0 0 (32, 32) (0.0, 0.0, 1.0, 0.0) (0.0, 1.0, 0.0, 0.0)
58 texparameter 2D min nearest
59 texparameter 2D mag nearest
61 draw arrays GL_PATCHES 0 6
63 tolerance 0 0.02 0.02 1
64 # blue in bottom left and top right corners, green elsewhere
66 relative probe rgba ( 0, 0 ) ( 0, 0, 1, 1 )
69 relative probe rgba ( 1, 1 ) ( 0, 0, 1, 1 )
70 relative probe rgba ( 0, 1 ) ( 0, 1, 0, 1 )
71 relative probe rgba ( 1, 0 ) ( 0, 1, 0, 1 )
72 relative probe rgba ( 0.5, 0.5 ) ( 0, 1, 0, 1 )