Shadows and virtual shadow maps
How real-time shadows are stored in shadow maps, why cascades exist, how Unreal's virtual shadow maps give 16k-resolution shadows by paging, and what that means for Nanite, foliage and World Position Offset.
A shadow map is a depth image rendered from a light's point of view; the engine checks it to see whether anything sits between a pixel and the light. Virtual shadow maps (VSMs) are Unreal Engine 5's version of the idea, which Epic describes as "the new shadow mapping method used to deliver consistent, high-resolution shadowing" (Unreal Engine Documentation: Virtual Shadow Maps).
#Resolution limits of shadow maps
A shadow map has a fixed number of texels. A sun shadow must cover everything from the grass at your feet to distant mountains, so one map spreads its texels too thin near the camera. The classic fix is cascaded shadow maps: split the view into distance bands and give each band its own map.
Godot's directional light defaults to "PSSM with 4 splits", each set relative to the shadow Max Distance (Godot Engine documentation: 3D lights and shadows). Unity URP exposes Max Distance, Cascade Count and split distances in its pipeline asset (Universal RP 17 documentation: Universal Render Pipeline Asset).
#How virtual shadow maps work
VSMs use far bigger maps than any GPU could hold, and keep only the parts that are needed.
- Huge virtual resolution. Each VSM has "a virtual resolution of 16k x 16k pixels" (Unreal Engine Documentation: Virtual Shadow Maps).
- Pages. The map is split into "tiles (or Pages) that are 128x128 each" (Unreal Engine Documentation: Virtual Shadow Maps). Only pages that visible pixels need are rendered.
- Clipmaps for the sun. "Each clipmap level is the same resolution but covers twice the radius of the previous one" (Unreal Engine Documentation: Virtual Shadow Maps). By default, levels 6 to 22 are allocated (Unreal Engine Documentation: Virtual Shadow Maps).
- Local lights. Spot lights use one 16k VSM with a mip chain; point lights use a cube of six (Unreal Engine Documentation: Virtual Shadow Maps).
- Caching. Pages are reused between frames, which Epic calls "key to maintaining high performance" (Unreal Engine Documentation: Virtual Shadow Maps).
Soft shadows come from Shadow Map Ray Tracing (SMRT), which shoots several rays towards the light; their spread follows Source Radius on local lights and Source Angle on the sun (Unreal Engine Documentation: Virtual Shadow Maps).
#What VSMs mean for your assets
- Use Nanite. "Non-Nanite geometry is much more expensive to render into VSMs", so Epic recommends Nanite "on all supported geometry, including low-poly meshes" (Unreal Engine Documentation: Virtual Shadow Maps). See virtualised geometry.
- Give non-Nanite meshes LODs. Without them they "become extremely expensive to render into small pages" (Unreal Engine Documentation: Virtual Shadow Maps). See level of detail.
- Be careful with World Position Offset. Moving vertices in the material, such as foliage wind, "always invalidates cached pages every frame"; Epic suggests skeletal animation or moving instance transforms instead (Unreal Engine Documentation: Virtual Shadow Maps). Fortnite's trees, for example, replaced complex per-vertex wind with a cheaper baked lookup (Unreal Engine tech blog: Bringing Nanite to Fortnite Battle Royale in…).
- Don't move the sun without reason. "Any light movement or rotation will invalidate all cached pages for that light" (Unreal Engine Documentation: Virtual Shadow Maps), so a slow time-of-day cycle costs more than a fixed sun.
#Common mistakes
- Mesh bounds too small. Parts of the object lose their shadow (Unreal Engine Documentation: Virtual Shadow Maps).
- Profiling with the VSM visualisation on. It has "a small but measurable effect" (Unreal Engine Documentation: Virtual Shadow Maps).
- Too many small shadowed local lights. Epic lists this case as still a work in progress (Unreal Engine Documentation: Virtual Shadow Maps).
- In other engines: shadow distance too long. A longer Max Distance spreads the same cascade texels further; set it to what the player needs (Godot Engine documentation: 3D lights and shadows; Universal RP 17 documentation: Universal Render Pipeline Asset).
Related: real-time lighting, light and shadow, performance and profiling.
#Further reading and watching
References
- · Virtual Shadow Maps · Unreal Engine Documentation, 2026 · docs · accessed 2026-10-21
- · 3D lights and shadows · Godot Engine documentation (source on GitHub), 2026 · docs · accessed 2026-10-21
- · Universal Render Pipeline Asset · Universal RP 17 documentation, 2026 · docs · accessed 2026-10-21
- · Bringing Nanite to Fortnite Battle Royale in Chapter 4 · Unreal Engine tech blog · article · accessed 2026-10-21
- · Virtual Shadow Maps in Fortnite Battle Royale Chapter 4 · Unreal Engine tech blog, 2023 · article · accessed 2026-10-22
- · Dev Diary #5: A Dive into Next-Gen Game Development · Paradox Interactive, 2023 · article · accessed 2026-10-22
Pages that link here
- Light and shadow Topic
- Real-time lighting Topic
- Ray tracing Key term
- Cascaded shadow maps Key term
- Shadow bias and shadow acne Key term
- Time of day Key term
- Foliage and vegetation Topic
- Wind and world position offset Key term
Last updated 2026-10-22