No.124 · Backgrounds
Marbled Ink
Endpaper marbling in a fragment shader: drag the cursor and it combs through the ink, dragging the veins along its path before they slowly settle.
The prompt
Written for the variant you picked above: Endpaper
Write a full-screen fragment shader (raw WebGL, one big triangle) that domain-warps 4-octave value-noise fbm twice (q, r) and reads marble veins from sin(f*22 + r.x*7), mixing four palette colours: base by f, a second colour by r.x, and thin veins in a fourth, then modulating with a fine paper-tooth noise. Add combing: keep a ring of 16 pointer samples (position + velocity) as a vec4 uniform array; for each, subtract its velocity × gaussian falloff × 6 from the sample coordinates so ink is dragged along the pointer's path. Velocities decay ×0.985 per frame so the veins ease back. Render at 0.6× DPR (cap 2), pause offscreen, use a static frame under reduced motion. Selected variant — Endpaper: Endpaper palette [#0f2a3a, #e8dcc0, #b3392b, #f5efe0]: deep navy and cream marbling with thin red veins, like a bookbinder's endpaper.
Notes
- Interaction
- Drag the pointer (or a finger) across the ink to comb the veins; they slowly relax afterwards.
- Motion
- Slow noise-time drift plus decaying pointer advection in the shader.
- Accessibility
- Decorative canvas (aria-hidden). Reduced motion freezes time (combing still works on demand). No flashing content.
- Responsive
- Resizes with its container; renders at reduced resolution for performance.