triangle fans

Started by
13 comments, last by Chaucer 21 years ago
So why can''t you just have one index buffer and render part of the index buffer for each fan? Is it the number of calls to DrawPrimitive() that''s slowing it down or something else?
Thanks!
Advertisement
The purpose of fans and strips is to reduce the amount of data that must be processed by the GPU.

The amount of data processed by the GPU for a non-indexed triangle list of n triangles is:
n * 3 * sizeof(Vertex) 

The amount of data processed by the GPU for a non-indexed triangle strip or fan of n triangles is:
( n + 2 ) * sizeof(Vertex) 


There is a huge difference between non-indexed lists and non-indexed fans/strips. If you are using non-indexed vertexes, then strips and fans are much faster.

The amount of data processed by the GPU for an indexed triangle strip or fan of n triangles is:
( n + 2 ) * sizeof(Vertex) + ( n + 2 ) * sizeof(Index) 

The amount of data processed by the GPU for an indexed triangle list of n triangles (in a strip or fan configuration) is:
( n + 2 ) * sizeof(Vertex) + n * 3 * sizeof(Index) 


Since the size of an Index is usually much smaller than the size of a Vertex, the additional overhead of the index buffer is minimal. The benefit of the indexed triangle list over the indexed and non-indexed strip/fan is that there can be less DrawPrimitive calls which can involve a lot of overhead. That outweighs the slightly less amount of data in strips and fans.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
As an interesting side note, Ive found my biggest gain on some low end cards comes from reducing my terrain texture size.

instead of one big 1024x1024 texture for the whole terrain, using 16 256x256 (even though you have more set texture calls)
seems to improve the frame rate even more than using lists vs fans.

Im still new to this so if im out to lunch please dont flame!

FruitJuice
and you have mipmaps?
Havent used those yet, still learning, but will check out!

This topic is closed to new replies.

Advertisement