Issue with SkyLights and r.AllowStaticLighting=0

Hi,

We noticed an issue when upgrading to 5.6 that some of our content that uses the SkyLightLeaking feature in SkyLights broke. We traced this back to Epic CL 37535452. The issue is that now that GetSkylightLeakingForReflections uses GetSkySHDiffuse they need to be populated and in our case they are not because UpdateSkyIrradianceGpuBuffer does not check IsStaticLightingAllowed() when testing the SkyLight->bHasStaticLighting flag. However, the mobile path in FViewInfo::SetupUniformBufferParameters does check it:

		const bool bSetupSkyIrradiance = Scene
			&& Scene->SkyLight
			// Skylights with static lighting already had their diffuse contribution baked into lightmaps
			&& (!Scene->SkyLight->bHasStaticLighting || !IsStaticLightingAllowed())
			&& Family->EngineShowFlags.SkyLighting;

Changing the logic in UpdateSkyIrradianceGpuBuffer to be the same fixes the glaring issue, but looking at this code more, it seems like there are many spots that test FSkyLightSceneProxy::bHasStaticLighting and FkyLightSceneProxy::bWantsStaticShadowing without considering IsStaticLightingAllowed(). Is this intentional or should these paths be changed too? Or should those flags be forced to false earlier if IsStaticLightingAllowed()=false?

Thanks,

Lucas

Steps to Reproduce
Create a static mobility SkyLight actor with a fixed cubmap texture and use a >0 SkyLightLeaking value in your post processing settings

Thank you for the reproduction steps.

I’ve reproduced the issue, and I believe this is unintentional as the editor view does not match the PIE or built presentation. I will reply with a bug tracking link when one becomes available.

Best regards,

Chris

Please find the tracking link available at Unreal Engine Issues and Bug Tracker (UE\-320675\).

Further updates should be provided on the tracker.

Best regards,

Chris