Skip to content

Multisample Anti-Aliasing 

MSAA is a depth-based anti-aliasing technique that renders additional fragments around object edges. This makes it much more stable in motion compared to non-temporal image-based solutions but it can also be more expensive depending on the complexity of the rendered geometry and shaders. This technique also doesn’t remove aliasing artifacts that can occur in texture details.

In WebGL and WebGPU, MSAA is implemented natively and can be enabled on a per-rendertarget basis. In postprocessing, this can be achieved by using the samples option of the GeometryPass.

const geoPass = new GeometryPass(scene, camera, { samples: 4 });
Tip

Anti-aliasing works best when applied after tone-mapping because it requires LDR input colors.

In practice, MSAA can be applied before tone-mapping, but it may fail to properly smooth edges if HDR colors are present in the scene colors.

Warning

MSAA is currently not compatible with depth-based effects.

External Resources