Feature Library

Light sheets in the air

1.24 GPU · 0.46 CPU ms
A still of the Light sheets in the air demo
Still
The live demo starts when it’s in view.Drag to orbit · switch the lights in the stage · Sweep for one quick pass

Volumetric air after the scene, for three.js WebGPU in TSL.

What it costs a frame

1.24 ms
0.46 ms
GPU
1.24 ms
CPU, median
0.46 ms
CPU, 95th pct
0.81 ms
Draw calls
20
Weight
Moderate

Measured 11 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. What ran: The hall at 1920×1080: 40 steps a pixel with the level sheet scanning, the spot and the glow lit and the haze drifting, then bloom; drawn every frame. 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 tool1.240.460.81
apple · Apple A19 Proin a browser tab · 16 November 20268.690.240.34
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 202610.61.552.63

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. A laser scanner sweeping through haze
  2. Stage light and spotlight shafts
  3. Sun through a high window
  4. Lamps, portals and flares lighting the air
  5. Product reveals and title shots
  6. Museum, hall and showroom moods

Pitfalls, in brief

  1. The air is drawn after the scene from its colour and depth (a pass node’s output and depth).
  2. Call frame(camera, seconds) before every render, after the camera has moved: the march rebuilds world positions from the matrices it was given, and a stale camera smears the air across the screen as you orbit.
  3. March the air once into its own texture (convertToTexture) before bloom: bloom reading the air node directly runs the whole march a second time.
  4. The scene pass renders into its own target (half float, multisampled), not the canvas: compileAsync with that target set, or the scene’s pipelines build on the first frame.
  5. The counts of spots, sheets and glows are fixed when it is made: they are written into the shader.
9 more in brief
  1. Nothing casts shadows in the air: a spot’s cone passes through a pillar in its way.
  2. Sky pixels (depth 1) march to maxDistance.
  3. Fewer steps are cheaper but coarser in the spots and glows (the sheets are exact at any count).
  4. On a weak GPU pass tier (LIGHT_SHEETS_TIER): low marches 24 steps at a third of the canvas, medium 32 at two fifths; the blades stay exact.
  5. The march is spread back by depth: where a pixel’s neighbours in the march all lie at other depths (a thin wire against the sky), it takes the nearest in depth, and a shaft behind a thin thing can lose a pixel or two of detail.
  6. The march texture follows the canvas’s drawing-buffer size times the scale: call node() once and change resolution, never node() again (each call makes a new texture and a new shader).
  7. A sheet seen edge on would be endless: its path is held to its thickness ÷ 0.035, about 29 times as bright as face on.
  8. surface() lines use fwidth: use them in a material’s emissive or colour (a fragment), not in a vertex or compute node.
  9. In three r187 a scene’s lights are part of every material’s shader: add a light or take one away and every lit material rebuilds.
14 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From My other apps. Fully custom code.

Henyey and Greenstein, phase function (1941): The spots’ forward scattering in the haze: the published formula.

Alexander Keller and Wolfgang Heidrich, Interleaved Sampling (Eurographics Workshop on Rendering, 2001): Neighbouring pixels march with different fixed offsets and a small filter combines them: here four offsets in each 2×2 block, averaged by the upsampling’s tent.

Johannes Kopf, Michael Cohen, Dani Lischinski and Matt Uyttendaele, Joint Bilateral Upsampling (SIGGRAPH 2007): The idea behind spreading the half-size march by the full-size depth: each low-resolution sample weighted by how alike its depth is.

Beer–Lambert law: The transmittance through the haze, step by step.

Numerical Recipes’ linear congruential generator (Press et al.): The constants 1664525 and 1013904223 that fill the noise lattices.

volumetricfoghazegod rayslight shaftslaserlight sheetray marchingtslpost-processinghalf resolutiondepth-aware upsamplinghenyey–greensteininterleaved samplingdraw on demandno dependencies

Near it in the frame