Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Directional Light extreme shadows flickering/blinking buildup

Discussion in 'High Definition Render Pipeline' started by DigohD, Sep 26, 2021.

  1. DigohD

    DigohD

    Joined:
    Mar 15, 2015
    Posts:
    7
    I have an issue where after running the game for a while some shadows from the directional light of the scene starts to flicker lightly. It then slowly builds up over the course of about 5 minutes until every single shadow from any directional light source flickers uncontrollably. Here in the debug view you can see the light shaking uncontrollably. This shaking builds up over time.

    https://gyazo.com/e48583cca34e009d20f3d9c6bd467142

    It is HDRP version 10.6

    It seems to not be related to the directional light itself, as I have tried deleting it and replacing it with a fresh one. It also seems to have nothing to do with Post-processing, since it continues after I turn it all off. The only way to make it disappear is to turn off the shadows of the directional light, or set its shadow dimmer to 0, but then of course I got no shadows at all.

    As I already mentioned, it is as if something slowly builds up under the hood in some way.

    I know it is not much to work with, but I would greatly appreciate any ideas of what might be going on.
     
    Last edited: Sep 26, 2021
  2. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    516
    how far is camera from origin (0,0,0)?
     
  3. DigohD

    DigohD

    Joined:
    Mar 15, 2015
    Posts:
    7
    About (4000, 0, 4000)

    I made some progress however. Turning of the enemies of the game makes the issue disappear. We are using DOTS for the enemies and are looking into it right now.
     
  4. DigohD

    DigohD

    Joined:
    Mar 15, 2015
    Posts:
    7
  5. DigohD

    DigohD

    Joined:
    Mar 15, 2015
    Posts:
    7
    Problem solved it seems.

    It was indeed probably a floating point precision issue, however not due to the position of the light source in relation to the world. The problem was that we had enemies who fell through the ground and continued to fall infinitely over time. This caused the directional light to cast shadows on entities which where continuously further and further away.

    So for anyone who encountered a similar issue and found this thread: make sure you do not have any objects in the scene which casts shadows very far from (0, 0, 0).