Archived

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

optimal terrain tringle strips

This topic is 5675 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

say I have an NxN set of vertices (for a terrain) and that I wanted to connect these with a tringle strip (or strips). 1) does anybody know if it is possible to connect the vertices with one continuous triangle strip? 2) if not, what is an optimal way of setting up the triangle strips? 3) does openGL like one long triangle strip or several smaller ones? What is the optimal number of triangle strips that openGL likes? Thank you!

Share this post


Link to post
Share on other sites
It may very from card to card but normally the fastest will be long strips for one purpuse You have to give it vertexs less times then if you use lots of them. the only problem with that is if you want to use lots of diffrent textures on it. Just a thought but if you are going to do that if you are going to use tiles to do the textureing(Most detailed probolity) you can put all tiles int one texture and then use texture coords to put all the diffrent tiles onto the final mesh.

good luck

Share this post


Link to post
Share on other sites
Actually if you want even faster rendering then strips....

Use vertex arrays. If your terrain engine is gona be static as in no deformation or no LOD. You can use compiled vertex arrays to be even faster. If your going to have deformation or LOD then vertex arrays will do fine.

Share this post


Link to post
Share on other sites
but from my understanding, when I use vertex arrays, I still need to provide a list of indices and tell OGL how to render them. Wouldn''t triangle strips be used in this case?

Share this post


Link to post
Share on other sites
You are right, Goosedump.

Using indexed triangle lists is pretty fast as it is. In fact, if you simply send indexed triangles (in a VA, of course) in triangle-strip-order (but not as a tristrip per se), you''ll get almost the same speed as if you had used triangle strips. Even without this special ordering, they''re quite fast. Still, though, I think indexed triangle strips are slightly faster - even if it''s only because there''s less to send to the card.

An entire terrain can be rendered as a single triangle strip, but there are a few problems with this technique. First, unless you choose a slightly nontraditional (I''ll get to this later) pattern of tesselation, you will have to use degenerate triangle strips. You also run into backface-culling problems this way. Finally, you don''t see a performance boost from striping above a certain number of triangles; there''s an internal cache on your graphics card which has a limited size.

However, there is no performance to be lost from striping your terrain, even if it doesn''t increase it. It can''t hurt.

Now, back to the patterns issue: If you zigzag back and forth across the terrain so that your triangles, taken together, form a rectangular heightmap, you run into the aforementioned problems. However, you may be able to use another pattern if you''re willing to have slightly irregular triangulations at portions of your terrain. It all ends up being about how you form "corners" of your strips. I can''t explain too much better without pictures, and I can''t post pictures without webspace, and I don''t have webspace, so I''m afraid that''s the best I can do for now. I hope I''ve helped a little though!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Don''t forget to keep Display lists in mind if your terrian is very detailed Displaylists are great for Lots of Vertexs and can be easlly made. On some cards Display lists are faster then Vertex Arrays!

Share this post


Link to post
Share on other sites
quote:
Original post by ANSI2000
Actually if you want even faster rendering then strips....

Use vertex arrays. If your terrain engine is gona be static as in no deformation or no LOD. You can use compiled vertex arrays to be even faster. If your going to have deformation or LOD then vertex arrays will do fine.


How will having dynamic terrain ( vertices changing possibly each frame ) prevent you from using the CVA extension?

You only call glLockArrays whenever you come to render, so that vertices are not transformed more than once ( for instance several glDrawElements calls on the same set of data ). How would this not work?

I think you are misinterpreting the meaning of CVA...



Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites