Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Chaucer

triangle fans

This topic is 5558 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 have a question about triangle fans. When using DrawIndexedPrimitive() how does it know when to switch to a new fan? Can''t each fan can contain a different number of triangles?

Share this post


Link to post
Share on other sites
Advertisement
Oh. Wouldn''t that require a ton of draw calls for a terrain? I would think that would make things alot slower.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In the words on nVidia. If you''re thinking of using fans, something has gone wrong.

Share this post


Link to post
Share on other sites
Are you saying I shouldn't use triangle fans when implementing this algorithm in d3d?

http://www.gamasutra.com/features/20000228/ulrich_pfv.htm

[edited by - Chaucer on April 2, 2003 2:10:58 PM]

Share this post


Link to post
Share on other sites
Triangle Fans are fast , but u can''t render triangles that are not connected with just 1 call . U either have to use many calls to DrawPrimitive or use Indexed Triangle Lists/Strips . I Still prefer Lists because they are very flexible + performance difference is very small if you use them clever .

Share this post


Link to post
Share on other sites
Ok I have a question in regards to the speed of triangle fans. Since you can only render one per call, I''m assuming that you would do something like

//set texture
SetTexture(texture)

//draw one fan
DrawPrimitive(triangle_fan)

//set texture to null
SetTexture(NULL)

Wouldn''t all those calls to set texture and draw primitive be slower than

//set texture
SetTexture(texture)

//draw all triangles with that texture
DrawPrimitive(triangle_list)

//set texture to null
SetTexture(NULL)

Or maybe you can draw all the fans per a single texture and the move to the next texture.

Would it still be faster than a triangle list with all those calls to drawprimitive()?

Share this post


Link to post
Share on other sites
Don''t use fans with DirectX. The overhead of making multiple DrawIndexedPrimitive calls is cost-prohibitive. Instead, use lists or strips.

Share this post


Link to post
Share on other sites
They aren''t in Direct X because architecturally there''s just no way to put multiple fans in the same indexbuffer. In OpenGL, they are faster because you don''t need as many vertexes to make each triangle. In OpenGL vertex fan buffers can be 1/3 as small as vertex lists which obviously helps when you''re talking about 10''s of thousands of triangles.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!