Sorted index array Vs. triangle strips
- From: "Jayhawk" <thomas.greenleaf@xxxxxxxxx>
- Date: 15 Aug 2006 12:55:31 -0700
Triangle strips are fast, but why exactly?
Is it because they never have a cache miss, or is it because the cards
have some special optimization just for triangle strips (and fans)?
If I, instead of a triangle strip, have a vertex buffer and en ordered
index buffer so that the indices mimics the order of a triangle strip,
will this be just as fast as a strip? .. or is there something else to
I have a mesh where a triangle strip can not easily be built, but I can
however order the indices in such a way that each triangle reuses two
vertices of the previous triangle. Each primitive only introduces a
single new vertex (index). How would the performance be?
I could test this, but I would like to have a theoretical answer first
and then make real world comparisons afterwards.
Just as an example. The index buffer could look like this
0,1,2 - 1,2,3 - 2,3,4 - 3,4,5 - 3,4,6 - 3,4,7 - 3,7,1 - 1,7,2
The only thing I can say about the order is that only one index changes
between to consecutive triangles.
Someone suggested that triangle strips are fast because the indexes
does not need to be calculated. I hardly see that this should be an
issue. Using an index array, indexes are read - not calculated. Apart
from this read, why would a triangle strip be faster than a properly
sorted index array?