Fast Mixed Anti-aliasing

Buy now on Asset Store!

FMAA, Fast Mixed Anti-aliasing is a collection of a few antialiasing algorithms:
- Temporal Antialiasing (TAA) – takes 66% of the time of Unity’s built-in TAA. Always combines two frames: current frame and one previous frame.
- Edge Antialiasing (EAA) – very simple algorithm that blurs edges.
- FXAA – well-known NVIDIA Timothy Lottes’s algorithm. Included just as a valuable addition so that it doesn’t have to be downloaded separately.

TAA algorithm thanks to jittering camera positon is capable of alleviating sub-pixel aliasing.
EAA and FXAA are post-processors that simply blur hard edges.
The two categories, temporal and post-processors, are orthogonal to each other and complement each other nicely. It is best to use a combination of either TAA+EAA or TAA+FXAA. The former will be faster while the latter will result in top-notch antialiasing solution that should be efficient enough not to take more than 1 ms on PS4 in full HD.

TAA and EAA both work on mobile systems that support OpenGL ES 3.0. FXAA is not supported on mobiles.

Screenshots

FMAA test scene.

FMAA test scene.

FMAA interface.

FMAA interface.

FMAA - no AA.

FMAA – no AA.

FMAA - TAA + EAA.

FMAA – TAA + EAA.

FMAA - TAA + FXAA.

FMAA – TAA + FXAA.

Interface

The package comes with one script FMAA.cs. It exposes the following properties:

  • Temporal – turn on/off Temporal Antialiasing.
  • Temporal Per Pixel Offset – sometimes just jittering camera’s position might not be enough if used sample coordinates happen to align with jagged geometry in screen space. In that case some additional, ideally per-pixel, offset can help. That is what this option does.
  • Temporal MRT Optimization – when turned on Unity will use multi-render target feature to make temporal antialiasing faster. This option gives around 20% speed boost.
  • Edge Blur – turn on/off Edge Antialiasing.
  • FXAA – turn on/off FXAA.

The remaining options are slots for AA shaders’ materials. A test scene shows how this should be configured.

Examples

In folder FMAA/Assets/BlossomGames/FMAA/Test you can find test scene that has a main camera with FMAA script attached. That is a good start to experiment.