UDN
Search public documentation:

PostProcessAA
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Post Process Effects > Post Process Anti Aliasing Effect

Post Process Anti Aliasing Effect


PostProcessAATeaser.jpg
PostProcessAATeaser2.jpg
The image shows some distant rocks (for better illustration the top was magnified 2x).
left: The image suffer suffers from aliasing (no MSAA)
right: The same image after PostProcessingAA was applied.

Overview


Computer generated images often suffer from an aliasing. There are many kinds of aliasing but here we focus on the stair step like appearance of edges that are near vertical or horizontal. The classic approach solving this is to use super sampling (render in higher resolution and downsample) or multi sampling (occlusion like super sampling but shading done per pixel). There has been many improvements in this area but for many reasons (performance, memory and complexity) many games ship with the mentioned image artifacts.

Morphological Antialiasing is a technique that was originally developed by Intel (see reference) that showed that the stair step appearance can be completely removed in a post process. The original technique was complex and CPU based but multiple people worked on SPU and GPU solutions.

The method works very well with most content but it cannot solve all aliasing cases. Problems might arise:

  • if content gets too small (e.g. wireframe lines)
  • if content is slowly moving (e.g. looking at stair cases while moving the camera lightly)
  • if content was meant to be hard edged (e.g. hand drawn art or text)

Solving the problem in a postprocessing step is tempting because it adds no complexity to the former steps and can be optimized independently from those steps. Note that following passes no longer can clearly associate one depth with one pixel so new artifacts are possible.

PostProcessAAOrganic.jpg
This image clearly shows that the problem of aliasing is mostly visible where there is a strong contrast. Those areas are effectively adressed by the method.
However the image as a whole seems to loose a bit of the sharpness. Here MLAA can be tweaked whereas FXAA doesn't offer any control.

How to activate?


In the uberpostprocess node in the post processing chain you can find a new group called Post Process Anti Aliasing.

PostProcessAAEditor.png

Change the type to activate, change the method (MLAA or FXAA) and the quality level. The threshold property is only used for the MLAA implementation.

Alternatively you can use the console variable PostProcessAAType in game:

Allows to override the post process anti aliasing type.
 <0: use post process settings (default: -1)
  0: off
1-6: FXAA Preset 0:low quality .. 5:very high quality but slow (1 pass)
  7: MLAA (requires extra render targets (requires bAllowPostprocessMLAA=True in .ini), 3 pass)

Because MLAA requires extra memory it needs to be explicitly enabled. It needs to be activated by changing the following ini setting (e.g. in BaseEngine.ini) from:

   bAllowPostprocessMLAA = False

to:

 
   bAllowPostprocessMLAA = True 

Note: The ini setting also can be changed at runtime with the following console command:

   scale toggle bAllowPostprocessMLAA

Implementation details


We integrated an MLAA implementation called FXAA from NVIDIA (see reference) and MLAA from AMD (see reference) into our uber postprocess effect. Thanks to their effort we can provide this feature to UnrealEngine3 users. Both are GPU solutions and produce very good results. They however differ in some implementation details:

FXAA (from NVIDIA):

  • One pass
  • Requires anisotropic texture lookup

MLAA (from AMD):

  • Three pass
  • Multiple levels of different performance/quality
  • Requires extra intermediate render target memory (can be optimized)
  • Slightly less blurring of inner details
  • 45 degree edges appear more wide

We recommend to try both methods and the different presets with your own content as the input content can affect the final look a lot.

Because of the extra memory requirements we currently don't advise using MLAA on console. It's possible to change the shader to share memory with other rendertargets but that hasn't been done yet. MLAA and FXAA have a high GPU cost and should only be used on platforms that can handle that. If you consider using the effect for your application you should invest some time to low level optimize the shaders for that platform.

Supported platforms


  • FXAA: DX9, DX11, Xbox360, PlayStation3
  • MLAA: DX9, DX11 (Xbox360 and PlayStation3 untested)

References


Thanks


  • Intel for developing MLAA
  • AMD CAS team for the GPU MLAA implementation
  • NVIDIA for the FXAA implementation