Cola Gummy
Material Studies / No. 010

ColaGummy.

A little fizz.
A lot of wobble.
Too good to share.

WEBGPU · STARTING

HandGrab any piece — base, body or neck — and pull.

Mass
≈—g
Volume
—% of rest
Kinetic
—µJ
Pieces
1

Illustrative scale: 1 sim unit ≈ 3.5 cm, gummy at 1.3 g/cm³. Volume and energy are summed live over every tetrahedron and particle.

Inside the experiment

A body made of tetrahedra

The bottle is a volumetric mesh of — particles and — tetrahedra, solved with XPBD on a fixed 60 Hz step split into 10 substeps. Each tetrahedron is pulled, with finite compliance, toward its best-fit rotated rest shape — a co-rotational elastic constraint that also flips inverted elements back out — and carries a volume constraint that keeps the gummy close to incompressible, so a stretched neck thins like the real thing.

The cream foam top is a little firmer than the cola body. Damping acts only on relative velocity along the mesh edges, so the bottle still falls and tumbles freely while its wobble dies away. Ground contact projects particles out of the floor with Coulomb-style friction; the grab is a soft attachment on a patch of particles, bounded in reach.

Cutting

Every piece is an outline in the bottle’s original rest plane, with rounded corners. Your stroke, read on the surface it was drawn over, fixes a vertical blade plane. For each piece it crosses, the piece’s current pose is fitted with a best rotation, the plane is carried back into rest space and becomes a straight line, and the outline is split along it — the two halves are prebuilt as fresh tetrahedral meshes the moment you let go. Because the bottle pinches in at the neck, a line that would leave one side in two separate bits is refused. Then the steel knife comes down: its edge first presses a groove into the gummy, and when it breaks through the new pieces are swapped in, taking over the position and speed of the candy they came from, while the blade wedges the faces apart on its way to the board. Each piece is its own soft body — grab it, stretch it, cut it again — and pieces push against each other instead of passing through.

A surface that rides along

The smooth surface and the fizz bubbles are separate meshes, each vertex pinned to a tetrahedron by barycentric weights — so the bubbles stretch, turn and travel with the candy around them.

Light through the gummy

WGSL shaders render the floor and bubbles first, then the bottle’s back faces to measure how much candy each view ray crosses. The front faces refract the scene behind by that thickness, absorb it with Beer–Lambert colour, add milky scattering in the foam, a back-lit glow at thin edges, Fresnel reflections of a procedural studio and GGX highlights. The floor gets a soft key shadow tinted by the gummy plus contact occlusion from a top-down height map.