At a very high level, the main steps were the following:
- Create a 'Timeline' node inside the level blueprint.
- Create the different parameter curves inside the 'Timeline' needed to drive all the cyclic items. More specifically, I'm talking about the sun position, the fog amount, skylight intensity, and the time of day.
- In order for the time of day and sun position to be consistent I had to drive the sun position from -270 degrees at 00:00 to 90 degrees at 24:00 hrs. Moreover, my time scale was 1 hr = 10 seconds.
- The fog parameters were trial and error but overall attempted to reduce fog during midday and increase it at night.
- The skylight allowed for nice ambient lighting during day light but it had issues at night as it would light up the terrain like crazy. Therefore, I decided to drive the skylight intensity to almost zero during night time.
- Create own copy of the engine's sky sphere in order to be able to tweak freely without affecting other levels or projects.
- Cloud amount, cloud speed, and stars brightness can be tweaked in the sky sphere blueprint but only at construction time. Hence, in order to drive those material parameters with the time of day, create another 'Timeline' node inside the sky sphere's BP event graph. Then, create the different curves for cloud amount, cloud speed, and stars brightness inside this timeline node. Afterwards, hook up those outputs to the corresponding parameters of the dynamic material instance. Finally, connect the time of day, from the 'Timeline' node in the level blueprint, to the time input of the Timeline node just created for the sky sphere's BP event graph. This is how the two blueprints communicate.
- Add milky way galaxy at night by grabbing picture from NASA and importing it as a power of two texture into the project. After that, find the section where the stars are being drawn inside the sky sphere's material and linearly interpolate the milky way galaxy texture. Getting the UV's tiling was trial and error but at the end found U tiling of 2 and V tiling of 1 factors worked best for me.
- Create Matinee by adding camera groups, a director group and a soundtrack.
- Need to set the directional light as movable.
- Need to register the directional light with the sky sphere in order to use its angle to drive the sun position.
- Need to call the sky sphere's 'Update Material' function every time the sun position is updated.
- It looks nicer with distance field ray traced shadows enabled.
- Reduce skylight intensity at night in order to avoid glitches where the terrain lights up at night. Still investigating if this is a glitch with skylights or if its a problem where I'm abusing of the interface type of deal.
To do items
- Explore the distance field shadows parameters better.
- Investigate lighting artifact where there are isolated pockets of the landscape that light up at weird times during night cycle.
- Investigate why the dirt mask applied to camera 2 is not working.
- Improve landscape material. Investigate how to autogenerate landscape materials blends based on terrain features.
- Another reason to improve the landscape material is due to the grid patterns being formed by the UV tiling.