Set Cubemap Blend in SkyLight and reflections on transluscent materials

Hey,
I actually solved this for a similar use case myself earlier and just happened to bump into this thread while searching for a solution to something else entirely.

My fix to this was changing one line in shader code:

In “\Engine\Shaders\Private\ReflectionEnvironmentComposite.ush” find the following:



#if REFLECTION_COMPOSITE_SUPPORT_SKYLIGHT_BLEND
   float3 SkyLighting = GetSkyLightReflectionSupportingBlend(RayDirection, Roughness, SkyAverageBrightness);
#else
   float3 SkyLighting = GetSkyLightReflection(RayDirection, Roughness, SkyAverageBrightness);
#endif


…and change the lower function (after ‘else’) to also support blending. ( GetSkyLightReflection() → GetSkyLightReflectionSupportingBlend() )

The shader code is recompiled when you restart the editor and load your project or run “RecompileShaders changed” console command in game. The compile might take a while obviously so expect a short freeze if you do it with the console command.

I haven’t tested this change enough to know if it has any serious drawbacks apart from the minor performance effect. After all, the blend is probably not supported for a reason such as not being supported on consoles or something like that so use this with that in mind!

Hope this helps!

2 Likes