The live demo starts when it’s in view.Click the ground to walk · drag to look round · try the cart, the boat and your hand
One shared touch field that anything moving presses (walkers, a cart, a boat, the pointer), and responders that read it in their vertex stage.
What it costs a frame
GPU
0.55 ms
CPU
1.77 ms
02468101216.7 ms
GPU
0.55 ms
CPU, median
1.77 ms
CPU, 95th pct
3.85 ms
Draw calls
40
Weight
Moderate
Measured 15 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 0.55–0.55, CPU 1.64–1.81 ms). What ran: Measured on the tour, stepped a 60th of a second a frame (so the uncapped run walks it as at 60 Hz): the measured frames begin with the walker in the hedge and follow it through the reeds and flowers into the lily pond (rings, wake, pads), so bushes, stems, pads and water all move, with kick-ups, a 2048 shadow map and the touch field pressed and uploaded on the CPU every frame. The wallow (station 7) lies behind the start: nobody wades it in the measured frames, so its pool sleeps and costs only its draw where it is in view. The preview is posed: the hedge parting with the pond behind, held still. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
4.03
1.36
1.80
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
3.74
2.21
3.12
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
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
three.js 0.187.0No other packages
What it’s for
A player walking through bushes, reeds and tall grass that part and spring back
A vehicle laying plants over and leaving them to stand up again
Lily pads, leaves or debris on a pond pushed aside by a wader or a boat
A curtain of vines, a willow or a bead curtain swinging aside as someone passes
A pointer brushing through a garden or a product scene
Leaves, pollen, snow and fliers released where something disturbs the plants
Footprints in frost, and a path through leaf litter that stays clear
Tuning each plant’s response per kind and keeping the values in a game’s content
Wading through mud, slush, honey or any thick liquid that is pushed aside and flows shut behind
Wheel ruts through a mud patch that close again, and footprints carried out of it
A finger drawing a furrow through a thick liquid in a product or a toy
Pitfalls, in brief
Turn a plant, never shear it.
The ring’s addressing: a world cell lives in slot (i mod size, j mod size).
A plant outside the field reads nothing, and a cell that leaves the window is forgotten: a bush mid-swing snaps to rest and shaken snow comes back.
Keep each CPU twin and its node in step: the tests run the shader’s own WGSL functions on the CPU (wgsl-cpu.mjs) against the twins.
Low leaves stop at the ground: a bush leaning toward a low leaf would push it underground, so the turned point keeps its height at 0 (it slides a few centimetres instead).
14 more in brief
A pad must never pass through the walker.
Cap how far a vehicle lays a plant over: a vehicle presses three times as hard, and without a cap it folds a bush under itself.
Keep the ring’s size even (TouchCore rounds it): half an odd size puts the window’s corner between cells, and the cells leaving it are never cleared.
On three’s WebGL2 backend, set pixel-store values through its own state (backend.state.pixelStorei), never gl.pixelStorei directly: three caches them, and a stale cache uploads its next flipped texture upside down.
Upload only the rows written: the field is 1 MB a texture at 256 cells.
The field’s clock is single precision, as the texture and the shaders hold it: keep it in Math.fround on the CPU, or a cell pressed this frame reads a few microseconds old and a test of “pressed now” fails.
Normals turn with the plant through a varying worked out in the vertex stage.
The field is flat: it knows where something presses, not how high.
A thick liquid keeps a field of its own per pool, not the touch field: a trough is a signed height with a rim beside the cut that closes without a bounce on the liquid’s own time, and a pool must keep it wherever the camera goes, while the touch field holds a push and when it was let go, springs back past rest and forgets what leaves its ring.
Hand a pool what touches the liquid, not the size the touch field parts plants with: a walker’s 0.5 m reach would dig a trench nearly 2 m wide, and a cart’s one body would plough instead of cutting two ruts.
Give a pool’s pushers an id: it sweeps each from where it was a frame ago.
Never cut a pool’s top to its floor: it stops a film above it (STICKY_FILM), or the two fight for the same pixels.
A pool’s depth comes from the floor under it: its shader must work out the same floor the ground is built from, or a trough digs under the floor or stops short of it.
A pool asleep does nothing: it wakes on a push and sleeps once flat again.
19 pitfalls in full, the hook-up guide, the module source and its tests come with the part.
Where it comes from
From HaTac, and in the garden walk showcase. Fully custom code.
Tommy Ettinger, mulberry32 (public domain): The seeded random numbers the plants and the kick-ups are drawn with (plant-instances.ts `seeded`).
Charts made of falling sand: page elements become glasses that fill with real grains to each value, the brim at the plan and the surplus heaped over it, in…