converting from tri-fans to tri-strips on terrain rendering.

Started by
1 comment, last by GekkoCube 20 years, 8 months ago
Implementing a triangle fan based quadtree terrain engine was easy enough. but every suggested that i move over to triangle strips for speed and space. After some though i quickly came across a problem, or should i say, a challenge. Since my terrain will always have areas with different level of details, triangle strip rendering seems almost counter-intuitive. Im using a vertex buffer that draws 1000 vertices per drawprimitive call. so it loops thru, drawing 1000 vertices worth of polygons until the buffer has all been drawn. problem with using tri-strips is that moving from one quad or area to another will cause the triangles to draw undesireable triangles at undesireable locations. ex: suppose one area far away from the camera is represented by 1 large quad (8 polygons). Then the quads (which are at a higher detail) that are neighbors to the first mentioned quad will have to be drawn BUT CONTINUING with the same triangle strip. Can you see the potential problem here? how is it done then, using tri-strips?
Advertisement
If you are using tri-fans, then I assume you are not using CLOD. If you are, this would make switching to tri-stips somewhat harder.

Anyway, there are two "tricks" for using triangle strips:
1. Use larger patches for each LOD.
2. Use degenerate triangles to link the end of one strip with the beginning of the next.

If you could post a sketch of how the triangles in your terrain are arranged, especially in two neighboring areas of different LODs, this would help any additional explanations...

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"


We come in peace... surrender or die!

[edited by - technobot on August 13, 2003 3:58:42 AM]
Michael K.
im using triangle fans on a CLOD terrain.
so im calling drawprimitive for every quad (a fan).
so the drawing for this is easy, simply draw the vertex set for every quad that needs to be drawn.

This topic is closed to new replies.

Advertisement