Game dev
Saved & recent

Alpha blending

Related terms: transparency, alpha channel, alpha test

Alpha is a fourth color channel that stores opacity. 1 is solid, 0 is invisible. Blending mixes a new pixel with the one already on screen using that value.

Transparent objects must be drawn back to front, after the solid ones, or they blend against the wrong thing. Alpha test (cutout) avoids sorting by making every pixel fully on or fully off, which suits leaves and fences.

out = src * alpha + dst * (1 - alpha)

Further reading
LearnOpenGL: blending
rear pane opaque plant front pane overlap metal clamps
In this conventional source-over example, the opaque scene is followed by rear blue α = 0.35 and then front amber α = 0.5. At the marked leaf, the mixed color is 50% amber + 17.5% blue + 32.5% leaf color. The panes are idealized uniform tints without refraction.

View in the full Game dev collection