PDA

View Full Version : Tessellation Evaluation Layout Primitive Ordering



GingerBread
03-18-2012, 09:04 AM
Hi all,
I have defined the vertices and indices of the quad in the following way:


const Vertex VERTICES[4] =
{
{ {0.5f, 0.5f, 0.0f} },
{ {0.5f, -0.5f, 0.0f} },
{ {-0.5f, -0.5f, 0.0f} },
{ {-0.5f, 0.5f, 0.0f} }
};

const GLuint INDICES[4] =
{
0, 1, 2, 3
};





p0 p1
.......
. .
. .
.......
p3 p2



In the Tessellation Evaluation Shader, when I put the primitive ordering CCW, then it draws the quad according to given tessellation levels otherwise just a blank screen:


layout(quads, equal_spacing, ccw) in;

vec3 puv = interpolate3D( interpolate3D(p3, p2, u), interpolate3D(p0, p1, u), v);

I wonder how it decides the order of the given set of vertices.

Thanks,