Day and Night Cycle

Hi guys

I have been looking at some of the UE4 day and night cycle documents and was finding it hard to see how static mesh shadows would work or does having a day and night cycle make static mesh shadows irrelevant and everything has to be done on the moveable setting for the shadows to work?

Hi Defused,

It can work both ways to a degree.

For the directional light that is going to be shifting for your day night cycle you would want this to be movable which will use dynamic lighting with no static lightmaps.

However, if you have an environment setup like a forest with a log cabin, you could have the lights in the cabin set to be static and bake lighting there. The objects in the house would use static lighting while anything outside using dynamic.

Keep in mind that since the light is set to Movable this does not mean that the static mesh has to be set to movable. It can still be listed as static for its mobility unless you are using it as a movable object.

If you have any questions or need further examples feel free to ask any questions! :slight_smile:

Tim

Hi Tim

Thanks for the reply im just looking back on this and i have a few more questions. if i have a town for example and in the buildings the all have lights in them then can be turned on and off, and then outside i have a day and night cycle does this then make the lightmaps irrelevant for the buildings and the things inside them as the only light that will be cast on them will be moveable/dynamic?

If all your lights are being turned on and off in the buildings then having them set to movable would be one option because lightmaps are primarily used for static lighting.

However, here is a use case for using stationary lighting for your objects.

You can setup all your interior lights to be Stationary. This will allow you to toggle the visibility to turn them on and off. Since you are toggling the lights on and off you will only need shadows for when the light is turned on. The shadows can be baked into a lightmap for nice crisp shadows and as your player gets close it will change to dynamic as it’s always done. When the lights are off you won’t see the shadows anyhow since you have the lights off.

I hope this helps.

If you still have questions feel free to ask! :slight_smile:

Tim