Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 6501 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 i have a scene where the object closest to the viewer gets at certain angles objects appear to disappear also obscure the view of other objects when they should not - i.e they are draw in front of or behind other objects when it should be the opposite also the also disappear at certain angles I have the following in my initOGL() glShadeModel(GL_SMOOTH); glCullFace (GL_BACK); glEnable( GL_DEPTH_TEST ); // Enables Depth Testing glEnable (GL_LINE_SMOOTH);//makes grids on floor look smooth glEnable (GL_POLYGON_SMOOTH); glEnable (GL_CULL_FACE); and in onPaint() i have glDepthFunc(GL_EQUAL); // The Type Of Depth Testing To Do glClearDepth( 1.0f ); // Set Depth Buffer to Max Dist. when cleared glClearColor( 0.0f,0.0f,0.0f,0.0f ); // Black Background glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); any ideas?

Share this post

Link to post
Share on other sites
You probably want to use GL_LEQUAL not GL_EQUAL in your depth function.

See if that helps.


Share this post

Link to post
Share on other sites

  • 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!