m_PrefilteringModeAdditionalLight keeps changing between iOS and Android

I have a project that I’m building for both iOS and Android in Unity 2022.3.19 with URP 14.0.10

When I build for iOS, m_PrefilteringModeAdditionalLight in my Universal Render Pipeline Asset.asset gets set to 3. When I build for Android, that gets set to 4. This doesn’t seem to cause any problems with the build, but is annoying for source control.

Is there a way to fix that? I’ve poked through my Universal Render Pipeline Asset.asset in the editor and don’t see an exposed variable for m_PrefilteringModeAdditionalLight, and before I try to go poking through the source I thought I’d ask here.

I have numerous projects that I build for both platforms, and I haven’t noticed this behavior in any of the rest of them.

1 Like

I’ve been seeing the same behavior. Any luck finding the cause?

This has troubled me without knowing about it for months now and this is the only thread that comes up when searching for the keyword (but with ForwardPlus keywords instead of additional lights).

Based on what I read in URP documentation and the file where these are defined. Unity does try to figure out the tightest combination of shader keywords in order to reduce the necessary compiled shader variations.
The difference between m_PrefilteringModeAdditionalLight 3 and 4 is:
PrefilteringModeAdditionalLights.SelectPixel,
PrefilteringModeAdditionalLights.SelectPixelAndOff (which includes per pixel shadows and the no shadows variant)

So either this system has some faults and detects the actual used lights incorrectly OR in the urp assets you use for those plattforms you defined different shadow setting and/or you have scenes which use lights differently. The switch from 3 to 4 would be due to a scene containing an additional light with “No Shadows” selected.

Is one of these cases a possibility?

1 Like

So I tried messing with the soft shadow settings and turned on soft shadows, and now even more variables are changing between ios and Android!

9875403--1423992--upload_2024-6-5_18-51-16.png

On the same machine – with no other changes to the project than switching build platform – m_PrefilteringModeAdditionalLight, m_PrefilterSoftShadowsQualityMedium, and m_PrefilterSoftShadows all change. And note that m_PrefilterSoftShadowsQualityMedium and m_PrefilterSoftShadows swap their values; I suspect that they’re the same variable but unintentionally serialized differently between Android and iOS.

9875403--1423986--upload_2024-6-5_18-50-43.png