API

Class WebXRCubeLayerWrapper

Wraps a native cube layer and exposes its raw subimage. Cube layers require six face uploads or render passes and therefore do not use Babylon's 2D composition-layer render target provider.

Hierarchy (View Summary)

Index
_originalInternalTexture: Nullable<InternalTexture> = null
createRTTProvider: (
    xrSessionManager: WebXRSessionManager,
) => WebXRLayerRenderTargetTextureProvider<LayerTypeT>
getHeight: () => number
getWidth: () => number
isMediaLayer: boolean = false

Whether this layer receives its content directly from an HTML media element.

isMultiview: boolean

Whether the layer renders both views into a texture array.

isStatic: boolean = false

Whether the layer can only be rendered when its native needsRedraw flag is set.

layer: XRCubeLayer
layerType: "XRCubeLayer"
transformNode: TransformNode

The Babylon node whose world position and rotation are applied to the native layer.

usesRenderTargetProvider: boolean = false

Cube layers are populated through raw cubemap or array-layer access.

usesSessionReferenceSpace: boolean

Whether the layer should follow changes to the session manager's reference space.

  • get forceMonoPresentation(): boolean

    Gets whether the compositor presents the left-eye layer configuration to both eyes.

    Returns boolean

    Whether mono presentation is forced.

    If mono presentation control is not supported by the active XR runtime.

  • set forceMonoPresentation(value: boolean): void

    Sets whether the compositor presents the left-eye layer configuration to both eyes. Applications should continue rendering both eyes when this is enabled.

    Parameters

    • value: boolean

      Whether to force mono presentation.

    Returns void

    If mono presentation control is not supported by the active XR runtime.

  • get opacity(): number

    Gets the compositor opacity applied to this layer.

    Returns number

    The native opacity in the range 0 to 1.

    If opacity is not supported by the active XR runtime.

  • set opacity(value: number): void

    Sets the compositor opacity applied to this layer. The native runtime clamps the value to the range 0 to 1.

    Parameters

    • value: number

      The desired opacity.

    Returns void

    If opacity is not supported by the active XR runtime.

  • get quality(): XRLayerQuality

    Gets the compositor quality hint applied to this layer.

    Returns XRLayerQuality

    The current native layer quality hint.

    If quality hints are not supported by the active XR runtime.

  • set quality(value: XRLayerQuality): void

    Sets the compositor quality hint applied to this layer.

    Parameters

    • value: XRLayerQuality

      The desired quality hint.

    Returns void

    If quality hints are not supported by the active XR runtime, or the native runtime rejects the value.

  • Gets the compositor-owned cube subimage for the current frame. WebGL callers must populate all six cubemap faces. WebGPU callers must render to six consecutive array layers beginning at the descriptor's base array layer.

    Parameters

    • frame: XRFrame

      the current XR frame

    • Optionaleye: any

      the eye to retrieve for stereo cube layers

    Returns any

    the raw WebGL or WebGPU cube subimage