views:

720

answers:

1

For drawing complex concave polygons with OpenGL, is it better to tesselate it into triangles, or use the stencil buffer? I'm guessing the stencil buffer would be faster for a single frame, but triangulation would be better for multiple frames if the polygon doesn't change. However, I haven't actually tried it, so I don't know.

+4  A: 

It's exactly the way you said it:

Triangulated polygons render faster but have a high one-time CPU cost, namely the triangulation itself. In my experience it pays off to triangulate the polygons if you have to render it at least twice.

The size of the polygon makes a difference though. Very small polygons cost much less if you use the stencil buffer method than large polygons because you can restrict the size of the second rendering pass to the boundary box of the polygon.

Nils Pipenbrinck