Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Project nD points to 3D display space on the main thread, WASM-accelerated.

      The two expensive steps — nD→3D extraction and effective-radius computation — run through the compiled WASM kernels (extract_3d_positions, calculate_effective_radii) on the wasm module the caller supplies (compiled WASM, or the uncapped TS reference for ndim > 16 — see getPointsBackend). The zero-radius filter, multi-type compaction, uint8-radius /255 normalization, scalar handling, and bounds stay in TypeScript: they are cheap, multi-type, and tightly coupled to the accumulator's in-place reuse contract.

      Points run on the main thread (not a worker) by design: projection is memory-bandwidth-bound and pairs with the zero-allocation accumulator, so offloading would pay transfer cost both ways for little compute gain. This is the single Points projection implementation — the former worker dispatcher copy was deleted in W4b.

      Two execution paths share this entry point:

      • Accumulator path (targetBuffers provided): the supported hot path. Writes through preallocated accumulator buffers for zero-allocation operation. Production code always takes this path via LoadedPointsDataAccumulator.
      • Fallback path (targetBuffers null/undefined): allocates fresh arrays. Used by tests and the explicit no-accumulator opt-out. Color/sharpness inputs pass through by reference; positions3D and (when filtering applies) radii are freshly allocated.

      Parameters

      • wasm: WasmModule

        WASM backend (compiled or TS-reference fallback) supplying the projection kernels. Obtain via getPointsBackend(ndim).

      • positions:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Float16Array<ArrayBufferLike>
            | null
      • colors:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Float16Array<ArrayBufferLike>
            | null
      • radii:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Float16Array<ArrayBufferLike>
            | null
      • sharpness:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Float16Array<ArrayBufferLike>
            | null
      • viewState: ViewState
      • ranges: PointRange[]
      • ctx: ProjectionContext
      • OptionaltargetBuffers: ProjectionTargetBuffers | null

        Optional accumulator buffers for zero-allocation operation. When provided, writes directly through; when null/undefined, allocates new arrays for the result.

      • Optionalscalars:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
            | Float16Array<ArrayBufferLike>
            | null

        optional per-point scalars for colormap lookup.

      • colorComponents: 3 | 4 = 3

        Components per color item: 3 = RGB (default), 4 = RGBA (the alpha column is per-point opacity). Strides every color guard/compaction below — a hardcoded 3 would truncate + misalign RGBA data (the gsplat colorK lesson).

      Returns LoadedPointsData