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

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:

8494994--1130603--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:

8494994--1130609--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: Shadow Strength Settings Drastically Changes Entire Image | Unity LTS 2020.3.20+ | iOS Build

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):

8494994--1130624--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:

Any help is appreciated.

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:

8495093--1130648--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.

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.

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?

1 Like

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.

Just got back, seems this is already reported here:

I don’t really understand the difference between Open GLCore and Metal, but should I just switch over? And if so, how can I do that?

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:

  • Go to Project Settings
  • Select Player in the sidebar
  • Unfold the Other Settings dropdown
  • Uncheck Auto Graphics API for Mac toggle
  • In the array directly underneath, click on the plus button in the bottom right corner
  • Select OpenGL Core
  • Drag it to the top of the list
2 Likes

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ā€ā€¦ :frowning:

Edit: Oh I see, it’s in the Settings for Windows, Mac, Linux tab. :slight_smile:
Edit 2: that worked perfectly, thanks so much for helping me. Colors are back to normal.

1 Like

Can confirm this happens in Unity 2021.3.19 as well and this solution works! Thank you!