This thread is about getting user feedback on the new anti-aliasing compositor node. The goal is to agree on the final design from a user’s perspective before moving on to polishing the code.
The node removes distortion artefacts around edges known as aliasing.
The anti-aliasing node is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA) by Jimenez et al. . C++ implementation and current integration in Blender was done by Shinsuke Irie .
It is a post-processing filter with 3 main steps. First, it finds edges and corners in the input image and classifies them according to patterns (first pass). Second it eliminates edges that are usually not perceived by the eye and therefore avoid unwanted artefacts. This step is called local contrast adaptation (second pass). Finally, anti-aliasing is achieved by blending pixels in borders detected in first step using precomputed textures (third pass).
Edge detection, (find discontinuities in image based on):
- Color (typically RGB)
- Value (also called Depth in earlier versions)
Describes edge detection sensitivity across the whole image.
Example threshold 0.5 vs 0.05:
Local contrast adaptation factor
The human eye does not perceive all edges equally. For instance it tends to mask low contrast edges in the presence of much higher contrasts in the surrounding area. Therefore applying anti-aliasing to unperceived edges will produce artefacts.
This parameter quantifies the difference between low contrast and high contrast (neighbouring) edges.
Example 1 vs 5 (notice that only edges around eyes are affected, where neighbouring edges of higher contrast exist):
Detect corners to help preserve the original shape
Example of no corner detection vs maximum corner preservation
This serves as an alternative input for RGB or luma, e.g. depth pass from a render to help detect edges.
Edges output gives intermediate result of edge detection. It’s only there for debug purposes and will be removed later
Simplify interface as follows:
The authors of the original paper argue it is best to choose luma for edge detection, because this information is always available (unlike depth or object id) and because the underlying idea of morphological anti-aliasing assumes edges are color discontinuities. Also, I could reproduce same results from luma and RGB by choosing different threshold. So edge detection was set to luma by default and other options were removed.
Corner detection is now off it corner rounding is set to 0, otherwise use the value.
Feedback is welcome!
Please let me know what you think of the interface, especially of the simplified version. It would be nice to have the node tried out by compositing artists. Windows, Linux and macOS builds are available here
This is a continuation of D2411. Patch is not ready for review. Defining node design/usability is more important now
 Jorge Jimenez and Jose I. Echevarria and Tiago Sousa and Diego Gutierrez 2012, Enhanced Subpixel Morphological Antialiasing, in Computer Graphics Forum (Proc. EUROGRAPHICS 2012). https://www.iryoku.com/smaa/