Open topic with navigation
This sample presents a high performance and high quality screen-space software approximation to anti-aliasing called FXAA.
This sample has the following app-specific controls:
|mouse||Left-Click Drag||Rotate the scene|
|Middle Button Scroll||Zoom the scene|
|Right-Click Drag||Rotate the light|
|keyboard||F2||Change rendering device|
FXAA is a single-pass, screen-space anti-aliasing technique designed for producing high-quality images with low performance impact. The included code and sample use FXAA version 3.11, the latest version available as of this writing.
Figure 1: No AA vs 4xMSAA vs FXAA
(Click to enlarge)
The technique targets aliasing both on triangle edges and within shader results. It has logic to reduce single-pixel and sub-pixel aliasing, which one can see clearly in the reduction of stipple aliasing in Figure 1.
FXAA is designed to be easy to integrate into a single pixel shader and it runs as a single-pass filter on a single-sample color image. Depending on the engine, there may be a performance advantage in merging FXAA into an existing post processing pass. For example, the following can be done in a single full screen pass: FXAA + composite bloom results + color grading + adding film noise. If the engine already has the ability to selectively apply post processing to only the regions which need a given effect, anti-aliasing, and thus FXAA, is likely not needed in areas under strong motion blur or depth of field.
Please refer to extensively commented
FXAA3_11.h file included in the sample for additional tuning parameters and explanation. Also refer to the original FXAA whitepaper and presentation for additional technical details (linked below).
FXAA reduces visible aliasing while maintaining sharpness and keeping within a practical ms/frame cost for a typical game engine. For example, on a GTX 460, FXAA costs 0.88ms/frame on 1920x1080 @ 60Hz with default presets. On a GTX 560, the time drops to 0.39ms/frame with the same scene and settings.
Futher, FXAA provides not only a memory advantage over MSAA, especially on stereo and multi-display render targets or back buffers, but also a significant performance advantage for deferred rendering over using MSAA and shading multiple samples.
NVIDIA® GameWorks™ Documentation Rev. 1.0.210204 ©2014-2021. NVIDIA Corporation. All Rights Reserved.