Material Studies / No. 009

Melon /Jelly.

A thick wedge of gummy watermelon,
simulated as soft candy, lit like a specimen,
and cut with a very sharp knife.

WebGPU · Starting

Drag the slice to pull it. Switch to the knife and draw a stroke to cut.

Mass ≈—
Volume—
Kinetic—
Pieces—

Illustrative scale — 1 sim unit ≈ 3.5 cm; gummy density 1.3 g/cm³.

Inside the experiment

The slice is a tetrahedral soft body. A jittered lattice of points is Delaunay-triangulated inside the wedge, and each tetrahedron stores its rest shape. Every substep each tet solves a co-rotational shape-matching constraint — it works out the rotation that best explains its own deformation, then pulls itself back toward that rotated rest shape — followed by a volume constraint that keeps the candy nearly incompressible. Ten small substeps with one iteration each beat one big step: the material stays stiff without exploding.

Firmness sets the compliance of those shape constraints on a log scale, from a slice that trembles under its own weight to one that is almost set. Internal damping is applied to relative velocities along every edge, which is what makes the difference between lively and syrupy. Contact with the board uses static and kinetic friction, and the whole body gets a whisper of air drag so it eventually sits still.

The candy is drawn as a translucent shell. A first pass renders everything behind it — board, seeds, air bubbles, and the knife — then the back faces of the jelly are rasterised into a depth target, which gives per-pixel thickness. The front faces refract that scene colour, take a few jittered taps along the refracted ray, and absorb each tap with Beer–Lambert law, capped by the remaining thickness so the seeds never halo. Look closely and you can see the blade through the flesh.

Cutting is geometric, not destructive. The stroke you draw is read on the deformed surface and lifted into a vertical plane, which is then mapped into the rest frame of every piece it crosses. There it becomes a straight line; the piece's convex outline is clipped into two halves, each pulled back by the rounding radius so the rebuilt outlines meet exactly at the cut. Both halves are re-meshed, the new particles inherit positions and velocities interpolated from the old tets, and the blade is already on its way down before the swap happens.

Everything is one simulation and one draw call: pieces are particles with a component id, so a piece can be grabbed, stretched and cut again. Fresh faces collide softly and are eased apart by a few millimetres per substep — cut candy does not snap open, it relaxes open. The knife has no animation files; it is a procedural nakiri, posed each frame on the CPU, and it buries itself in the jelly before the split is committed.