SOG Gaussian Splatting
Adds PlayCanvas SOG (Spatially Ordered Gaussians) format support to UnityGaussianSplatting. Import and render .sog files as GaussianSplatAsset with full Float32 quality.
com.ollihuttunen.sog-gaussian-splatting Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/sog-gaussian-splatting.git 
README Markdown
Copy this to your project's README.md
## Installation
Add **SOG Gaussian Splatting** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/sog-gaussian-splatting.git
```
[](https://www.pkglnk.dev/pkg/sog-gaussian-splatting)Dependencies (2)
README
Unity SOG Plugin
A Unity UPM package that adds SOG (Spatially Ordered Gaussians) format support to Aras PranckeviΔius's UnityGaussianSplatting plugin.
SOG is a compressed 3D Gaussian Splatting format by PlayCanvas that achieves ~15β20Γ smaller file sizes compared to PLY, using WebP images and vector quantization codebooks inside a ZIP archive.
Features
- Editor import β drag a
.sogfile into the Unity Project window; it auto-imports as aGaussianSplatAsset - Full quality β uses Float32 buffers (no lossy re-compression)
- Higher-order SH β supports spherical harmonics up to band 3 (15 coefficients)
- Correct coordinate conversion β handles SOG's Y-down β Unity Y-up transform for positions, rotations, and SH coefficients
- Runtime loader component β
SOGRuntimeLoaderMonoBehaviour for assigning pre-imported assets at runtime
Requirements
| Dependency | Version |
|---|---|
| Unity | 6000.0 (Unity 6) or newer |
| UnityGaussianSplatting | latest |
| libwebp native library | 1.4.0 |
Note: Unity's built-in
ImageConversion.LoadImagedoes not support VP8L lossless WebP.
The editor importer requires the nativelibwebp.dll(see Installation).
Installation
Step 1 β Install UnityGaussianSplatting
In Unity Package Manager β Add package from git URL:
https://github.com/aras-p/UnityGaussianSplatting.git
Step 2 β Install this package
In Unity Package Manager β Add package from disk β select package.json from this repository.
Or add directly to your project's Packages/manifest.json:
{
"dependencies": {
"com.ollihuttunen.sog-gaussian-splatting": "file:../path/to/Unity-SOG_plugin"
}
}
Step 3 β Add libwebp native library
Download libwebp 1.4.0 for Windows x64.
Extract and copy libwebp-1.4.0-windows-x64\lib\libwebp.dll to:
Packages/com.ollihuttunen.sog-gaussian-splatting/Plugins/x86_64/libwebp.dll
Usage
Editor Import
- Drag a
.sogfile into your Unity Project window - Unity imports it automatically; this creates several files next to it:
YourFile.assetβ theGaussianSplatAsset(assign this to your renderer)YourFile_pos.bytes,YourFile_other.bytes,YourFile_color.bytes,YourFile_sh.bytesβ binary data buffers
- Add a GaussianSplatRenderer component to a GameObject
- Assign the generated
.assetto the renderer's Asset field
Runtime (pre-imported assets)
Add SOGRuntimeLoader to the same GameObject as GaussianSplatRenderer:
GameObject
βββ GaussianSplatRenderer
βββ SOGRuntimeLoader
βββ Load Source: Direct Reference
βββ Asset Reference: [drag your .asset here]
Or load from a Resources/ folder:
GameObject
βββ GaussianSplatRenderer
βββ SOGRuntimeLoader
βββ Load Source: Resources
βββ Resources Path: "Splats/MyScene"
SOG Format Overview
SOG files are ZIP archives containing:
| File | Description |
|---|---|
meta.json |
Splat count, codebooks, file references |
means_l.webp + means_u.webp |
16-bit quantized positions (lower + upper bytes) |
quats.webp |
Rotations (smallest-three quaternion encoding) |
scales.webp |
Log-scale values via 256-entry codebook |
sh0.webp |
DC color coefficients + opacity |
shN_centroids.webp + shN_labels.webp |
Higher-order SH via two-level palette |
Key technical details
Positions use a log transform:meta.json mins/maxs are in log-space: logVal = sign(x)*log(|x|+1).
Inverse: x = sign(logVal) * (exp(|logVal|) - 1).
Quaternion component order: [qw, qx, qy, qz] (PlayCanvas internal convention).
Alpha channel in quats.webp: 252 + dropped_component_index.
Opacity: sh0.webp alpha channel is direct linear [0,1] = byte/255. Not a logit, not a codebook lookup.
Y-axis coordinate conversion (SOG Y-down β Unity Y-up):
- Position:
(x, -y, z) - Quaternion:
(-qx, qy, -qz, qw)β negate qx and qz (not qy!) - SH coefficients: negate bands with odd Y parity (sh1, sh4, sh5, sh9, sh10, sh11)
Project Structure
Unity-SOG_plugin/
βββ package.json
βββ Runtime/
β βββ SOGData.cs # Data structures (SOGMeta, SOGRawData, etc.)
β βββ SOGParser.cs # ZIP reading, WebP decoding, per-splat data extraction
β βββ SOGConverter.cs # SOGRawData β GaussianSplatAsset binary buffers
β βββ SOGRuntimeLoader.cs # MonoBehaviour for runtime asset assignment
βββ Editor/
β βββ SOGImporter.cs # ScriptedImporter (.sog β binary buffers)
β βββ SOGImporterEditor.cs # Custom Inspector for importer
β βββ SOGPostprocessor.cs # Creates GaussianSplatAsset after buffers import
β βββ LibWebPDecoder.cs # Native libwebp P/Invoke wrapper
βββ Plugins/
βββ x86_64/
βββ (place libwebp.dll here)
Known Limitations
- Windows x64 only (primary target) β the libwebp native plugin is configured for Windows x64. The C# code itself is fully cross-platform; only the native library needs to be swapped for other platforms.
- Editor import only β true runtime
.sogloading (without prior editor import) is not yet supported.GaussianSplatAssetrequiresTextAssetsub-assets that can only be created in the editor. - Unity 6+ only β uses
ScriptedImporterand APIs from Unity 6.
macOS note
The plugin has not been tested on macOS but the C# code should work as-is. If you want to try it, you need libwebp.dylib instead of libwebp.dll. The easiest way to get it is via Homebrew:
brew install webp
# library location: /opt/homebrew/lib/libwebp.dylib (Apple Silicon)
# /usr/local/lib/libwebp.dylib (Intel Mac)
Place the .dylib in Plugins/macOS/ inside the package folder and configure its platform in the Unity Inspector. Contributions adding official macOS support are welcome.
How It Works
The import pipeline:
.sog file
ββ SOGImporter (ScriptedImporter)
ββ SOGParser β SOGRawData
ββ SOGConverter β binary buffers (.bytes files)
ββ SOGPostprocessor β GaussianSplatAsset (.asset)
ββ GaussianSplatRenderer (Aras's plugin renders it)
SOGParseropens the ZIP, readsmeta.json, decodes each WebP image using the native libwebp library, and producesSOGRawDatawith per-splat positions, rotations, scales, colors, and SH coefficients.SOGConvertertransforms the raw data into the binary buffer format expected byGaussianSplatAsset(Float32 quality, Morton-tiled color texture, 10.10.10.2 quaternion encoding).SOGPostprocessordetects the generated.bytesfiles and assembles the finalGaussianSplatAssetwith allTextAssetreferences.
License
MIT License β see LICENSE file.
Acknowledgements
- Aras PranckeviΔius for the UnityGaussianSplatting plugin
- PlayCanvas for the SOG format specification and splat-transform reference implementation
- Google WebM Project for libwebp
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In