Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Flickering shadows with moving directional light

Discussion in 'Editor & General Support' started by LootlabGames, Nov 10, 2022.

  1. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    340
    I am having a problem with shadows flickering when I have a directional light that rotates(time of day).
    The direction light is rotating very slowly as well but makes all shadows flicker.
    As soon as I stop the rotation the flickering goes away.

    Here is a video of the problem:


    Using built in render pipeline.
    Lighting is real time nothing baked.
    Although I have tried baking it as well(looks even worse).

    I have been searching for an answer to this all morning(about 4 hours).
    I have tried every "fix" I could find.

    Here are my current settings.
    But it gets even worse if I reduce the settings.

    upload_2022-11-10_13-31-40.png

    Here is the light:
    upload_2022-11-10_13-32-39.png

    And lighting
    upload_2022-11-10_13-37-48.png
     
    Last edited: Nov 11, 2022
  2. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    340
    Here is a better video showing the problem
     
  3. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    340
    I can't believe that no one is having this issue.
    Tried newest version of Unity, creating new project with only Enviro(the time of day manager) a terrain, a few trees and grass and get the same issue.
    I even tried using URP and it is the same thing.

    So no one is making games with a time of day manager(or a rotating directional light) while using shadows?
    I see lots of posts from people that had flickering shadows due to rotating a directional light but none of them seemed to ever get a resolution,
    Is this the reason to change engines?
    If Unity can't handle a single moving directional light that is sad.
     
    Last edited: Nov 11, 2022
  4. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    340
    I think I found out the problem but I am not very happy about it.
    If you turn the shadow distance low(so it looks like your game came out back in the 90's) then the flickering stops.
    So it looks like this is a Unity Engine limitation.
    Sad, sad sad.