I’m working on a archviz project with a day-night cycle. When the sun goes down, I want lights and emissive materials to turn on. There are many lights and static meshes with emissive material in the level.
I managed to do this in 2 ways, but I am a newbie and I can’t tell which one is better / more efficient:
1) Using BluePrints
I made very simple blueprint actors with just a spotlight (or a point light) and 2 events (LightON and LightOFF) that control the Intensity.
I made also blueprint actors with a static mesh with a emissive material and 2 events (LightON and LightOFF) that modify a Dynamic Material Instance based on the emissive material.
When the Time of Day is within a certain range, a BluePrint Actor calls all the custom events with “Get all actors of class” > “For Each Loop” and I have to do that for all the different BluePrint Actors I made.
2) Using Material Parameter Collection
I made a MPC with a scalar parameter set to 0.
Then I made a emissive material using the MPC and a Light Function material using the same MPC.
I use the emissive material for static meshes and Light Function material for the spotlights, point lights etc.
When the Time of Day is within a certain range, a BluePrint Actor changes the parameter in MPC from 0 to 1, and lights turn on.
In both cases I use a timeline with a Lerp and I get a nice transition when everything turns on.
I think that using MPC is easier because I don’t need to create BluePrints, I just place static meshes / lights in the scene and apply the material / light function. If I want to make different kind of lights, I just have to make a material instance.
But again, I’m a newbie with UE.
Thanks in advance!!