Jump to content
  • Advertisement

Archived

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

gimp

OpenGL [OPENGL] Depth Sorting Problem.

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

I''e just noticed a little problem not that my object are lit and no longer black blobs on the screen. I have depth sorthing turned on like this: glEnable(GL_DEPTH_TEST); The problem is that A distant object is sitting on top of a close object. So I turned z sorting off and a strange thing happened. The bounding sphere around each object is now being drawn on top of the object it contains as you would expect as it it in code draw after the object. The models however are now sorted correctly with a distant object being occluded by a close object. Anyone like to have a stab at what is going on here (I have checked my codebase and there are no other points where I modify the zsorting state. My window has been created with a 16 bit depthbuffer. (SDL creates this for with with : SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); many thanks Chris

Share this post


Link to post
Share on other sites
Advertisement
perhaps you''re drawing the near object after the far object

glEnable(GL_DEPTH_TEST);
u might of enabled it but is it GL_GREATER or GL_LESS



http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
He mean what for normal rendering you need to write
glEnable(GL_DEPTH_TEST);
and
glDethFunc(GL_LESS);

this is normal render mode....

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!