---
id: "weighted-blended-oit"
title: "Weighted blended order-independent transparency"
aliases: [WBOIT, weighted blended OIT]
domain: "visibility"
stage: "visibility"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot]
year_introduced: 2013
inputs: [mesh, depth]
outputs: [hdr-image]
style: "both"
dynamic: "dynamic"
cost: "cheap"
authority: "McGuire & Bavoil"
url: "https://texelatlas.vercel.app/t/weighted-blended-oit/"
sources_verified_at: "2026-11-29"
---
# Weighted blended order-independent transparency (McGuire & Bavoil)

> 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.

## 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

## 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 use it

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](https://texelatlas.vercel.app/t/hashed-alpha-testing.md) when the surfaces can be stochastic cutouts resolved by [Temporal Anti-Aliasing](https://texelatlas.vercel.app/t/temporal-anti-aliasing.md), 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.

## Cost

cheap — One geometry pass with blending into two small targets plus a fullscreen composite; cost is dominated by overdraw bandwidth, not sorting.
Measured GPU Weight: 2.2× baseline (light) — 0.0723 ms median / 0.0757 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 1.77× baseline (feather) — 0.0281 ms median (2.57× faster on L4).
Ampere A100 scaling: 1.29× baseline (feather) — 0.0372 ms median (1.94× faster on A100).

## Failure modes

- 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

## Engine support

- threejs: official — `import { oitPass } from 'three/addons/tsl/display/OITPassNode.js'` (evidence: https://github.com/mrdoob/three.js/blob/r187/examples/jsm/tsl/display/OITPassNode.js, checked 2026-12-01)

## Dataflow

- Inputs: mesh, depth
- Outputs: hdr-image
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot

## Presets

### Unsorted over vs WBOIT vs sorted, four overlapping discs (glsl-fragment; rendered 2026-11-29)

```json
{
  "alpha": 0.55,
  "depths": [
    1,
    2,
    3,
    4
  ]
}
```

```glsl
// 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

## Combines with

- [Hashed alpha testing / alpha-to-coverage for foliage](https://texelatlas.vercel.app/t/hashed-alpha-testing.md): Hashed cutouts handle opaque-ish foliage while WBOIT handles the genuinely translucent layers in the same frame.

## Sources

1. [primary] Morgan McGuire, Louis Bavoil Weighted Blended Order-Independent Transparency. jcgt.org. https://jcgt.org/published/0002/02/09 (verified via http on 2026-11-29)
2. [implementation] stevinz (2022) stevinz/three-wboit. https://github.com/stevinz/three-wboit License: MIT. (verified via github on 2026-11-29)
3. [implementation] mhalber (2019) mhalber/Weighted-Blended-OIT. https://github.com/mhalber/Weighted-Blended-OIT License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Weighted blended order-independent transparency." https://texelatlas.vercel.app/t/weighted-blended-oit/ (accessed 2026-12-01).
