Is it possible to make a nearly uninterrupted triangle strip out of every possible object? I played around a lot and I found out that triangle strips are nearly twice as fast on my voodoo 3. I also tested some optimization code that sorts triangles, finds triangle fans and starts new strips if neccessary but every time there were some small geometry errors in the scene and only objects created out of a sphere are really faster (about 98% optimization).
so is there a common way to do this optimization or is it unneccesary because only a voodoo accelerates triangle strips/fans this much?
Triangle strips are faster on all cards, as they minimise the transformation claculations required and maximise use of any vertex caches present.
Due to the way opengl orders the vertices in drawing strips, you’ll always have to use several strips for all but the simplest of shapes. Personally, I found that once I included extra vertices for normals and textures on faces, it was hardly worth stripifying meshes, as I was restarting strips all the time. If you’re just drawing untextured, unlit objects then it’s definitely worth it though.
Strips can be a non-insignificant gain even if your strips on average are short (4-5 indices on average), just on the number of indices you aren’t sending multiple times. nVidia’s web site has a pretty nice striping program that’s reasonably easy to use. It has the option to strip all your geometry together by using degenerate triangles. Personally, I think that’s a bit excessive, but it is entirely possible to turn your geometry into one single strip. I wouldn’t suggest it.
hey, thx for this information.
the code i’ve already written does not insert any new vertices or something, it just detects strips and if they are not longer possible it starts a new one. the code also detects fans but there are still some triangles missing. my best result is currently an objects (deformated sphere) with 39600 faces where 496 times a new strip has to be started, that’s a length of about 80 triangles per strip! performance gain is 50% (20-30fps).
i also tested sorting triangles but like Benjy said this works best with untextured objects.
i just downloaded the nvidia stripe library and i’m going to test it soon.
why do you think this is excessive? i think a performance gain of 50% - 80% is a good reason to find some algorithm that strips geometry.
I never actually tested performance using my triangle strips - I hope I can still find my stripifier and test it out. I just assumed all those drawelements calls were too expensive.