Jump to content
  • Advertisement
Sign in to follow this  
Woltan

Depth Problem

This topic is 4001 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!