# Set Cubemap Blend in SkyLight and reflections on transluscent materials

**URL:** <https://forums.unrealengine.com/t/set-cubemap-blend-in-skylight-and-reflections-on-transluscent-materials/137795>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [February 7, 2020, 9:43pm UTC](https://forums.unrealengine.com/t/set-cubemap-blend-in-skylight-and-reflections-on-transluscent-materials/137795 "2020-02-07T21:43:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeNikitov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NeNikitov](https://forums.unrealengine.com/u/NeNikitov)\
**Post date:** [February 7, 2020, 9:43pm UTC](https://forums.unrealengine.com/t/set-cubemap-blend-in-skylight-and-reflections-on-transluscent-materials/137795/1 "2020-02-07T21:43:40Z")

</div>

Hello  
I have a day/night cycle that controls SkyLight’s cubemap with a node Set Cubemap Blend. I captured a sky each 3 hours to have 8 static images that i can use to blend.  
It works works perfectly fine on opaque materials (cube on the left) while on transluscent materials (like water) cubemaps dont blend and there is a visible pop up. I printed out values on the left side of the screen: the first value is alpha, the last 2 are cubemap names.  
Video:  
[video][https://drive.google.com/file/d/16LnYOBYgluSYRl8Ga4ktnWhC4vjMZSoh/view?usp=sharing[/video]](https://drive.google.com/file/d/16LnYOBYgluSYRl8Ga4ktnWhC4vjMZSoh/view?usp=sharing%5B/video%5D)  
Any ideas how to fix this?

---

<div class="post-metadata">

**Author:** ![Darkloud1989](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Darkloud1989](https://forums.unrealengine.com/u/Darkloud1989)\
**Post date:** [April 23, 2020, 2:50pm UTC](https://forums.unrealengine.com/t/set-cubemap-blend-in-skylight-and-reflections-on-transluscent-materials/137795/2 "2020-04-23T14:50:36Z")

</div>

Did you ever figure this out? I am having the same issue… Any workarounds or fixes?

---

<div class="post-metadata">

**Author:** ![Felkroth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Felkroth](https://forums.unrealengine.com/u/Felkroth)\
**Post date:** [May 14, 2020, 9:08pm UTC](https://forums.unrealengine.com/t/set-cubemap-blend-in-skylight-and-reflections-on-transluscent-materials/137795/3 "2020-05-14T21:08:08Z")

</div>

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:

```auto

#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!

---

<div class="post-metadata">

**Author:** ![SebHillaire](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sebhillaire/32/1194571_2.png) [@SebHillaire](https://forums.unrealengine.com/u/SebHillaire)\
**Post date:** [October 24, 2023, 8:29am UTC](https://forums.unrealengine.com/t/set-cubemap-blend-in-skylight-and-reflections-on-transluscent-materials/137795/4 "2023-10-24T08:29:57Z")

</div>

Hello,

Mini update:

This is because in forward, lerped skylight blending needs to be enabled per material (using _Blend Sky Light Cubemaps_) since it adds a bit of cost and might not be worth it for non specular material. At least that is how I understand the history of it.

In 5.4, this has been updated and you can simply override all your forward material to feature blending of skyboxes for total specular correctness. A decision you can take per platform for a project. This can be enabled by setting r.ForwardShading.ForceSkyLightCubemapBlending to 1.

The change list one can integrate to get that behavior is [this one](https://github.com/EpicGames/UnrealEngine/commit/3732464a7dd9539effe004155dadef73933a8fc5).
