What to try
- Select a numbered site, then drag it or use arrow keys on the field.
- Switch between Distance F₁ and Nearest region, then choose Inspect distance.
What to look for: F₁ measures distance within a cell; region color records which site wins. The solid and dashed lines connect the sample to its nearest and second-nearest sites.
How it works
Feature points divide space into nearest-point regions. Measuring the distance to the nearest point creates rounded basins; assigning each region a color creates a cellular mosaic. Distance-based fields and region labels are related constructions, but they are not the same image.
The Lab’s Worley generator builds a seeded cellular distance field. The Voronoi generator exposes a point count and region-color variation. More points or higher frequency creates smaller cells; changing the seed changes their placement.
Use it in the Lab
Use Worley for stone-like, cellular or cracked tonal structures and Voronoi for a mosaic scaffold. Thresholding, edge detection and morphology can turn either into a different kind of mark.
Limits & distinctions
Not every cellular-looking texture is the same Worley distance function. The current controls do not expose every F1/F2 distance combination from the broader algorithm family.
Further reading
Worley noise, also known as Voronoi noise or cellular noise, is a procedural texture generation technique that produces organic, cell-like patterns. Unlike gradient-based noise functions such as Perlin noise, Worley noise is fundamentally based on spatial relationships between randomly distributed feature points.
How Worley Noise Works
The algorithm begins by dividing space into a grid and placing random feature points within each cell. For any given sample point in space, the noise value is determined by calculating distances to nearby feature points. This distance-based approach creates natural cellular divisions, similar to biological cell structures or cracked surfaces.
The basic process involves searching the neighboring grid cells around a sample point, finding the closest feature points, and using these distances to compute the final noise value. This spatial partitioning creates the characteristic cellular appearance that distinguishes Worley noise from other procedural noise functions.
Distance Metrics and Variations
Worley noise offers several distance-based variations that produce distinctly different patterns:
- F1 (First Distance): Uses the distance to the closest feature point. This creates smooth cellular regions with clear boundaries, ideal for stone textures, cracked earth, or cell membranes.
- F2 (Second Distance): Uses the distance to the second-closest feature point. This produces a different pattern with more variation in cell sizes and shapes.
- F2-F1 (Distance Difference): Subtracts the first distance from the second, creating pronounced cell boundaries or edge detection effects. This variation is particularly useful for creating veins, cracks, or network-like structures.
Distance Calculation
The distance metric can be customized using different formulas: Euclidean (standard geometric distance), Manhattan (grid-based distance), or Chebyshev (maximum coordinate difference). Each produces unique cellular characteristics.
Common Applications
Worley noise excels at generating textures that require cellular or fragmented patterns. Its applications span multiple domains in computer graphics and procedural generation:
Surface Textures
The cellular nature of Worley noise makes it ideal for creating realistic stone, marble, and rock surfaces. The F1 metric produces smooth stone with natural variation, while F2-F1 creates the veining and cracks found in marble or weathered surfaces. Water caustics and foam patterns also benefit from Worley noise's organic distribution.
Organic Materials
Biological surfaces such as skin pores, scales, and cellular structures are naturally suited to Worley noise. The algorithm's distance-based approach mirrors natural growth patterns where cells expand until they meet neighboring cells, creating realistic organic textures.
Procedural Generation
In game development and terrain generation, Worley noise helps create biome boundaries, resource distribution maps, and territorial divisions. The cellular structure naturally segments space into distinct regions, making it valuable for procedural world generation where clear boundaries between areas are desired.
Differences from Perlin Noise
While both are procedural noise functions, Worley and Perlin noise operate on fundamentally different principles and produce contrasting results:
Perlin noise uses gradient vectors at grid points to create smooth, flowing patterns through interpolation. It produces continuous, cloud-like textures with natural-looking turbulence. The output is characterized by smooth transitions and organic flow, making it ideal for terrain heightmaps, clouds, and natural phenomena that require continuous variation.
Worley noise, in contrast, creates discrete cellular regions based on proximity to feature points. Rather than smooth gradients, it produces distinct boundaries and cell-like structures. The patterns have clear divisions and fragmented characteristics, making them suitable for materials with cellular or fractured properties.
Complementary Techniques
Worley and Perlin noise are often combined in practice. Perlin noise can modulate the feature point positions in Worley noise, or Worley noise can add cellular detail to Perlin-based terrain. This layering approach leverages the strengths of both algorithms.
Implementation Considerations
Implementing Worley noise requires careful attention to performance. The algorithm must search multiple grid cells for each sample point, making it more computationally expensive than gradient-based noise. Optimization techniques include spatial hashing to reduce search space, caching feature point positions, and using GPU parallelization for real-time applications.
The density of feature points significantly affects the final appearance. More points create smaller, more numerous cells, while fewer points produce larger cellular regions. This parameter allows artists to control the scale and granularity of the resulting texture, from fine-grained skin pores to large stone blocks.
Performance Optimization
For real-time applications, limit the search radius to immediate neighboring cells and use simplified distance metrics. Manhattan distance is faster to compute than Euclidean distance while still producing useful cellular patterns.
Related artworks
Sources & references
Guide updated
