Add native .spz Gaussian Splat format support#39
Open
Enndee wants to merge 1 commit intohyperlogic:mainfrom
Open
Add native .spz Gaussian Splat format support#39Enndee wants to merge 1 commit intohyperlogic:mainfrom
Enndee wants to merge 1 commit intohyperlogic:mainfrom
Conversation
Integrates nianticlabs/spz (MIT) as a submodule at third_party/spz. Adds GaussianCloud::ImportSpz() and routes .spz extension in app.cpp. Only new vcpkg dependency: zlib (already present in most builds via libpng). ~10x size reduction vs equivalent PLY files. - CMakeLists.txt: find ZLIB, add SPZ source files and include dir - vcpkg.json: add zlib dependency - src/gaussiancloud.h: declare ImportSpz() - src/gaussiancloud.cpp: implement ImportSpz() with full SH support - src/app.cpp: route .spz to ImportSpz(), .ply to ImportPly()
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.
Add native .spz file loading support
Summary
This PR adds native loading support for the
.spzGaussian Splat format — Niantic's open, compressed binary format for 3D Gaussian Splatting scenes..spzfiles are typically ~10× smaller than equivalent.plyfiles, making them significantly faster to distribute and load.Motivation
The PLY format used by splatapult is large and uncompressed. For scenes captured with tools such as SHARP, 3DGS, or Gaussian Opacity Fields, the resulting PLY files can be tens to hundreds of MB. The
.spzformat provides:Implementation
New dependency:
nianticlabs/spzThe PR integrates
nianticlabs/spz(MIT license) as a git submodule atthird_party/spz. Only three.ccsource files are compiled directly into the splatapult executable (load-spz.cc,splat-types.cc,splat-c-types.cc). No separate static/shared library is needed.Files changed
.gitmodulesthird_party/spzsubmodule pointing tonianticlabs/spzvcpkg.jsonzlibdependencyCMakeLists.txtsrc/gaussiancloud.hImportSpz()src/gaussiancloud.cppImportSpz()src/app.cpp.spzextension toImportSpz(),.plytoImportPly()GaussianCloud::ImportSpz()detailsspz::loadSpz(filename, UnpackOptions)withCoordinateSystem::UNSPECIFIED(preserves PLY coordinate space — coordinates are stored as-is by converters such as
3dgsconverter)BaseGaussianData(SH degree 0) andFullGaussianData(SH degree 3)[x, y, z, w]; splatapult uses[w, x, y, z]expf()applied identically[coeff, channel]inner ordering; remapped to splatapult'sr_sh0/g_sh0/b_sh0...r_sh3/g_sh3/b_sh3layoutFile-extension routing in
app.cppThe internal variable
plyFilenamenow accepts any supported extension. A simple case-insensitive extension check dispatches toImportSpzorImportPly. All other logic (file watcher, hot-reload, etc.) is unchanged.How to test
HOW_TO_SUBMIT.mdin the PR package)cmake+ your generator as usual.plyscene file to.spzusing3dgsconverter:.spzfile:Backward compatibility
Fully backward-compatible. Existing
.plyworkflows are completely unaffected. The routing inapp.cppfalls through toImportPly()for any non-.spzextension.Dependencies
zlib— only new vcpkg dependency; very widely available and already present in most builds via libpngnianticlabs/spz— MIT license, C++ only, no GPU/graphics dependenciesRelated