PDA

View Full Version : Does TRIANGLE_STRIP vertex drawing order matter?



GLRon
11-28-2010, 07:14 PM
If you give a triangle strip six vertices (v0, v1, v2, v3, v4, v5, v6), according to the docs, it doesn't draw:

(v0, v1, v2) , (v1, v2, v3) , (v2, v3, v4) , (v3, v4, v5)

It actually draws:

(v0, v1, v2) , (v1, v3, v2) , (v2, v3, v4) , (v3, v5, v4)

Are there any practical cases where this matters? I mean, the output should appear identical in POINT, LINE, or FILL mode with or without vertex colors.

ugluk
11-28-2010, 07:45 PM
I think GL switches vertex order so that the triangle orientation remains constant (such as it was for v0, v1, v2). This should not matter.

mhagain
11-29-2010, 02:04 AM
Back face culling depends on the vertex winding order in your triangles; using (v0, v1, v2), (v1, v3, v2), (v2, v3, v4), (v3, v5, v4) preserves the same winding for all triangles in the strip, meaning that the cull mode itself doesn't need to be flipped (e.g. from CCW to CW or vice-versa) on alternate triangles.