• Welcome to Dark Bit Factory & Gravity.
 

OpenGL Triangle Strips

Started by Xalthorn, March 31, 2010

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Xalthorn

Okay, so I have my little demo doing what I want it to do but now I want to do some heavy optimising.

It uses a significant number of triangles held in a big list and I figured the thing would run faster if I converted it to a few triangle strips.

However, having read through some websites, there seems to be a debate on whether or not this will make any difference whatsoever, and in fact it might run slower due to vertex cache issues.

As this is my first OpenGL project and I really don't have a clue, I'm hoping some of the experienced OpenGL'ers could let me know if it's worth wrestling with strips or just leave it as a triangle list.
Challenge Trophies Won:

hellfire

If your application is limited by vertex-throughput use indexed triangle-lists with VBOs.
With strips you always pass one vertex per triangle.
With indexing you can get significantly lower (~0.5 vtx/tri) because all three vertices of a new triangle are still in the cache.
Challenge Trophies Won:

Xalthorn

Quote from: hellfire on March 31, 2010
If your application is limited by vertex-throughput use indexed triangle-lists with VBOs.
With strips you always pass one vertex per triangle.
With indexing you can get significantly lower (~0.5 vtx/tri) because all three vertices of a new triangle are still in the cache.

Umm, okay looks like I need to do some more reading.  I'll follow that link and have a read :)
Challenge Trophies Won:

Voltage

This looks like a good resource for finding bottlenecks in your opengl apps:

http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node205.html
Challenge Trophies Won:

hellfire

Quotea significant number of triangles held in a big list
If "list" means a display-list you won't see much gain from VBOs.
The driver often performs quite some optimizations when assembling the list.
Challenge Trophies Won:

Xalthorn

Quote from: hellfire on April 01, 2010
Quotea significant number of triangles held in a big list
If "list" means a display-list you won't see much gain from VBOs.
The driver often performs quite some optimizations when assembling the list.

Nope, my list is not as organised as that, it's just running through an array, spitting out OpenGL triangle commands as it goes.  I'm essentially writing a freebasic program throwing data at OpenGL and I'm sure OpenGL is annoyed at the way I'm doing it :)

But that gives me something else to think about, thanks :)
Challenge Trophies Won:

hellfire

Are your vertices static or dynamic?
Challenge Trophies Won:

Xalthorn

Quote from: hellfire on April 01, 2010
Are your vertices static or dynamic?

Assuming you are asking if the vertices have the same local coordinates and not whether the vertice list changes, I have two large models, one is static (although the thing scales, but I can probably mess with the camera for that) and the other is extremely dynamic.

From initial looks, I'm guessing I can pop the static one in a display list for sheer speed as the thing never changes shape.  That should get me a huge speed increase, and I'm wondering if I pop the dynamic one into a display list I should be sending less information to the OpenGL pipeline each frame.
Challenge Trophies Won: