# spz-loader **Repository Path**: gotoeasy/spz-loader ## Basic Information - **Project Name**: spz-loader - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-03 - **Last Updated**: 2025-08-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

๐ŸฆŽ
spz-loader

NPM Version X (formerly Twitter) Follow

## About spz-loader is a set of npm packages for loading .spz, a type of 3D Gaussian Splatting file format. For more information on the .spz format, see [the blog post](https://scaniverse.com/news/spz-gaussian-splat-open-source-file-format) published by Niantic and the [GitHub repository](https://github.com/nianticlabs/spz). spz-loader provides `@spz-loader/core`, which is a pure decoding facility using `nianticlabs/spz` converted to wasm by Emscripten, and loader packages for various platforms that depend on it. ### Features - ๐Ÿฑ decode .spz file into pure-JS Object - ๐Ÿงฉ integration to 3D engines (Babylon.js/PlayCanvas) - ๐Ÿฅช divided into core functionality and other features - โœจ wrapping official implementation through WebAssembly ### Limitations - Spherical Harmonics (SH) is currently not supported ## Packages | package | version | description | | :-------------------------------------------- | :--------------------------------------------------------------------------------------------- | :---------------------------------------------------- | | [core](./packages/core/README.md) | NPM Version | core logics for decode .spz | | [babylonjs](./packages/babylonjs/README.md) | NPM Version | integration for Babylon.js `GaussianSplattingMesh` | | [playcanvas](./packages/playcanvas/README.md) | NPM Version | integration for PlayCanvas Engine and `GSplat` Entity | ## Install & Usage ### Example of Babylon.js Install like below. `@spz-loader/babylonjs` requires Babylon.js version 7 or later. ```sh # for npm npm i @babylonjs/core @spz-loader/babylonjs # for pnpm pnpm add @babylonjs/core @spz-loader/babylonjs ``` Code example of ESModule or TypeScript. ```ts import "./style.css"; import { Engine, Scene } from "@babylonjs/core"; import { createGaussianSplattingFromSpz } from "@spz-loader/babylonjs"; import spzPath from "../assets/hornedlizard.spz?url"; const engine = new Engine(renderCanvas); const scene = new Scene(engine); // ... const splat = await createGaussianSplattingFromSpzUrl(spzPath, scene); ``` ### Core package Install like below. ```sh # for npm npm i @spz-loader/core # for pnpm pnpm add @spz-loader/core ``` Usage example of core package. ```ts import { loadSpz } from "@spz-loader/core"; import spzUrl from "../assets/racoonfamily.spz?url"; const splat = await loadSpzFromUrl(spzUrl); console.log(splat.numPoints); ``` ## Developing spz-loader ### Environment Project author's local environment is below. - Windows 11 Home - Node.js 20.18.1 - pnpm 9.14.2 - Docker Desktop - with VSCode dev container - Emscripten 3.1.72 (on docker) ### Setup Clone this repo and submodule ```sh git clone https://github.com/drumath2237/spz-loader.git git submodule update --init --recursive ``` Repository structure is below. spz-loader is a monorepo project setup by pnpm-workspace. ```txt / โ”œโ”€ packages/ โ”‚ โ”œโ”€ core/ โ”‚ โ”‚ โ””โ”€ lib/ โ”‚ โ”‚ โ”œโ”€ spz-wasm/ โ”‚ โ”‚ โ”‚ โ””โ”€ spz/ <-- submodule โ”‚ โ”‚ โ”œโ”€ build.sh โ”‚ โ”‚ โ””โ”€ index.ts โ”‚ โ”œโ”€ babylonjs/ โ”‚ โ”‚ โ””โ”€ lib/ โ”‚ โ”‚ โ””โ”€ index.ts โ”‚ โ””โ”€ playcanvas/ โ”‚ โ””โ”€ lib/ โ”‚ โ””โ”€ index.ts โ”œโ”€ package.json โ”œโ”€ pnpm-lock.yaml โ””โ”€ pnpm-workspace.yaml ``` To install dependencies, you can run `pnpm install` on the root directory. ```sh pnpm install ``` ### Build packages Run build script `build:all`. This command does follow: 1. Build spz(C++) to WebAssembly by Emscripten on a Docker container 2. Build `@spz-loader/core` package by Vite library mode 3. Build `@spz-loader/babylonjs` package by Vite library mode ```sh pnpm build:all ``` ## Author [@drumath2237](https://x.com/ninisan_drumath)