• Advertisement
Sign in to follow this  

OpenGL Depth Issue

Recommended Posts

Hi all,

I've been looking at this for ages, have tried everything I can think of and can't make progress so I need to ask for some help.

Long story short: I have a camera at <0,0,0> looking down <0,0,1> and an object at <0,0,3> and am having rendering issues which suggest something is wrong with the depth-test? I've included an image to give you a better idea of what's happening.

I've tried changing the depth-test, changing the winding-order, changing the cull-mode, changing the handedness during model loading - none of it helps...

My current set-up for depth and culling:

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

glEnable( GL_DEPTH_TEST );  
glEnable( GL_DEPTH_CLAMP );  
glDepthFunc( GL_LESS );

Any help would be really appreciated.

- Thank you

Edited by CacheMiss

Share this post


Link to post
Share on other sites
Advertisement

Looks like the depth test is off. Make sure it's on and that it is also set the write the depth values when rendering.

Share this post


Link to post
Share on other sites

Thanks Spinning, I knew something was up with it but your comment prompted me to check other parts of the code. I'm using sfml and hadn't provided it with a non-zero bit depth  <_<

Normally not something I'd of missed but along with integrating it into forms etc. it slipped by - thank you for taking the time!  :)

Edited by CacheMiss

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement