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
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