Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Interface LuxarLayerOptions

    interface LuxarLayerOptions {
        renderer: Renderer;
        getCamera: () => Camera;
        getViewportSize: () => ViewportSize;
        scene: Scene;
        requestRender?: () => void;
        loaderConfig?: LoaderConfig;
        gpuPoolMaxBytes?: number | null;
        wasmPath?: string;
        workerPath?: string;
        lodFade?: boolean;
        lodEnergyComp?: boolean;
        lodFinest?: boolean;
        lodBias?: number;
        densityGuard?: boolean;
        densityCap?: number;
        blendWarmup?: boolean;
        depthSort?: boolean;
        renderOrder?: number;
    }
    Index
    renderer: Renderer

    Host-owned renderer. The layer never constructs, resizes, clears, or disposes it — it only reads capabilities and the drawing-buffer size.

    getCamera: () => Camera

    Live camera accessor. A getter rather than a value because a host may swap camera objects (a perspective/ortho toggle), and a captured reference would keep projecting from the abandoned one.

    getViewportSize: () => ViewportSize

    Live viewport accessor, in CSS pixels. Read on resize and per LOD evaluation.

    scene: Scene

    Host scene. The layer adds its root group on LuxarLayer.load and removes it on LuxarLayer.dispose.

    requestRender?: () => void

    Called when new geometry commits outside the host's own interaction — progressive refinement, lazy LOD loads, retries — and from LuxarLayer.update when a frame's sort / LOD evaluation changed what is drawn (a fade advances one step per frame). Hosts with an on-demand render loop must wire this or late commits will not repaint and fades freeze. Hosts that render continuously can omit it.

    loaderConfig?: LoaderConfig

    Cache and prefetch flags forwarded to the data loader.

    gpuPoolMaxBytes?: number | null

    Session-wide GPU geometry budget in bytes. null auto-sizes from device memory, measured heap, and device class; 0 disables byte-budget eviction, and a positive value pins the budget. Defaults to config.dataLoading.performance.gpuPoolMaxBytes. Page-wide: the first Luxar host to configure it wins (a later value is ignored with a warning), and each host evicts against it separately (see the README's multi-host notes).

    wasmPath?: string

    Override for bundlers that can't resolve import.meta.url asset URLs.

    workerPath?: string

    Same, for the data worker.

    lodFade?: boolean

    Cross-fade adjacent replacement LOD levels. Default true.

    lodEnergyComp?: boolean

    Compensate incomplete stream ladders by committed energy. Default true.

    lodFinest?: boolean

    Force the finest replacement LOD regardless of coverage. Default false.

    lodBias?: number

    Replacement-LOD bias in screen-area units. Non-finite or non-positive values are treated as the neutral 1. Default 1.

    densityGuard?: boolean

    Projected-density guard: thin blendable nodes that pack more elements per drawing-buffer pixel than config.densityGuard allows (brightness compensated), and hold back refinement rungs that would push a node past it. Default true (and only while config.densityGuard.enabled).

    densityCap?: number

    Session-only override of the density guard's blendable cap (elements per drawing-buffer pixel), as LuxarAppOptions.densityCap. Undefined ⇒ config.densityGuard.capElementsPerPixel.

    blendWarmup?: boolean

    WebGL blend-program warm-up, as LuxarAppOptions.blendWarmup. Default true on laptops/desktops; always off on phones/tablets and under WebGPU.

    depthSort?: boolean

    Worker-based back-to-front sorting for order-dependent geometry. Default true. false also skips the per-frame cross-node order pass (authored cross-layer bands, physical glass drawn first), which needs the coordinator's camera: the layer's nodes draw in plain three.js order.

    renderOrder?: number

    renderOrder stamped onto every Group in the layer subtree. Three.js uses the nearest Group's value as the primary transparent-sort key, so nested scene / LOD / partition groups must agree. Default 10.