Add initial SOG format support#478
Open
querielo wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds initial support for the SOG (Spatially Ordered Gaussians) scene format to GaussianSplats3D, enabling loading of both bundled .sog archives and multi-file SOG directories.
Key changes include:
- Implementation of a minimal ZIP reader for browser-based .sog archive extraction (STORE method only)
- SOG parser that reconstructs 3D Gaussian splats from WebP-encoded data using quantization and codebooks
- Integration with existing loader infrastructure and viewer components
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/loaders/sog/ZipReaderBrowser.js | Minimal ZIP reader supporting STORE compression for .sog archives |
| src/loaders/sog/SogParser.js | Core parser for SOG format data reconstruction from WebP images |
| src/loaders/sog/SogLoader.js | Main loader with support for both directory and ZIP-based SOG files |
| src/loaders/Utils.js | Added SOG format detection for .sog file extensions |
| src/loaders/UncompressedSplatArray.js | Fixed spherical harmonics data placement in splat components |
| src/loaders/SceneFormat.js | Added SOG format enum value |
| src/index.js | Exported SogLoader for public API |
| src/Viewer.js | Integrated SOG loading support into main viewer |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ShunChengWu
reviewed
Nov 4, 2025
| const rIdx = centroidsImg.data[cidx + 0]; | ||
| const gIdx = centroidsImg.data[cidx + 1]; | ||
| const bIdx = centroidsImg.data[cidx + 2]; | ||
| rest[j + 0 * shNCoeffsWanted] = shNCodebook[rIdx] ?? 0; |
There was a problem hiding this comment.
The code here createed a sequential layout [R0, R1, R2, ..., G0, G1, G2, ..., B0, B1, B2, ...], but the renderer expects an interleaved lauout.
The code here should be changed to something like this:
const shIndexMap = [
0, 1, 2, 9, 10, 11, 12, 13, 24, 25, 26, 27, 28, 29, 30, // R channel indices
3, 4, 5, 14, 15, 16, 17, 18, 31, 32, 33, 34, 35, 36, 37, // G channel indices
6, 7, 8, 19, 20, 21, 22, 23, 38, 39, 40, 41, 42, 43, 44 // B channel indices
];
for (let j = 0; j < 3; j++) {
for (let k = 0; k < shNCoeffsWanted; k++) {
const u = (label % 64) * shNCoeffsTotal + k;
const v = Math.floor(label / 64);
if (u < centroidsImg.width && v < centroidsImg.height) {
const cidx = (v * centroidsImg.width + u) * 4;
const codebookIdx = centroidsImg.data[cidx + j];
const outIndex = shIndexMap[j * 15 + k];
if (outIndex < restCount) {
rest[outIndex] = shNCodebook[codebookIdx] ?? 0;
}
}
}
}
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.
Issue: #476
This PR adds first-class support for the SOG (Spatially Ordered Gaussians) scene format to GaussianSplats3D. It enables loading both:
Limitations and follow-ups
Zipreader supports only STORE (no DEFLATE). This matches thesplat-transformwriter.