Search Unity

Question Bad shadow for dynamic object in the URP

Discussion in 'Universal Render Pipeline' started by AntonAndev, Nov 18, 2022.

  1. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    Hello. I have bad shadow for dynamic object, looks like artifacts. Tried to tune all paramaters in the URP asset, directions light's settings. I uploaded a video to show a problem. It seems I can't use shadows for traffic. Unity 2022.1.23.

     

    Attached Files:

  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Doesn't seem like you need 250m of shadows. Reduce it for better clarity.
    Now the shadow resolution is low and soft shadows will make the wobblyness
     
  3. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    250m is good for my scene, if I set 150m, I do not see shadows from far distance. If I set 4096 for shadow resolution, I see very bad shadows too, attached screenshot.
     

    Attached Files:

    • 4096.png
      4096.png
      File size:
      180.3 KB
      Views:
      108
    Last edited: Nov 19, 2022
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    If you need 250 meters shadows I suggest baking them instead of doing them realtime.
    Realtime shadows get worse the bigger the distance is
     
  5. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    766
    Maybe you can try to reduce the shadow distance for cascade 1. (such as 8 meters)
     
  6. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    766
    If you mean the edge of shadow is not smooth enough, there's a High shadow filtering settings in Unity 2022.2.

    URP_Shadow_High.jpg

    And it should be released soon.
    Unity_2022_2.jpg
     
  7. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    I have my custom terrain, user can modify terrain, I can't bake shadows for dynamic scene.
     
  8. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    Then use cascades. First cascade will need a very small distance.
     
  9. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    I use cascades, updated to Unity 2022.2.0, tried all settings and combinations, still bad shadows