OGL - Hidden Surfaces (Depth Buffer)


I’m using glEnable(GL_DEPTH_TEST); to Enable the Depth Buffer (glDepthFunc(GL_LESS); as parameter) and glClear(GL_DEPTH_BUFFER_BIT); for clearing it.

It works all perfect while software rendering but if i enable hardware acceleration some polygons in the background aren’t hidden.

I think it’s a problem with the Voodoo III. Does anyone know how to hide the polygons which are deeper in the z-axis space correct on a VIII?

My SDK is Glut.

(And yes i know, my English is very bad )

You might have selected pixelformats with different numbers of depth bits.
Check the number of depth bits with DescribePixelformat() or glGetIntegerv(GL_DEPTH_BITS);

If you have 16 bits in HW and 32 bits in SW this could be one reason for different images.

Check the size of your viewing frustum.
Make the ratio of zFar/zNear as small as possible.