← All resources

Weighted, Blended Order-Independent Transparency

Blog Advanced

Morgan McGuire, Louis Bavoil (NVIDIA)

Visit resource ↗

Description

Morgan McGuire and Louis Bavoil's JCGT 2013 technique for rendering transparency without per-primitive sorting. The Casual Effects blog post at casual-effects.blogspot.com walks through the algorithm with copy-paste GLSL and explains why sorted alpha blending breaks for overlapping foliage, fog, and glass.

During transparent rendering, output to two render targets: an RGBA16F accumulation buffer weighted by depth and opacity, and an R8 revealage buffer. Draw transparent surfaces in any order with custom blend modes, then run a full-screen composite pass to normalize weights and blend over opaque geometry. Handles alpha cutouts, colored transmission, particles, and mixed-resolution billboards when tuned correctly.

Advanced rendering programmers implementing smoke, hair, glass, or foliage in OpenGL or Direct3D benefit most. The method assumes non-refractive monochrome transmission and requires tuning weight functions to your scene depth range.

McGuire and Bavoil implemented it in the G3D Innovation Engine and Unreal; Patrick Cozzi and Dan Bagnell ported it to WebGL for Cesium. The journal paper and reference shader code are linked from the blog.

Widely adopted in real-time engines when sorted transparency is too costly or produces popping in particle systems.