Skip to main content
Version: 2.x

Enabling anti-aliasing

Anti-aliasing is a technique to reduce the aliasing effects in the rendered result, and improves visual quality.

Reveal supports several anti-aliasing modes:

  • Fast approximate anti-aliasing (FXAA) - a fast technique that reduces anti-aliasing at modest cost.
  • Multi-sample anti-antialiasing (MSAA) - hardware supported supersampling technique. This produces high-quality anti-aliasing at some performance cost depending on how many samples is taken per output pixel. Reveal supports 4, 8 or 16 samples. This mode is only supported on WebGL 2 (currently this means desktop computers, most Android devices, but not iOS - see caniuse.com).
  • MSAA + FXAA - a combination of both modes where an FXAA pass is performed after the MSAA pass.
  • Disabled - no anti-aliasing.
Comparison of different anti-aliasing techniques

It might be hard to notice the difference in a scaled image, click the image to open the full resolution image.

By default Fast approximate anti-aliasing (FXAA) is used. This mode works on both WebGL 1 and WebGL 2. If WebGL 2 isn't supported, FXAA is used as a fallback.

const viewer = new Cognite3DViewer(
{
sdk: client,
antiAliasingHint: 'msaa4+fxaa'
});

Modes currently supported are 'disabled', 'fxaa', 'msaa2+fxaa', 'msaa4+fxaa', 'msaa8+fxaa', 'msaa16+fxaa', 'msaa2', 'msaa4', 'msaa8' and 'msaa16'.

note

The examples in this documentation use msaa4+fxaa.