
102 IDiscovering
layout (quads) in;
in vec3 tcPosition[];
patch in mat4 cx , cy, cz ;
uniform mat4 Projection;
uniform mat4 Modelview;
void main ()
{
float u=gl_TessCoord.x, v = gl_TessCoord.y;
vec4 U=vec4(u*u*u,u*u,u,1);
vec4 V=vec4(v*v*v,v*v,v,1);
float x=dot(cx * V, U);
float y=dot(cy * V, U);
float z=dot(cz * V, U);
gl_Position = Projection * Modelview * vec4(x , y, z , 1);
}
Listing 6.6. Evaluation shader.
Current drivers have trouble with varying arrays of matrices; we had to replace
the c[] array with three separate matrices.
Further gains could be achieved by removing the for loop and using the barrier
instruction, but current drivers do not support the ...