Search Unity

Are there any disadvantages to setting a camera's far clipping plane to 10000?

Discussion in 'Getting Started' started by sr3d, Oct 27, 2015.

  1. sr3d

    sr3d

    Joined:
    Oct 19, 2015
    Posts:
    78
    Are there any disadvantages to setting a camera's far clipping plane to 10000?
     
  2. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    The larger the far clip plane and the smaller the near clip plane (or the bigger the difference between them) the less precise your depth buffer will be (In simple terms). This could create what is known as Z-Fighting. Z-Fighting is when there isn't enough precision in the camera's depth buffer to know if an object is in front or behind another object that is at a similar distance from the camera. The result is the two objects flickering as from frame to frame a different one is deemed in front of the other.
     
    farazk86, Ryiah, jhocking and 2 others like this.
  3. sr3d

    sr3d

    Joined:
    Oct 19, 2015
    Posts:
    78
    Thank you for this information. I'll be on the look out for Z fighting off in the distance between objects.
     
  4. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    814
    Antony's answer is spot-on. I just have one additional thing I'd point out: the reason this happens is because the video card has a finite number of depth values it can recognize (this is what they're talking about when referring to 16 or 24 or 32 bit depth buffers). Those finite slices are spread out between the near and far clipping planes, and so when the clipping planes are further apart, the depth values are spread further apart.

    As a result, you want to keep the far clipping plane as near as possible while still being far enough for your game, and vice versa for the near clipping plane.
     
    farazk86 and Antony-Blackett like this.
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Just to elaborate a bit more, what matters is the ratio between the far and near clipping planes. Not the linear difference. So, if you're having problems, pushing your near clipping plane out a few meters helps a lot more than pulling the far clipping plane in by the same amount.

    If I had a far clipping plane of 10,000, I would set the near clipping plane to at least 1.0, and maybe try for 2 or 5 (or even 10 if I can manage it).
     
    farazk86 and Antony-Blackett like this.