Search Unity

Depth camera near plane? Depth camera location?

Discussion in 'General Graphics' started by Alex_May, Jun 18, 2019.

  1. Alex_May

    Alex_May

    Joined:
    Dec 29, 2013
    Posts:
    198
    Imagine this: In my scene, I want to create a sphere centred on the camera that casts a shadow such that the whole scene inside the sphere is in shadow.

    I've got my sphere, and it's casting shadows on the scene, but not all of the scene. I look at the frame debugger and what I see is that the sphere is drawing but the top of the sphere is being clipped by the near plane of the depth camera, so there's a big circular hole right where the light shines through. It seems as if the depth camera is closer to the ground than I imagined it would be given the depth settings on the main camera.

    Is the depth camera's position affected by the main camera's farClipPlane value?

    How can I get that sphere rendering in the depth pass without being clipped?