Voronoi noise creates sharp, cellular patterns. Unlike Perlin or Simplex noise which creates smooth gradients, Voronoi noise produces sharp, crystalline patterns. It’s based on Voronoi diagrams, where each point belongs to the closest seed.

How?

Voronoi diagrams can be generated through several algorithms:

  • Brute Force: For each pixel, calculate distance to all seeds and assign to closest
  • Fortune’s Algorithm: Sweep line algorithm for efficient computation
  • Jump Flooding Algorithm: GPU-friendly method for real-time generation

Brute Force Algorithm Logic

The logic works by checking every pixel against every seed, which is simple but slow for large grids or many seeds.

It is like a nested loop:

  • For each currentPixel in the grid:
    • Initialize minimumDistance to a very large number (like 999999), and closestSeed to null.
    • For each seedPoint in the list of seeds:
      • Calculate distanceToSeed =
      • If distanceToSeed < minimumDistance, set minimumDistance = distanceToSeed and closestSeed = seedPoint
    • Assign currentPixel to closestSeed’s cell.

This “counts” by comparing distances to find the closest seed for each point. Boundaries form where distances to two seeds are equal.