How do I lerp CubeMaps for SkyLight in Blueprints

Hi all,

I’ve wasted quite a few hours now trying to figure this one out on my own I’m wondering if some kind soul would illuminate the way for me. I’m new to blueprints, (and also to game engines) and haven’t been able to solve this issue on my own.

I’ve captured 23 cubemaps of my lighting environment, and want to fade indirect/reflection between the cubemaps using blueprints per hour. I have the per hour setup working to blend between the cubemaps for ambient cubemap lighting via 2 postprocess volumes, but i would like the reflection contributions from the skylight to also blend between via the hourly cubemaps by the minute as well. Everything is working except the lerping of the cubemaps, and injecting that into the skylight’s cubemap slot. I can’t seem to get that to work for the life of me. Can someone show me the way, or if there is a better way… point me in another direction…

I’m needing to bake out my indirect/reflection in this way because while updating skylight in blueprints is too slow, and causes a hitch. have ambient working but no skylight reflection.

Many thanks for any leads/help!

Hello ,

I am currently in the process of writing a new tutorial for the community for this exact process. For starters, you won’t really need 23 different cubemaps for each hour of the day, as this is overkill.

Try and find unique times of day like Dawn, Mid-day, Dusk, and Midnight. You can obviously have more in between those times, but calling your ‘Skylight’ to update between 23 different cubemaps is going to be performance heavy in any case.

What you will want to do is create a timeline similar to the one I have provided in the screenshot below in conjunction with the Set Cubemap Blend node. You will need to then get your time of day and blend between your cubemaps based on the time of day. What defines the blending between your cubemaps is based on your day length and your timeline length from a 0 to 1 range.

In my case, I created four separate cubemaps and had each one blend between one another over 30 seconds. I chose 30 seconds because my day length is 2 minutes (120 seconds) divided by the four separate cubemaps.

Cubemap Blend Set Up

Timeline Set Up

Here you can see that I am blending the cubemaps along the timeline over 30 seconds, checking to make sure the time of day is correct.

I will be making a tutorial to cover this process more in depth, so if you have questions please let me know.

Cheers,

This seems to work at first. Then I noticed every time a “set cubemap blend” node is reached, the skylight flashes the wrong cubemap for a single frame. Is this a bug? Does this tutorial you speak of exist yet, or is there a file you can provide showing this technique? I have yet to see an example of a working dynamic skylight.

The documentation says “The caller is responsible for avoiding pops due to changing the source or destination”.Is that what this is referring to? And if so, just how are these pops avoided? If the Source Cubemap’s file is set to previous nodes Destination cubemap, why would there be a pop?

Hey 3DMoss,

The tutorial does not exist as of yet. I have been quite busy recently, but I will be sure to make a note to get this done in the near future.

The description of the node telling the user they are responsible for avoiding the pops is exactly what you are seeing. There are still some kinks in my set up, and the popping is one of them. I did have a set up prior to this one that was able to avoid the popping by calling the ‘Skylight’ to ‘Recapture’ every X amount of seconds. I created it into a float variable and tied it to event tick. This way, when you Switch from Source to Destination, they are immediately recaptured and the reflections are updated correctly and the popping is reduced.

You will also need to make sure that the ending of one Cubemap, blends into the next one by making sure that time of day and the ambient color associated with that particular time, closely resembles the upcoming Cubemap that is about to be set.

Currently this is all the information I have at the moment, as it is still a work in progress for myself as well. I would head to the Forums as well because there are a lot of people who can offer some helpful advice, and a larger chance that someone is also working on this approach as well.

Cheers,

Ok, thanks. I look forward to that tutorial. Did your other method cause any hitching when recapture was called?

Yes, the hitching is something I am working to solve, but it was far less noticable. The only problem with that set up, is that when you call the ‘Skylight’ to recapture at almost each frame, you take a nice performance hit, since you are asking the ambient light to update each frame. Spreading out the update so it occurs every other frame, or even longer could give you back some of the performance. Try experimenting to see what you can produce, and let me know if you come across any new information.

Coincidentally enough, Zach Parish just posted a video tutorial on this yesterday!

Blending Between Multiple Skylight Cubemaps in Blueprints

Have fun and let me know if you get stuck. I will be following it for myself so we might be able to help one another out if needed.

Cheers,

Wow, perfect timing. I haven’t tried replicating what he did in the tutorial in my project yet, but it looks like we both made the same mistake of using multiple Set Cubemap Blend nodes instead of using 1 node and swapping out the cubemaps inside it. The way the documentation is worded, it suggests this is what leads to pops, but apparently this is exactly what needs to be done. I think it would help if a single line was added to the docs suggesting to only use a single node.

Thanks for the heads up on that tutorial, I might have missed it.

I agree, a documentation change could be of help. I will look into entering a doc change so this can be clarified.