I have a depth buffer and am making a cone on the screen. It works, but then I realized that I had forgotten the standard inclusion of depth testing, and when I turned it on, now nothing appears at all.
I have only one object, a cone, on my stage, so thereβs nothing else in front of it.
Depth buffer is configured normally:
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthRenderbuffer);
I bind the render buffer:
glBindRenderbuffer(GL_RENDERBUFFER, m_renderbuffer);
Then I put out the cone:

(My experiments with this dirty cone are the subject of another question that I will ask in the near future).
But, as soon as I add the following line after creating the depth buffer and binding the visualization buffer:
glEnable(GL_DEPTH_TEST)
... then my cone magically disappears. There is nothing on the screen, not even a small dot.
Why should it be?
source share