Jump to content
  • Advertisement
Sign in to follow this  
Riviera Kid

TriangleFan and IndexBuffer

This topic is 4860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
That's the whole problem with fans. They're pretty useless really and, ideally, should be removed.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!