API

Interface IWebXRCompositionLayerCreationOptions<TWebGLInit, TWebGPUInit>

Common options for creating a graphics-backed WebXR composition layer.

interface IWebXRCompositionLayerCreationOptions<TWebGLInit, TWebGPUInit> {
    fallbackMode?: "none" | "mesh";
    fallbackTexture?: BaseTexture;
    gpuLayerInit?: Partial<TWebGPUInit>;
    layerInit?: Partial<TWebGLInit>;
    transformNode?: TransformNode;
}

Type Parameters

  • TWebGLInit

    the WebGL layer initialization dictionary

  • TWebGPUInit

    the WebGPU layer initialization dictionary

Index
fallbackMode?: "none" | "mesh"

Uses a Babylon mesh when the requested native layer factory is unavailable. Import @babylonjs/core/XR/features/WebXRLayersFallback to enable this optional fallback. Fallback is disabled by default.

fallbackTexture?: BaseTexture

A texture to display on the fallback mesh. Required when fallbackMode is "mesh".

gpuLayerInit?: Partial<TWebGPUInit>

WebGPU-specific initialization overrides. Shared spatial and layout values are copied from layerInit before these overrides are applied.

layerInit?: Partial<TWebGLInit>

Initialization values shared with the WebGL Layers API. Babylon supplies the current reference space and projection-layer pixel dimensions when omitted.

transformNode?: TransformNode

A Babylon node whose world position and rotation will be synchronized with the layer. Babylon creates and owns a node when this is omitted.