01 — How it works

Four switches, four ways this goes wrong.

Each of these is a thing the library does that most versions of this effect do not, and each one fails silently — no error, no warning, just a surface that looks subtly or completely wrong. Turn them off and see what they were buying.

01

Rebuild the normals

The height field displaces the vertices, and the shading normal is rebuilt from the result — a tangent frame from the mesh's own normal, sampled at two offsets, tilted by the gradient.

forging

02

Displace along a welded direction

At a hard edge one position carries two different normals. Displacement follows a direction averaged across everything at that position, so both halves of the seam move together.

forging

03

Find the cursor by ray cast

The pointer is unprojected into the scene and intersected with the object, in its own space, so the dent lands under the cursor wherever the object has been turned.

forging

04

Keep a trail, not a stir

Every point the cursor passes through emits its own expanding ring on its own clock, so the wake outlives the gesture that made it.

forging

All four are in packages/liquidforge/src — the first two in the vertex shader, the third in the pointer probe, the fourth in the trail buffer. The component takes a diagnostic prop if you want to break them in your own page.

Go and make one