Mesh distance fields
A volume texture that stores, for each cell, the distance to the nearest surface of a mesh; Unreal uses them for soft shadows, ambient occlusion and Lumen's software ray tracing.
A mesh distance field is a 3D texture baked for a mesh in which every cell stores how far it is from the mesh's nearest surface. Epic's documentation calls it a signed distance field (SDF): "It works by storing the distance to the nearest surface in a volume texture", with positive values outside the mesh and negative values inside (Unreal Engine Documentation: Mesh Distance Fields). Because a ray can safely jump forward by the stored distance without hitting anything, distance fields make tracing rays through a scene far cheaper than testing triangles.
#What they are used for
In Unreal, mesh distance fields power several systems (Unreal Engine Documentation: Mesh Distance Fields; Unreal Engine Documentation: Lumen Technical Details):
- Dynamic ambient occlusion and shadowing for static mesh actors.
- Lumen's software ray tracing, the default mode: Lumen traces "against each mesh's distance field for the first two meters for accuracy" and against a merged Global Distance Field for the rest of each ray (Unreal Engine Documentation: Lumen Technical Details).
- Materials and effects, such as GPU particle collision and dynamic flow maps (Unreal Engine Documentation: Mesh Distance Fields).
The Global Distance Field is "a low-resolution Distance Field" that follows the camera, built by compositing every mesh's field into "a few volume textures centered around the camera, called clipmaps" (Unreal Engine Documentation: Mesh Distance Fields). Lumen's scene built from it covers 200 m from the camera by default, extendable to 800 m (Unreal Engine Documentation: Lumen Technical Details).
#Resolution and memory
Quality depends on the resolution of each mesh's volume texture, set with Distance Field Resolution Scale in the Static Mesh Editor (Unreal Engine Documentation: Mesh Distance Fields). "The maximum size volume texture any single mesh can have is 8 megabytes with a resolution of 128x128x128" (Unreal Engine Documentation: Mesh Distance Fields), and the editor shows each mesh's size in the viewport corner.
#Limitations and artefacts
Epic lists the main ones (Unreal Engine Documentation: Mesh Distance Fields; Unreal Engine Documentation: Lumen Technical Details):
- Rigid meshes only. Skeletal meshes do not cast distance field shadows; Epic points to capsule shadows instead (Unreal Engine Documentation: Mesh Distance Fields).
- No vertex animation. World Position Offset or displacement "may cause self-shadowing artifacts", because the field was generated offline (Unreal Engine Documentation: Mesh Distance Fields). See wind and world position offset.
- Non-uniform scaling is not handled correctly; uniform scaling "by two times or less" is usually fine (Unreal Engine Documentation: Mesh Distance Fields).
- Rounded corners and thin surfaces. Corners round off at low resolution, and thin surfaces are only represented by a negative cell inside the mesh (Unreal Engine Documentation: Mesh Distance Fields).
- Foliage. Dense grass can overflow internal buffers, so enable Affect Distance Field Lighting only on foliage types that need it (Unreal Engine Documentation: Mesh Distance Fields). Two-Sided Distance Field Generation suits masked foliage but "does come at a higher ray marching cost" (Unreal Engine Documentation: Mesh Distance Fields).
#In other engines
Godot 4 has a related technique, SDFGI (signed distance field global illumination), described on global illumination. The idea is shared: approximate the scene with distances, then march rays through it.
Related: global illumination, real-time lighting, ambient occlusion.
#Further reading and watching
References
- · Mesh Distance Fields · Unreal Engine Documentation, 2026 · docs · accessed 2026-10-21
- · Lumen Technical Details · Unreal Engine Documentation, 2026 · docs · accessed 2026-10-21
- · Lumen brings real-time global illumination to Fortnite Battle Royale Chapter 4 · Unreal Engine Tech Blog, 2023 · article · accessed 2026-10-21
- · Indiana Jones and the Great Circle requirements may put your PC in a museum · Tom's Hardware, 2024 · article · accessed 2026-10-22
Pages that link here
- Real-time vs. offline rendering Topic
- Global illumination Key term
- Ray tracing Key term
- Light leaking Key term
- Wind and world position offset Key term
Last updated 2026-10-22