Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TriangleList versus TriangleStrip

Tags:

opengl

Between a TriangleStrip and a TriangleList, which one performs faster?

Something interesting I've just read says: "My method using triangle list got about 780fps, and the one with triangle strip only got 70fps". I don't have details as to what exactly he is making, but according to this he's getting about 10 times the frame rate using a TriangleList. I find this counter-intuitive because the list contains more vertex data.

Does anyone know a technical reason why the TriangleList might be so much faster than a Strip?

like image 878
Joseph Lormand Avatar asked Aug 23 '12 14:08

Joseph Lormand


1 Answers

Triangle strips are a memory optimization, not a speed optimization. At some point in the past, when bus bandwidth between the system memory and video memory was the main bottle neck in a data intensive application, then yes it would also saved time but this is very rarely the case anymore. Also, transform cache was very small in old hardware, so an ordinary strip would cache better than a badly optimized indexed list.

The reason why a triangle list can be equaly or more efficient than a triangle strip is indices. Indices let the hardware transform and cache vertices in a very previsible fashion, given that you are optimizing your geometry and triangle order correctly. Also, in a very complex mesh requiring a lot of degenerate triangles, strips will be both slower and take more memory than an indexed list.

I must say I'm a little surprised that your example shows an order of magnitude difference though.

like image 133
Coincoin Avatar answered Oct 11 '22 16:10

Coincoin