{
 "id": "dual-filter-bloom",
 "title": "Dual-filter and progressive-downsample bloom",
 "aliases": [
  "Call of Duty bloom",
  "progressive downsample bloom"
 ],
 "domain": "post",
 "subdomain": "glow",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 2014,
 "inputs": [
  "hdr-image"
 ],
 "outputs": [
  "hdr-image"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "Bloom built by downsampling the HDR image through a chain of mips with a wide-footprint filter, then upsampling and adding the levels back; the cost stays small even for very large glow radii.",
 "how_it_works": "Rather than one huge blur, the image is repeatedly halved. Each downsample uses a 13-tap tent-like pattern arranged to avoid fireflies and aliasing: weighted overlapping 4-tap groups around the pixel, with a Karis average on the first level so a single hot pixel cannot dominate. The result at the lowest mip has an effective radius of many pixels at tiny cost. The chain is then walked back up: each level is upsampled with a 3x3 tent filter, optionally multiplied by a per-level weight and added to the next-larger mip. The final blend adds the combined glow, scaled by an intensity, to the HDR scene before tonemapping. Thresholding is optional and often omitted for a physically motivated, energy-conserving look.",
 "when_to_use": "Choose it for HDR glow around emissives and specular highlights, particularly on mobile and WebGL where wide Gaussians are too slow.\n\nPrefer a thresholded Gaussian when you need a tight, art-directed halo. Prefer `lens-flare` for streaks and ghosts rather than isotropic glow; the two share the downsampled mip chain.",
 "cost": {
  "class": "cheap",
  "notes": "About 2 x log2(height) small passes with shrinking cost; qualitative."
 },
 "failure_modes": [
  "Without the Karis average a single bright pixel produces flickering blobs",
  "Blocky or shimmering glow if the filter is replaced by plain bilinear downsample",
  "Bloom in LDR after tonemapping looks washed out",
  "Fixed mip radii give resolution-dependent glow size"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare",
   "type": "talk",
   "title": "Next Generation Post Processing in Call of Duty: Advanced Warfare",
   "authors": [
    "Jorge Jimenez"
   ],
   "year": null,
   "venue": "SIGGRAPH 2014 Advances in Real-Time Rendering",
   "url": "https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261115081758/https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare/",
     "timestamp": "20261115081758"
    },
    "page_title": "Jorge Jimenez &#8211; Game Developer &#8211; Next Generation Post Processing in Call of Duty: Advanced Warfare",
    "host": "iryoku.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare → 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": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "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": 0.95,
   "__bib": "jimeneznext"
  },
  {
   "role": "tutorial",
   "key": "url:https://learnopengl.com/Advanced-Lighting/Bloom",
   "type": "tutorial",
   "title": "Bloom",
   "authors": [
    "Joey de Vries"
   ],
   "year": null,
   "venue": "learnopengl.com",
   "url": "https://learnopengl.com/Advanced-Lighting/Bloom",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261108174543/https://learnopengl.com/Advanced-Lighting/Bloom",
     "timestamp": "20261108174543"
    },
    "page_title": "LearnOpenGL - Bloom",
    "host": "learnopengl.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://learnopengl.com/Advanced-Lighting/Bloom → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://learnopengl.com/Advanced-Lighting/Bloom → 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://learnopengl.com/Advanced-Lighting/Bloom → 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": 0.6666666666666666,
   "__bib": "vriesbloom"
  },
  {
   "role": "implementation",
   "key": "gh:pmndrs/postprocessing",
   "type": "code",
   "title": "pmndrs/postprocessing",
   "description": "A post processing library for three.js.",
   "authors": [
    "pmndrs"
   ],
   "year": 2015,
   "venue": "GitHub",
   "url": "https://github.com/pmndrs/postprocessing",
   "ids": {
    "repo": "pmndrs/postprocessing"
   },
   "license": "Zlib",
   "extra": {
    "stars": 3009,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-22T15:27:35Z",
    "language": "JavaScript",
    "homepage": null,
    "license_name": "zlib License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmndrs/postprocessing",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmndrs/postprocessing",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmndrs/postprocessing",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmndrs/postprocessing",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmndrs/postprocessing",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmndrs/postprocessing",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "pmndrs2015pmndrs"
  }
 ],
 "presets": [
  {
   "id": "dual-filter-bloom-specimen",
   "title": "Left: HDR frame tonemapped. Right: bloom from a 3-level dual-filter pyramid (5-tap down-sample chain, bright-pass first)",
   "runtime": "glsl-fragment",
   "params": {
    "HPX": 3,
    "BI": 1.2
   },
   "code": "float hash(vec2 c){uvec2 u=uvec2(ivec2(floor(c)));uint h=u.x*1597334673u^u.y*3812015801u;h^=h>>15;h*=2246822519u;h^=h>>13;h*=3266489917u;h^=h>>16;return float(h)*(1./4294967296.);}\nfloat lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}\nvec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}\n\nconst float HPX=3.0; // P\nconst float BI=1.2; // P\nvec3 src(vec2 p){\n  vec3 c=vec3(.02,.025,.04)+vec3(.08,.05,.1)*(p.y+.5);\n  c=mix(c,vec3(.15,.12,.1),smoothstep(.002,-.002,abs(length(p-vec2(0.,-.2))-.11)-.02));\n  c+=vec3(1.,.8,.5)*30.*smoothstep(.002,-.002,length(p-vec2(-.1,.2))-.025);\n  c+=vec3(.4,.7,1.)*30.*smoothstep(.002,-.002,length(p-vec2(.12,.0))-.02);\n  c+=vec3(1.,.4,.4)*30.*smoothstep(.002,-.002,max(abs(p.x+.02),abs(p.y+.3)*.1-.0)-.008)*step(abs(p.y+.3),.1);\n  return c;}\nvec3 D0(vec2 p){return max(src(p)-1.,vec3(0.));}\nvec3 D1(vec2 p,float h){return(4.*D0(p)+D0(p+h*vec2(1.,1.))+D0(p+h*vec2(-1.,1.))+D0(p+h*vec2(1.,-1.))+D0(p-h*vec2(1.,1.)))/8.;}\nvec3 D2(vec2 p,float h){float g=2.*h;return(4.*D1(p,h)+D1(p+g*vec2(1.,1.),h)+D1(p+g*vec2(-1.,1.),h)+D1(p+g*vec2(1.,-1.),h)+D1(p-g*vec2(1.,1.),h))/8.;}\nvec3 D3(vec2 p,float h){float g=4.*h;return(4.*D2(p,h)+D2(p+g*vec2(1.,1.),h)+D2(p+g*vec2(-1.,1.),h)+D2(p+g*vec2(1.,-1.),h)+D2(p-g*vec2(1.,1.),h))/8.;}\nvec3 D4(vec2 p,float h){float g=8.*h;return(4.*D3(p,h)+D3(p+g*vec2(1.,1.),h)+D3(p+g*vec2(-1.,1.),h)+D3(p+g*vec2(1.,-1.),h)+D3(p-g*vec2(1.,1.),h))/8.;}\nvoid mainImage(out vec4 fragColor,in vec2 fragCoord){\n  vec2 uv=(fragCoord-.5*iResolution.xy)/iResolution.y;bool R=uv.x>0.;vec2 q=vec2(uv.x+(R?-.25:.25),uv.y);\n  vec3 c=src(q);\n  if(R){float h=HPX/512.;c+=BI*(D2(q,h)+D3(q,h));}\n  vec3 col=gam(c/(1.+c*.5));\n  if(abs(uv.x)<.0015)col=vec3(1.);fragColor=vec4(col,1.);\n}",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "dual-filter-bloom",
     "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.3051,
      "std": 0.1566,
      "unique_colors": 198
     },
     "image": "/specimens/dual-filter-bloom-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "lens-flare",
  "auto-exposure-histogram"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "lens-flare",
   "why": "The bloom mip chain doubles as the source texture for ghosts and halos."
  },
  {
   "id": "depth-of-field-scatter-as-gather",
   "why": "Both rely on an HDR buffer and the same downsample infrastructure."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/post/dual-filter-bloom.json"
 },
 "solves": [
  "glow around bright lights is too expensive on mobile",
  "wide gaussian blur kills my frame rate",
  "need big soft glow radius at low cost in webgl",
  "emissive surfaces should bleed light into surroundings"
 ],
 "authority": "Jimenez",
 "url": "https://texelatlas.vercel.app/t/dual-filter-bloom/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 108.49,
  "tier": "extreme",
  "p50_ms": 3.5692,
  "p95_ms": 3.6353,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "dual-filter-bloom-specimen",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 52.39,
   "tier": "heavy",
   "p50_ms": 0.833,
   "p95_ms": 0.8448,
   "speedup_x": 4.28,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 56.1,
   "tier": "heavy",
   "p50_ms": 1.6156,
   "p95_ms": 1.6283,
   "speedup_x": 2.21,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}