Feature Library

Post stack: AO, bloom, shine smoothing

2.08 GPU · 0.56 CPU ms
A still of the Post stack: AO, bloom, shine smoothing demo
Still
The live demo starts when it’s in view.Drag the handle to compare before and after · switch each pass in the card · Measure times them · drag to orbit

Ambient occlusion (GTAO from the frame’s own depth), bloom that only takes light brighter than lit white, specular anti-aliasing in every lit material and a…

What it costs a frame

2.08 ms
0.56 ms
GPU
2.08 ms
CPU, median
0.56 ms
CPU, 95th pct
0.77 ms
Draw calls
68
Weight
Heavy

Measured 13 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 1.81–2.08, CPU 0.56–0.63 ms). What ran: The courtyard at 1× with all four passes on at their defaults (AO High at full resolution, bloom Subtle, shine smoothing High, the grade), the split off, the camera swaying so every frame is drawn. Standing still with nothing changing, nothing is drawn. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool2.080.560.77
apple · Apple A19 Proin a browser tab · 16 November 202617.10.501.38
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 202615.71.902.76

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
three.js 0.187.0No other packages

What it’s for

  1. Contact shade where things meet, in any three.js WebGPU scene, without an extra scene pass
  2. Glow round lamps, neon and sparks that never washes out lit white walls or snow
  3. Stopping highlights flickering on bumpy, ridged or finely detailed glossy surfaces
  4. A graphics menu where each pass switches on and off without a hitch
  5. Before/after comparisons of a look
  6. Top-down and orthographic game views (the AO takes the camera axis)

Pitfalls, in brief

  1. It reaches into three r187 internals: Renderer._getFrameBufferTarget and _textures, NodeManager.getOutputNode and getOutputCacheKey, NodeLibrary.toneMappingNodes and the standard and physical materials’ setupVariants.
  2. It needs three’s frame buffer, which three makes when it tone-maps or converts colour space (the default).
  3. Draw with post.render(), not renderer.render(scene, camera): it arms the passes and shows the AO’s marker for that one frame.
  4. The AO spares transparents by draw order: those with renderOrder above 2.5 (AO_SURFACE_ORDER) are left out by how much of the pixel they cover; those below take the shade like the ground under them. three’s default renderOrder is 0, so particles, glass and markers must be raised above 2.5 or they get the corner’s shade.
  5. What glows is spared from the AO by brightness (linear max channel from 1 to 2, AO_GUARD).
9 more in brief
  1. setAo and setBloom build their passes and a new copy: a short compile on the next frame, Low to High included.
  2. The AO radius is in world units (metres in the source): scale it with your scene.
  3. The bloom threshold is linear brightness before exposure and the tone curve, with lit white near 0.85–1.
  4. Shine smoothing patches three’s standard and physical material prototypes for the whole page: install it before anything compiles (materials built before keep their shaders), and uninstall it when you leave.
  5. Shine smoothing calms highlights from normals that turn within a pixel; it cannot undo a pattern that aliases outright.
  6. The grade is three’s CustomToneMapping on that renderer: set renderer.toneMapping = THREE.CustomToneMapping. three keeps one custom curve a renderer, so a second one (yours, or another entry’s) conflicts.
  7. A mask is built into the copy and the materials: give it at install and construction, as a node driven by a uniform (the demo’s split is step(split, screenUV.x)).
  8. On a weak GPU pass tier to the PostStack: the AO is nearly all its cost, so medium draws High at 0.75 of the resolution and low at half with 2 slices of 4 steps (radius and strength unchanged).
  9. The glow is sized from the drawing buffer (three’s BloomNode) and the AO from the frame buffer: the same at full scale.
14 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Adapted from published work, named below.

Jorge Jimenez, Xian-Chun Wu, Angelo Pesce, Adrian Jarabo, “Practical Real-Time Strategies for Accurate Indirect Occlusion” (GTAO, SIGGRAPH 2016): The method: horizons searched along screen slices, the cosine-weighted slice integral, the projected normal.

Intel XeGTAO (MIT): The AO follows its formulation closely: the slice integral as it writes it, the horizon falloff with its 0.615 share, the low horizon the falloff blends to, the quadratic step spacing and the minimum first step. Written in TSL, not copied text; its MIT notice is kept in NOTICE.md. Not taken: its denoiser, Hilbert noise and thickness heuristic.

Anton Kaplanyan and Stephen Hill (Hoffman), “Filtering Distributions of Normals for Shading Antialiasing” (HPG 2016), as Filament implements it: Shine smoothing widens GGX’s alpha² by the variance of the normal’s screen derivatives, capped.

three.js BloomNode and neutralToneMapping (MIT): The bloom extends three’s mip-chain BloomNode (its bright pass replaced); the grade calls three’s Khronos PBR Neutral curve. Both stay in three: nothing of theirs is copied.

Third-party terms ship with it in NOTICE.md.

ambient occlusiongtaobloomspecular anti-aliasingshine flickercolour gradingtone mappingtslthree.jswebgputhree internalsa/b comparepost-processing

Near it in the frame