Alpha testing is widely used for rendering surfaces with transparency. While it works well when transparency is a binary function, semi-transparent regions cause problems, as they are classified as either fully transparent or opaque. Unfortunately, semi-transparent texture regions often appear in coarser mipmap levels, causing surfaces to disappear with distance. We introduce the alpha distribution approach for pre-processing the alpha values of a texture such that alpha testing produces expected results with semi-transparency without any modification to render-time operations. We describe two separate algorithms for alpha distribution with similar qualitative behavior. Our results show that alpha distribution can produce high-quality results with low noise. One important advantage of alpha distribution is that it requires no modification to fragment shader code for alpha testing. We also explain how alpha distribution can be extended for high-quality rendering with alpha-to-coverage.
VideosAlpha Distribution, I3D 2018 paper video.
An implementation of alpha distribution methods is in cyCodeBase. The related code release shows how to modify the alpha channel of a given texture in OpenGL.