Weighted blended order-independent transparency
Draws all transparent surfaces in any order into two cheap accumulation targets and resolves them in one pass with a depth-dependent weight, trading exact ordering for single-pass speed.
Also known as WBOIT, weighted blended OIT
In the family Visibility, shadows & ambient occlusion, order-independent transparency
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Official add-on | import { oitPass } from 'three/addons/tsl/display/OITPassNode.js' docs |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | None found | Unreal's OIT uses sorted per-pixel lists rather than McGuire-Bavoil Weighted Blended OIT. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Transparent geometry is rendered after the opaque pass with depth writes off. Each fragment contributes to two render targets using additive/multiplicative blending: an RGBA16F target accumulating premultiplied colour times a weight, plus the weight itself in alpha, and an R8/R16F target accumulating the product of (1 - alpha), which is the final revealage (how much background still shows). The weight is a hand-designed function that grows with alpha and falls steeply with view depth, so nearer layers dominate the average the way they would after sorting. A fullscreen composite then divides accumulated colour by accumulated weight to get an average transparent colour and blends it over the opaque image using one minus revealage. Because accumulation is commutative, no sorting, per-pixel lists or multiple depth peels are needed. Variants add a colour-dependent transmittance target, or tune the weight to the scene's depth range.
When to choose it
Reach for it when
- many overlapping transparent particles render in the wrong order
- need transparency without sorting triangles every frame
- smoke and glass layers pop when camera moves
- transparent foliage cards need cheap blending on webgl2
- sorting transparent objects is too slow with thousands of quads
Choose it for particles, smoke, foliage cards, glass-like clutter and any case where many low-to-moderate alpha layers overlap and approximate ordering is acceptable, especially on WebGL2 and mobile where linked lists are unavailable. Prefer Hashed alpha testing / alpha-to-coverage for foliage when the surfaces can be stochastic cutouts resolved by Temporal Anti-Aliasing, and exact sorted or per-pixel-list OIT when a few high-alpha layers (stacked windows, jewellery) must layer correctly. Keep opaque and refractive-glass objects in their own passes.
Field marks
- Ordering errors with high-alpha layers: a distant opaque-looking surface can bleed over a near one
- The depth weight needs tuning per scene; too flat gives order-dependent mush, too steep makes far layers vanish
- Colour tints from averaging, since colours blend by weight rather than by true transmittance
- Float target precision limits with huge weights or very many layers (overflow in RGBA16F)
- Needs a separate pass and care to avoid double-blending with fog or bloom inputs
Presets
Unsorted over vs WBOIT vs sorted, four overlapping discs
{
"alpha": 0.55,
"depths": [
1,
2,
3,
4
]
}Show GLSL (54 lines)
// GLSL ES 3.0, Shadertoy-style. Left: unsorted "over" blending. Middle: weighted blended OIT. Right: sorted reference.
const float ALPHA = 0.55;
const vec4 Z = vec4(1.0, 2.0, 3.0, 4.0); // view depth per layer (index 0 is farthest)
vec3 layerColor(int i) {
if (i == 0) return vec3(0.95, 0.25, 0.20);
if (i == 1) return vec3(0.95, 0.80, 0.15);
if (i == 2) return vec3(0.15, 0.75, 0.35);
return vec3(0.20, 0.35, 0.95);
}
vec2 layerCenter(int i, float t) {
float a = t * 0.6 + float(i) * 1.57;
return vec2(0.13 * cos(a), 0.13 * sin(a)) + vec2(-0.08 + 0.055 * float(i), 0.0);
}
float coverage(int i, vec2 p, float t) {
return step(length(p - layerCenter(i, t)), 0.20);
}
float weightFn(float z, float a) {
return a * clamp(10.0 / (1e-5 + pow(z / 5.0, 3.0) + pow(z / 200.0, 6.0)), 1e-2, 3e3);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
float panel = floor(uv.x * 3.0);
vec2 p = vec2(fract(uv.x * 3.0) - 0.5, uv.y - 0.5);
vec3 bg = mix(vec3(0.92), vec3(0.55, 0.60, 0.70), uv.y);
vec3 col = bg;
float t = iTime;
if (panel < 0.5) {
int order[4] = int[4](2, 0, 3, 1); // arbitrary submission order, no sorting
for (int k = 0; k < 4; k++) {
int i = order[k];
float c = coverage(i, p, t) * ALPHA;
col = mix(col, layerColor(i), c);
}
} else if (panel < 1.5) {
vec3 accum = vec3(0.0); float aw = 0.0; float reveal = 1.0;
for (int i = 0; i < 4; i++) {
float cov = coverage(i, p, t);
float w = weightFn(Z[i], ALPHA) * cov;
accum += layerColor(i) * w;
aw += w;
reveal *= 1.0 - cov * ALPHA;
}
vec3 avg = accum / max(aw, 1e-5);
col = mix(bg, avg, 1.0 - reveal);
} else {
for (int i = 0; i < 4; i++) { // back to front
col = mix(col, layerColor(i), coverage(i, p, t) * ALPHA);
}
}
if (abs(fract(uv.x * 3.0) - 0.5) > 0.495) col = vec3(1.0);
fragColor = vec4(col, 1.0);
}
Attribution: written for this index; weight function follows the formula family in the cited paper · basis: 0
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| wboit-overlap-vs-unsorted | Tesla T4 1920x1080 | 2.20× baseline (light) · 0.072 ms / 0.076 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| wboit-overlap-vs-unsorted | NVIDIA L4 1920x1080 | 1.77× baseline (feather) · 0.028 ms / 0.028 ms · 2.6× faster on L4 | opengl-timer-query · Cross-architecture validation |
| wboit-overlap-vs-unsorted | NVIDIA A100-SXM4-40GB 1920x1080 | 1.29× baseline (feather) · 0.037 ms / 0.037 ms · 1.9× faster on A100 | opengl-timer-query · Cross-architecture validation |
Crosses
- Hashed alpha testing / alpha-to-coverage for foliage: Hashed cutouts handle opaque-ish foliage while WBOIT handles the genuinely translucent layers in the same frame.
Sources
- primaryMorgan McGuire, Louis Bavoil. Weighted Blended Order-Independent Transparency. jcgt.org.Verified via live page · 2026-11-29
- implementationstevinz (2022). stevinz/three-wboit. Weighted, blended order independent transparency pass for use with three.js.GitHub API · license MIT · 2026-11-29
- implementationmhalber (2019). mhalber/Weighted-Blended-OIT. Simple implementation of "Weighted Blended Order-Independent Transparency" by McGuire & Bavoil '13GitHub API · license MIT · 2026-11-29