glEnable(GL_DEPTH_TEST) - nothing rendered

后端 未结 3 534
傲寒
傲寒 2020-12-31 02:49

In OpenGL, I display a simple model. When I enable the depth buffer,

glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);

3条回答
  •  误落风尘
    2020-12-31 03:46

    If the following answers above do not work try the following:

    • If you have GL_CULL_FACE enabled check the winding order of your model's vertices. (LH) vs (RH).
    • If GL_DEPTH_TEST is enabled; then check the planes to your frustum against your model view projection matrix along with the camera's position & view direction.
    • If GL_BLEND is enabled; check the rendering order of your objects in comparison to the z-buffer.

提交回复
热议问题