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.
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.
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.
