Skip to content

No.213 · Backgrounds

Caustic Pool

Light refracted through moving water onto the floor of a dark pool — a web of filaments, split faintly into colour.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Night pool

Write a WebGL1 fragment-shader background that looks like the bottom of a pool at night: a deep, nearly black blue floor crossed by the shifting web of caustic light that moving water throws down. Build the caustics from cellular noise rather than sine soup: compute F2 − F1 (distance to the nearest cell edge) of a Worley field whose feature points drift in small circles over time. Turn each edge into a thin bright filament (1 − smoothstep(0, ~0.18), cubed). Use two such layers at different scales moving in opposite directions, add them, and add their product boosted — where the webs cross, the light pools into bright knots, just like real caustics. Bend the whole floor with a slow low-frequency swell. Sample the pattern three times with a tiny horizontal offset per channel for a faint chromatic split at the edges of every filament. Grade it like water: brighter in the shallows (top), darker and bluer toward the bottom, with a soft vignette and fine dither. The cursor is a hand in the water: a gentle Gaussian lens around the pointer that magnifies and brightens the light beneath it, easing in and out. Render at 0.65× resolution (0.45× and ~30fps on touch), pause offscreen, and draw a single frame under reduced motion. Selected variant — Night pool (night): Night pool: cool white-blue caustic light (tint #b9d4f0) over a near-black blue floor (depth #050a12). This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: A soft magnifying lens of brighter light follows the pointer inside the pool and fades when it leaves. Motion: Continuous shader time; feature points orbit; swell warps the floor; pointer lens eases at 6–8% per frame. Accessibility: Canvas is aria-hidden; reduced motion renders one still frame. Responsive behavior: Fills its container at reduced internal resolution for performance. Touch: No lens on touch; the light still moves. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
A soft magnifying lens of brighter light follows the pointer inside the pool and fades when it leaves.
Motion
Continuous shader time; feature points orbit; swell warps the floor; pointer lens eases at 6–8% per frame.
Accessibility
Canvas is aria-hidden; reduced motion renders one still frame.
Responsive
Fills its container at reduced internal resolution for performance.
On touch
No lens on touch; the light still moves.