Lights that have their Mobility set to Movable are lights that can be moved or changed dynamically in any way during runtime — these are sometimes called dynamic lights. Their performance cost is higher than those lights that are Static or Stationary and depend on the number of meshes affected by the light along with the triangle count of those meshes. For example, a shadow-casting dynamic light with a large radius has a higher performance cost than one with a smaller radius.
Movable lights support dynamic indirect lighting when used with Lumen Global Illumination and Reflections, which new projects use by default.
Of the three light mobilities to choose from, Movable lights have varying quality (depending on the type of dynamic shadows being used), highest mutability, and highest performance cost.
Supported Shadow Types
Movable lights support a lot more dynamic lighting and shadowing methods than Static and Stationary Lights do. The following types of shadowing are supported for lights that are Movable:
Shadow Maps provide whole scene dynamic shadows. They work across most platforms for all light types, and are used when Virtual Shadow Maps are disabled or not supported. Shadow maps do not provide soft area shadowing, like many of the other shadowing methods in this list.
Virtual Shadow Maps are the default for new projects. They provide consistent, high resolution shadow maps that works well with film-quality assets and large dynamically lit open worlds. They provide soft area shadowing and work well with Nanite, Lumen Global Illumination and Reflections, and World Partition to deliver the highest quality at a reasonable performance cost. Virtual Shadow Maps are supported on the same platforms as Nanite.
Ray Tracing Shadows simulate soft area lighting effects for the highest shadowing quality at reasonable performance. They require a platform and GPU that support hardware ray tracing.
Mesh Distance Field Shadows provide lighting effects and soft area shadowing from meshes based on a distance field representation of the mesh. This method requires the distance field meshes for the project, which is needed for software ray tracing in Lumen Global Illumination and Reflections, and Distance Field Ambient Occlusion.
When MegaLights is enabled, lights with Allow MegaLights enabled are lit and shadowed by MegaLights instead, using ray tracing or Virtual Shadow Maps as set by the light's MegaLights Shadow Method. This keeps the cost stable even with many shadow-casting Movable lights in view.
Shadow Biasing
The default shadow mapping techniques in Unreal Engine work across all platforms for Movable lights to provide dynamic shadowing. Shadow mapping comes with some limitations that produce artifacts, such as faceted shadows on curved surfaces and shadow contact hardening at surface intersections that can make objects look like they are floating or not grounded in the scene.
Shadow biasing is a per-light set of properties that help reduce these types of artifacts while improving accuracy of self-shadowing and contact hardening from these light sources. These biasing settings work by finding a trade-off between balancing accuracy in one area while reducing self-shadowing artifacts in another.
Adjusting the Shadow Slope Bias reduces self-shadowing artifacts at the loss of shadow accuracy, which can cause a peter-panning (or floating) effect for grounded objects in the scene. Slope bias adjustments won't solve all your self-shadowing issues with dynamic lighting, but it can solve most of them. It's up to you to decide the right balance for your project.
Directional Lights have an extra depth bias property that controls the bias strength across the Cascaded Shadow Maps (CSM). It reduces discontinuities of shadow artifacts at cascade transition points.
The following properties are available on Lights to adjust shadow biasing:
| Property | Description |
|---|---|
Shadow Cascade Bias Distribution | (Directional Lights Only) Controls the depth bias scaling across Cascaded Shadow Maps. It mitigates the difference in shadow artifacts between different cascade transitions. Values of 1 scales shadow bias based on each cascade's size. 0 scales shadow bias uniformly across all cascades. |
Shadow Bias | Controls how accurate self shadowing of whole scene shadows are from this light source. At 0, shadows start at their shadow caster surface but there will be many artifacts. Larger values have shadows starting farther from their caster and there won't be any self-shadowing artifacts, but the object may appear to float above a surface. Values around the mid-point of 0.5 is a good trade-off balance between accuracy and reduction in self-shadowing artifacts. |
Shadow Slope Bias | This works in addition to Shadow Bias to control the accuracy of self-shadowing of whole scene shadows from the selected light. This property increases the amount of bias depending on the slope of a given surface. At 0, shadows start at their caster surface but will have many self-shadowing artifacts. Larger values will start shadows farther from their caster and there won't be any self-shadowing artifacts but objects might appear to float above a surface. |
Shadow Filter Sharpen | Adjusts the sharpness of direct shadowing from Stationary or Movable lights. It can reduce the soft shadowing effect of shadow mapping. |
These biasing settings apply to conventional shadow maps. Lights that use Virtual Shadow Maps don't use them.
Shadow Map Caching
Shadow map caching is a feature of Movable lights that makes shadow casting from Point and Spot Lights much more affordable in games. In Levels where you have assets that don't need to move, their shadow calculation is costing performance each frame. Shadow map caching looks at these assets that have their Mobility set to Static or Stationary and doesn't need to recalculate them each frame unless something changes with them or the light. This section describes caching for conventional shadow maps. Virtual Shadow Maps have their own caching, which is covered on the Virtual Shadow Maps page.
Shadow map caching has a significant impact on performance, especially in levels where there are a lot of assets affected by a lights.
For instance, in a moderately sized scene with three shadow-casting Movable Point lights, they could take upwards of 14 milliseconds to render shadow depths. With cached shadows enabled, those same three lights may take around 1 millisecond to render shadow depths.
Shadow map caching require memory to store the cached shadows, and for large enough scenes, you may need to adjust the amount of memory alloted to them with the console command r.Shadow.WholeSceneShadowCacheMb.
Shadow Map Caching Performance
You can check the performance of cached shadows by opening the stat window for shadow rendering with Stat ShadowRendering. Then enable/disable cached shadows with the console command r.Shadow.CacheWholeSceneShadows.
Shadow Map Caching Limitations
Shadow map caching can significantly decrease the cost of using dynamic shadowing in your Levels, but there are some limitations that must be considered when using unsupported features of the engine.
By default, caching can only happen when the following assets meets these criteria:
Primitives in the Level must have their Mobility set to Static or Stationary.
Materials that use World Position Offset will not be cached.
Point Lights and Spot Lights are supported and must have their Mobility set to Movable while casting shadows.
Lights that move around will not have their shadows cached.
Materials that use animated Tessellation or Pixel Depth Offset can cause artifacts because their shadows will be cached but look incorrect with the asset.