Skip to main content

The GLB Format

GLB (binary glTF) can store 3D Gaussian Splat data using the Khronos KHR_gaussian_splatting extension. This makes splats first-class citizens of the glTF ecosystem: they travel through standard glTF pipelines and can live alongside regular meshes, materials and animations in a single file.

You can create these files with SplatTransform and load them directly with the PlayCanvas Engine.

How Splats Are Stored​

The extension stores each splat scene as a glTF mesh primitive with POINTS topology. Splat properties are supplied as vertex attributes:

AttributeTypeContents
POSITIONVEC3Splat center positions
KHR_gaussian_splatting:ROTATIONVEC4Rotation quaternion (xyzw)
KHR_gaussian_splatting:SCALEVEC3Per-axis size in linear space
KHR_gaussian_splatting:OPACITYSCALAROpacity with sigmoid already applied
KHR_gaussian_splatting:SH_DEGREE_{d}_COEF_{n}VEC3Spherical harmonics coefficients (RGB per coefficient)
COLOR_0VEC4Optional fallback color for viewers without splat support

Some differences from the PLY format worth knowing about:

  • Activated values: scale is stored in linear space (PLY stores log-space) and opacity is post-sigmoid (PLY stores pre-sigmoid values).
  • Coordinate system: splat data uses the standard glTF coordinate system (+Y up), so unlike PLY files, no flip rotation is needed when placing the loaded splat in a scene.
  • Fallback rendering: viewers that don't understand the extension can still render the COLOR_0 point cloud.

Creating GLB Files​

Convert any supported splat format using SplatTransform:

splat-transform scene.ply scene.glb

SplatTransform also reads GLB splat files, so you can convert one back to PLY, SOG or any other output format. See the CLI Reference for the GLB files it accepts.

Loading in PlayCanvas​

Splat GLB files load as container assets (like any other glTF content), not as gsplat assets:

const asset = new Asset('scene', 'container', { url: 'scene.glb' });
app.assets.add(asset);
app.assets.load(asset);

asset.ready(() => {
// creates an entity hierarchy with gsplat components
const entity = asset.resource.instantiateRenderEntity();
app.root.addChild(entity);
});

The container exposes the loaded splats as subordinate gsplat assets via asset.resource.gsplats, mirroring how renders and materials are exposed. Make sure your application registers the GSplatComponentSystem.

Engine Support Notes​

  • Only the ellipse kernel (standard 3D Gaussian Splatting) is supported. Other kernels render as ellipse with a warning in debug builds.
  • The sortingMethod and projection properties are ignored — sorting is controlled by the engine's global gsplat settings.
  • The KHR_gaussian_splatting_compression_spz_2 compression extension (still a draft) is not supported.

When to Use GLB​

GLB stores splat data uncompressed, so files are comparable in size to PLY. Use it when you need splats in standards-based glTF pipelines or combined with mesh content in a single asset.

tip

For web delivery, SOG remains the recommended format — it offers 15-20× compression and faster loading.