#### Archived

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

# Perspective ZNear plane

This topic is 5531 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have heard that the best value for Z-near plane in perspective projection is 1.0f (I heard that with this value you get less clipping problems, and is best for Zbuffer, but I don''t understand much), so I put it in my gluPerspective, but, with this value I can''t come near an object because the camera clip it. It''s true that is the best value, if so, how I can come near and object without clipping it? (I see that in the shotem up games, when you come near a wall, the wall is not clipped, what value is used in this games?) thanks

##### Share on other sites
Let me just rudely explain something.If your near plane is 1.0 that means that the objects will become to clip 1 unit away from the current''s camera position.That''s they get clipped so early.Try setting 0.1 or 0.01 and see the results

The PAIN is coming...this summer!!!In cinemas everywhere.

##### Share on other sites
why should a near plane 1 away from the camara point be any bad? ... if you use 0.1 as near and 1000 as far, your z-test resolution is about one ten-thousands-th worser than if you used 1 for near

##### Share on other sites
ah... and 0 distance cannot be used

##### Share on other sites
then, if you use 1 too, how do you do to come near an object?

##### Share on other sites
Just scale your "world" so that the distance 1 is quite small, then limit your approach to a wall (via some form of collision detection) so that you cannot get near enough for the camera to clip it.

Simple!

It all depends on what sort of game you are making - an indoor FPS can probably get away with a near clipping plane of 0.1 or less, but if you try this on an outdoor environment with a far clipping plane of 1000 or more then you will get z-buffer problems with the further away polygons.

##### Share on other sites
That means that in a game that have indoor and outdoors I have to change the near plane in every level/zone?, like return to castle of wolfenstein that have indoors and outdoors

##### Share on other sites
No, I was meaning "real" outdoor games like flight sims where you can see for a long way, games like RTCW have a very limited draw distance outdoors

##### Share on other sites
*former washington: ''666_1337'' kamikaze-d with ''mig29h carriing 4 at22s equiped with nuclear warheads'' injuring ''Anonymous Poster'' by a splash-damage amount of 50x (times) his life, a ''got hit by crashing aircraft-damage'' of 9x his life and a ''heat-damage'' of other 50x his life @ 2 minutes ago* [connection reset by peer]

...
so he maybe doesn''t think return to castle wolfenstein would be an indoor & outdoor game - for any longer

##### Share on other sites
ah ok, I understand.
This means that I have to scale the world coord units, and use collision detection to avoid the cilping if I use 1.0f znear, but scale up or down?

• 17
• 11
• 12
• 9
• 49
• ### Forum Statistics

• Total Topics
631393
• Total Posts
2999757
×