← Back to the journal
ShadersWebGLCreativity

Shader poetry in the browser

Fragment shaders as a medium for generative beauty — on noise, gradients, time and how a few lines of code open infinite worlds.

A fragment shader might be the most poetic piece of code I know. It runs for every single pixel at once, knows nothing of its neighbors, and yet out of that radical solitude a coherent image emerges. One small function, a few variables — and suddenly a whole world flows across the screen.

Little code, infinite worlds

What fascinates me about shaders is their ratio of effort to result. With a handful of lines — a noise function, a gradient, time as a variable — you can conjure fog that never looks the same twice. No asset, no video, no megabytes — just mathematics recomputing itself frame by frame.

That's what I mean by poetry. A poem says more with a few words than a page of prose ever could. A shader does the same with code. sin, fract, mix, a little Perlin noise — that's the vocabulary, and the combinations are endless.

A shader isn't an image you save. It's a rule by which beauty is born again and again.

Time as a material

What makes shaders feel alive is time. The moment I feed u_time into a function, the image stops being a still and becomes a flow. Gradients drift, noise shifts, colors breathe. That soft, endless change reads as organic — it recalls water, smoke, light falling through leaves.

In practice I use shaders gently: as a calm, living background, as a transition between images, as a texture that gives a surface depth. They should never shout. Their strength is the subliminal — that barely perceptible shimmer that makes a page feel warm and alive without your being able to say why.

Writing shaders feels less like programming to me and more like painting with mathematics. You set up an equation and watch which world emerges from it. Sometimes it's chaos. And sometimes, when the numbers are right, something appears that you never planned and that's somehow exactly right.