HDRP 7.1.1 Strange shadow behavior

Already posted this on the hdrp thread, but I will post pictures here.
I have a “sun” spot light (y = 250) used to make shadows on a civ-like world. Previously to hdrp 7.1, it was working perfectly. Now, with a near plane of 0.1, the shadowmap is empty.

If I push it to 10, the shadowmap seems ok. But in the view, there’s no shadows for the trees placeholders (although they are there on the shadowmap) and the clouds placeholders shadows are strangely cut. I think if the object is close to the ground, the shadows don’t appear (Something closer than y = 2).

If I put the spot light to y = 125 instead of 250, shadows for the trees begin to appear, but they are cut. Note that bias doesn’t do anything. I suspect that if I could put the near plane to more than 10, I could have something good. But I don’t know why it’s reacting like that.

I modified HDShadowUtils :

    static class HDShadowUtils
    {
        public static readonly float k_MinShadowNearPlane = 0.0001f;
        // public static readonly float k_MaxShadowNearPlane = 10.0f;
        public static readonly float k_MaxShadowNearPlane = 100.0f;

And behold, with a near plane of 100 :


Correct shadows ! Why do I have to do this ?

Hi,

sorry could you provide Unity binary version and HDRP version where you see the issue? and what was previous version?

" Previously to hdrp 7.1"

There is no 7.1 pacakge out yet? do you use latest master of github repository with an alpha version of 2019.3?

Thanks

Yes, I’m using the master of GitHub. I couldn’t tell you the previous version of hdrp, I’m just getting the master when I feel enough have changed to bother changing it. It really looks like it’s a parameter problem, and it was “easy” to modify in the hdrp, so I’m not really bothered by the issue anymore. My project is fairly complex, so if you think it’s necessary, I’m sure I could make a new simple project that would reproduce the issue with a very far spot light, point shadows, a plane and some small objects.
I guess it’s coming from this :

  • Changed how shadow map resolution scaling with distance is computed. Now it uses screen space area rather than light range.