Sky Atmosphere

The SkyAtmosphere system is used to create physically based sky and atmosphere rendering with time-of-day features and ground to space view transitions featuring aerial perspective.

Windows
MacOS
Linux

The Sky Atmosphere component in Unreal Engine 4 (UE4) is a physically based sky and atmosphere rendering technique. It's flexible enough to create an Earth-like atmosphere with time-of-day featuring sunrise and sunset, or to create extra-terrestrial atmospheres of an exotic nature. It also provides aerial perspective to which you can simulate transitions from ground to sky to outer space with proper planetary curvature

Banner1.png

The Sky Atmosphere gives an approximation of light scattering through a planetary atmosphere’s participating media giving outdoor levels a more realistic or exotic look by including the following:

  • You can have two atmospheric Directional Lights that receive sun disk representation in the atmosphere with sky color depending on the sunlight and atmosphere properties.

  • A sky color that will vary depending on the altitude of the sun or in other terms, how close the dominant Directional Light's vector gets to being parallel with the ground.

  • Control over scattering and fuzzy settings, allowing for full control of your atmospheric density.

  • Aerial perspective that simulates the curvature of the world when transitioning from ground to sky to space views.

Enabling the SkyAtmosphere Component

Enable the SkyAtmosphere component by following these steps using the Modes panel in the Editor:

  1. Place a SkyAtmosphere component in the scene.

  2. Place a Directional Light in the scene and from its Details panel, enable Atmosphere/Fog Sun Light.

    1. If using multiple Directional Lights set the Atmosphere Sun Light Index for each; for instance 0 for the Sun and 1 for the Moon.

  3. Place a Sky Light in the scene to capture Sky Atmosphere and have it contribute to the scene lighting.

Adjusting Atmospheric Directional Lights

When you’ve enabled Atmosphere/Fog Sun Light on your Directional Light(s) and set the Atmosphere Sun Light Index for each, you can quickly adjust each light’s position using the following keyboard shortcuts:

  • Ctrl + L with mouse movement will adjust the Directional Light set to index 0. Typically this would be the Sun.

  • Ctrl + L + Shift with mouse movement will adjust the Directional Light set to index 1. Typically this would be the Moon.

Moving these light sources will affect the atmosphere based on properties set in the SkyAtmosphere component for each Directional Light.

Sky Atmosphere Model

Simulating the sky and atmosphere in UE4 requires several properties that mimic the look and feel of a real-world atmosphere. These properties can be used to define the look of the sky and atmosphere by scattering light in an appropriate and accurate manner. By default, the SkyAtmosphere component in UE4 represents the Earth.

For an Earth-like planet, the atmosphere is made up of multiple layers of gasses. They themselves are made up of particles and molecules that have their own shape, size and density. When photons (or light energy) enters the atmosphere and collides with the particles and molecules there, it is either scattered (reflected) or absorbed (see below).

ParticleLightInteraction.png

1 - Incident Light from the Sun; 2 - Particles in the Atmosphere; 3 - Redirected Light Energy

The SkyAtmosphere system simulates absorption with Mie scattering and Rayleigh scattering. These scattering effects enables the sky to appropriately change colors during time-of-day transitions by simulating how the incident light interacts with particles and molecules in the atmosphere.

The sky color changes depending on the time-of-day simulation when using the SkyAtmosphere component.

Rayleigh Scattering

The interaction of light with smaller particles (such as air molecules) results in Rayleigh Scattering. This type of scattering is highly dependent on the light wavelength. For instance, in the Earth’s sky, blue scatters more than other colors giving the sky its blue color during the daytime. However, at sunset, it appears red because light rays need to travel further in the atmosphere. After long distances, all blue light is scattered away before other colors, resulting in colorful sunsets full of yellow, orange, and red colors.

RayleighParticleShape.png

1 - Incident light; 2 - Small particles in the atmosphere; 3 - Rayleigh scattered light energy

In an Earth-like atmosphere when sunlight interacts with small particles (1) in the atmosphere (2), Rayleigh scattering happens throughout the atmosphere. The upper atmosphere is less dense compared to the lower atmosphere near the Earth’s surface (3).

RaylightAtmosphereInteraction.png

Increasing or decreasing the density of particles in the atmosphere causes light to scatter more or less.

Drag the slider to see the effects of decreasing and increasing the Rayleigh Scattering Scale. (Left to right, 1-3)

  1. Decreased scattering causes light to scatter less through the atmosphere. This is 10x less dense than Earth's atmosphere.

  2. This is representative of an Earth-like atmospheric density.

  3. Increased scattering allows light to scatter more through the atmosphere. This is 10x more dense than Earth's atmosphere.

Mie Scattering

The interaction of light with larger particles—such as those from dust, pollen, or air pollution—suspended in the atmosphere results in Mie Scattering. These particles are referred to as Aerosols and can be caused naturally or by human activity. Incident light that follows the Mie scattering theory usually absorbs light causing the clarity of the sky to appear hazy by occluding light. Light also usually scatters more forward, resulting in bright halos around the light’s source, such as around the sun disk in the sky.

MieParticleShape.png

1 - Incident light; 2 - Large particles in the atmosphere; 3 - Mie scattered light energy

Increasing or decreasing the aerosol density causes more or less clarity in the sky, contributing to how hazy it looks.

Drag the slider to see the effects of decreasing and increasing the Mie Scattering Scale. (Left to right, 1-3)

  1. Decreased particle density allows the sky to appear more clearly. It has less haze and light is scattered less directionally.

  2. Default Mie scattering scale.

  3. Increased particle density causes the sky to become occluded. It also causes the sky to appear hazy with the strong forward scattering lob around the incident light direction.

Mie Phase

The Mie Phase controls how uniformly light scatters when interacting with larger aerosol particles in the atmosphere. With Mie scattering, light usually scatters more forward, resulting in bright halos around the light’s source, such as around the sun disk in the sky.

MiePhaseFunctionShape.png

1 - Incident Light; 2 - Larger particles in the atmosphere; 3 - Stronger Mie scattered light energy

Use the Mie Anisotropy property to control how uniformly Mie scattering happens across the atmosphere.

Drag the slider to see the effects of decreasing and increasing the Mie Anisotropy of the atmosphere. (Left to right, 1-3)

  1. Decreasing the Mie Anisotropy scatters light more uniformly across the atmosphere. This example is using a value of 0.

  2. Default settings mimic an Earth-like atmosphere. This example is using a value of 0.8.

  3. Increasing the Mie Anisotropy scatters light more directionally causing it to tighten around the light source. This example is using a value of 0.9.

Atmospheric Absorption

The amount and colors absorbed are controlled using the Absorption Scale and Absorption color picker properties. The examples below demonstrate removing a single RGB color through the increased Absorption Scale.

Drag the slider to see the effects of decreasing and increasing the Absorption Scale of the atmosphere. (Left to right, 1-3)

  1. No atmospheric absorption.

  2. Default Earth Ozone absorption scale.

  3. Increased Ozone absorption scale.

The amount and colors absorbed are controlled using the Absorption Scale and Absorption color picker properties. The examples below demonstrate removal of a single RGB color through an atmosphere with increased absorption.

Absorption_GreenRemoved.png

Absorption_RedRemoved.png

Absorption_BlueRemoved.png

Green Absorbed

Red Absorbed

Blue Absorbed

Absorption of some colors may not be as noticeable during different times of day due to the way light scatters through the atmosphere.

Altitude Distribution

The SkyAtmosphere component enables you to control the atmosphere from not only a ground perspective but also from an aerial and space one. This means that you can effectively define the curvature of your world so that transitioning from ground to sky to space feels and looks like a real-world atmosphere.

Use the following properties to achieve this:

  • Use Ground Radius to define the planet's size.

  • Use Atmospheric Height to define the height of the atmosphere above which we stop evaluating light interactions with the atmosphere.

  • Use Rayleigh Exponential Distribution to define the altitude (in kilometers) at which Rayleigh scattering effect is reduced to 40% due to reduced density.

  • Use Mie Exponential Distribution to define the altitude (in kilometers) at which Mie scattering effect is reduced to 40% due to reduced density.

Rayleigh Atmosphere Height: 0.8 km

Rayleigh Atmosphere Height: 8 km (Default)

Rayleigh Atmosphere Height: 80 km

Click images for full size.

Planetary View

When defining a planetary view from outer space (or, simply, a higher perspective), you can define the look using settings like the ones below.

Earth Radius: 6360 km

Earth Radius: 300 km

Planet Radius: 300 km

Planet Radius: 300 km

Planet Radius: 300 km

Atmosphere Height: 100 km

Atmosphere Height: 100km

Atmosphere Height: 100 km

Atmosphere Height: 100 km

Atmosphere Height: 300kn

Rayleigh Atmosphere Height: 8 km

Rayleigh Atmosphere Height: 8 km

Rayleigh Atmosphere Height: 2 km

Rayleigh Atmosphere Height: 32 km

Rayleigh Atmosphere Height: 32 km

Click images for full size.

Artistic Direction

In addition to physically based properties, the SkyAtmosphere component supports artistic control when you want to define a specific look for your project.

Aerial Perspective Scale

The Aerial Perspective View Distance Scale property scales distances from the view to surfaces to make them look thicker when viewing from an aerial perspective.

Drag the slider to change the Aerial Perspective View Distance Scale property. (Left to right, 1-3)

  1. Some atmospheric properties setup for this scene.

  2. The same scene with the Aerial Perspective View Distance Scale increased slightly.

  3. The same scene with Aerial Perspective View Distance Scale doubled.

Exponential Height Fog

Mie scattering is a component of the atmosphere and is a height fog simulation in itself, meaning you can already use it to create height fog in your scene without using the Exponential Height Fog component (see below).

ExpoHeightFog.png

Height fog produced from the SkyAtmosphere component without Exponential Height Fog component.

However, if your project requires it, you can enable it from the Project Settings with the Support Atmosphere Affecting Height Fog setting. The contribution is additive on top of the existing fake colors on the height fog itself. The strength of the influence of the sky and sin on the height fog is controllable using the Height Fog Contribution property on the SkyAtmosphere component.

Drag the slider to see the height fog contribution increase and decrease its contribution to the SkyAtmosphere component. (Left to right, 1-3)

  1. Default height fog contribution from the SkyAtmosphere component.

  2. Half height fog contribution (0.5) from the SkyAtmosphere component.

  3. Double height fog contribution (2.0) from the SkyAtmosphere Component.

Sky Rendering Options

The sky and aerial perspective is rendered on screen using ray marching. However, doing so for each pixel can be expensive, especially with today's standard pushing towards 4K or 8K resolution. That is why the sky is evaluated in a few Look-Up-Table at low resolution. Those LUTs are:

By default, all of these LUTs are all evaluated, but using the examples below you can determine the needs for your own projects.

Type of LUT Used

Description

FastSkyViewLUT

stores a latitude/longitude texture of the ray ray marched sky luminance around a point of view. It is applied on the sky pixels only.

AerialPerspectiveLUT

stores the transmittance and scattered luminance into froxel (camera frustum voxel). This is used to apply aerial perspective on opaque and transparent meshes**.

MultipleScatteringLUT

during ray marching, used to evaluate the multiple scattering contributions.

TransmittanceLUT

during ray marching, used to evaluate the remaining illuminance from the sun light for any position within the atmosphere and on the planet.

DistanceSkyLightLUT

stores non occluded luminance after a scatter event with a uniform phase function.

Many of these settings allow you to control the LUT's performance and visual quality for your project. For additional details about them, see the Sky Atmosphere Reference page.

Rendering the Sky uisng a Skydome Mesh

For some projects, you will want to position the skydome mesh around the world, enabling artists to control the way the sky is composited with clouds, stars, sun and any other celestial bodies, like the moon.

To set up a skydome mesh to work with the SkyAtmosphere component, you'll need to enable the following in its Material:

  • Enable Is Sky in the Material Details panel under the Material category.

  • Set the Blend Mode to Opaque.

  • Set the Shading Model to Unlit.

The sky material is rendered as the last opaque mesh during the base pass, meaning that aerial perspective will not be applied on it to avoid double contribution. However, height fog and volumetric fog will continue to be applied, if used.

In this material, you will have the freedom to compose the sky, sun disk, clouds and aerial perspective. Also, you will have to compute lighting on the clouds and other elements in the sky.

There are several Material Expressions with which you can use to achieve this in your Material. You can find them when searching for "SkyAtmosphere" in the Material Editor.

For additional information about these Material Expressions, see the Sky Atmosphere Reference page.

The shape of the skydome mesh is important when using some of these expressions since they will drive evaluation of those values. For example, if you use the functions to evaluate lighting on clouds, you can assume the skydome pixel world position represents the cloud world position in the atmosphere.

Time of Day Example Level

A working example template map demonstrating a skydome mesh with a material using the SkyAtmosphere Material Expressions is available with UE4.

SkyAtmos_TimeOfDayMap.png

You'll find this Level located in the Engine Content folder under Engine/Maps/Templates, or you can use the main menu to create a new level and select the TimeOfDay_Default Level.

Visualization and Debugging

The SkyAtmosphere visualization and debugging view enables you to see—in real-time—the changes you make to the atmosphere settings.

SkyAtmosVisualization.png

  1. The Hemisphere View shows a visual representation of your atmosphere taking into account Rayleigh and Mie scattering along with Absorption.

  2. The Time-of-Day Preview displays different times of day based on the settings that are applied to the SkyAtmosphere component.

  3. The Graph View shows a representation of Rayleigh, Mie, and Absorption values within the SkyAtmosphere component's set Ground Level and Atmosphere Height.

Enable the SkyAtmosphere visualization to be drawn on screen using the command:

r.SkyAtmosphere.Visualize 1

Additional Information

  • Setting up Physically Based Sky Lighting

    • When the Sun is at its zenith, it should be set to 120000 lux (or cd:sr*m^2) for an angular diameter of 0.545 degrees.

    • The total Lux on a white diffuse surface with a perpendicular sun at its zenith should be around 150000 Lux.

      • Sky contribution would be 20% of that total.

      • Disable Ambient Occlusion when measuring this value in the Engine using the luminance/illuminance meter that is available in the HDR (Eye Adaptation) Visualization tool (Show > Visualize).

      • Multiscattering in the SkyAtmosphere component should be equal to 1 and Earth Albedo is 0.4 (linear) by default.

    • When the Moon is at its zenith, it should be set to 0.26 Lux for an angular diameter of 0.568 degrees.

  • Why does the ground/lower hemisphere appear dark? When you are close to the ground, there isn’t any fog, so you don’t get the scattering effect nor any fog color. This means for the lower hemisphere of a virtual planet, it is black. To address this, try the following:

    • Populate the scene with a terrain or mesh to represent the planet surface.

    • Use an Exponential Height Fog component as a lower hemisphere color filler.

    • Place your terrain or mesh surface at a higher altitude.

  • Why does the second Directional Light source have a lower impact on the sky? Currently, multi-scattering is not evaluatated for the second light source.

  • Why are texels are visible on the skydome? Try increasing the resolution of the FastSkyViewLUT (r.SkyAtmosphere.FastSkyViewLUT.SampleCountMax) if texels appear on the sky. If texels appear on fogged elements, increase the resolution of the AerialPerspectiveCameraVolumeLUT (r.SkyAtmosphere.AerialPerspectiveLUT.DepthResolution).

  • Does atmospheric lights work when the camera is not close to the +Z North Pole of the planet? As an optimization, sun light transmittance effect on surface lighting is only evaluated as if the camera is at the top of the planet (over +Z position). This will be improved in a future release based on feedback.

  • Can you render multiple planetary atmospheres on screen at once? This is not currently supported with this version of the SkyAtmosphere system.

  • Noise, aliasing, and some rings of different colors are visible When you have high-frequency elements or values that generates high spikes in the atmosphere close to the ground that are hard to catch, resolve this using one of two ways:

    • Increase the SkyAtmosphere sample count using r.SkyAtmosphere.SampleCountMax.

    • If you’re using the FastSky LUT instead of per-pixel ray marching, use r.SkyAtmosphere.FastSkyLUT.SampleCountMax. For additional details, see the Sky Rendering Options section of this page for more details.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback