Open-Source Wikis

/

Bevy

/

Packages

/

bevy_anti_alias

bevyengine/bevy

bevy_anti_alias

Anti-aliasing techniques: FXAA, SMAA, TAA, and contrast-adaptive sharpening (CAS). Each is its own plugin you can enable per camera.

Purpose

The crate hosts the post-process anti-aliasing techniques that don't require multi-sample render targets:

  • FXAA — fast approximate AA. Cheapest, slightly blurry.
  • SMAA — subpixel morphological AA. Sharper than FXAA, more expensive.
  • TAA — temporal AA. Reuses the previous frame; needs motion vectors. Sharpest at the cost of ghosting.
  • CAS — contrast-adaptive sharpening, often paired with TAA.

MSAA itself is configured on the camera in bevy_render, not here.

Directory layout

crates/bevy_anti_alias/src/
├── lib.rs                  # AntiAliasPlugin
├── fxaa/                   # FXAA implementation
├── smaa/                   # SMAA implementation
├── taa/                    # TAA implementation
├── contrast_adaptive_sharpening/
└── …

Each technique is one render-graph node plus a fragment shader.

Key abstractions

Type File Description
Fxaa crates/bevy_anti_alias/src/fxaa/ Component; per-camera FXAA settings.
Smaa / SmaaPreset crates/bevy_anti_alias/src/smaa/ Per-camera SMAA settings.
TemporalAntiAliasing crates/bevy_anti_alias/src/taa/ TAA component.
ContrastAdaptiveSharpening crates/bevy_anti_alias/src/contrast_adaptive_sharpening/ CAS component.

How it works

Each plugin adds a render-graph node that runs after the main pass and before tonemapping. Cameras opt in by adding the corresponding component. TAA additionally requires the prepass to be enabled (it reads motion vectors).

Integration points

  • Depends on: bevy_render, bevy_core_pipeline, bevy_camera.
  • Depended on by: Anyone using DefaultPlugins with the bevy_anti_alias feature.

Entry points for modification

  • Each technique has its own subdirectory — start there.
  • Adding a new AA technique: create a directory with a plugin, a node, and a shader; wire it into the core pipeline graph.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

bevy_anti_alias – Bevy wiki | Factory