Jump to content
  • Advertisement
Sign in to follow this  
MisterHeadache

Drawing terrain from non-triangle strip friendly source

This topic is 3773 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 need to draw terrain that has a mesh that looks like this (sorry for the old school grafix): -------- |\|/|\|/| -------- |/|\|/|\| -------- |\|/|\|/| -------- |/|\|/|\| -------- Terrain mesh that is "friendly" for triangle strips does not have the alternating diagonal pattern and looks more like this: -------- |\|\|\|\| -------- |\|\|\|\| -------- |\|\|\|\| -------- |\|\|\|\| -------- Any tips on how to generate a vertex buffer and an index buffer to draw this kind of terrain? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
If you take the center point of each of those 'X's, you could draw 8 triangles at once using a triangle-fan instead of a strip.

Share this post


Link to post
Share on other sites
Don't use a fan! You want each draw call to draw hundreds or thousands of triangles. Use a triangle list. If you're creative with your index generation you can optimize for vertex cache hits (a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=371052&whichpage=1�">See discussion here or See JollyJeffers benchmark, which implies the fancy technique requires a fairly hefty batch size for any benefit.

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.

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

Sign me up!