Feature Library

GPU particles with collisions and emitters

0.69 GPU · 0.23 CPU ms
A still of the GPU particles with collisions and emitters demo
Still
The live demo starts when it’s in view.Pick an effect · click or tap the floor or a box to burst there · drag to orbit

A general compute-particle core: emitters as plain data, noise turbulence, buoyancy and vortex forces, particles that bounce, slide or stick on floors and…

What it costs a frame

0.69 ms
0.23 ms
GPU
0.69 ms
CPU, median
0.23 ms
CPU, 95th pct
0.39 ms
Draw calls
8
Compute passes
3
Weight
Moderate

Measured 3 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured on the Fireworks preset at rate ×3: a shell about every 0.3 s, each shell’s 12 particles bursting into 192 stars on the GPU (a sub-emitter on death) that bounce on the floor and boxes, and a flash light timed to each burst. Only the glow layer is alive, so only it simulates and draws. 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 tool0.690.230.39
apple · Apple A19 Proin a browser tab · 16 November 20262.100.080.10
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20262.560.821.30

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. Sparks, fire and smoke
  2. Fireworks and magic
  3. Rain with splashes
  4. Falling petals and leaves
  5. Debris that stays
  6. Impacts and blood that stick

Pitfalls, in brief

  1. The demo needs WebGPU, and so does the module: every layer is a compute pass over storage buffers, spawning scatters requests into a ring, and child emitters (the fireworks’ bursts, sparks that splash) append events with atomic counters that a sub-emit pass turns into new particles.
  2. TSL: an If(cond, () => x.assign(y)) arrow that returns a node is a return and ends the whole pass.
  3. Round an interpolated style index (+ 0.5) before toInt(): 0.99999 truncates to the style before, and particles draw as another effect.
  4. WebGPU allows 8 storage buffers a stage by default: the state is five vec4s a particle interleaved in one buffer, and the field’s static and moving boxes share one.
  5. A floor cell’s empty heights must read as no floor (NO_FLOOR, checked), or every particle falls to them, through the world.
7 more in brief
  1. Every shape fades out before its quad’s border: noise-warped edges otherwise show a square.
  2. Give the sprite geometry its normal attribute from the start and draw it single-pass (forceSinglePass): either, added on the first burst, built a new pipeline then (about 250 ms on D3D).
  3. Hidden layers are skipped by compileAsync, and the debris’s shadow pipeline is built only by a real draw: warm(renderer, camera, scene) shows them for the compile and draws them empty for a quarter second.
  4. A batch first drawn with no instances draws nothing later: instanceCount never goes below 1.
  5. Sprites are placed in vertexNode, so three’s fog sees the quad, not the particle: pass fogPosition to hand each corner’s world position to a fog node of your own.
  6. The turbulence is vector noise, not divergence-free curl noise: strong values bunch particles up.
  7. Soft edges fade by height above the floor under each particle, not by the depth buffer (a multisampled depth cannot be sampled by a material).
12 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

Ken Perlin, improved noise (2002): The turbulence and the smoke’s edges read three.js’s MaterialX noise nodes (mx_noise_vec3, mx_noise_float): imported from three, not copied.

PCG random (Melissa O’Neill): Per-particle randomness is three’s TSL hash node, a PCG hash: imported from three, not copied.

Rodrigues’ rotation formula: Debris tumbles about its own axis by it. The formula, not code.

computevfxemitterssub-emitterscollisionnoiseprocedural spritesinstancingtsl

Near it in the frame