Open topic with navigation
This sample presents a high performance and high quality screen-space software approximation to anti-aliasing called FXAA.
The OpenGL samples all share a common app framework and certain user interface elements, centered around the "Tweakbar" panel on the left side of the screen, which lets you interactively control certain variables in each sample.
To show and hide the Tweakbar, simply click or touch the triangular button positioned in the top-left of the view.
Other controls are listed below:
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.
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 the 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.
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.
Further, 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.211026 ©2014-2021. NVIDIA Corporation and affiliates. All Rights Reserved.