Jump to content
  • Advertisement
Sign in to follow this  
Hermes

Depth Testing

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

glDepthMask(GL_FALSE);//disable writing into depth buffer glDepthFunc(GL_LEQUAL); Does this mean that everything is drawn without clipping? If this is true why do i need to specify the depth function used to draw the objects ,wouldn't this be the same with glDepthMask(GL_FALSE)(no depth testing)? Thankx for your help

Share this post


Link to post
Share on other sites
Advertisement
No.

glDepthMask alters writing to the depth buffer ( as in turns it on and off ), it doesn't do anything about testing. For that, you use
glEnable/Disable( GL_DEPTH_TEST ).

Share this post


Link to post
Share on other sites
Quote:
Original post by Prefect
Also remember that depth of polygons is only written when depth test is enabled.

cu,
Prefect


Wow,I didn't know that. I always thought that the depth is written even if depth-testing is disabled, but as it turns out it doesn't. You have to enable depth test and set DepthFunc(GL_ALWAYS) to achieve that effect.

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!