Jump to content
  • Advertisement
Sign in to follow this  
qbic

Changing DEPTH_TEST far & near

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

How do you change the FAR and NEAR values used when enabling GL_DEPTH_TEST? Trying to create a little terrain engine but it clipps the terrain off to near. Thanks /Jezper Blixt

Share this post


Link to post
Share on other sites
Advertisement
Maybe i'm explaining the problem stuid.
I whant to change the far clipping plane.

Share this post


Link to post
Share on other sites
When you setup your perspective projection matrix :

glMatrixMode( GL_PROJECTION ) ;
glLoadIdentity() ;

gluPerspective( 45.0f, apect_ratio, 1.0f, 500.0f ) ;

glMatrixMode( GL_MODELVIEW ) ;

1.0f is the near clipping plane while 500.0f is the far clipping plane.

Share this post


Link to post
Share on other sites
Quote:
Original post by qbic
What?
All i do is this:
glEnable(GL_DEPTH_TEST);


It would also help if you specify which kind of depth testing you're performing with :

glDepthTest( GL_LEQUAL ) ;

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.

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!