Choose your operating system:
Windows
macOS
Linux
This page includes reference information for the Sky Atmosphere system. It includes information about Project Settings, component properties, console commands and the SkyAtmosphere Material Expressions.
Project Settings
The following Project Settings are used to affect the Sky Atmosphere component in your project.
Property |
Description |
|
---|---|---|
|
||
Support Sky Atmosphere |
The Sky Atmosphere component requires extra samplers/textures in order to be bound to apply aerial perspective on transparent surfaces (and all surfaces on mobile via per-vertex evaluation). |
|
Support Sky Atmosphere Affecting Height Fog |
The Sky Atmosphere component can light up the height fog but it requires extra samplers/textures to be bound to apply aerial perspective on transparent surfaces (and all surfaces on mobile via per-vertex evaluation). It reuires that Support Sky Atmosphere be enabled. |
Sky Atmosphere Properties
The following settings can be found on the Sky Atmosphere component in the Level Details panel.
Property |
Description |
|
---|---|---|
Planet |
||
Ground Radius |
The planet radius measured in kilometers from the center to the ground level. |
|
Ground Albedo |
The ground albedo that tints the atmosphere when the sun light bounces on it. This is only taken into account when MultiScattering is greater than 0. |
|
Atmosphere |
||
Atmosphere Height |
The planet radius measured in kiolometers from the center to the ground level. |
|
MultiScattering |
Render multi-scattering as if sun light bounces around in the atmosphere. It is achieved using dual scattering approach. |
|
Atmosphere — Rayleigh |
||
Rayleigh Scattering Scale |
Rayleigh scattering coefficient angle. |
|
Rayleigh Scattering |
The Rayleigh scattering coeffecients resulting from molecules in the air at an altitude of 0 kilometers. |
|
Rayleigh Exponential Distribution |
The altitude in kilometers at which Rayleigh scattering effect is reduced to 40%. |
|
Atmosphere — Mie |
||
Mie Scattering Scale |
Mie scattering coefficient scale. |
|
Mie Scattering |
The Mie scattering coefficients resulting from particles in the air at an altitude of 0 kilometers. Light is scattered more as it increases. |
|
Mie Scattering Absorption |
Mie absorption coefficient scale. |
|
Mie Absorption |
The Mie absorption coefficients resulting from particles in the air at an altitude of 0 kilometers. Light is absorbed more as it increases. |
|
Mie Anisotropy |
A value of 0 means light is uniformly scattered. A value closer to 1 means light will scatter more forward, resulting in halos around light sources. |
|
Mie Exponential Distribution |
The altitude in kilometers at which Mie effects are reduced to 40%. |
|
Atmosphere — Absorption |
||
Absorption Scale |
Absorption coefficients for another atmosphere layer. Density increase from 0 to 1 between 10 to 25 kilometers and decreases from 1 to 0 between 25 to 40 kilometers. This approximates ozone molecule distribution in the Earth atmosphere. |
|
Absorption |
Absorption coefficients for another atmosphere layer. Density increases from 0 to 1 between 10 to 25 kilometers and decreases from 1 to 0 between 25 to 40 kilometers. The default values represents ozone molecules absorption in the Earth atmosphere. |
|
Tent |
Represents the altitude-based tent distribution of absorption particles in the atmosphere.
|
|
Art Direction |
||
Sky Luminance Factor |
Scales the luminance of pixels representing the sky. For example, not belonging to any surface. |
|
Aerial Perspective Distance Scale |
Makes the aerial perspective look thicker by scaling distances from view to surfaces (opaque and translucent). |
|
Height Fog Contribution |
Scale the sky and atmosphere lights contribution to the height fog when Support Sky Atmosphere Affects Height Fog is enabled in the Project Settings. |
|
Transmittance Min Light Elevation Angle |
The minimum elevation angle in degrees that should be used to evaluate the sun transmittance to the ground. Useful to maintain a visible sun light and show on meshes even when the sun has started going below the horizon. This does not affect the aerial perspective. |
Sky Atmosphere Material Expressions
The following Material Expressions are used when creating a sky material where you want to compose the sky, sun disk, clouds, and aerial perspective. Computing the lighting on the clouds and other elements in the sky is assisted with these expressions.
To explore a working example using these expressions within a material that are applied to a skydome mesh, see the
TimeOfDay_default
map found in the
Engine/Maps/Templates
folder, or use the main menu to create a new level and select it from there.
Also, for additional details, see the "Rendering a Skydome Mesh" section of the Sky Atmosphere 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.
SkyAtmosphereViewLuminance
Th SkyAtmosphereViewLuminance expression outputs the sky luminance resulting from the interaction with atmospheric lights in the atmosphere.
SkyAtmosphereAerialPerspective
The SkyAtmosphereAerialPerspective expression outputs RGBA-colored in-scattered luminance in RGB and grayscale transmittance over the skydome world position in A.
The shape of the skydome mesh is important because it drives the evaluation of these values. For instance, if you use these functions to evaluate the lighting on clouds, you can assume that the skydome pixel world position represents the cloud world position in the atmosphere. However, there is an override to provide the sampled position.
SkyAtmosphereLightDirection
The SkyAtmosphereLightDirection expression takes in the Atmospheric Light Index for a Directional Light and outputs the light direction from the light.
In the Details panel, set the Light Index for the Directional Light being referenced. This should match the Directional Light's Atmosphere Sun Light Index property.
SkyAtmosphereLightIlluminance
The SkyAtmosphereLightIlluminance expression takes in the Atmospheric Light Index for a Directional Light and outputs illuminance reaching the skydome world position (see note below). This is illuminance, so it needs to be integrated against a BxD/phase function to get luminance to accumulate. A multiplication with a uniform phase function of 1/(4π) is a good starting point.
In the Details panel, set the Light Index for the Directional Light being referenced. This should match the Directional Light's Atmosphere Sun Light Index property.
The shape of the skydome mesh is important because it drives the evaluation of these values. For instance, if you use these functions to evaluate the lighting on clouds, you can assume that the skydome pixel world position represents the cloud world position in the atmosphere. However, there is an override to provide the sampled position.
SkyAtmosphereDistantLightScatteredLuminance
The SkyAtmosphereDistanceLightScatteredLuminance expression outputs the sky scattered luminance integrated over the unit sphere, assuming a uniform phase function. The sample is taken at the specified altitude of the DistanceSkyLight LUT (r.SkyAtmosphere.DistanceSkyLightLUT.Altitude).
SkyAtmosphereLightDiskLuminance
The SkyAtmosphereLightDiskLuminance expression takes in the Atmospheric Light index for a Directional Light and outputs the light sun disk luminance with atmosphere transmittance applied.
In the Details panel, set the Light Index for the Directional Light being referenced. This should match the Directional Light's Atmosphere Sun Light Index property.
Console Commands
The following console commands enable you to control the performance and visual quality of your atmosphere.
For additional details, see the "Sky Rendering Options" section of the Sky Atmosphere page.
Console Variable |
Description |
|
---|---|---|
System |
||
|
Sky Atmosphere components are rendered when this is not 0, otherwise ignored. |
|
|
Enables Sky Atmosphere rendering and shader code. |
|
|
Enables Sky Atmosphere affecting height fog. It requires r.SupportSkyAtmosphere to be true. |
|
Fast Sky View LUT |
||
|
When enabled, a lookup texture is used to render the sky. It is faster, but can result in visual artifacts if there are some high-frequency details in the sky such as Earth shadow or scattering lob. |
|
|
Fast sky minimum sample count used to compute sky/atmosphere scattering and transmittance. The minimal value is clamped to 1. |
|
|
Fast sky maximum sample count used to compute sky/atmosphere scattering and transmittance. The minimal value is clamped to r.SkyAtmosphere.FastSkyLUT.SampleCountMin +1. |
|
|
Fast sky distance in kilometers after which at which SampleCountMax samples is used to ray march the atmosphere. |
|
|
The width of the FastSky LUT. |
|
|
The height of the FastSky LUT. |
|
Aerial Perspective |
||
|
The distance at which we start evaluate the aerial perspective. Default is set to 100 meters. |
|
|
When enabled, a depth test is used to not write pixel closer to the camera than StartDepth, effectively improving performance. |
|
Aerial Perspective LUT |
||
|
The number of depth slices to use for the aerial perspective volume texture. |
|
|
The length of the LUT in kilometers (default is 96 kilometers to get nice cloud/atmosphere interactions in the distance for the default sky). Further than this distance, the last slice is used. |
|
|
The sample count used per slice to evaluate aerial perspective scattering and transmittance in camera frustum space froxel. |
|
|
The width and height on screen of the AerialPerspective LUT. |
|
Raymarching Sky |
||
|
The minimum sample count used to compute sky/atmosphere scattering and transmittance. The minimal value will be clamped to 1. |
|
|
The maximum sample count used to compute sky/atmosphere scattering and transmittance. The minimal value will be clamped to r.SkyAtmosphere.SampleCountMin +1. |
|
|
The distance in kilometers after which at which SampleCountMax samples is used to ray march the atmosphere. |
|
Transmittance LUT |
||
|
The sample count used to evaluate transmittance. |
|
|
If true, the transmittance LUT uses a small R8BG8B8A8 format to store data at lower quality. |
|
|
The width of the Transmittance LUT. |
|
|
The height of the Transmittance LUT. |
|
Multi-Scattering LUT |
||
|
The sample count used to evaluate multi-scattering. |
|
|
When enabled, 64 samples are used instead of 2, resulting in a more accurate multi-scattering approximation (but also a bit more expensive.) |
|
|
The width of the MultiScattering LUT. |
|
|
The height of the MultiScattering LUT. |
|
Distance Sky Light LUT |
||
|
Enable the generation of the sky ambient lighting value. |
|
|
The altitude at which the sky samples are taken to integrate the sky lighting. Defaults to 6 kilometers, typicall cirrus clouds altitude. |