Search Unity

Bug Broken shadows on long distance scene

Discussion in 'General Graphics' started by Innovine, Dec 11, 2020.

  1. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    351
    I am using 2021.1.0a5 but I have seen this on 2020 and 2019 too. I am using the built-in pipeline, SPI forward rendering, and one directional light with the shadow quality set to very high (not that it makes a difference here). Using a standard lit material below.

    My scene is quite large. Here is a screenshot of it, the distance to the horizon is maybe 40-50,000 unity units:



    The shadow distance above is set to 15000. You can see where the shadowing fades out about half way up the image. On the bottom right is a correctly shadowed area. However, the LIT area is totally destroyed with these flickering stripes.

    If I fly closer to the surface this happens:


    Here you can see that the lit part is actually correct up to a distance of about 5000 units...


    If I reduce the shadow distance to 6k, I get this:


    On the right hand side you can see how the correctly rendered shadow fades out as it approaches the max shadow distance, which is expected. But on the left side, you can see that Unity is incorrectly rendering the LIT area, from about 5000 to the shadow distance.

    If the shadow distance is set just to a few thousand units, the problem is hidden. Why is the lit area totally wrong beyond 5000 units? This worked ok for me in Unity 2018.
     
  2. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    351
    Can someone please help me with this??
     
  3. Ruslank100

    Ruslank100

    Joined:
    Apr 11, 2018
    Posts:
    18
    It looks like shadow banding, you can try to increase the shadow bias on the light
     
  4. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    351
    Bias has no effect. Please note that shadows are rendered correctly. This occurs on the LIT area.
     
  5. Ruslank100

    Ruslank100

    Joined:
    Apr 11, 2018
    Posts:
    18
    Sorry, didn't notice that (yes, a newbie that tried to help...). But I still think the flicker happens on the shadow range only, because a bit further the lighting is complete fine
    Did you try to increase the near clipping on the camera? If it doesn't help, I am out of ideas...
     
unityunity