{
 "id": "weighted-blended-oit",
 "title": "Weighted blended order-independent transparency",
 "aliases": [
  "WBOIT",
  "weighted blended OIT"
 ],
 "domain": "visibility",
 "subdomain": "order-independent transparency",
 "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",
 "summary": "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.",
 "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": "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` 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.",
 "cost": {
  "class": "cheap",
  "notes": "One geometry pass with blending into two small targets plus a fullscreen composite; cost is dominated by overdraw bandwidth, not sorting."
 },
 "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"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://jcgt.org/published/0002/02/09",
   "type": "web",
   "title": "Weighted Blended Order-Independent Transparency",
   "authors": [
    "Morgan McGuire",
    "Louis Bavoil"
   ],
   "year": null,
   "venue": "jcgt.org",
   "url": "https://jcgt.org/published/0002/02/09",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261111034734/https://jcgt.org/published/0002/02/09/",
     "timestamp": "20261111034734"
    },
    "page_title": null,
    "host": "jcgt.org",
    "title_confirmed_by_page": false,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://jcgt.org/published/0002/02/09 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://jcgt.org/published/0002/02/09 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "mcguireweighted"
  },
  {
   "role": "implementation",
   "key": "gh:stevinz/three-wboit",
   "type": "code",
   "title": "stevinz/three-wboit",
   "description": "Weighted, blended order independent transparency pass for use with three.js.",
   "authors": [
    "stevinz"
   ],
   "year": 2022,
   "venue": "GitHub",
   "url": "https://github.com/stevinz/three-wboit",
   "ids": {
    "repo": "stevinz/three-wboit"
   },
   "license": "MIT",
   "extra": {
    "stars": 67,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2023-08-03T01:18:44Z",
    "language": "JavaScript",
    "homepage": "https://stevinz.github.io/three-wboit",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/stevinz/three-wboit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/stevinz/three-wboit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/stevinz/three-wboit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/stevinz/three-wboit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/stevinz/three-wboit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/stevinz/three-wboit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "stevinz2022stevinz"
  },
  {
   "role": "implementation",
   "key": "gh:mhalber/weighted-blended-oit",
   "type": "code",
   "title": "mhalber/Weighted-Blended-OIT",
   "description": "Simple implementation of \"Weighted Blended Order-Independent Transparency\" by McGuire & Bavoil '13",
   "authors": [
    "mhalber"
   ],
   "year": 2019,
   "venue": "GitHub",
   "url": "https://github.com/mhalber/Weighted-Blended-OIT",
   "ids": {
    "repo": "mhalber/Weighted-Blended-OIT"
   },
   "license": "MIT",
   "extra": {
    "stars": 22,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2020-01-13T00:38:05Z",
    "language": "C",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mhalber/Weighted-Blended-OIT",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mhalber/Weighted-Blended-OIT",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mhalber/Weighted-Blended-OIT",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mhalber/Weighted-Blended-OIT",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mhalber/Weighted-Blended-OIT",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mhalber/Weighted-Blended-OIT",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "mhalber2019mhalber"
  }
 ],
 "presets": [
  {
   "id": "wboit-overlap-vs-unsorted",
   "title": "Unsorted over vs WBOIT vs sorted, four overlapping discs",
   "runtime": "glsl-fragment",
   "params": {
    "alpha": 0.55,
    "depths": [
     1,
     2,
     3,
     4
    ]
   },
   "code": "// GLSL ES 3.0, Shadertoy-style. Left: unsorted \"over\" blending. Middle: weighted blended OIT. Right: sorted reference.\nconst float ALPHA = 0.55;\nconst vec4 Z = vec4(1.0, 2.0, 3.0, 4.0); // view depth per layer (index 0 is farthest)\n\nvec3 layerColor(int i) {\n  if (i == 0) return vec3(0.95, 0.25, 0.20);\n  if (i == 1) return vec3(0.95, 0.80, 0.15);\n  if (i == 2) return vec3(0.15, 0.75, 0.35);\n  return vec3(0.20, 0.35, 0.95);\n}\nvec2 layerCenter(int i, float t) {\n  float a = t * 0.6 + float(i) * 1.57;\n  return vec2(0.13 * cos(a), 0.13 * sin(a)) + vec2(-0.08 + 0.055 * float(i), 0.0);\n}\nfloat coverage(int i, vec2 p, float t) {\n  return step(length(p - layerCenter(i, t)), 0.20);\n}\nfloat weightFn(float z, float a) {\n  return a * clamp(10.0 / (1e-5 + pow(z / 5.0, 3.0) + pow(z / 200.0, 6.0)), 1e-2, 3e3);\n}\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = fragCoord / iResolution.xy;\n  float panel = floor(uv.x * 3.0);\n  vec2 p = vec2(fract(uv.x * 3.0) - 0.5, uv.y - 0.5);\n  vec3 bg = mix(vec3(0.92), vec3(0.55, 0.60, 0.70), uv.y);\n  vec3 col = bg;\n  float t = iTime;\n  if (panel < 0.5) {\n    int order[4] = int[4](2, 0, 3, 1);                  // arbitrary submission order, no sorting\n    for (int k = 0; k < 4; k++) {\n      int i = order[k];\n      float c = coverage(i, p, t) * ALPHA;\n      col = mix(col, layerColor(i), c);\n    }\n  } else if (panel < 1.5) {\n    vec3 accum = vec3(0.0); float aw = 0.0; float reveal = 1.0;\n    for (int i = 0; i < 4; i++) {\n      float cov = coverage(i, p, t);\n      float w = weightFn(Z[i], ALPHA) * cov;\n      accum += layerColor(i) * w;\n      aw += w;\n      reveal *= 1.0 - cov * ALPHA;\n    }\n    vec3 avg = accum / max(aw, 1e-5);\n    col = mix(bg, avg, 1.0 - reveal);\n  } else {\n    for (int i = 0; i < 4; i++) {                       // back to front\n      col = mix(col, layerColor(i), coverage(i, p, t) * ALPHA);\n    }\n  }\n  if (abs(fract(uv.x * 3.0) - 0.5) > 0.495) col = vec3(1.0);\n  fragColor = vec4(col, 1.0);\n}\n",
   "basis": "0",
   "license_note": "written for this index; weight function follows the formula family in the cited paper",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "weighted-blended-oit",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.7109,
      "std": 0.1302,
      "unique_colors": 79
     },
     "image": "/specimens/wboit-overlap-vs-unsorted.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "hashed-alpha-testing",
  "temporal-anti-aliasing",
  "froxel-volumetric-fog",
  "clustered-forward-shading"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "hashed-alpha-testing",
   "why": "Hashed cutouts handle opaque-ish foliage while WBOIT handles the genuinely translucent layers in the same frame."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/visibility/weighted-blended-oit.json"
 },
 "solves": [
  "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"
 ],
 "authority": "McGuire & Bavoil",
 "url": "https://texelatlas.vercel.app/t/weighted-blended-oit/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 2.2,
  "tier": "light",
  "p50_ms": 0.0723,
  "p95_ms": 0.0757,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "wboit-overlap-vs-unsorted",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.77,
   "tier": "feather",
   "p50_ms": 0.0281,
   "p95_ms": 0.0281,
   "speedup_x": 2.57,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1.29,
   "tier": "feather",
   "p50_ms": 0.0372,
   "p95_ms": 0.0373,
   "speedup_x": 1.94,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}