Search Unity

Shadows disappearing/glitching when having multiple light sources

Discussion in 'High Definition Render Pipeline' started by Flow-Fire-Games, Jan 28, 2021.

  1. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    Hey,
    The problem is that starting from a certain number of light sources (spotlights), shadows disappear completely in the scene or glitch out and sometimes appear or flicker depending on camera positon. We use realtime lights and shadows on enable.

    What are the general limitations? The Unity documentation does not mention any limitations, or is this a bug? Is there any more info about how the lights are implemented somewhere else?

    image_2021-01-28_155352.png

    Here with one spotlight

    image_2021-01-28_155415.png

    Here with multiple
    image_2021-01-28_155432.png

    2020.2.2f1, latest HDRP
     
  2. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, in your HDRP asset, did you increase the size of the atlas for the shadows? And are you using dynamic resize?

    If the atlas is too small, it will become overcrowded and some lights' shadows will be literally kicked out.

    Also, it's a good idea to lower the shadow fade distance as much as possible to the avoid rendering shadows for distant lights.
     
    Flow-Fire-Games likes this.