Skip to content
ExtendedSource checked

FXAA

Smooths jagged image edges with a fast post-process filter.

Quick Facts

Compact metadata for implementation and discovery.

Category
Rendering
Difficulty
Beginner
Family
Post-Process Anti-Aliasing
Tier
Extended
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
4
Code example
Ready
Visualization
Ready

Overview

Fast Approximate Anti-Aliasing detects high-contrast edges in the final image and blends samples along the edge direction.

Core Concepts

luminance contrastedge directionpost-process filterscreen-space blend

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(pixels)

Average

O(pixels)

Worst

O(pixels)

Space

O(1) extra

When to Use

  • Use when a cheap post-process anti-aliasing pass is needed.
  • Use when low-cost real-time anti-aliasing is a central requirement.

When Not to Use

  • Avoid when preserving very fine texture sharpness is more important than smoothing edges.
  • Avoid when the renderer cannot provide the buffers, samples, or lighting data the technique needs.

What It Does

  • Detects contrast edges
  • Estimates edge direction
  • Blends nearby pixels

Use Cases

  • Low-cost real-time anti-aliasing
  • Post-processing pipelines
  • Fallback edge smoothing

Inputs

  • Rendered color image

Outputs

  • Filtered color image

Key Formulas (1)

Luminance contrast

contrast = maxneighbor luma − minneighbor luma
contrast = max_neighbor_luma - min_neighbor_luma

Detects whether a pixel sits near a strong edge.

Pseudocode

  1. 1.Read the current pixel and neighbors
  2. 2.Measure local luminance contrast
  3. 3.Skip low-contrast pixels
  4. 4.Estimate the edge direction
  5. 5.Blend samples along that edge

Canonical Example

Input
edge pixels = black next to white
Output
output = intermediate blended edge
Explanation
FXAA detects the contrast and smooths the transition.

Implementation Notes

  • Tune contrast thresholds on representative scenes, not only test patterns.
  • Debug with simple geometry, known lights, and visualized intermediate buffers.
  • Keep a tiny example with expected output beside the implementation.

Common Pitfalls

  • Running FXAA before tone mapping or at the wrong color space can change its behavior.
  • Coordinate-space mismatches often cause artifacts that look like math errors.
  • Not defining boundary, empty, or degenerate inputs before implementation.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show a jagged high-contrast edge being softened by neighboring pixel samples.

FXAA mechanism walkthrough step 1 of 5
Step 1 of 5: Read the current pixel and neighbors
rendering-pipeline

Notes

FXAA is fast but may blur fine texture detail.

Sources (1)

What each reference supports for this entry.

NVIDIA FXAA Whitepaper

Documentation

NVIDIA whitepaper describing Fast Approximate Anti-Aliasing.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Alternative toMSAA

FXAA smooths edges after rendering instead of storing multiple coverage samples.

FXAA is a single-frame post-process alternative to temporal accumulation.

Tags

GraphicsAnti-AliasingFilteringScreen-Space