Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Lighting Reversed after Update from Unity 2019 to 2020/2021 - Realtime Shadow Strength bug

Discussion in 'Global Illumination' started by el_Guero, Oct 7, 2022.

  1. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    145
    Due to Google forcing us to update to Billing Library Version 4 we need to update our projects and base template to either Unity 2020 or 2021. We are currently using Unity 2019.4.40.f1 which is the latest LTS version available at the moment of this post.

    Our problem is that when we do, no matter if latest Unity 2020 or 2021, we get issues with the lighting of our scene:

    unity 2020.png

    No errors in the console whatsoever.

    As you can see, the lighting is the exact opposite of how it should be: shadows are now lit while the parts that should have light are with shadows. It's basically the same lighting but reversed/upside down.

    We tried to 'fix' this and came across the Realtime Shadows Strength variable. When we change the value this is what happens:

    slider2.gif

    It seems completely broken.

    Anyone knows why this is happening or if this is a bug?

    Seems similar is happening since December 2021: https://forum.unity.com/threads/sha...-image-unity-lts-2020-3-20-ios-build.1212354/

    When we switch platform from iOS to PC, Mac & Linux Standalone the problem seems to be gone. As soon as we switch back to iOS the problem appears again.

    Here a gif to showcase how it should look (recorded with same Unity version but platform set to Standalone):

    correct.gif

    This issue tracking seems to describe the same bug in October 2021 and it says it's fixed. Which is unfortunately not the case on our end as you can see:
    https://issuetracker.unity3d.com/is...r-just-white-when-changing-the-light-strength

    Any help is appreciated.
     
  2. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    145
    So just opened a clean project in Unity 2021.3.9.f1, switched to iOS platform, added a cube and a plane (plus a material to the plane to showcase a bigger contrast). But to reproduce you can just add a cube without anything and the problem is the same:

    clean2021.gif

    Makes me think that the actual problem is somewhere else?

    I'm on a intel iMac 27inch with a Radeon Pro Vega 48 8GB graphic card.
     
  3. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    145
    Ok, definitely a bug related to something else. I just did a build with Unity 2020.3.40.f1 and the problem does NOT happen on my iOS device (iPhone 11 Pro). So seems to be an exclusive editor bug with my computer and the iOS platform in both, Unity 2020 and 2021.
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,079
    Looks like a bug, could you please report it? Our customer QA will investigate, and will forward it to the appropriate team. Include a link to this thread in the bug report as well.

    If I understood correctly, this issue is not blocking your production, correct?
     
    el_Guero likes this.
  5. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    145
    Well it's not ideal cause for colors we have to move back to Standalone but yes, you're right, it doesn't block our production entirely.

    Bug reported. Thanks.
     
  6. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    145
  7. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,079
    If I were you, I'd wait for the fix to land. However, if it's blocking your production, you can switch graphics APIs by following these steps:
    1. Go to Project Settings
    2. Select Player in the sidebar
    3. Unfold the Other Settings dropdown
    4. Uncheck Auto Graphics API for Mac toggle
    5. In the array directly underneath, click on the plus button in the bottom right corner
    6. Select OpenGL Core
    7. Drag it to the top of the list
     
    Last edited: Oct 11, 2022
    RakshithAnand and el_Guero like this.
  8. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    145
    Hey thanks a lot for the detailed description. I'm not sure though why, but I don't seem to have these settings. I only see Metal API Validation, Metal Write-Only Backbuffer and Force hard shadows on Metal as options. But not "Auto Graphics API"... :(

    Edit: Oh I see, it's in the Settings for Windows, Mac, Linux tab. :)
    Edit 2: that worked perfectly, thanks so much for helping me. Colors are back to normal.
     
    Last edited: Oct 11, 2022
    kristijonas_unity likes this.
  9. RakshithAnand

    RakshithAnand

    Joined:
    Jun 30, 2013
    Posts:
    56
    Can confirm this happens in Unity 2021.3.19 as well and this solution works! Thank you!