Search Unity

Shadows passing through objects

Discussion in 'Editor & General Support' started by stanislavdol, Oct 2, 2020.

  1. stanislavdol

    stanislavdol

    Joined:
    Aug 3, 2013
    Posts:
    282
    Hi there.
    So I have 2 horizontal planes(actually flattened cubes), one above the other, with the top one having objects on it. Both planes receive shadows but don't cast them. Yet the shadows from the objects above the top plane project onto the bottom plane as well as the top one. (like the top plane is not even there)

    I wonder if there is a way to make shadows not go through the top plane?
    Thank you!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,736
    Is it perhaps because you set one of the scale axes to zero? That can cause issues with various bits of the renderer. Ideally use the correct geometry (a plane), or else sent that "thin axis" to something like 0.001f or so, not zero.

    If that's not it, perhaps attach a screenshot that illustrates your question more.
     
  3. stanislavdol

    stanislavdol

    Joined:
    Aug 3, 2013
    Posts:
    282
    No, all scale values are 1 or higher.
    Here is a simple representation of this issue:
    61T1NqM4FR0.jpg

    So, the cube on top casts shadows. Planes don't(but they receive shadows). The cube's shadow is cast through the planes. (I understand that normally, when planes cast shadows as well this wouldn't be an issue, due to cube's shadow being covered by plane's shadow. But I wonder if it is somehow possible to limit the distance of this shadow's projection? Without actually using projectors instead of unity shadows ). Though I fear it is impossible due to the way unity handles shadows(yet I hope to be wrong)