The live demo starts when it’s in view.Press, pinch, smooth or drag the clay · two fingers squeeze a ridge · on the sheet: arrows, hold Space, 1–4, [ ], Ctrl+Z
A slab of clay on a linen board that keeps every touch.
What it costs a frame
GPU
1.68 ms
CPU
0.34 ms
02468101216.7 ms
GPU
1.68 ms
CPU, median
0.34 ms
CPU, 95th pct
0.75 ms
Draw calls
0
Weight
Moderate
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.03–3.39, CPU 0.29–0.34 ms). What ran: Measured while a pressing finger travels round the slab and drags clay behind it (dirty rows uploaded as half floats, one full-canvas pass with a 14-step shadow march), timed by its own timestamp queries. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
9.60
0.50
0.58
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
1.57
0.50
0.77
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
NothingNo other packages
What it’s for
A tactile toy or a calm, hands-on moment in an app
A sculpting or stamping surface: seals, dimples, signatures pressed in
A material for a game: a dough, a putty, a wax or a sand tray
Teaching volume that is kept: whatever you push down rises somewhere else
A soft height field to build terrain brushes on
Pitfalls, in brief
Every tool moves clay; none adds or removes it.
Heights and widths share one unit (cells), so a slope is a real slope: the slump threshold (repose) and the shading read it directly.
Diffusion that keeps volume moves flux between pairs of neighbours, each pair once, from a copy of the heights: updating cells in place from their already-updated neighbours leaks or makes clay and smears the result toward the loop’s direction.
A drag carries clay at most a cell a step: longer strokes are cut into steps, or the carried clay jumps over cells and leaves stripes.
Upload only the rows an edit touched.
6 more in brief
r16float is filterable, r32float is not without the float32-filterable feature: half floats let the hardware do the bilinear taps the bicubic filter is built from.
The shading reads the grid with a cubic filter and the shadow with plain bilinear taps; a shadow marched over the cubic heights costs four times as much for no visible gain.
Two touches always squeeze, whatever the tool: on a phone that is the gesture people try first.
One stroke is one undo step: snapshot when the first pointer or the Space key goes down, keep it only if something changed, and push it when the last one comes up.
When a tool has nowhere to put what it took (a pinch centred on bare board), give back exactly the amounts taken, kept per cell.
Draw on demand: the tools report what moved and when the clay has settled (busy), and nothing draws in between.
11 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.
Christian Sigg & Markus Hadwiger, Fast Third-Order Texture Filtering (GPU Gems 2, ch. 20, 2005): The cubic B-spline from four bilinear fetches that gives the coarse grid smooth normals.
Mark Jarzynski & Marc Olano, Hash Functions for GPU Rendering (JCGT, 2020): The PCG hash behind the grain and the grog.
Angle of repose (granular mechanics): The slump rule: a step steeper than the material holds moves a share of its excess downhill, as in sandpile models (Bak, Tang & Wiesenfeld, 1987).
claysculptheight fielddeformpresspinchsmoothsmearmass conservingangle of reposetouchmulti-touchkeyboardundobicubicsoft shadowshalf floatraw webgpuwgslcanvas 2d fallbackdraw on demandtimestamp queriesno dependencies
Light that comes in through a window, lands on the floor and bounces round the room, worked out on the GPU in a few frames instead of the half a minute…