Jump to content
  • Advertisement


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


What should I set the near clipping plane to?

This topic is 6010 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''m fooling around with a terrain renderer. The camera''s veiwpoint is set as:
camera.z = terrainHeight(camera.x, camera.y) + epsilon   //epsilon small

I want my camera to be closer to the terrain''s surface, ie. epsilon smaller. But if I make it too close to the surface, the near clipping plane sometimes slices the geometry close to the camera. I can fix this by making the near clipping plane closer to the camera. I completely understand what is going on here, and why things are working this way. My questions: 1) Is having the near clipping plane below 1.0f bad? I seem to remember somewhere that this causes problems. 2) I''m sure other people have had this problem, is there another way to resolve it, or did you do it the same way? Right now I have the near and far clipping (frustum) planes to 0.1 and 10000:
gluPerspective(60.0f, (GLfloat)width/(GLfloat)height, 0.1f, 10000.0f);
Thanks guys, Z01

Share this post

Link to post
Share on other sites
You could get a problem with the z-buffer precision if the near clipping-plane is too close (the far clipping-plane matter too, but the near affects this much more). You'll see if there's a precision problem, polygons will be jagged and look weird. Just use something that look good, and if you see any problems, try to increase the near clipping-plane.

BTW I've never needed to use a clipping-plane as low as 0.1 but I guess that depends on the scale of your world, among other things.

"problems have solutions
a lifetime of fucking things up fixed in one determined flash"
- The Downward Spiral, NIN

//Edit: spelling...

Edited by - Rudan on January 30, 2002 7:08:03 PM

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!