In this lesson, you will learn how to synchronize your Directional Light with the Sky Atmosphere component to establish a physically-based, unified lighting foundation for your open world.
The Physics of Synchronization
In a large-scale world, lighting inconsistencies often stem from the sun’s angle not matching the atmospheric scattering calculations. The Sky Atmosphere component works by calculating how light from your Directional Light scatters through the air particles based on the light’s orientation. If these two components are not linked, your world will feel like a collection of disjointed assets rather than a single, coherent environment.
To achieve global consistency, you must ensure your Directional Light is set to Atmosphere/Sun Light. When this property is enabled, the light actor communicates its transformation data directly to the Sky Atmosphere component. As you rotate your light, the Sky Atmosphere automatically updates its scattering, extinction, and sky color values.
Implementation Workflow
To bind them, select your Directional Light and perform these two steps:
- Enable Atmosphere: In the Details panel, scroll to the Atmosphere & Cloud section and check the Atmosphere/Sun Light box.
- Assign the Component: Ensure that the
Sky Atmospherecomponent in your scene is set to reference the light by its orientation.
You can visualize the link by adjusting the light's pitch. As the light approaches the horizon, the Sky Atmosphere will calculate the longer light path through the atmosphere, naturally shifting the lighting to the warm oranges and deep purples associated with dusk.
// Within the Directional Light component settings
// The following flag forces the light to influence the Sky Atmosphere shader
DirectionalLightComponent->AtmosphereSunLight = true;
By linking these systems, you ensure that your global illumination (Lumen), volumetric clouds, and height fog all respond to the exact same solar position. This creates a "golden hour" or "mid-day" look that persists uniformly across your entire landscape, regardless of how far the player travels or which streaming cells are currently loaded.
Key Takeaway: Linking your Directional Light to the Sky Atmosphere is essential for physical accuracy, as it allows the sky’s color palette and light scattering to automatically recalculate based on the sun’s orientation.