Feature Library
0.94 GPU · 0.45 CPU ms
A still of the Wear and grime demo
Still
The live demo starts when it’s in view.Click a thing to throw mud at it · drag to orbit · the card picks a thing for the keyboard

Paint that wears through on edges and corners, dirt and rust that gather in crevices, and grime the world leaves.

What it costs a frame

0.94 ms
0.45 ms
GPU
0.94 ms
CPU, median
0.45 ms
CPU, 95th pct
0.74 ms
Draw calls
11
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 0.94–1.20, CPU 0.30–0.55 ms). What ran: Measured with four things (2,600 to 13,000 vertices each) drawn by two taught materials from one wear bank, ageing by itself in a 30 s loop and the figure walking through the puddle (grime stepped ten times a second, packed and uploaded); a 2048² key-light shadow map and a room environment. Each lit pixel reads the triplanar wear noise six times. 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.940.450.74
apple · Apple A19 Proin a browser tab · 16 November 20264.850.520.72
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20266.550.991.48

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

  1. Vehicles, props and machines that look used, and get more used as play goes on
  2. A level whose things age with its story: new at the start, worn by the end
  3. Characters whose clothes take mud from the ground and lose it in the rain
  4. Many worn things on screen at once without a material each
  5. Checking where a model’s edges and crevices are before texturing it
  6. A quick weathered look for generated or kitbashed models that have no hand-painted textures

Pitfalls, in brief

  1. The bake lives in the vertices, so a mesh needs vertices where the wear goes: a box of eight corners has nowhere to put a worn edge, and its faces fade from edge to edge.
  2. Weld before measuring.
  3. Fill the voxel copy solid before marching rays through it.
  4. Start each ray about one and a half voxels off the surface, and keep it at least 8° up from the face: from the surface itself, every ray strikes its own voxel, and a grazing ray strikes the next step of the voxel stair.
  5. Every mesh drawn with a taught material needs the wear attribute: three warns and reads zeros where it is missing, and the shader for that geometry is a different one.
5 more in brief
  1. Read the wear on the model at rest (positionGeometry, normalGeometry), never where it is posed: a skinned part bending or turning slides through its own dirt.
  2. Vertex colours multiply after a node material’s colour, so dirt over a dark paint comes out darker still.
  3. Write wear into the slot, never into the material: changing a uniform or a define per thing would mean a material per thing and a pipeline each.
  4. Without WebGPU, make the bank with textures: WearBank.needsTextures(renderer) (after renderer.init()).
  5. Bake once, when the mesh is made or loaded (tens of milliseconds for ten thousand vertices): not in a frame.
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.

wearedge wearchipped paintgrimedirtrustmudweatheringcurvatureambient occlusioncavityvertex bakevoxelsraystriplanarstorage bufferone materialslotsrainwetageingtslno dependencies

Near it in the frame