Plankton Drift
Faint motes in deep water that brighten as the current takes them.
The canvas in this preview is the file shown here. The surrounding demo shell only provides context and is not part of the copied code.
import { useEffect, useRef } from "react";
/**
* Vibary · Plankton Drift
*
* Faint motes suspended in deep water, brightening as the current takes
* them and dimming as it lets go.
*About this effect
Ambient depth for a dark surface — a focus mode, a night theme, the background of a player or a reading view. Brightness is coupled to speed, and speed comes from one flow field shared by every mote: a mote lights because the current found it, and since the current is continuous a whole region brightens together, so the glow crosses the frame as a slow wave. Random per-particle blinking produces the same average brightness and none of that quality — it reads as static, because nothing is agreeing with anything. The glow is drawn once into an offscreen sprite and blitted, so ninety motes cost ninety image draws rather than ninety gradients.