Website powered by

Unreal Engine Blueprint System - Day & Night

Here's a system I prototyped in Unreal Engine using Blueprints to create complex, dynamic, day & night cycles. The interesting bit of that system is that the system works for any kind of planet of any kind of solar system. The idea is to build that solar system in world space first, then use inverse transforms to figure out where all the stellar bodies are located in the sky from any given point of view.

This approach has its limitations but it was a nice experiment to do. It was cool to see things like sun eclipses, moon crescents, summer and winter days and star motion work as expected (somewhat, it's not really physically acurate but close enough).

On top of that, a whole layer of controls lets you create the visual mood at any time of day with great artistic controls by customizing the colors of the sky using color and float curves.

Sun eclipse (sun light intensity is decreased by the amount of its surface eclipsed)

Sun eclipse (sun light intensity is decreased by the amount of its surface eclipsed)

Moon crescent, size exaggerated (moon light intensity based on its crescent surface)

Moon crescent, size exaggerated (moon light intensity based on its crescent surface)

Realistic star motion

Realistic star motion

Semi-accurate summer and winter days. Above polar circles, the sun never sets for half of the year and never rises for the other half

Semi-accurate summer and winter days. Above polar circles, the sun never sets for half of the year and never rises for the other half

Debug view of the system showing the solar system being built in world-space first

Debug view of the system showing the solar system being built in world-space first

Trajectories in real-time of all stellar bodies in world-space

Trajectories in real-time of all stellar bodies in world-space

Debug view of the system showing the motion of all stellar bodies in local-space from any given point of view once reverse transformations have been used

Debug view of the system showing the motion of all stellar bodies in local-space from any given point of view once reverse transformations have been used

You can select any planet to be the point of view and then use longitude and latitude to move your location on the selected planet

You can select any planet to be the point of view and then use longitude and latitude to move your location on the selected planet