Skip to main content
Shaders for Games (GLSL) Lesson 16 of 20

Cellular (Voronoi) noise

Scatter points and color by the nearest one — cracked mud, scales, stone, cells.

Value noise gives soft, cloudy blobs. Cellular noise gives something completely different: a pattern of CELLS — cracked mud, reptile scales, stone, foam, a giraffe’s coat. It is built from the randomness you just learned, but used a new way: instead of a random value per cell, you scatter a random POINT in each cell, and color every pixel by its distance to the nearest point.

The recipe (this is the Worley / Voronoi algorithm): divide space into a grid; give each grid cell one random feature point. For a pixel, look at its own cell and the eight neighbours, measure the distance to each of those nine points, and keep the smallest. That nearest-point distance is the pattern — dark right at the points, brightening outward until you hit the border where two cells meet. Animate the points with u_time and the whole cellular field flows like something alive.

That is live cellular noise: the dark centres are the feature points (with a bright dot drawn on each), and the ridges are the cell borders. Change the 5.0 to scatter more or fewer cells, and watch the points drift with time.

Tip Like fBm, cellular noise is an ever-changing organic field with no single “correct” image, so this lesson is yours to explore rather than graded. Try coloring by the border distance for a stained-glass look, or feed minDist into mix() for glowing cells.
Quick check

Cellular (Voronoi) noise colors each pixel by:

▶ Grow your own cells Paste the random2 helper, change the cell density, or color by the second-nearest distance for sharp edges.
Wayline
Tools, assets and tutorials for game makers
Get started