Overview
One of my favorite activities as a kid was paper marbling. Inspired by endpaper in my favorite books, I had a station set up in the basement where I’d fill a big dish with water, scatter some paint, and make wildly abstract art for my parents.
Since I’ve grown up, their offices have been looking a little bare. This project is both an attempt to remedy that and an exercise in modeling basic fluid motion. To use, just drop paint in the water, tap and drag it into patterns, and pull a print.
Mechanics
Water
Instead of simulating the surface as a grid of bouncing heights, I used the sum of many waves. I modeled them based on physics: short ripples travel at different speeds than long swells and lose energy faster. A Fourier transform (FFT) turns the set of waves into a surface at each frame. The visual effect comes from surface tilt bending light—reflection, refraction, soft caustics, and curves where it meets the glass.
Paint
I applied a technique aptly named ‘mathematical marbling’. When a new drop lands, everything else on the surface slides directly away from the landing point. Paint nearest to the drop moves the most, while more distant paint barely moves. Every drop has the same amount of pigment, so it spreads thin on clear water and forms a small, vivid circle in a packed dish.
Drawing
Dragging carries paint along the cursor, with the pull fading to give feathered points. I modeled touch as two small patches of pressure: a big, slow push and a tiny, sharp contact ring. Holding leaves a dimple; the snap of touching and lifting is what sends out tight ripples in the water. I tuned overall strength, speed, and damping against a reference clip.
Transfer
The program doesn’t store the paint as an image, instead tracking each drop in reverse chronological order: its position, its color, and its current size. This is why color boundaries stay sharp before drawing, while a real fluid simulation would muddy faster.
References
Amanda Ghassaei, Digital Marbling
Evan Wallace, WebGL Water
Paint Toys, Marbling