Search Unity

Realtime Shadow Issue!

Discussion in 'High Definition Render Pipeline' started by Tricktale, Nov 4, 2019.

  1. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    42
    Hi all,

    I'm experiencing a strange issue with realtime shadows since upgrading my project from 2019.1.0f2 using HDRP 5.13.0 to 2019.3.0b9 using HDRP 7.1.1.



    The shadows look like they're being culled in a weird way close to the camera. The video clip was recorded in the scene view, but the same also happens in game.
    Both projects have the same shadow settings in the volume component with a max distance of 500 (default). If I increase the max distance to 5000 in the 2019.3.0b9 project, the issue mostly disappears, but the shadows look awful (blurred) no matter what settings I set in the shadows override for cascade etc.

    Something must have changed regarding shadows between versions as I can recreate the issue using a new default scene project created with 2019.3.0b9.

    Any help appreciated.

    Edit:

    The scene uses a single directional light with following settings:

     
    Last edited: Nov 4, 2019
    Cynicat likes this.
  2. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    42
    Still trying to find the cause of the problem...

    tried 2019.1.14f1 with HDRP 5.16.1 and there is no problem with the shadows.
    tried 2019.2.11f1 with HDRP 6.9.0 and the shadows are messed up as shown in video.

    Could this change in HDRP 6.8.0 be the cause?
    • Changed how shadow map resolution scaling with distance is computed. Now it uses screen space area rather than light range.
     
  3. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    42
    After looking into this some more, the issue lies with me using PBR Shader Graph shaders. Lit Shader Graphs look fine.

    Edit: To clarify, there's a bug with PBR Shader Graph shaders, where shadows from directional lights are not calculated correctly.
     
    Last edited: Nov 19, 2019