• Advertisement
Sign in to follow this  

Changing DEPTH_TEST far & near

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