Show a Gaussian splat
Draw a place or an object captured as a Gaussian splat, SPZ or PLY, beside the models and shapes of a scene.
A Gaussian splat is the appearance of a place learned from photographs: many small coloured
ellipsoids, blended in depth order. It looks like the photographs, gloss and fine texture
included, where a mesh from the same capture looks like a scan. It is not a surface, so it is a
geometry kind of its own, splat, and never a model format.
import { createScene, isSplatPly, SPLAT_FORMATS } from "@klorad/api/world";
import { createThreeRenderer } from "@klorad/engine-three";
const scene = createScene({ coordinateSystem: { origin: { lat: 40.62, lon: 22.95 } } });
// A splat is a geometry of its own: drawn as the place looked, not a surface. SPZ unless `format` says PLY.
scene.add({ id: "olive", name: "Olive tree", position: { east: 0, north: 0 }, geometry: { kind: "splat", uri: "/splats/olive.spz" } });
// When it was captured places it on the Time Spectrum: what the place looked like then.
scene.add({ id: "nave", name: "Nave", position: { east: 12, north: 4 }, orientation: { heading: 90 }, geometry: { kind: "splat", uri: "asset:7d3c", format: "ply", capturedAt: "2026-10-29T10:00:00Z" } });
// It stands beside models and shapes, picked by the box of its points.
scene.add({ id: "bench", name: "Bench", position: { east: 2, north: -2 }, geometry: { kind: "box", width: 1.6, depth: 0.5, height: 0.45 } });
// The formats a splat may come in, and whether a PLY's header holds splats or a point cloud.
export const formats = SPLAT_FORMATS; // ["spz", "ply"]
export const isSplat = isSplatPly("ply\nproperty float opacity\nproperty float scale_0\nproperty float rot_0\n"); // true
createThreeRenderer({
container: document.getElementById("view")!,
scene,
assetUrl: (assetId) => `/api/assets/${assetId}`,
});Formats
| Format | Extension | Notes |
|---|---|---|
| SPZ | .spz | Niantic's compressed form, about a tenth of a PLY. The form to prefer, and the one Klorad One keeps. |
| PLY | .ply | As 3D Gaussian Splatting training writes it. A PLY is a splat only when its header holds opacity, scale_0 and rot_0; isSplatPly(header) says so. Any other PLY is a model. |
A splat names its file by uri and stands on its own origin as a model does. Its file is read
as 3D Gaussian Splatting writes it, y down and z forward, and stood up. capturedAt, an ISO 8601
instant, says when it was captured.
What the renderer does
@klorad/engine-threedraws splats with Spark on its own WebGL renderer, sorted with the scene's meshes in one render, on screen and in a headset. Spark is imported the first time a scene holds a splat; a scene without one downloads none of it.- A splat is picked and labelled by the box of its points. It is never walked on: place a model or a plane where a visitor should stand.
asset:<id>names a file your application stores, fetched whereassetUrlsays.- The plan readers (OpenLayers, Mapbox) and Cesium draw a splat as a symbol at its place, and say so in their capabilities.
Migrating
splat is a new member of the Geometry union. Code of your own that switches over every
geometry kind, a reader of your own say, needs a case for it; a reader declares what it does
with a splat in its ReaderCapabilities.
Something wrong or unclear? Tell us.