Jump to content
  • Advertisement
Sign in to follow this  
CacheMiss

OpenGL Depth Issue

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!