用
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
做初始化图形无法显示,
把glDepthFunc()中的参数改为GL_ALWAYS才行,这个问题怎么造成的?如何解决?
谢谢
...全文
7139打赏收藏
OpenGL中glClearDepth的问题
用 glClearDepth(1.0f); // Depth Buffer Setup glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do 做初始化图形无法显示, 把glDepthFunc()中的参数改为GL_ALWAYS才行,这个问题怎么造成的?如何解决? 谢谢
GL_NEVER Never passes.
GL_LESS Passes if the incoming z value is less than the stored z value. This is the default value.
GL_LEQUAL Passes if the incoming z value is less than or equal to the stored z value.
GL_EQUAL Passes if the incoming z value is equal to the stored z value.
GL_GREATER Passes if the incoming z value is greater than the stored z value.
GL_NOTEQUAL Passes if the incoming z value is not equal to the stored z value.
GL_GEQUAL Passes if the incoming z value is greater than or equal to the stored z value.
GL_ALWAYS Always passes.