Triangle Strips VS just plain Triangles

Started by
11 comments, last by NeXius 21 years ago
Hi I''ve heard from a few places that using triangle strips isn''t as much of a speed boost as it''s sometimes made out to be... and that it''s usually smarter to just use triangles for simplicity and ease (making culling, collision detection, etc. easier) I know at some time in the past it made a great optimization but what about for modern GPU''s? Please clarify this for me Thanks
MSN: stupidbackup@hotmail.com (not actual e-mail)ICQ: 26469254(my site)
Advertisement
Triangle strips are fastest for maily two reasons:

1) you pass a new polygon with only a new single vertex.

2) every software/hardware renderer can manage only triangles so passing triangles is the natural way to describe a polygon.

Older/newer GPU it is not the matter...passing more data (vertices) consumes time! However the rel bottleneck, we know, is the fillrate (80-90% of the total rendering time) so passing TRIANGLE STRIP can be a minor optimization and it''s possible only with a specific mesh.





and now that you can even store the index arrays in video memory the difference is even smaller ,-) a big advantage so far would have been that you have just about a 3rd of the indices to send with strips (of course now you can say you have just a 3rd of them to store ,-) )...
f@dzhttp://festini.device-zero.de
Strips are faster there is no doubt on that.

Consider this:


  p1---p2---p4---p6 \   |   /|   /|  \  |  / |  / |   \p3.---p5---p7  


what happens here is that you only provide one extra vertex
for a new polygon where in the single poly case you have three
vertices per polygon. That means extra traffic on the card.
Traffic that could have been used to draw two more polygons.


____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

No no no no! :)
youre forgetting cases where you would need to draw 5 strips instead of one tri list, where you''re fillrate bound and it doesnt matter if you could send three times as many polys etc.
isolated they may be faster, but quite often they wont make a difference or slow you down (prefer one tri list over 10 short strips any day)
f@dzhttp://festini.device-zero.de
quote:
Strips are faster there is no doubt on that.

Meeep, wrong

They are faster, only if one condition is met: if you are AGP transfer bound (they use less memory for the indices, and less bandwidth for the transfer). Once the index arrays are in VRAM, the rasterization speed of both is exactly the same. Although tristrips might be a bit faster here too (because of less memory access), this will almost be unnoticeable (VRAM is very fast, when accessed by the GPU).

But don''t forget to include the vertex cache into the equation. And that''s where the situation turns around: a well optimized (ie. vertex cache friendly) triangle list mesh is going to be much faster than a perfectly optimized tristrip mesh (assuming both are in VRAM). Why ? Because the stripping limits your use of the vertex cache. You don''t have much choices about the next face to be drawn, it has to fit into the strip. Lots of already transformed vertices will be pushed out of the cache, you have no possibilities to reuse them. With tri-lists, however, you have arbitrary access to the indices, and can take full adavantage of the cache. That can make a huge difference, especially in combination with complex vertex shaders.
Hmm, well I can say that Richard Huddy who used to work t nVidia
would disagree. When I talked with him little over a year ago he was quite specific about the use of strips over anything else. What you say might be true for an older generation of cards I really can''t say but I have honestly heared (and from what I myself have tested) that Tri lists are faster. But at the same time when I saw some demonstrations that he presented of the different techniques I am not so sure any more. To quote him: -Always use strips, there are almost no case where anything else is faster.

So whom should I listen to? Someone who has been working on this issue internally at nVidia or you? ;-) It''s all very confusing. Although I would not mind to see some source that further proves the point. This is not meant as I don''t believe you but now I have two opinions from quite respectacle ground standing against each other. If you feel you have the time to provide me with some samples feel free to drop me a mail at michael@planetrift.com I really would appreciate that since it really would affect the way I make my gaming API. Since I am just making the 3D part it is still not too late for me to change strategy.

Sincerely

Michael

____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

No no no no! :)
People I know in the 3D hardware industry told me I''d better used index primitive rather than anything else, cause it''s more cache friendly (the driver/hardware could manage it).

So Indexed Triangles or TriStrip should do the trick, difference of performances is minimal I heard. (and I agree with Yann L about the cache and all)

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
If you are using tristrips you have less vertices to transform with matrices, vp! Often It''s smarter to jump to strips rather than have a lot of tris & frustuming/oclusioning. However, its question what''s slower CPU/GPU!

______________________________
Madman
______________________________Madman
quote:
What you say might be true for an older generation of cards I really can't say but I have honestly heared (and from what I myself have tested) that Tri lists are faster.

No, I meant the most recent generation. The larger the vertex cache (and it will obviously grow larger, as newer cards come out), and the more complex your vertex processing, the larger the speed gain for (well optimized) tri-lists.

Note that there are two primary factors playing against each other: tri-strips are inherently faster, because they need less memory access. But tri-lists are faster, because they can better reuse pre-transformed vertices.

Now, which is faster in practice, does entirely depend on your use of those features. In old-school engines (no vertex shaders, lots of streaming, no VRAM cache: Quake3 style), then tri-strips are going to be faster. Always.

But on next-generation engines, with highly complex (and slow) vertex shaders and VRAM caching, then the equation flips around: the fact, that the results of the expensive vertex shader can be retrieved from a cache (in a much better way than with tri-strips) will definitely make tri-lists faster. That was the case on any 3D card I tested, and that were quite a few.

In conclusion: since it depends on your particular use of the GPU, you'll have to profile it for yourself.

Oh and important: we are of course comparing indexed tri-strips with indexed tri-lists, obviously.

quote:
If you are using tristrips you have less vertices to transform with matrices, vp!

Nope, it's the opposite: while tri-strips have less indices, they need to transform vertices much more often to get the same mesh (at least statistically, on real-life meshes).


[edited by - Yann L on May 5, 2003 11:40:48 AM]

This topic is closed to new replies.

Advertisement