• Advertisement
Sign in to follow this  

Depth Problem

This topic is 3825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey folks, once again i need your help. I have a problem i bet you can solve immediatly! Here we go: I am drawing quads or triangles and all the triangles that have a lower z value are in front of the higher z-value ones. I am clearing the depth buffer, and use GL_DEPTH_TEST. Also I am using glOrtho, if that could have something to do with it. I just cannot figure out what is going wrong. I hope you can help me with it cherio Woltan

Share this post


Link to post
Share on other sites
Advertisement
Hey CodeMunkie,
I gave every glDepthFunc parameter a try, and none of them could solve the problem. The problem is, that a mesh is not rendered infront of an other mesh although it is closer to the camera.
I hope some of you still have an idea of what is going on. Can it have something to do with an FBO I am using?
Any advice, link, hint etc is appreciated!!
cherio Woltan

Share this post


Link to post
Share on other sites
When rendering to an FBO you either need a depth render buffer or a depth texture attached to it for z-buffering to work. You also need to be sure to do glEnable(GL_DEPTH_TEST) and set the glDepthFunc() to GL_LESS or GL_LEQUAL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement