I have a strange encounter of using a light to illuminate an object where occluded part of the object is still illuminated instead of in shadow, like the screenshot below: a directional light shines coincidentally with the normal of side surface of torus object, and despite making sure the light is casting shadow and the torus can cast and receive shadows, the supposedly occluded torus inner surface is illuminated. Is this expected in Unity? Seems to me that the occluded surface is illuminated because it is facing the directional light, and unaware that it’s occluded by the front part of the torus. Any comments and solutions would be appreciated!
just to add more info. this is done on built-in rendering pipeline with a default shader/material. any tips to fix the rendering will be great!
found a solution, in case anyone might find it useful. my problem turns out to be a problem of flickering shadow when the camera moving away from the shadow.
in Unity Project Settings - Quality - Shadow distance, the default value might be outside the range of the viewing camera’s clipping plane, so any shadow further away from the viewing camera (exceeding the far clipping plane) will be culled. Hence, to make sure that the camera always sees all shadow rendered, make sure the “Shadow Distance” value match the camera’s far clipping plane value.
