Skip to main content

Anti-Aliasing

Some splat trainers apply an anti-aliasing filter while training, in the style of Mip-Splatting: Postshot does it by default, and Brush and gsplat offer it as a mode. Splats trained this way need a matching opacity compensation when they are rendered. Without it, small and distant splats render too bright, and fine detail such as hair or fur looks glittery. Splats trained without the filter must render without the compensation, or they look too faint.

Automatic Detection​

By default, each splat is rendered the way its file asks for. When a splat file loads, the training mode it records sets antiAlias on its resource:

FormatRecorded as
PLYThe antialiased 1 header comment (Postshot), or SplatRenderMode: mip (Brush, SplatTransform)
SOG"model": "antialiased" in meta.json
Streamed SOG"model": "antialiased" in lod-meta.json, for all the files it streams
SPZThe anti-aliased header flag

Files that do not record it, LCC2 and glTF files, and procedural splats render without the compensation. A scene can mix splats trained both ways, and each renders with its own setting.

SplatTransform keeps the training mode when it converts between these formats.

Files That Don't Record the Training Mode​

Set antiAlias on the resource yourself. It can be changed at any time:

const asset = new Asset('scene', 'gsplat', { url: 'scene.ply' });
asset.ready(() => {
// this scene was trained with anti-aliasing, but its file does not record it
asset.resource.antiAlias = true;

const entity = new Entity();
entity.addComponent('gsplat', { asset });
app.root.addChild(entity);
});
app.assets.add(asset);
app.assets.load(asset);

For a streamed scene, the resource is a GSplatOctreeResource, and its setting applies to every file it streams.

Overriding for the Whole Scene​

app.scene.gsplat.antiAlias is undefined by default, which lets each splat follow its resource. Set it to true or false to render every splat with or without the compensation, whatever their files record:

// render every splat without the compensation
app.scene.gsplat.antiAlias = false;

// let each splat follow its resource again
app.scene.gsplat.antiAlias = undefined;

Filter Size​

Trainers use different anti-aliasing filters: the anti-aliased mode of gsplat trains with a filter of 0.3 pixels squared, Mip-Splatting and the mip mode of Brush with 0.1. Files do not record the size, so set app.scene.gsplat.antiAliasFilterSize to match the trainer. It defaults to 0.3. A filter larger than the one the splats were trained with renders them too soft:

// splats trained with Mip-Splatting or Brush's mip mode
app.scene.gsplat.antiAliasFilterSize = 0.1;

The size applies to the splats rendered with the compensation. Other splats always render with the 0.3 filter of standard training.

Performance​

The compensation adds a few instructions per splat. A scene that mixes splats trained with and without anti-aliasing also reads a per-splat flag, a small extra cost that scenes with a single kind of splats don't pay.