Back Alignment + GL_TRIANGLE_STRIP?

If I have 4 vertices, which I do in the following order:

2-3 |\| 0-1 

using GL_TRIANGLE_STRIP , and then I allow the cast on the front with the front labeled CCW, and then the bottom left triangle should face me and the other not? If so, what is the most effective way to make the square so that both sides are visible? Do I need to use GL_TRIANGLES and skip 6 vertices instead of 4?

+6
source share
2 answers

A simple strip primitive does the right thing regarding culling. You can think that the order of winding the tris is controlled so that the order is consistent for each triangle in the strip - for example, you can think about rendering the GPU (0,1,2), (2,1,3) ...

+4
source

All triangles in a triangular strip maintain the same direction / winding order. They do not roll over one after another. Thus, either both triangles will be directed towards you, or far away from you (if your primitive is a flat square shape (that is, convex and does not intersect), where all the vertices belong to the same plane).

PS You know, you CAN make a trianglestrip primitive in an OpenGL application with disabling enabled and see for yourself.

+4
source

Source: https://habr.com/ru/post/907729/


All Articles