Search Unity

Resolved Why are shadows so low in resolution?

Discussion in 'High Definition Render Pipeline' started by ANUBISKONG, Dec 18, 2020.

  1. ANUBISKONG

    ANUBISKONG

    Joined:
    Nov 16, 2016
    Posts:
    47
    Why are shadows so low in resolution?
    I just upgraded my project from Unity 2020.1 to Unity 2020.2
    upload_2020-12-18_15-19-48.png
     
  2. ANUBISKONG

    ANUBISKONG

    Joined:
    Nov 16, 2016
    Posts:
    47
    Shadows Filtering Quality: High
    Cause this, set it medium will fix it, but still not good enough, why is high filtering quality so bad?
     
  3. ANUBISKONG

    ANUBISKONG

    Joined:
    Nov 16, 2016
    Posts:
    47
    I really regret being a guinea pig on your HDRP, it's useable for unity employee only.
    I just close the Density Volumes of your new sample project and turn it on again, then it doesn't work anymore. Crap.
     
  4. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, what is your shadow resolution? (in the HDRP asset, and also on the light itself)

    HDRP can produce extremely fine shadows. Based on your screenshot, it seems your shadow resolution is set extremely low (128px).

    Btw, "Filtering" and "Resolution" are different things. Even with the "High" filtering quality, if you use extremely low-resolution shadows, you will encounter such artifacts.
     
  5. ANUBISKONG

    ANUBISKONG

    Joined:
    Nov 16, 2016
    Posts:
    47
    My game is a physical simulation, most items movable, high shadow resolution reduces performance, so I used low-resolution shadows and Filtering :high. In the new version, Filtering: High didn't work at all, so I had to set Filtering to Medium for now, and there is still sawtooth shadow every where.
     
  6. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    What is the "Radius" or "Angular Diameter" value on the light?

    If the value is nearly 0, it could also explain some artifacts. The lower the radius of the light, the sharper the shadows will become when using the High-quality shadow filtering mode, because the amount of filtering depends on the radius when using this mode.
     
    Last edited: Dec 23, 2020
  7. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    I've done a few tests to double check, and even with a very low resolution of 128 for the directional light, and Low quality filtering, HDRP can still deliver smooth shadows.
    upload_2020-12-23_13-30-31.png


    If you absolutely want to use high-quality shadow filtering, double-check that your advanced shadow settings are correctly tuned in the Light's inspector, to compensate for the very low resolution you want to go for.
    upload_2020-12-23_13-35-50.png

    I'm actually surprised the shadow quality holds up that well even at that incredibly low resolution. They are very soft for sure, but nowhere near the results you got. Please double-check your setup. ;)
     
    Last edited: Dec 23, 2020
  8. ANUBISKONG

    ANUBISKONG

    Joined:
    Nov 16, 2016
    Posts:
    47
    I know what the problem is, it is caused by the shadow setting in post, I still don't know why the same setting is so different from the unity 2020.1 and Unity 2020.2.
    Solved.
     
  9. CuprumGD

    CuprumGD

    Joined:
    Jun 2, 2020
    Posts:
    11
    I've got the same problem with same solution - medium filtering gave me extremy crisp good shadows, but noisy with high. I don't understand this quirk, pls explain :) Angular diameter is 2.5 btw, only light source is the sun
     

    Attached Files:

  10. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    When set to high filtering, you have a more realistic approach to how shadows are rendered. Simply put this is crisper shadows near the base of the object and blurrier ones the further from the object.

    However this is also more Physically accurate meaning if you're not using a physically based input, you will get results you're not expecting like this.

    In this case it's because your sun's diameter is 2.5 degrees. For the majority of a day the sun's diameter is 0.5236 degrees.

    Hope that helps :)
     
  11. CuprumGD

    CuprumGD

    Joined:
    Jun 2, 2020
    Posts:
    11
    Yeah, that was it :) Thanks for sharing your knowledge. Btw, i tried raytraced shadows with sun radius=2.5 and result is great. Can't wait when raytracing hardware will be faster and common, so much better quality and easier to use.
     

    Attached Files:

    HIBIKI_entertainment likes this.