Jump to content
  • Advertisement
Sign in to follow this  
swiftcoder

winding blues

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

Just got my LOD planet working, it starts with a cube, and then subdivides each face into four quads, etc. each tile is actually a 4x4 vertex buffer, that is rendered as a triangle strip. So I came up with a spiral layout for the indices, starting at the lower left corner, and spiraling in to the center. The corners are accomplished by placing a duplicate vertex at each change in direction, so that there is basically an extra area-less triangle. This works great, except that I can't use backface culling, because those empty triangles mess up the winding order. I tried adding a third vertex at each of these corners, under the misapprehension that this would help, but it only seems to make things worse. If anyone has any ideas, or a better way to index my triangle strip, it would be most welcome, Thanks, SwiftCoder [edit]replaced non-functional ascii art with a description ;)[/edit] [Edited by - swiftcoder on June 12, 2005 10:34:36 AM]

Share this post


Link to post
Share on other sites
Advertisement
Better to not use a strip, but an indexed triange list. These don't have winding order changing issues.

Share this post


Link to post
Share on other sites
Quote:
Original post by SimmerD
Better to not use a strip, but an indexed triange list. These don't have winding order changing issues.


Yes best way is to ditch the triangle strips and use triangle lists or seperate triangles, due to the winding order with strips can get really messy. Plus you will have degenerate triangles <- (think thats what they are called when you cross over the same vertices twice...) the nice thing about strips if you can is call the whole mesh in one call. I have my terrain mesh rendered in one call now. I have to rearrange my index list but was worth it, and it tooks me most of a day to work it out. HTH

Share this post


Link to post
Share on other sites
Quote:
Original post by SimmerD
Better to not use a strip, but an indexed triange list. These don't have winding order changing issues.


I was doing this before, and it is of course much easier to set up. Most of the reason I was using strips is that I usually see a large performance increase from this, when rendering vertex by vertex (is this what is known as 'direct mode'?), but since both the vertices and the indices are in VBOs in this case, I guess that the performance hit would be much less.

Thanks for your input,'

SwiftCoder

[edit] by a 'triangle list' do you just mean a series of triangles, rendered from an array or VBO? [/edit]

Share this post


Link to post
Share on other sites
Quote:
the nice thing about strips if you can is call the whole mesh in one call.

same diff with GL_TRIANGLES.

MHO strips used to be worthwhile last century nowadays theres not much difference in speed between the two (strips slightly quicker) though in an actual game there should be NO difference between the two.
if by chance u do see a difference in your engine then 'your engine sux' ;)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!