Optimizing modern OpenGL relies on aggressive batching, which is done by calls like glMultiDrawElementsIndirect. Although glMultiDrawElementsIndirect
can render a large number of different meshes, it makes the assumption that all these meshes are made of the same primitives (eg. GL_TRIANGLES
, GL_TRIANGLE_STRIP
, GL_POINTS
).
In order to most efficiently batch rendering, is it wise to force everything to be GL_TRIANGLES
(while ignoring possible optimizations with GL_TRIANGLE_STRIP
or GL_TRIANGLE_FAN
) in order to make it possible to group more meshes together?
This though comes from reading the Approaching Zero Driver Overhead slides, which suggests to draw everything (or, presumably, as much as possible) in a single glMultiDrawElementsIndirect
call.
GL_TRIANGLE_STRIP
andGL_TRIANGLE_FAN
are counter-productive if you are trying to group meshes together. You have to insert degenerate triangles or primitive restart indices in order to do that. In reality, the primary benefit of strips (cache efficiency) can be achieved just by using an indexed list of triangles in that order. Of course if you used strip order verbatim you would have winding issues, it is not the vertex order that you need to duplicate but the triangle order. \$\endgroup\$