12

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?

3 Answers 3

12

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.

3
  • 1
    Thank you for your answer. I too was surprised to see such a huge difference in frame rate between the two in his tests. Aug 23, 2012 at 15:23
  • 3
    There's no reason it should be 10 times faster. I think he's doing something wrong.
    – Robinson
    Aug 23, 2012 at 15:48
  • 1
    @Joseph I agree with Robinson. Something is wrong here. Maybe you should double check the test and make sure that both tests use the same streaming method (glVertex, buffer objects, ...)
    – Coincoin
    Aug 23, 2012 at 21:14
6

A triangle list can be much faster than a strip because it saves draw calls by batching the vertex data together easily. Draw calls are expensive so the memory you save by using a strip is sometimes not worth the decreased performance.

0
2

Indexed triangle lists will generally win..

Here's a simple rule. Count the number of vertices you will be uploading to the graphics card. If the triangle list (indexed triangle list to be precise) has less vertices than the same data as a triangle strip, then likely it will run faster.

If the number of vertices are very close in both cases, then possibly the strip will run faster because it doesn't have the overhead of the indice list, but I expect that is also driver specific.

Non-Indexed triangle lists are almost always worst case (3 verts per triangle, no sharing) unless you are just dealing with disjoint quads which will also cost 6 verts per quad using degenerate stripping. In that case, you get each quad for 4 verts with indexed triangle lists so it probably wins again but you'd want to test on your target hardware I think.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.