PDA

View Full Version : Z Buffer Issues



MeshMan
10-04-2004, 02:07 PM
Hi guys,

My previous was a bit vague so I'll try again. Here's two screenshots of some issues im having when rendering. The first shot is inside a ship mesh, the second is outside the mesh.

www.meshsoft.net/mesh1.jpg (http://www.meshsoft.net/mesh1.jpg)
www.meshsoft.net/mesh2.jpg (http://www.meshsoft.net/mesh2.jpg)

When i move the camera around, I get flickering on the edges of the triangles and when looking from the inside of the mesh, i can see lines on the edges of the polys. I'm assuming this is a Z Buffer problem, so everytime I draw i'm clearing the Z Buffer, setting clear depth to 1.0, setting the z buffer func to GL_LEQUAL, and enabling depth writing. Nothing is taking effect.

What else could it be thats affecting this? Oh, im also setting glEdgeFlag to 0 just incase that was bothering it.

MeshMan
10-04-2004, 02:12 PM
Debugging Notes:

Z Buffer Near: 10.0f
Z Buffer Far: 1000.0f
Z Buffer Bits: 32

This same model renders perfectly in 3D Studio MAX using the OpenGL drivers.

-NiCo-
10-04-2004, 02:58 PM
Try setting the z buffer func to GL_LESS.

Nico

MeshMan
10-04-2004, 03:25 PM
No change.

I'm beginning to wonder if it really is a bad Z-Buffer problem, or could it just be bad aliasing?

-NiCo-
10-04-2004, 03:55 PM
Did you check your polygon fill mode, stippling, dithering, etc... ?

Nico

MeshMan
10-04-2004, 03:57 PM
I enable GL_DITHER. I don't about the others you mentioned.

-NiCo-
10-04-2004, 04:06 PM
I asuume the triangles are properly connected by sharing vertices using index pointers?

Nico

rgpc
10-04-2004, 05:34 PM
The images don't work for me.

Do you have Polygon Smoothing enabled? If so, try turning it off.

MeshMan
10-05-2004, 04:09 AM
It seem's to be GL_POLYGON_SMOOTH that creates these bad lines. I found a link that discusses the problem at:

http://lists.apple.com/archives/mac-opengl/2004/Sep/msg00063.html

Thanks for your help.

Hellhound
10-06-2004, 11:57 PM
Sorry i can't open u're images, but it sounds to me like a problem i've some times ago. Reduce u're z-Buffer value down to 24Bits, most of the grafic-cards have a limited z-Buffer value in relate to the color-Buffer, perhaps this should solve u're problems...