← All effects

Gradient Shader Flow

BackgroundWebGL · zero dependenciesthe shader IS the code
-- fps
prefers-reduced-motion detected — the flow is shown frozen

X-ray · layers

the colour drifts over time (off = frozen)
domain warping — bends the field into liquid streaks
a fine film grain over the top

Parameters

Speed0.40
Scale3.0
Warp0.60
Grain0.06
your version · updates as you tinker

How this effect works

This one runs on the GPU. A single fragment shader — a tiny program — is executed once for every pixel, in parallel, and its only job is to return a colour. There's no per-frame JavaScript loop drawing shapes; the browser hands the shader to the graphics card and it fills the whole screen at once. That's why a full-screen animated gradient costs almost nothing.

The colour comes from fbm noise — several octaves of smooth noise added together — mapped onto a three-colour gradient. The magic is domain warping: before we read the noise, we distort the coordinates using more noise, so the field folds into liquid, marble-like streaks instead of flat blobs. Turn the Warp layer off and you see the plain noise underneath — proof of how much that one step adds. Flow just feeds time into the warp; Grain sprinkles a per-pixel dither so the gradient never banks into flat bands. This is a TinkerFX first: a shader you can take apart — every slider is a uniform, and the Full-code tab is the real GLSL.

Production notes: respects prefers-reduced-motion (one static frame) · falls back to a CSS gradient where WebGL is unavailable · one draw call per frame, device-pixel-ratio capped for battery · the shader is fixed and ours; only numeric uniforms are tunable — never code from a visitor · the copied snippet is self-contained HTML + GLSL + JS.