3
votes

I have read many times that merging geometry from triangles to triangle strips or triangle fans can increase performance of 3D rendering, because less vertices has to be processed etc... How relevant are all these considerations in the context of use of VBO and indexed rendering?

For example I have a primitive (sphere) that consists of triangles. I have VBO where I store only unique vertices, and I have VBO (bound to GL_ELEMENT_ARRAY_BUFFER) where I store indices to construct primitive from vertices. All rendering is done via glDrawElementsInstanced(). Will I get any performance increase after applying some stripifying technique and rendering my primitive as GL_TRIANGLE_STRIP with primitive restart enabled?

The documentation says that OpenGL pipeline assembles the primitives after all per vertex operations and before rasterization. As I can guess, it means that driver first call vertex (geometry, etc.) shader for all vertices, and only after that starts using index array to get triangles. If it's true, stripifying can slow down the process since additional checks for primitive restart will be applied.

I tried to find some stripifier libraries, but all I've found looks abandoned a couple of years ago. So people suddenly lost interest in this area...

Taking all these considerations into account, there is no need in stripifying. Am I correct or I've missed something important? Does one need to stripify on modern hardware?

1

1 Answers

3
votes

Generally speaking no, you will not get an advantage from tri-strips. Modern hardware is expecting indexed data, and is optimised for that.

That is not to say that indexes can be randomly accessed - locality is important as data is cached. So arranging the triangles in a strip order might give some improvement.

Performance will also vary depending on how much time is actually spent worrying about triangle setup and vertex processing, and how much is going on actual shading.

So as with everything - profile your performance to see what works for your own case, but I haven't bothered with stripping triangles since the PS2.