I am new to OpenGL, and I am using Qt Creator as an IDE. I am wondering what the glClearDepth() function does. I do not quite understand the description on the documentary, but when I change my code "glClearDepth(1.0)" to "glClearDepth(0.0)", the polygon widget I have no longer appears. Could someone explain this function to me in simple words?
Thanks,
Flurite



the depth buffer will be filled with value 1. Now the incoming pixels depth value will be compared to 1. If you do not modify the depth function (glDepthFunc(...)) which defaults to GL_LESS), the incoming value will be passed when the depth is < 1. Now when you change the clear depth to 0, it is already the lowest value and thus no fragment is <0 hence no pixel is written.