Search Unity

Behaviour of spotlight shadows

Discussion in 'High Definition Render Pipeline' started by darkydoodle, Feb 17, 2020.

  1. darkydoodle

    darkydoodle

    Joined:
    Oct 27, 2018
    Posts:
    64
    I'm using a far spotlight (250 or more) to generate good resolution shadows (impossible with directional lights).
    I already had a problem with the k_MaxShadowNearPlane in HDShadowUtils which didn't allow me to use spotlights as I intended. I overrided this.
    But, in the last version of HDRP (from master), the shadows from spotlights are dimmed after a certain distance, whatever the intensity of the light (and with the dimmer parameter to 1). So, around a distance from 150 to 200, shadows disappears. Is that normal ? Because, it seems with the time, the HDRP is less and less flexible. Be it the k_MaxShadowNearPlane or the non overridable spotlight shadow dimmer, I can't think of a reason for it to work like this.
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
  3. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    >or the non overridable spotlight shadow dimmer,

    What do you mean ?
     
  4. darkydoodle

    darkydoodle

    Joined:
    Oct 27, 2018
    Posts:
    64
    I'm actually talking about the fade distance parameter. When the spotlight is farther than a certain distance (around 180 or maybe 200, something like that), the fade distance does nothing. You can put as much as you want, the shadows fade anyway, without any change. Put a distance of more than 200, and you can be sure there will be no shadows.
    It's not that much of a problem for me now, because I just saw I could use a directional light with the dynamic rescale to have a good shadow resolution. Previously, I was using a spotlight at the position of my sun, then I was pointing it to my camera pointer, resizing the spot angle to just the size of the screen and with that, the spotlight shadows were good.
     
  5. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    There is a max distance settings in the "shadow" volume settings. This is also controlling the max shadow, is it correct for you?