Introduction
A .ksplat file holds a Gaussian splat scene for GaussianSplats3D, Mark Kellogg’s splat viewer for three.js. It is the viewer’s own in-memory splat buffer saved to disk, so it loads with almost no work: the viewer converts a 3D Gaussian Splatting PLY or a .splat file to it once, and later loads are quick.
The format has three compression levels. Level 0 keeps 32-bit floats; level 1 keeps positions as 16-bit offsets within small cubes called buckets, and the rest as half floats; level 2 also keeps the spherical harmonics in single bytes. Harmonics go up to degree 2.
Structure
The file is little-endian. The current version, 0.1, is laid out as follows.
0Header version, counts, compression level, scene centre, harmonics range4096 bytes4096Section headers one per section: counts, buckets, sizes, harmonics degree1024 bytes each…Section data one block per section, in orderits data size each+0Bucket lengths splats in each partly filled bucket, uint324 bytes each…Bucket centres x, y, z as float3212 bytes each…Splats centre, scale, rotation, colour, harmonics24 to 140 bytes each
The file has no signature. It is known by its extension and by a header whose first bytes are the version 0 and 1, and whose section count fits the file.
In this reference
- Headers – the 4096-byte file header, the compression levels and the 1024-byte section header
- Sections and splats – buckets, the splat record at each level, and how it becomes a Gaussian
Not described
The pages follow the code of GaussianSplats3D (SplatBuffer.js and the
loaders), which is the only description of the format, and the file layout is checked
against splat-transform’s reader. The explorer labels what it does not decode.
Known, not yet covered
- Reference and viewer: harmonics of degree 3. The library’s helper counts 45 components for it, but nothing in the loaders or the buffer reads or writes them, so the pages and the explorer take degrees 0 to 2; a section with degree 3 is shown as damaged.
- Viewer: checked on one real file (splat-transform’s 4-splat test file, level 0, which differs from the library’s own output in three header fields) and on built files for levels 1 and 2 and for harmonics. No scene written by GaussianSplats3D itself was available to test.
- Viewer: the progressive-loading use of
sectionCountandsplatCount(a file read in parts): the explorer treats a section as in use when its own count is above 0 and notes where the header disagrees.
Unknown
- Reference: versions of the format above 0.1. The loader accepts any later major version without saying what changes.
Links
Software
- GaussianSplats3D – Mark Kellogg’s three.js splat viewer, which defines the format and converts PLY and .splat to it (web)
Developers
- @mkkellogg/gaussian-splats-3d – the viewer as an npm package, with its loaders and writer (JavaScript)
Reference
- SplatBuffer.js – the code that reads and writes the format, its only description