Shader Stripping checkboxes in Project Settings are inverted for Realtime GI

I just spent hours trying to debug why Enlighten realtime GI wasn't working in my builds, and my discovery and fix is that the two checkboxes in Project Settings > Graphics > Shader Stripping > Lightmap Mode are lying: they're actually inverted.

In other words, if you check Realtime Non-Directional, it prevents stripping of Directional shaders, and vice versa.

You can confirm that under the hood by looking at ProjectSettings\GraphicSettings.asset's YAML in a text editor:

  • Realtime Non-Directional affects m_LightmapKeepDynamicDirCombined
  • Realtime Directional affects m_LightmapKeepDynamicPlain

Just from the naming, it's obvious that they are inverted.

Furthermore, "Import From Current Scene" will (un)check the right box(es), but that means it doesn't have the right effect, so you can't trust that button either.

I'm just sharing my findings in case anyone else wonders why Enlighten Realtime GI works in Editor but not in Builds. (And yes I know I should probably report this as a bug but I've had a very long day and I'm too lazy to setup a repro project, sorry!)

8723487--1179732--upload_2023-1-11_16-56-3.png

Which Unity version? I can't seem to be able to recreate it in latest 2021LTS on a Mac, but I also have had project settings do different things than what they were saying they did in the past.

[quote=“AcidArrow”, post:2, topic: 905813]
Which Unity version? I can’t seem to be able to recreate it in latest 2021LTS on a Mac, but I also have had project settings do different things than what they were saying they did in the past.
[/quote]
2020.3.43f1

[quote=“LazloBonin”, post:3, topic: 905813]
2020.3.43f1
[/quote]
Nope, unfortunately I can’t recreate the issue there either, although 2020LTS is the version where I also had issues with project settings storing the wrong values.

[quote=“AcidArrow”, post:4, topic: 905813]
Nope, unfortunately I can’t recreate the issue there either, although 2020LTS is the version where I also had issues with project settings storing the wrong values.
[/quote]
Very odd! I can consistently reproduce it here. Wonder what kind of environment setup might make ours differ. Thanks for looking into it & providing a different perspective though. Either way, I sure am keeping both of these checked on my end in the time being! :wink:

I was able to reproduce this on my machine, and have submitted a usability ticket internally. To our defense, when placing a mouse cursor over the properties, the tooltip clearly indicates that by checking the box, you'd be including that shader in the build.

[quote=“kristijonas_unity”, post:6, topic: 905813]
I was able to reproduce this on my machine, and have submitted a usability ticket internally. To our defense, when placing a mouse cursor over the properties, the tooltip clearly indicates that by checking the box, you’d be including that shader in the build.
[/quote]
Thanks! I think we may be referring to different things. I understand that checking means preserving and not the other way around. However, checking directional seems to preserve non-directional, and checking non-directional seems to preserve directional. That’s the unintuitive inversion I’m referring to.

Thanks for the clarification. I did try to reproduce this issue in the latest 2021.3 LTS, but was not able to. Please see the attached screenshots.
Though it appears that you can reproduce the issue just fine. Could you please report the bug, once you'd have the time? You can also include the link to this thread in the bug description. Thanks!

8727720--1180722--CornellBox-KeepRTDirectionalShadersOnly.jpg
8727720--1180725--CornellBox-KeepRTNonDirectionalShadersOnly.jpg