TriangleFan and IndexBuffer

Started by
11 comments, last by AQ 19 years ago
I read about a LOD terrain technique which uses triangle fans. At the moment I am using TriangleLists. I was wondering how the index buffer should be arranged for a triangle fan. I cant find a tutorial mentioning it. Also, how would i "disable" a vertex when performing LOD? Thank you.
--------------------------------Dr Cox: "People are ***tard coated ***tards with ***tard filling."
Advertisement
Quote:Original post by Riviera Kid
I read about a LOD terrain technique which uses triangle fans. At the moment I am using TriangleLists.

I was wondering how the index buffer should be arranged for a triangle fan. I cant find a tutorial mentioning it.

Also, how would i "disable" a vertex when performing LOD?

Thank you.


If I temember right, index 0 is at the center of the fan, and 1...N are the vertices around the edges...

As for "disabling" a vertex, you would need to maintain a "render" list seperate from your standard vertex list.
ah right, i see.

So you must have a different stream for each fan?
you cant have lots of fans in the same vertex buffer.

and i maintain a low detail index buffer and a high detail index buffer for each fan?
--------------------------------Dr Cox: "People are ***tard coated ***tards with ***tard filling."
yes .. you got that .. You need to maintain just one vertex buffer but several index buffers .. one for each resolution.

OR atleast that would be one way to do it .. I would be interested in knowing if anyone can point out some other technique.
Count your blessings before you count your problems.www.wiu.edu/users/muaiq
I don't recommend to use triangle fans, as this means sending many small portions of vertex data to the GPU. Try triangle strips in a vertex buffer instead - they're way faster, because you don't have to switch between them that often.
I know that Trent Polack uses fans in his article about GeoMipmapping. However, even he admits that this isn't the best solution.

Greetz, Chris
Triangle Fans are absolutely horrible for performance. Some algorithms naturally map to fans which is why you see them being used. Converting to indexed lists is fairly easy though.
Stay Casual,KenDrunken Hyena
Quote:Original post by DrunkenHyena
Triangle Fans are absolutely horrible for performance. Some algorithms naturally map to fans which is why you see them being used. Converting to indexed lists is fairly easy though.


I don't believe the fans themselves are the bottleneck, rather the problem is that only 8 or so triangles are drawn at a time when you ideally want 1000s of triangles drawn at a time.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
That's the whole problem with fans. They're pretty useless really and, ideally, should be removed.
Quote:Original post by DBX
That's the whole problem with fans. They're pretty useless really and, ideally, should be removed.


Agreed, at the moment, I can [almost] no reason why you'd want to use a fan.

Though they could be fixed: have a 'special' index value that "the next vertex you fetch is the anchor/start of a new fan". But that requires hardware and/or driver support, which implies it would be on a cap like 32-bit indices are.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Quote:Original post by JohnBolton
I don't believe the fans themselves are the bottleneck, rather the problem is that only 8 or so triangles are drawn at a time when you ideally want 1000s of triangles drawn at a time.

But since fans limit the tris you can draw at a time, then they are responsible for the poor performance. I s'pose you could say the fans are efficient themselves, but cannot be used efficiently for anything. :)
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement