AR/VR
Unreal for XR: Lumen, Nanite, and VR Template
Cyberpunk 2077 RT Overdrive with Lumen-style lighting and Nanite geometry represents the peak of current rendering. A VR version of that game? Absent, because Lumen and Nanite physically do not fit inside the thermal envelope of a mobile headset. In Unreal Engine 5, an XR developer faces two opposite worlds: PC VR on an RTX 4080 with the full UE5 stack, and Quest standalone where every megabyte of memory and every megahertz is bargained for. Knowing what to keep and what to switch off in the render pipeline is exactly what separates a shippable XR project from a tech demo that never reaches release.
- **Half-Life Alyx (Source 2, not UE5, but the same logic):** PC VR at 90+ FPS demands two pipelines - one for high-end GPU, another for Quest 2 wireless
- **Asgard's Wrath 2 (Sanzaru/Meta):** UE5 on Quest 3 standalone - Lumen and Nanite disabled, custom mobile renderer, art direction over tech
- **Pavlov VR (Vankrupt):** PC VR on UE5.3 with Lumen for reflections and Nanite for weapon models - feasible only thanks to RTX-class GPUs
VR Template: Contract of an Unreal XR Project
Unity's VR Template has an Unreal counterpart that arrived in Engine 4.27 and was rebuilt in UE5 on top of Enhanced Input. It ships with a VRPawn, motion controller components, locomotion (teleport, snap turn, continuous), grab mechanics through interface-based dispatch, and rendering presets tuned for Quest 2/3 and PC VR. The template covers picking, throwing, and 3D UI menus. Unlike Unity XRI, interactions in Unreal are wired through a Blueprint Interface (IInteractable), which gives a strict contract between the actor and the controller without hard-coding type checks.
Core components of the VR Template: VRPawn (a Pawn subclass with a MotionControllerComponent for each hand), VRTeleportVisualizer (parabolic trajectory prediction for the teleport target), VRGameMode and VRPlayerController, which manage the PlayerStart tracking space. Enhanced Input has replaced the legacy Input Action mapping: action contexts allow switching control between states (menu vs gameplay) without if-statements inside Tick. Rendering is set up around the Forward Renderer with MSAA - mobile VR cannot afford deferred shading.
Why does the Unreal VR Template use the Blueprint Interface IInteractable instead of checking concrete classes through Cast?
Niagara: GPU Particles Under XR Frame Budgets
Cascade, Unreal's legacy particle system, could not keep up with modern requirements: a million sparks, realistic smoke, fluid simulation. Niagara, introduced in UE4.20 and matured to production in UE5, rewrote the stack on GPU compute shaders. Emitters run on the GPU, simulation scales to millions of particles, and the modular stack (Spawn, Update, Render) composes effects from reusable modules. For XR Niagara is mission-critical: every extra millisecond on CPU particles destroys the 90 FPS required for comfortable VR.
Niagara separates emitters into CPU and GPU sim. CPU sim handles up to about 5000 particles - fast for controlled effects (a flicker of magic in the hand). GPU sim handles thousands and millions (sparks from a sword, an NPC crowd, fluid). The modular stack: an Emitter holds System Spawn (once at startup), Emitter Update (each frame), Particle Spawn (per new particle), Particle Update (each frame per particle), Render. Effects are composed via drag-and-drop from built-in modules: Add Velocity, Apply Gravity, Color over Life, Sprite Renderer.
Why is GPU sim in Niagara critical for VR projects when working with mass effects, instead of CPU sim?
Lumen: Real-Time Global Illumination
Before UE5, global illumination in Unreal demanded hours of lightmap baking - 4-16 GB of textures per scene, frozen lighting, and artefacts on dynamic geometry. Lumen (UE5, 2022) is a hybrid real-time GI solver: ray tracing over signed distance fields for consumer hardware without RT cores, plus precise hardware RT on high-end GPUs. Artists see final lighting in-editor instantly, with no bake step. Dynamic day-night cycles, room transitions, destruction - all are lit correctly with no preprocessing. For VR, Lumen runs on high-end PC VR (RTX 4080 class and above) but does NOT run on Quest standalone, where legacy lightmaps are still the rule.
Lumen architecture: Surface Cache (a simplified scene representation in a card atlas), Screen Traces (cheap screen-space test for primary rays), World Space Trace (visibility traversal over SDF/BVH), Final Gather (radiance aggregation with BRDF). It is a tiered system - cheap data comes from screen space, exact data from hardware RT. For VR, screen percentage scaling is typically disabled and the renderer is forced into forward shading on constrained GPUs, in which case Lumen relies on the software-RT fallback with reduced quality.
Why does Lumen not run on Quest 3 standalone despite the headset having a GPU?
Nanite in VR: A Billion Triangles in Stereo
Nanite (UE5, 2022) is virtualized geometry: a mesh with a billion triangles renders at roughly the cost of one with a million. Under the hood: cluster-based LOD at the level of small triangle groups (around 128 each), a software rasterizer on a compute shader for small clusters, and the hardware rasterizer for large ones. This changes the workflow: an artist imports a ZBrush sculpt directly without retopology or decimation. For VR, UE5.4+ officially supports Nanite in stereo rendering: a single pass through both viewports with instancing, costing roughly 1.5x mono rather than the 2x of naive double draw.
Specifics of Nanite in VR: stereo instancing requires Instanced Stereo Rendering enabled (r.InstancedStereo=1), which lowers CPU overhead for two eyes. Nanite does not run on Quest standalone - the same thermal envelope and bandwidth wall as Lumen; mobile VR keeps traditional LOD via DistanceFieldShadow and Static Mesh Components. On PC VR (Index, Quest Link, Pico 4 Ultra wired), Nanite has worked correctly since UE5.3 and delivers photogrammetry-grade detail in real time.
UE5 with Lumen and Nanite gives photo-real VR out of the box, even on Quest 3
Lumen and Nanite require PC VR with a desktop-class GPU; Quest standalone stays on legacy lightmaps plus static LODs due to thermal and bandwidth constraints
Quest 3 has a 15-watt thermal envelope and around 70 GB/s of bandwidth, while Lumen and Nanite were designed for 200+ watt desktops. UE5 production targeted at Quest requires Lumen off, Nanite off, virtual shadow maps off, and the mobile forward renderer with traditional techniques. This is not an engine flaw but a hardware reality of mobile VR
Why does Nanite cost about 1.5x in stereo rendering rather than the 2x of naive double draw?
Key Ideas
- **VR Template** in UE5 delivers VRPawn, motion controllers, Enhanced Input, and the IInteractable Blueprint Interface - an open-closed contract for the interaction system.
- **Niagara GPU sim** is required for mass particle effects in VR: 90+ FPS leaves no budget for CPU simulation even across a handful of effects.
- **Lumen** provides real-time GI without baking on PC VR but does not run on Quest standalone due to thermal and bandwidth constraints of the mobile GPU.
- **Nanite in stereo** costs about 1.5x instead of 2x thanks to Instanced Stereo Rendering and reuse of cluster culling across eyes; on mobile VR it is unavailable.
Related Topics
The Unreal XR stack ties directly into stereo rendering, ray tracing, and cross-platform abstractions.
- Unity for XR — Unity XRI solves what VR Template solves in UE5 - standardizing the interaction stack; OpenXR runs identically in both engines
- Real-Time Ray Tracing: RTX — Lumen uses hardware RT on RTX cards; the same BLAS/TLAS and BVH-traversal theory applies inside the Unreal pipeline
Вопросы для размышления
- Lumen and Nanite require a desktop-class GPU. Where is the line: does a VR developer ship one project across both platforms (Quest and PC) or two separate builds with different pipelines?
- Blueprint Interface IInteractable is the open-closed pattern for XR actors. Which categories of objects are still better left hard-coded (for example, specific NPC AI behaviour) rather than expressed through an interface?
- Mobile VR (Quest, Pico) lives inside a roughly 15-watt thermal envelope. Which UE5 techniques will become available on the next generation of standalone headsets within 3-5 years, and which will remain PC-only for longer?
Связанные уроки
- arvr-13 — Unity is the baseline engine for Unreal comparison
- arvr-15 — Unreal is part of the XR system architecture
- arvr-12 — XR rendering context for Lumen/Nanite
- ml-29-cnn — Lumen ray marching resembles convolution over space
- ml-19-pca — Nanite LOD like PCA: keep main components, discard details
- prob-11-normal
- cg-01