Skip to main content

@luma.gl/engine/webxr

From v10Experimental API

@luma.gl/engine/webxr exposes experimental WebGPU and WebGL WebXR session helpers. They stay outside the Engine root API because WebXR brings its own session lifecycle, frame scheduler, per-view rendering state, raw camera access, and future input/depth APIs.

Scope​

  • WebXRAnimationFrameProvider drives an engine AnimationLoop from XRSession.requestAnimationFrame().
  • WebXRManager prepares WebGPU projection layers or an XRWebGLLayer, then resolves per-view framebuffer, viewport, projection, and view matrix state.
  • WebXRCameraTexture binds WebXR Raw Camera Access as a borrowed read-only WebGL texture sampled through GLSL sampler2D.

Use WebXRManager.getInputState(xrFrame) to read input sources and their poses for the current frame.

The v10 API does not provide WebGPU raw camera textures, hit testing, anchors, depth sensing, or non-projection layers.