Feature Library

Dents on any mesh

1.01 GPU · 0.88 CPU ms
A still of the Dents on any mesh demo
Still
The live demo starts when it’s in view.Click the car, a barrel or the sign to dent it · click the floor to roll a ball through that spot · drag to orbit

Crash dents on car bodies, barrels, panels and props, drawn by the GPU from one small table of objects × dent slots.

What it costs a frame

1.01 ms
0.88 ms
GPU
1.01 ms
CPU, median
0.88 ms
CPU, 95th pct
1.50 ms
Draw calls
62
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.01–1.07, CPU 0.53–0.89 ms). What ran: Measured with nine dents placed ahead on all four things (so every dented mesh runs its loops per vertex and per pixel) and a ball rolled at something every 1.2 s, its dents popping in; a repair every 6 s. Shadows from one key light and a room environment. Standing still outside the bench, nothing is drawn at all. 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.010.881.50
apple · Apple A19 Proin a browser tab · 16 November 202610.21.184.66
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20267.771.562.62

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.

How steadily it runs on Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258V · in a browser tab

Typical frame ?
13.42 ms
1% low ?
42 fps
Varies by ?
±2.61 ms
All metricsIntel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258V · in a browser tab
p50p95p997.16 ms22.80 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run back to back, each starting once the GPU has finished the last, so frame times show the work itself. They have a floor of about 4–5 ms from the browser’s own scheduling: GPU and CPU ms stay the measure of cost.

Frames

Median (p50) ?
13.42 ms
p95 ?
15.48 ms
p99 ?
16.28 ms
Slowest ?
39.87 ms
Mean ?
12.80 ms
Standard deviation ?
2.61 ms
1% low ?
42 fps
0.1% low ?
25 fps
Hitches ?
2 of 600
Over budget ?
5 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 2.8 / 3.4 ms

Input

No input during this run. A browser-tab run plays none.

Memory

JavaScript heap ?
96.0 → 89.8 MB
Growth ?
-6.22 MB

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

  1. Car crashes in a racing or driving game: dents where it hit, deeper with each knock
  2. Props that take hits: barrels, bins, lockers, signs, doors, metal sheds
  3. A ball, a ram or debris denting what it strikes, from the contact point and speed
  4. Repairing damage over a second or two: a pit stop, a workshop, a reset
  5. Many objects sharing one material, each with its own dents
  6. Damage that must run on WebGL2 as well as WebGPU

Pitfalls, in brief

  1. Wrap a material before it is first compiled, and never change it on the first dent: the loops sit behind a per-object test (slot ≥ 0), so the same shader serves undented and dented meshes and nothing recompiles mid-game.
  2. The lean is what shows a dent on a big flat face: a panel of a few large triangles has no vertices to push.
  3. A physical material with clearcoat shades its coat with its own normal (clearcoatNormalNode), which is the plain geometry normal by default: lean only the base normal and the glossy coat stays perfectly smooth over the dent. wrap leans both.
  4. Dents live in each mesh’s own space, after skinning and morphs.
  5. Storage buffers are WebGPU only, and a WebGPU device in compatibility mode may allow none in a vertex shader.
5 more in brief
  1. Not a uniform array for WebGL2: 64 objects × 12 dents × 2 vec4s is 24 KB, over the 16 KB a uniform block is guaranteed.
  2. The table is written in place and uploaded whole when its version changes (24 KB at the defaults): call update(dt) every frame, which also plays the pops and repairs.
  3. Snap hits onto the undented surface (place, on by default): a contact box or a blast’s centre is often beside the hull, and a dent centred in the air dents nothing (the source’s widest vehicle missed by 0.45 m).
  4. A dent is a sphere in the mesh’s own space: on a mesh scaled unevenly it stretches with the mesh.
  5. The bounding sphere is not grown: dents push in, so the culling bounds still hold.
10 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.

dentsdamagedeformationvertex displacementnormal perturbationcrashimpactcar bodyvehicle damagerepairstorage bufferdata textureWebGL2 fallbackper-object uniformsshared materialsraycast placementclearcoatthree.jsTSLno dependencies

Near it in the frame