Drawing terrain from non-triangle strip friendly source

Started by
2 comments, last by MisterHeadache 16 years, 2 months ago
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!
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.
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.
Thanks, guys - I think I am on the right track now.

This topic is closed to new replies.

Advertisement