1 day ago · Tech · 0 comments

Picture a full-screen canvas. Dark teal water, lit from somewhere below, with thousands of faint cyan filaments drifting and swirling across it. It's never the same, and it's always flowing. There isn't a shader or a particle simulation engine here. The whole thing is a couple hundred lines of arithmetic, and the engine driving every one of those filaments is the same function Ken Perlin wrote in 1985 to fake textures on a computer that couldn't draw them for real, which we know today as Perlin noise.I'll walk you through a moving-water visualization to illustrate what Perlin noise actually is, and how a single noise value can be used to steer thousands of particles into curving currents to create a flowing surface. The snippets use the Squint ClojureScript dialect, but the ideas are language-agnostic.What is Perlin noise?Naively using random values is the wrong approach for creating a natural-looking texture. Pure randomness at every pixel will produce boring static that's chaotic…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.