GLSL · Water · Motion · Web Audio
Drop or paste screenshots, press Analyze, and a mocked agent writes a prompt that could recreate them. While it runs, the composer folds into a single "Working" line with a spinner, step text, a live timer and Stop, and the pasted shot sits below under a GLSL water surface that bends the light across it.
The details
- The water is analytic. The height field is a sum of seven directional ripples, from broad swell down to 40px capillary waves, with the gradient accumulated term by term. An earlier value-noise field sampled with finite differences only produced soft dark smudges. Exact slopes give crisp refraction, per-channel dispersion and thin specular glints, and the shader only ever adds light.
- The wave shape is drawn, not coded. A tuning panel holds a bezier curve editor, and the curve bakes into a 512x1 greyscale LUT the shader samples for both height and slope. Sliders cover shimmer, glint, rim, refraction and dispersion.
- The scan is also the transition. Sweeps are scheduled in JS. With several shots, a reading sweep alternates with a hand-over sweep that carries the next image in behind the crest, so the seam bends with the water.
- The reveal rides the same line. The shader reports the crest position every frame, and that value writes two complementary CSS masks: the image dissolves exactly where the prompt paper underneath is uncovered.
- Sound is synthesised with Web Audio: bandpassed noise for water, plus a hum whose level follows the crest's distance from the centre of the frame.
How it evolved
It started as a static prompt box, then a mocked app with a movie-style scan overlay over the generated text. Both went. The effect moved onto the pasted source, the URL field was dropped for images only, and the lime palette turned light blue near the end. The longest bug was a grey box during hand-overs, which turned out to be the wave LUT itself: the shader canvas uploaded each texture before claiming its unit, so the LUT stayed bound to the slot the outgoing image was read from.


