Jump to content
  • Advertisement
Sign in to follow this  

Depth_test Enabling renders nothing with LEQUAL or LESS (GL3+)

This topic is 2212 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

Hello all,

I'm having an awkward problem and haven't been able to solve this yet.

I am rendering a basic random point cloud using VAO's, VBO+IBO, glsl 1.5, etc.

The problem is that i can render everything just fine when disabling DEPTH_TEST or setting DepthFunc to GEQUAL or GREATER. this is not what i wanted. i need the depth buffer to be using LESS or LEQUAL.

anyone have any idea why this could be happening?

When using GREATER the point cloud shows up on screen (not sorted correctly but thats because of the depth func, it's inverted).
When using LESS or LEQUAL nothing shows up on screen..

here's my render states:

glFrontFace( GL_CCW );
glCullFace( GL_BACK );
glEnable( GL_CULL_FACE );

glDisable( GL_BLEND );

glDepthFunc( GL_LEQUAL );
glDepthMask( true );
glEnable( GL_DEPTH_TEST );
Edited by mrmurder

Share this post

Link to post
Share on other sites
My two guesses is that you either have the near and far clip planes reversed (likely not the issue if you're using a perspective projection), or you're clearing the depth buffer with 0 instead of 1.

Share this post

Link to post
Share on other sites
Thanks for the help! It was indeed the depth buffer clear set to 0.. Thank you so much, you just released me from a day of pain looking for this problem!

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!