API

Class WebXRMediaLayerWrapper<LayerT, LayerTypeT>

Wraps an XRMediaBinding layer.

Type Parameters

Hierarchy (View Summary)

Index
  • Creates a wrapper for a media-backed spatial layer.

    Type Parameters

    • LayerT extends any = any

      the concrete media layer type

    • LayerTypeT extends any = any

    Parameters

    • getWidth: () => number

      returns the current video width

    • getHeight: () => number

      returns the current video height

    • layer: LayerT

      the native media composition layer

    • layerType: LayerTypeT

      the concrete spatial layer type

    • transformNode: TransformNode

      the Babylon transform synchronized with the native layer

    • ownsTransformNode: boolean

      whether the wrapper should dispose the transform node

    • usesSessionReferenceSpace: boolean

      whether the layer should follow session reference-space changes

    Returns WebXRMediaLayerWrapper<LayerT, LayerTypeT>

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

Media layers receive their contents directly from the user agent.

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: LayerT
layerType: LayerTypeT
transformNode: TransformNode

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

usesRenderTargetProvider: boolean = false

Media layers are populated directly by the user agent.

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.