IT lexicon › Hardware › Alpha testing

Alpha testing

Hardware På svenska → Updated: 2026-10-25

Discarding a pixel entirely if its alpha falls below a threshold — binary transparency that gives hard edges without any sorting headache.

An alpha channel can be used two ways. Alpha blending mixes semi-transparent pixels together and demands that everything be drawn in correct depth order. Alpha testing instead makes a binary choice: if alpha is below the threshold the pixel vanishes with a discard, otherwise it is fully opaque. The result writes depth normally, so it can be drawn in any order and works with the z-buffer — perfect for foliage, fences and chain-link.

The downside is stair-stepped edges, since every pixel is either on or off. That is softened with alpha-to-coverage, which spreads the decision across a multisample coverage mask. In old fixed-function OpenGL it was glAlphaFunc; in modern shaders it is a single line of code.

← Back to the lexicon