-
Notifications
You must be signed in to change notification settings - Fork 245
Implement support for KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2
#1262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
One random thing to note, might be a concern might not, the SPZ decoding rewrites the color channel to always be a float. This is because I was having some issues with handling conversions to the |
|
Some things I'd like to fix with the
|
| "scripts": { | ||
| "generate-3d-tiles": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/tileset.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/common/rootProperty.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/PropertyTable/propertyTable.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/Subtree/subtree.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/Schema/schema.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/Statistics/statistics.schema.json --output ../../Cesium3DTiles --readerOutput ../../Cesium3DTilesReader --writerOutput ../../Cesium3DTilesWriter --extensions https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/extensions/ --namespace Cesium3DTiles --readerNamespace Cesium3DTilesReader --writerNamespace Cesium3DTilesWriter --config 3dTiles.json", | ||
| "generate-gltf": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/specification/2.0/schema/glTF.schema.json --output ../../CesiumGltf --readerOutput ../../CesiumGltfReader --writerOutput ../../CesiumGltfWriter --extensions https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/extensions/2.0/ --namespace CesiumGltf --readerNamespace CesiumGltfReader --writerNamespace CesiumGltfWriter --config glTF.json", | ||
| "generate-gltf": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/specification/2.0/schema/glTF.schema.json --output ../../CesiumGltf --readerOutput ../../CesiumGltfReader --writerOutput ../../CesiumGltfWriter --extensions https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/extensions/2.0/ https://raw.githubusercontent.com/CesiumGS/glTF/draft-splat-spz/extensions/2.0/ --namespace CesiumGltf --readerNamespace CesiumGltfReader --writerNamespace CesiumGltfWriter --config glTF.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open a PR to merge the draft extension into the cesium-native branch, rather than pulling it from a separate branch. Or maybe Adam already did?
CesiumGS/glTF#88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it needs an update, but you can open another similar PR.
It now matches the official vcpkg one as of `2025.09.17`, plus it adds the `loadSpz.patch` patch to add an overload of loadSpz taking a raw pointer.
| return unpackGaussians(loadSpzPacked(data), o); | ||
| } | ||
|
|
||
| +GaussianCloud loadSpz(const uint8_t *data, int32_t size, const UnpackOptions &o) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's open a PR upstream for this. It seems like a nice change that should be easy to get accepted, and then we (eventually) won't need an overlay port. spz is in vcpkg now, btw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR made: nianticlabs/spz#62
Closes #1219. This PR adds support for the new
KHR_gaussian_splattingextension and theKHR_gaussian_splatting_compression_spz_2extension. The latter is the majority of this PR - it implements SPZ decoding using the spz library, allowing glTFs with SPZ payloads to be read. It also implements backwards compatibility for theKHR_spz_gaussian_splats_compressionandKHR_gaussian_splatting_compression_spzextensions, previous iterations that have already had some tilesets created using them.