THREE.JS / FOUNDATIONS 171

Shadow, then session.

A moving light and a small cast of objects make the XR shadow path visible before a headset ever enters the loop. The desktop scene is real; native immersive presentation remains a separate boundary.

Initializing shadows0 / 2 ready

Preparing the paired renderers, shadow maps, and XR manager flags…

WEBGPU BACKENDstarting

ACES · PCF · XR enabled

WEBGL2 BACKENDstarting

forced fallback · same shadow rig

shadow pipeline

Move the light. Name the boundary.

shadow map1024² · init
XR entry pointdesktop fallback

The official path enables XR, uses an unsigned-byte output buffer, keeps multiview off, configures PCF shadows, and lets VRButton or the WebGL fallback own session entry. Map size is set at initialization; live GPU texture resizing is intentionally not simulated.

WebGPUWebGL2
backend
——
shadows
——
draw calls
——
shadow map
——
XR session
——
01cast + receive shadow
02PCF shadow map
03XR manager enabled

Drag either scene to orbit · immersive XR requires a supported device

LAB 171 / XR SHADOW BACKENDS