THREE.JS / FOUNDATIONS 163

A layer beside the scene.

Render a separate scene into a WebXR quad layer, then keep its emulated render target visible on desktop. The same callback is exercised every frame; only an immersive session can promote it to a native layer.

Initializing Preparing renderer

Preparing the XR manager, quad-layer render target, fallback proxy, and official XR button...

session
-
layer
-
native
-
renderLayers
-
layer frames
-
draw calls
-
Layer controlsdesktop fallback

The proxy is a normal scene mesh backed by the layer's emulated render target. It is not evidence of a physical headset layer.

Real session entry pointprobing

The official helper requests immersive-vr with local-floor and layers. A device must grant the feature before the layer becomes native.

Native promotion boundaryprobing
WebXR API-
immersive VR support-
renderer.xr.enabled-
session enabledFeatures-
manager binding-

Outside XR, Three.js renders the layer callback into an XRRenderTarget and maps it onto the proxy mesh. The native XRWebGLBinding path is session-owned.

Use ?forceWebGL=1 to inspect the WebGL2 companion. This lab intentionally does not claim native-layer evidence when the browser reports no immersive device support.

THREE.JS FOUNDATIONS LAB