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

    GSplats data loader using spatial indices for efficient nD queries.

    Key features:

    • Chunk-based loading using spatial index
    • Handles all array encoding types (broadcasted, quantized, LUT, etc.)
    • Support for optional arrays (colors)

    Implements

    Index
    chunkIndex: ChunkSpatialIndex | null = null
    zarrLocation: Location<Readable>
    node: SceneNode
    _onceInit: OnceInit = ...
    rangeLoader: RangeLoader
    zarrStore: Readable | null = null
    _accumulator: GSplatsDataAccumulator | null = null
    _accumulatorConfig: { capacity: number; ndim: number } | null = null
    _labelIndicesScratch: Uint32Array<ArrayBuffer> = ...
    colorComponents: 3 | 4 = 3

    Color layout of this dataset: 3 (RGB) or 4 (RGBA, alpha = per-splat opacity).

    l0Cache: DecompressedChunkCache | null = null
    _activeProbe: ResidencyAccumulator | null = null
    _activeSignal: AbortSignal | null = null
    prefetcher: ChunkPrefetcher | null = null
    sliceCache: SliceCache | null = null
    _initialLoadDone: boolean = false
    _toleranceOptions: ToleranceOptions | null = null
    events: LoaderEventEmitter = ...
    metrics: LoaderMetrics
    activeQueries: Map<string, QueryInfo> = ...
    nextQueryId: number = 0
    totalQueryCells: number = 0
    facadeCtx: SpatialFacadeCtx
    arrays: {
        centers?: Array<DataType, Readable>;
        amplitudes?: Array<DataType, Readable>;
        cholesky_factors_diag?: Array<DataType, Readable>;
        cholesky_factors_offdiag?: Array<DataType, Readable>;
        cholesky_factors?: Array<DataType, Readable>;
        colors?: Array<DataType, Readable>;
        label_ids?: Array<DataType, Readable>;
    } = {}
    • get prefetchByteUpperBound(): number

      Conservative whole-rung L0 footprint used to bound speculative ladder lookahead before the exact visible chunk set is known. Zarr scalar types top out at 8 bytes; counting every optional channel and whole stored rung deliberately overestimates sliced/broadcast arrays so lookahead cannot evict more useful cache entries on a large scene.

      Returns number

    • Thin wrapper around the shared registerGSplatsArrayBounds helper so the call sites read more naturally than passing the prefetcher and node path on every call.

      Parameters

      • arrayName: string
      • array: Array<DataType, Readable>

      Returns void

    • Query visible splat ranges based on view state.

      Delegates the chunk-bounds AABB scan and range coalescing to the canonical SpatialQueryBuilder, which also handles the extend_to_all short-circuit. Returns a load-all range when no spatial index is available.

      Parameters

      Returns Promise<SplatRange[]>

    • Open the Cholesky factor array(s), supporting both the v3.1 split layout (cholesky_factors_diag + optional cholesky_factors_offdiag) and the legacy v3.0 single packed cholesky_factors. The off-diagonal array is absent for 1D gsplats. Recombination into the packed buffer happens in loadCholeskyRanges.

      Returns Promise<void>

    • Load Cholesky factors into the packed (N, k) form, recombining the v3.1 split arrays when present. For the legacy single-array layout this is a direct passthrough to loadArrayRanges. On success every packed position is written (diagonal ∪ off-diagonal = all k columns), so a reused target buffer never leaks stale values. The corrupt-file precondition (a d > 1 store missing the off-diagonal array) is checked BEFORE any write, so a throw never leaves the (possibly reused) target buffer half-populated.

      Parameters

      • ranges: SplatRange[]

        Visible splat ranges

      • ndim: number

        Dimensionality (k = ndim*(ndim+1)/2 packed elements/splat)

      • OptionaltargetBuffer: Float32Array<ArrayBufferLike>

        Optional packed output buffer (zero-alloc path)

      Returns Promise<Float32Array<ArrayBufferLike>>

    • Parameters

      • arrayName: string
      • ranges: SplatRange[]
      • elementsPerSplat: number
      • OptionaltargetBuffer: Float32Array<ArrayBufferLike>

      Returns Promise<Float32Array<ArrayBufferLike>>

    • Load color ranges with multi-type support (preserves original_dtype)

      This method handles the full encoding/decoding pipeline for colors, including original_dtype restoration for encoded arrays.

      Parameters

      • ranges: SplatRange[]
      • OptionaltargetBuffer:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>

      Returns Promise<
          | Uint8Array<ArrayBufferLike>
          | Float32Array<ArrayBufferLike>
          | Uint16Array<ArrayBufferLike>,
      >

    • Prefetch chunks for the given view state into the cache without decoding.

      Uses planned visible ranges when supplied; otherwise performs the same spatial index query as updateView(). Issues zarr get() calls for each visible range on every array. The fetched data populates the HTTP cache and L0 decompressed-chunk cache but is NOT accumulated into output buffers — the typed-array results are immediately discarded. This makes the subsequent updateView() call a fast cache hit without the memory cost of allocating full-size output arrays that would only be thrown away.

      Parameters

      Returns Promise<void>

    • Release pooled decoded buffers after a progressive parent has copied them. Earlier payloads remain valid because dispose() replaces the accumulator buffers rather than clearing their old arrays. This deliberately gives up pooling across view changes to release the progressive ladder's second copy.

      Returns void