PDA

View Full Version : GL_TRIANGLE_STRIP Causing Artifacting



Tyler Camp
09-18-2010, 09:48 PM
http://www.youtube.com/watch?v=oH_mA-UmYpQ

The video above shows my issue along with my situation in the comments. I'm fairly new to OpenGL and assumed that creating a MPD-based terrain simulation would be a good way to start. The code is split up across several files, so I'd rather not post it unless someone asks for it. I'm hoping someone will be able to recognize the artifacting as being caused by something specific. I'm assuming there are two problems with my program since certain triangles seem to be culled when I don't have backface culling enabled, and other triangles look to be overlapping other triangles slightly even though they are behind.

I'm running the program under Mac OS X (obviously) and am creating the OpenGL environment through SFML with a 24-bit depth buffer and 8-bit stencil buffer.

Alfonse Reinheart
09-18-2010, 11:36 PM
How do you know that this has anything to do with triangle stripping? If you draw with a triangle list, do you get similar results?

strattonbrazil
09-19-2010, 06:54 AM
I'm not sure that has anything to do with triangle stripping either. Could you try it with a different displacement function? If you make it into a dome, for example, it's easier to see the disconnects. Also are you sharing vertex indices across faces?

Tyler Camp
09-19-2010, 02:29 PM
Also are you sharing vertex indices across faces?Yes. I thought that the fact that it was a terrain generator would've implied this, sorry for not confirming it.

I'm not entirely sure that it's GL_TRIANGLE_STRIP that's causing it either. I put that in the topic name in order to illustrate how I was going about doing what I am. I wouldn't think that drawing it with a triangle list would make any difference, I'll try it later since I'm fried right now.

ZbuffeR
09-19-2010, 03:47 PM
Looks more like z-fighting to me.

Try pushing the near clip plane 10 or 100 times farther to see if it is better.

Tyler Camp
09-30-2010, 12:59 PM
Sorry that it took so long to reply. Yes, that seems to have worked. Thanks.