Add SPZ gaussian splat format support via external parser#9018
Merged
Conversation
Adds a parser for the SPZ format (https://github.com/nianticlabs/spz), version 4, implemented outside the engine as a script (scripts/esm/gsplat/spz-parser.mjs) and registered with the gsplat resource handler by the application. The splat data is kept in its quantized form on the GPU (~20 bytes per splat plus spherical harmonics) and dequantized in the shader, similar to the compressed PLY and SOG formats. The ZSTD compressed attribute streams are decompressed using a wasm module registered draco-style via pc.WasmModule, with the decoder vendored into examples assets. Includes a new gaussian-splatting/simple-spz example with the biker asset converted to spz v4.
Build size reportThis PR does not change the size of the minified bundles.
|
This was referenced Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for loading gaussian splats from SPZ files (version 4), implemented as an external parser script rather than engine code, using the parser registry on the gsplat resource handler.
Changes:
scripts/esm/gsplat/spz-parser.mjs-SpzParserwhich applications register viaapp.loader.getHandler('gsplat').addParser(new SpzParser(app)). The parser reads the SPZ v4 (NGSP) container directly and keeps the splat data in its quantized form in GPU textures (~20 bytes per splat plus optional spherical harmonics), dequantizing it in the shader - similar to the compressed PLY and SOG formats. Supports 0-3 SH bands (degree 4 files are clamped to 3 bands), and both GLSL and WGSL.zstddeclibcompiled to wasm, 54kB) is vendored intoexamples/assets/wasm/zstd/with provenance and licenses documented in the wasm assets README.GSplatResourceBase/GSplatFormatAPI.Examples:
gaussian-splatting/viewerexample now accepts dropped.spzfiles (loaded with +Y up, no flip rotation).gaussian-splatting/simple-spzexample, loading the biker asset converted to spz v4 (2.1MB vs 2.5MB compressed ply). Verified on WebGL2 and WebGPU, with spherical harmonics additionally verified using an SH3 test asset.