Alpha masking refers to a special case of alpha blending where all pixels are rendered as either fully opaque (100% alpha) or fully transparent (0% alpha) with no partial transparency. This can be treated as a special case because it does not require alpha sorting in order to produce visually correct results. On most hardware, this provides a significant performance win over an equivalent alpha sorted material. On some hardware, this is substantially slower than an opaque material. This technique also guarantees correct visual outcomes, whereas alpha sorting is inevitably an approximation which will show incorrect results in certain edge cases.
Materials which support alpha masking
The following materials support alpha masking:
- TBD: legacy materials which optionally support alpha masking.
Control of alpha masking via texture.txt file
texture.txt files may be created with masked alpha, either by using a perfectly black and white (as opposed to grayscale) alpha channel, or by forcing alpha masking using the appropriate tags. This controls the contents of the texture file, but does not affect the behavior of the material (except for certain auto-switching legacy materials). The appropriate material type must be used to achieve the desired outcome.
TBD: alpha masking vs mip mapping
TBD: Image of alpha mask and the in-game result, versus alpha blending.
TBD: Discussion of using alpha testing without a b&w texture.
TBD: Overdraw concerns