The Sky Light captures the distant parts of your level and applies that to the scene as a light. That means the sky's appearance and its lighting/reflections will match, even if your sky is coming from the atmosphere, or layered clouds on top of a skybox, or distant mountains. You can also manually specify a cubemap to use. To light and preview a scene with an HDR image, see HDRI Backdrop Visualization Tool.
Scene Capture
The Sky Light will only capture the scene under certain circumstances:
For Static Sky Lights, updates automatically happen when building lighting.
For Stationary or Movable Sky Lights, updates happen once on load and only updates further when Recapture is called unless the Real Time Capture feature is enabled. Both are accessible via the Details panel, and you can call the Recapture Sky Blueprint node in-game. Changing any Sky Light property in the editor also recaptures it.
Details panel Sky Light Recapture button
If you change the texture that the skybox is using, it will not automatically know to update. You'll be required to use one of the methods above for it to update.
A Sky Light should be used instead of the Ambient Cubemap to represent the sky's light because Sky Lights support local shadowing, which prevents indoor areas from getting lit by the sky.
Mobility
Similarly to other Light Types, the Sky Light can be set to one of the following Mobilities:
| Mobility | Description |
|---|---|
Static | Lighting cannot be changed while in game. This is the fastest method for rendering and allows for baked lighting. |
Stationary | When lighting is built, shadowing and light bounces will only be captured from static geometry. All other lighting will be dynamic. This setting also allows for the light to change color, intensity, and the cubemap in-game, but it does not move and allows for partially baked lighting. |
Movable | Lighting can be moved and changed in-game as needed. |
Static Sky Light
A Sky Light set to Static will be baked completely into the lightmap for static objects in the level and therefore costs nothing. When edits are made to the light's properties, the changes will not be visible until lighting has been rebuilt for the level.
When using a Static Sky Light, only Actors and Lights in the level that have their mobility set to Static or Stationary will be captured and used for lighting. Furthermore, only the emissive contribution of Materials can be captured with a Static Sky Light in order to avoid a feedback loop. For this reason, make sure any skybox has a Material that is set to Unlit. If your project supports ray tracing or mesh distance fields, a Static Sky Light is still captured at runtime, because Lumen and ray tracing effects use it.
Stationary Skylight
A Sky Light with Stationary Mobility gets baked shadowing from Lightmass. Once you place a Stationary Sky Light in your level, you have to rebuild lighting once to get the baked shadowing. You can then change the sky light as much as you want without rebuilding. The Sky Light shadowing that Lightmass bakes stores directional occlusion information in what is called a Bent Normal. Stationary Sky Lights require Support Stationary Skylight to be enabled in the Project Settings, which it is by default.
Only components and lights with Static or Stationary Mobility will be captured and used for lighting with a Stationary Sky Light.
Like all types of Stationary Lights, the color of the direct lighting can be changed at runtime through Blueprint or Sequencer. However the indirect lighting is baked into the lightmap and cannot be modified at runtime. The amount of indirect lighting can be controlled by Indirect Lighting Intensity.
Movable Sky Light
A Sky Light set to Movable does not use any form of precomputation. It captures components and lights of any mobility when setup to capture the scene.
Distance Field Ambient Occlusion
This feature requires that Mesh Distance Fields be enabled in the project settings.
Shadowing for a Movable Sky Light is provided by Distance Field Ambient Occlusion from Signed Distance Field Volumes that are generated around each rigid object. Distance Field Ambient Occlusion supports dynamic scene changes where the rigid meshes can be moved or hidden, and it will affect the occlusion. Its settings are in the Sky Light's Distance Field Ambient Occlusion category. Most of them are only editable when the Sky Light is Movable and Cast Shadows is enabled. When Lumen Global Illumination is enabled, Lumen computes the sky light's occlusion itself and Distance Field Ambient Occlusion isn't used.
Click image for full size.
Check out the How to use Distance Field Ambient Occlusion page for more information and examples.
Precomputed (Static or Stationary) Sky Light
When using baked lighting with a Static or Stationary Sky Light, the lighting and shadowing data will be stored in lightmaps. Baked lighting requires Allow Static Lighting to be enabled in the Project Settings. The sections below discuss some of these features supported by Lightmass.
Improved Static Sky Light Directionality
Prior to Unreal Engine 4.18, Static Sky Lights used to be represented by Lightmass with a 3rd Order Spherical Harmonic which didn't capture the detail that could be present in a sunrise or sunset. A filtered cubemap is used now which results in a higher resolution by default. Lightmass will also select the appropriate mip of the cubemap texture based on the size of the Final Gather rays to avoid any aliasing.
To see an example of this type of interaction, go to Engine Content > MapTemplates > Sky and select SunsetAmbientCubemap as it will show a great example.
The biggest difference can be seen in heavily occluded scenes with a Sky Light cubemap that has a lot of brightness and color variations.
Camera Obscura
With the improved directionality of Static Sky Lights, it is now possible to recreate a pinhole camera effect (Camera Obscura) with a small enough opening. The smaller the opening, the more directional sky lighting will become.
[REGION:lightbox] [/REGION] | [REGION:lightbox] [/REGION] |
Sky Light Source Cubemap | Resulting Light Build |
Click image for full size. | Click image for full size. |
Bent Normal for Stationary Sky Lights
For Stationary Sky Lights, static and stationary lighting is baked separately from movable using Lightmass to store directional information in what is called a Bent Normal. This is the direction from the texel to the most un-occluded source of ambient light. Areas that are mostly occluded use this direction for sky lighting instead of the surface normal, which improves quality in cracks.
The first image shows Sky Light with Ambient Occlusion only. The second image shows Sky Light with Bent Normal occlusion. Notice how surfaces in cracks 'agree' on where the lighting is coming from.
For additional information visit the Bent Normal Map page.
Multiple Light Bounces
Multiple bounces of indirect light from Sky Lights is supported by adjusting the Num Sky Lighting Bounces setting in World Settings > Lightmass.
Setting for the number of sky light bounces to use.
For multiple Sky Light bounces to be noticeable, your Materials need to have a high diffuse value in most cases. For example, with a diffuse value of .18 (18% grey), the second sky light bounce will only contribute 18^3 = 0.006 of the light's emitted energy, which is very subtle. With a diffuse value of 0.5, the second skylight bounce will contribute 0.125 of the light's emitted energy and be noticeable.
Each added bounce increases non-distributed build times, so use with care when not using Swarm distribution.
Real Time Capture
The Real Time Capture mode provides dynamic and specular environment lighting, making possible dynamic time-of-day simulations with real-time reflections on scene elements.
This mode is available when the Sky Light's mobility is set to Stationary or Movable and when Real Time Capture is enabled from the Sky Light component Details panel.
This mode supports the following components for captured reflections and shadowing:
Sky Dome Meshes with an unlit material tagged as IsSky
These are some additional things to keep in mind when using this mode:
Volumetric Fog is not supported.
Requires a Sky Atmosphere component, a Volumetric Cloud component, or a mesh with a material tagged as IsSky in the scene. Otherwise the sky lighting is black.
It's possible to render meshes only in real time capture mode by disabling them from rendering in the main view.
It's possible to have a different sky dome mesh for the main view as compared to the reflection of the real time capture when enabling Visible in Real Time Sky Captures on individual actors.
Real Time Capture mode allows for ambient shadowing from Volumetric Clouds to be cast onto the world when Cloud Ambient Occlusion is enabled.
Real Time Capture mode is faster and more efficient than the Recapture Sky Blueprint node because all the computations stay on the GPU without any use of CPU processing that can cause pauses, or slowdowns in gameplay.
If you are using the volumetric clouds, performance can vary a lot depending on the complexity of the cloud material you're using. You can control the performance tradeoff—while respecting visuals in your scene—by adjusting the Volumetric Cloud component's Reflection Sample Count Scale and Shadow Reflection Sample Count Scale values.
Reflection Quality
The quality of reflections captured by the Sky Light is set by the property Cubemap Resolution. It uses power of two values (such as, 64, 128, 256, and so on) to specify a texture resolution for the captured scene.
Keep in mind that higher resolution values increase quality at the cost of performance. The specified value is applied to the highest cubemap mip (a texture's level of detail).
Drag the slider to see decreased (64), default (128), and increased (256) skylight cubemap resolutions being used.
Note that Screen Space Reflections (SSR) has been disabled in these shots. Reflections are only the result of the Sky Light.
Time Slicing Optimization
Real Time Capture mode utilizes a performance optimization called Time Slicing to distribute the captured scene over several frames rather than performing a full scene process every frame. This optimization reduces the per frame cost that would make a full process real time capture every frame too expensive for use on some platforms.
Distributing a single frame's capture over multiple frames has the benefit of keeping real time skylight capture within an affordable budget for your project, because time slicing is only as expensive as its most costly frame. It also means you can look for opportunities to push quality in other areas, such as the quality of the sky or clouds, because you have a little bit of room in the frame budget.
Time slicing is enabled by default, but can be set using the console variable r.SkyLight.RealTimeReflectionCapture.TimeSlice.
Shadowing from Movable Objects
Soft shadowing from movable objects onto the environment can be achieved using Capsule Shadows for Skeletal Meshes or Distance Field Indirect Shadowing for rigid meshes. These require a separate setup to work properly.
Properties
Most Sky Light properties are in the Light category, which mixes settings specific to Sky Lights with settings common to all lights. The table below lists those two groups separately, followed by the Atmosphere and Cloud, Distance Field Ambient Occlusion, and Ray Tracing categories. These can be accessed from the Actor Details panel. Sky Light properties are specific to Sky Light Actors, while Light properties are common to all Light Actors. Certain properties are only accessible by expanding the Advanced section, indicated in the table below.
| Property | Description |
|---|---|
| Sky Light | |
Real Time Capture | When enabled, the sky will be captured and convolved to achieve dynamic diffuse and specular lighting. SkyAtmosphere, VolumetricCloud Components as well as sky domes with Sky materials are taken into account. Only available on Stationary and Movable Sky Lights. |
Source Type | Whether to capture the distant scene and use it as the light source or to use the specified cubemap. When capturing the scene, anything further than Sky Distance Threshold from the Sky Light position will be included:
You can't change Source Type while Real Time Capture is enabled. |
Cubemap | Specify the Cubemap to use for sky lighting if Source Type is set to SLS Specified Cubemap. |
Source Cubemap Angle | The angle to rotate the source cubemap when Source Type is set to SLS Specified Cubemap. |
Cubemap Resolution | Maximum resolution for the very top processed cubemap MIP. The value is rounded up to a power of 2. |
Sky Distance Threshold | Distance from the Sky Light at which any geometry should be treated as part of the sky (also used by Reflection Captures). |
Capture Emissive Only | Only capture emissive Materials. Skips all lighting making the capture cheaper. Advanced. |
Lower Hemisphere Is Solid Color | Whether all lighting from the lower hemisphere should be set to Lower Hemisphere Color. Enabling this is accurate when the ground blocks the sky. Disabling it can approximate bounce lighting from the ground. Advanced. |
Lower Hemisphere Color | Use the color picker to select the color for the lower hemisphere. Requires Lower Hemisphere Is Solid Color. Advanced. |
| Light | |
Intensity Scale | The total energy that the light emits. When Real Time Capture is enabled and Source Type is SLS Specified Cubemap, this property is labeled Intensity and is in cd/m². |
Light Color | Filter color of the light. Note that this can change the light's effective intensity. |
Affects World | Whether the light can affect the world, or whether it is disabled. |
Cast Shadows | Whether the light should cast any shadows. |
Indirect Lighting Intensity | Scales the indirect lighting contribution from this light. A value of 0 disables any global illumination (GI) from this light. |
Volumetric Scattering Intensity | Intensity of the volumetric scattering from this light. This scales Intensity and Light Color. |
Casts Static Shadows | Whether the light should cast shadows from static objects. Also, requires Cast Shadows to be set to True. Advanced. |
Casts Dynamic Shadows | Whether the light should cast shadows from dynamic objects. Also, requires Cast Shadows to be set to True. Advanced. |
Affect Translucent Lighting | Whether the light affects translucency or not. Disabling this can save GPU time when there are many small lights. Advanced. |
Transmission | Whether light from the skylight transmits through surfaces with subsurface scattering profiles. Requires the light to be movable. Advanced. |
Cast Volumetric Shadow | Whether the light shadows Volumetric Fog. Advanced. |
Cast Deep Shadow | Whether the light should cast high quality hair-strands self shadowing. When this option is enabled, an extra GPU cost is applied to this light. Advanced. |
Cast Ray Traced Shadows | Whether the light shadows are computed with shadow mapping or ray tracing (when available). Only editable when ray tracing is enabled for the project. Advanced. |
Affect Ray Tracing Reflections | Whether the light affects objects in reflections when ray traced reflection is enabled. Advanced. |
Affect Ray Traced Global Illumination | Whether the light affects global illumination when ray traced global illumination is enabled. Advanced. |
Deep Shadow Layer Distribution | Change the deep shadows layer distribution. 0: linear (uniform layer distribution), 1: exponential (more details on near small shadows). Requires Cast Deep Shadow to be enabled. Advanced. |
| Atmosphere and Cloud | |
Cloud Ambient Occlusion | Whether the cloud should occlude sky contribution within the atmosphere (progressively fading out multiple scattering) or not. |
Cloud Ambient Occlusion Strength | The strength of the ambient occlusion. Higher values will block more light. |
Cloud Ambient Occlusion Extent | The world space radius of the cloud ambient occlusion map around the camera in kilometers (km). |
Cloud Ambient Occlusion Map Resolution Scale | Scales the cloud ambient occlusion map resolution. The base resolution is 512, and the result is clamped by |
Cloud Ambient Occlusion Aperture Scale | Controls the cone aperture angle over which the sky occlusion due to volumetric clouds is evaluated. A value of 1 takes the entire hemisphere into account, resulting in blurry occlusion. A value of 0 takes a single direction of occlusion (vertical) into account, resulting in sharp occlusion. |
| Distance Field Ambient Occlusion | |
Occlusion Max Distance | Maximum distance at which one point can occlude another. Higher values increase the cost of Distance Field Ambient Occlusion exponentially. |
Occlusion Contrast | Contrast S-curve applied to the computed occlusion. A value of 0 adds no contrast, while 1 adds a lot. |
Occlusion Exponent | Exponent applied to the computed occlusion. Values lower than 1 brighten occlusion overall without losing contact shadows. |
Min Occlusion | Controls how dark a fully occluded area can get. This tends to destroy contact shadows, so use Occlusion Contrast or Occlusion Exponent instead. |
Occlusion Tint | Tint color for occluded areas, for artistic control. |
Occlusion Combine Mode | How occlusion from Distance Field Ambient Occlusion is combined with Screen Space Ambient Occlusion:
|
| Ray Tracing | |
Samples Per Pixel | Number of samples per pixel used when the sky light is ray traced. |
Limitations
These features would be useful with SkyLights but are not yet implemented:
Soft shadowing from movable objects (characters) onto the environment is not integrated with Sky Light and currently requires implementing separate features at additional rendering cost.
The Recapture Sky Blueprint function can be used, however it has a high processing cost and requires at least 120 ms, leading to a pause or slowdown in gameplay.