Taos API Reference
    Preparing search index...

    Interface XrSessionOptions

    interface XrSessionOptions {
        mode?: XRSessionMode;
        referenceSpaces?: XRReferenceSpaceType[];
        optionalFeatures?: string[];
        requiredFeatures?: string[];
        colorFormat?: GPUTextureFormat;
        textureType?: "texture" | "texture-array";
        depthStencilFormat?: GPUTextureFormat;
        scaleFactor?: number;
        depthSensing?: XRDepthStateInit;
        domOverlayRoot?: Element;
    }
    Index

    Properties

    mode?: XRSessionMode

    Session mode. Default 'immersive-vr'.

    referenceSpaces?: XRReferenceSpaceType[]

    Reference space, in preference order. First that resolves wins. Default ['local-floor', 'local', 'viewer'].

    optionalFeatures?: string[]

    Extra WebXR features to request as optional.

    requiredFeatures?: string[]
    colorFormat?: GPUTextureFormat

    Projection-layer color format. Defaults to the binding's preferred format, falling back to ctx.format. NB the engine's final blit pipeline is keyed on ctx.format, so a mismatch forces a format-conversion blit; keep them equal when possible (see TODO/webxr-integration.md).

    textureType?: "texture" | "texture-array"

    'texture' (side-by-side wide texture, the viewport model) or 'texture-array'. Default 'texture' to match the engine's viewport path.

    depthStencilFormat?: GPUTextureFormat

    Depth-stencil format for the projection layer (e.g. 'depth24plus'). Default: none. Some runtimes (notably Android Chrome's WebGPU-WebXR AR path) only present correctly when the projection layer is created WITH a depth-stencil swapchain — without it the runtime falls onto a buggy texture-array "Direct Copy" that invalidates the color texture. The engine renders depth into its own pooled targets, so the layer's depth texture is not used as an attachment; its presence alone selects the good present path. Match the immersive-web webgpu/ar-barebones reference.

    scaleFactor?: number

    Projection-layer resolution multiplier (default 1 = runtime-recommended). Values <1 shrink the per-eye texture for higher frame rate — the primary perf lever, since the full pipeline renders once per eye.

    depthSensing?: XRDepthStateInit

    Depth-sensing negotiation. Passed straight through to requestSession's depthSensing init; also forces 'depth-sensing' into the required features. Only meaningful for 'immersive-ar'.

    domOverlayRoot?: Element

    Element to show as a 2D overlay in handheld (phone) AR. Adds the 'dom-overlay' optional feature and passes domOverlay: { root }.