This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA)
The algorithm was proposed by:
Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez
This node provides only SMAA 1x mode, so the operation will be done with no spatial multisampling nor temporal supersampling.
Since the "depth edge detection" simply calculates differences between neighboring pixels, we can use arbitrary grayscale or binary image such as alpha channel or object IDs instead of depth.
Here is a comparison between existing antialiasing (Scale3x, imported from GIMP) and the Anti-Aliasing Node (SMAA 1x):
SMAA 1x produces much higher quality results than Scale3x.
The existing AA operation seems to be used only for binary images by some other nodes. Using SMAA for binary images needs no important parameter such as "threshold", so we perhaps can switch the operation to SMAA, though that changes existing behavior.
Currently, Anti-Aliasiing Node shows a lot of options. I merely implemented them for testing all configurable parameters, so I plan to remove unimportant options later.
Example: Using Anti-Aliasing Node as an alternative of OLM smoother that is widely used in Japanese animation studios:
- The program code assumes the screen coordinates are DirectX style that the vertical direction is upside-down, so "top" and "bottom" actually represent bottom and top, respectively
- smaa_areatex.cpp is a stand-alone software I wrote for another project, so its copyright is still owned by me and under MIT-style license
- Unfortunately, this patch doesn't include OpenCL support (I'm not familiar with it...), though SMAA is not so slow
Tested on Ubuntu 16.10 and Windows 10.