Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Banded shadows in HDRP Distance Shadowmask vs Shadowmask

Discussion in '2018.3 Beta' started by Sinbad3D, Nov 27, 2018.

  1. Sinbad3D

    Sinbad3D

    Joined:
    Oct 11, 2016
    Posts:
    17


    This is a scene setup with Unity 2018.3b11, HDRP 4.2.0 on a Radeon RX480.
    • Default directional light
    • A static cube as the floor
    • A dynamic mesh floating slightly above it
    • Default scene settings
    • Default HDRP asset
    • No realtime GI
    When using Mixed lighting and the light set to Distance Shadowmask, there is noticeable banding on the shadows.

    If switched to Mixed / Shadowmask, the banding disappears.

    If the light is set to Realtime instead of Mixed, the banding comes back even with Shadowmask, so the issue is not 100% down to the distance shadowmap route.

    It looks like a precision problem in some shadow paths. It's most noticeable with directional lights - you can reduce the effect by tuning the cascades but it's always there. The Mixed/Shadowmask route is perfect though, and since the model is dynamic I believe that it's not a result of using baked lighting in that mode.

    Any ideas?
     
  2. jpleroux

    jpleroux

    Unity Technologies

    Joined:
    Jun 29, 2017
    Posts:
    7
    I think I know what is happening:
    The bands are cause by Edge leak fixup + Self shadowing of the plane.
    When shifting to Shadow mask, The static object do no longer cast dynamic shadows, so the self induce banding are gone.
     
  3. Sinbad3D

    Sinbad3D

    Joined:
    Oct 11, 2016
    Posts:
    17
    Thanks for the reply - so this is for Unity to follow on up rather than me? I don't see any options to tweak these settings, the "View Bias Scale" we can change doesn't seem to make a difference.
     
  4. jpleroux

    jpleroux

    Unity Technologies

    Joined:
    Jun 29, 2017
    Posts:
    7
    Start by reducing / defining you max distance in the HD Shadow Settings component of your scene settings.
    I have the same level of artifacts you are showcasing with a one meter cube if this component is not present. 100 meters should be a good starting point
    (don't forget that in HD, 1 unity unit == 1 meter)
     
  5. jpleroux

    jpleroux

    Unity Technologies

    Joined:
    Jun 29, 2017
    Posts:
    7
    After that Adjusting the normal bias also help removing this artefacts
    Normal bias are located in the advanced option of your light.
    You can display them by clicking on the little + at the end of the shadow tab
     
  6. Sinbad3D

    Sinbad3D

    Joined:
    Oct 11, 2016
    Posts:
    17
    Thanks, I didn't see the "+" there. Indeed the normal bias value seems the best fix; 100 was a bit short for my shadows (but does fix the problem), 200 is ideal and plus a normal bias of ~1 rather than 0.5 the banding is gone.
     
    LeonhardP likes this.
  7. jpleroux

    jpleroux

    Unity Technologies

    Joined:
    Jun 29, 2017
    Posts:
    7
    My pleasure
     
    LeonhardP likes this.