Feature Library

Compute gallery

1.60 GPU · 0.58 CPU ms
A still of the Compute gallery demo
Still
The live demo starts when it’s in view.Arrows, Page Up/Down or the numbers to travel · drag the metal or the glass · click the dish or the vase

A dark exhibition of six WebGPU compute techniques, each a reusable module on its own plinth.

What it costs a frame

1.60 ms
0.58 ms
GPU
1.60 ms
CPU, median
0.58 ms
CPU, 95th pct
1.05 ms
Draw calls
24
Compute passes
4
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: Measured touring by itself, a station every 1.6 s (each glide 0.9 s), so the median spans every station; only the station in view (and the one being left, during a glide) simulates. Full element counts. 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.600.581.05
apple · Apple A19 Proin a browser tab · 16 November 202611.60.240.42
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20267.471.883.04

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.0three/addons RoundedBoxGeometry and BloomNode (the hall and the grade only)

What it’s for

  1. A showcase or attract loop of GPU effects in one world
  2. Liquid metal, blobs and morphing sculptures
  3. A liquid that sloshes in a container you can tilt
  4. Growing networks, roots, veins and paths between points
  5. Organic patterns (coral, stripes, a maze) grown on a mesh
  6. Objects that crumble into dust and reform
  7. Teaching parallel sorting, or any compute pass you want to see
  8. A gallery or museum layout with stations and a guided camera

Pitfalls, in brief

  1. renderer.compileAsync(scene, camera) culls to the camera and builds for the target that is set.
  2. A mesh whose vertices come from a storage buffer must not carry a placeholder normal attribute: three derives its specular anti-aliasing from the geometry normal’s screen slope, and zeros there make every surface fully rough (chrome looked like porcelain).
  3. WebGPU has integer atomics only: MPM scatters through fixed point (×1e7).
  4. Meshing a particle liquid straight from its density looks lumpy (a few particles a cell is noisy), and a lattice start beats against the grid.
  5. three’s transmission on a liquid inside a transparent glass came out grey and colourless here: the liquid samples the copied frame itself (viewportSharedTexture, bent by its normal) and absorbs by the length seen through it (Beer–Lambert) through backdropNode.
5 more in brief
  1. compileAsync run in the background (a rebuild while frames draw) puts back the render target it started with each time it pauses: set the canvas target (null) at the start of every frame.
  2. Several dispatches with different uniforms in one frame (the sort’s passes) need one renderer.compute call each: uniforms are written once per call.
  3. Only the station in view simulates: keep its clock its own (the vase’s blasts, the glass’s rocking) so a station resumes where it was, and prime each at load so one seen in passing has already grown.
  4. Physarum agents that start in a small ring collapse into one loop: scatter them over the whole dish.
  5. A new element count rebuilds the station in view first, then the others nearest first, each compiled ahead (compute, then its draw from its own shot with a camera of its own) and primed before it is swapped in; until then the old one runs on.
10 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

Written for the library. Fully custom code.

William Lorensen & Harvey Cline, Marching cubes (SIGGRAPH 1987): The surface from a scalar field; the case table here is built from the cube’s faces rather than copied.

Geoff, Brian & Craig Wyvill, Data structure for soft objects (1986): The (1 − d²/R²)³ falloff the metaballs sum.

Yuanming Hu et al., A moving least squares material point method (SIGGRAPH 2018): MLS-MPM, the liquid’s solver.

Chenfanfu Jiang et al., The affine particle-in-cell method (SIGGRAPH 2015): APIC transfers between particles and grid.

Niall Tessier-Lavigne, MLS-MPM guide and “88 lines” fluid: The weakly compressible fluid’s constants and step order, written here from the description.

Jeff Jones, Characteristics of pattern formation in approximations of Physarum transport networks (2010): The sense–turn–move–deposit agents.

Sage Jenson, physarum artworks (2019): Inspiration for the look of glowing networks.

P. Gray & S. K. Scott (1983); John Pearson, Complex patterns in a simple system (1993): The reaction–diffusion model and its pattern classes.

Karl Sims, Reaction-diffusion tutorial: The grid form: diffusion 1.0 and 0.5, the 3×3 Laplacian weights, coral feed and kill.

Kenneth Batcher, Sorting networks and their applications (1968): The bitonic sort.

Ken Perlin, Improving noise (SIGGRAPH 2002): The smootherstep the glide eases with.

Mark Jarzynski & Marc Olano, Hash functions for GPU rendering (2020): PCG, through three’s TSL hash: the agents’ randomness and the grain.

three.js RoundedBoxGeometry and BloomNode: The plinths and the bloom in the grade (MIT, imported from three/addons, not copied).

computetslmarching cubesindirect drawatomicsmetaballsmls-mpmfluidphysarumslime mouldagentsreaction-diffusiongray-scottparticlesdisintegratebitonic sortgpu sortstorage textureshowcasegallerycamera glidebloomno dependencies

Near it in the frame