The AntialiasedTextureMask expression allows you to create a material using a soft (anti-aliased) transition mask. The mask can be used to blend between two complex material properties or to fade out an alpha blended material (works well with SoftMasked). Simply specify a texture with the mask specified in one channel (red, green, blue, or alpha), set the used channel in the expression and specify the comparison value. Assuming the channel stores a grayscale value in the range 0 = black to 1 = white the comparison function defines if the resulting mask should be 0 or 1. This expression is a parameter, allowing the Texture property to be overridden by child MaterialInstances.
Specifies the value used as the cutoff point in pixel coverage. Pixel coverage values less than this become black; values greater become white.
Specifies the channel of the Texture to use as the mask.
Specifies the mask texture to use.
Takes in texture coordinates to apply to the texture mask.
Result = 1
if TextureLookup < Threshold then Result = 0
The actual implementation is quite a bit more complicated as it tries to return values between 0 and 1 depending on the actual pixel coverage to avoid aliasing.
Example (this tiny 128x128 texture, uncompressed for best quality):
Was used as a normal texture (left top) and used with the described material expression (bottom right):
The technique works best in magnification and with blurred input content. Compression hurts the quality a lot so try to use uncompressed low resolution textures.