glEnable(GL_DEPTH_TEST) - nothing rendered
opengl
Solution
Did you make sure you clear the depth buffer?
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
^^^^^^^^^^^^^^^^^^^
Problem
In OpenGL, I display a simple model. When I enable the depth buffer, ``` glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glDepthMask(GL_TRUE); ``` everything disappears. I read this OpenGL FAQ, but it didn't help me. My perspective settings are: `angle=45deg`, `near=1`, `far=40`, I put model at `(0,0,0)` and I place my eye at `(0,0,4)`. Without the Z-buffer, I can see the model. What could be wrong?