winding blues

Started by
3 comments, last by zedzeek 18 years, 10 months ago
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]

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Advertisement
Better to not use a strip, but an indexed triange list. These don't have winding order changing issues.
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
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]

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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' ;)

This topic is closed to new replies.

Advertisement