1. Post #1
    Cookieeater's Avatar
    September 2010
    342 Posts
    I can understand the reason for the far clipping plane, so that you wouldn't just render infinitely beyond, but what's with the near clipping plane? If you have a model, and scale it up, you'll probably be able to see the model and look around. But if you have the small model, and scale it down, the near clipping plane will dissect the model in half when you should be exactly where you were last time in the huge model scale wise. Is there any reason for this?

  2. Post #2
    Gold Member
    ZeekyHBomb's Avatar
    June 2006
    3,577 Posts
    http://www.sjbaker.org/steve/omniv/l..._z_buffer.html

    I don't think this has any relevance when you have a deferred renderer, as you can scale the Z-Buffer as you want; I could be wrong though, I'm not deep into CG.
    Reply With Quote Edit / Delete Reply Germany Show Events Informative Informative x 1 (list)

  3. Post #3
    Gold Member

    March 2005
    3,028 Posts
    You can think of that near clipping plane as the full area of your screen.
    Everything is projected onto that plane, then it is scaled to fit your monitor.

    Now what if your monitor was a singularity?
    Reply With Quote Edit / Delete Reply Show Events Informative Informative x 2 (list)

  4. Post #4
    Gold Member
    danharibo's Avatar
    July 2006
    4,498 Posts
    Now what if your monitor was a singularity?
    Light would have a hard time leaving it. Black holes need one hell of a backlight.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Zing Zing x 9 (list)

  5. Post #5
    Gold Member
    HueyFreeman's Avatar
    August 2006
    214 Posts
    The clipping plane is usually represented by a logarithmic scale. This means that if you set your clipping plane at the camera, the distance between the clipping plane and the camera would be zero. Log(0) is -infinity, so the near plane must be greater than 0.

    Edited:
    It looks like Zeeky's link has similar information.

  6. Post #6
    LouisD's Avatar
    April 2011
    52 Posts
    Yeah HueyFreeman is pretty much on the money, its to do with the fact that your zBuffer (or DepthBuffer) is stored as a floating point surface on your graphics card. Floating points are actually represented inside your computer as a fraction.

    (A number line representation of some float numbers see how the accuracy is not constant)
    By defining clear bounds for your clipping plane you can change the accuracy of it to one that suits your situation, for example a game with mainly enclosed indoor spaces will have a much smaller far plane than a game that features wide outdoor vistas. You will see examples of zFighting (an error caused by your zBuffer being too inaccurate if you set your far plane to really really far) when there is not enough accuracy in the zbuffer for the graphics card to determine if two depths are equal.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 2 (list)

  7. Post #7
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Some games have multiple rendering passes with different values for zNear and zFar to account for this inaccuracy.
    Reply With Quote Edit / Delete Reply Netherlands Show Events Informative Informative x 1 (list)

  8. Post #8
    knighty's Avatar
    February 2011
    314 Posts
    And the higher the near clip plane value can be the better. Depending on what type of game it is, you can get away with different values. Third person games can get away with very large near clip values, but FPSs allow you to get close to walls and such, which means you have to go with a lower value.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  9. Post #9
    Gold Member
    esalaka's Avatar
    July 2007
    10,249 Posts
    And the higher the near clip plane value can be the better. Depending on what type of game it is, you can get away with different values. Third person games can get away with very large near clip values, but FPSs allow you to get close to walls and such, which means you have to go with a lower value.
    Although in this case you could do what most games don't seem to do and prevent people from embedding their bodies in walls. Might give you several units of possible extra distance to the near-z plane.
    Reply With Quote Edit / Delete Reply Finland Show Events Agree Agree x 1 (list)