Voronoi
Cellular / Worley noise — per-sample distance to the nearest feature point. The procedural primitive behind stained glass, leopard spots, cracked surfaces, bubbles, and crystalline lattices.
Category: Fields Menu path: Fields > Voronoi
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
out | imageRgba16f | output | GPU rasterization of the distance output (canonical cellular pattern) |
scalar | scalar | output | Distance sampled at origin |
vec2 | vec2 | output | Unit direction from origin to its nearest feature point |
distance | scalarField | output | Per-sample distance field, remapped by mode |
cellId | scalarField | output | Per-sample hash of the containing Voronoi region — constant across each cell. Feed into Colorize for stained-glass coloring. |
direction | vectorField | output | Unit vector from each sample toward its nearest feature point |
cellPosition | vectorField | output | Absolute position (in comp pixels) of the nearest feature point. Constant across each cell — pipe into ImageSample.uv_in to sample an image once per cell. |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
mode | enum | F1 | How the distance output is computed. F1 = distance to nearest feature (classic cellular). F2 = distance to second-nearest. F2-F1 = edge-of-cell highlight (cracks, stained-glass borders). |
metric | enum | Euclidean | Distance metric. Euclidean = round cells. Chebyshev = square cells. Manhattan = diamond cells. |
seed | scalar | 0 | Pattern seed. Any change fully reshuffles the cells. |
scale | vec2 (linked) | 100, 100 | Cell size in pixels. Smaller = denser cells. |
jitter | scalar | 1.0 | Feature-point randomness inside each cell. 0 = perfect regular grid. 1 = fully randomized. Values in between give mesh-like patterns. |
evolution | scalar | 0 | Temporal offset — drifts feature points. Animate for living/breathing cellular patterns. |
Expose Channels
When enabled (E button on node header), adds input ports that override params via edge connections:
| Port | Type | Overrides |
|---|---|---|
seed_in | scalar | seed |
scale_in | vec2 | scale |
jitter_in | scalar | jitter |
evolution_in | scalar | evolution |
How It Works
The canvas is divided into a grid of cells of size scale. Each cell contains one pseudo-random feature point whose position is determined by hashing the cell index together with seed and evolution. jitter controls how far that point can deviate from the cell's center.
At every sample, Voronoi looks at the 3×3 neighborhood of cells around it, finds the nearest feature point (F1), and optionally the second-nearest (F2). The distance output is shaped by mode: F1 gives bright cell interiors fading to dark edges; F2−F1 flips that into bright edges on a dark interior (classic cracked-glass look). cellId returns a constant hash per Voronoi region — pair with Colorize to paint each region a different color.
The primary out texture rasterizes the distance output at GPU speed. The cellId and direction field outputs are evaluated lazily per consumer sample, so cost only shows up when those ports are actually connected.
Usage Examples
Basic: Classic cellular pattern
Voronoi.out → Output. Default params give the textbook cellular look (F1, Euclidean).
Basic: Stained glass
Set mode = F2-F1. Pipe out into Output — you'll see bright cracks on dark cells. Invert (or use Levels) if you want light cells with dark borders. Bump jitter down to ~0.6 for more uniform cell shapes.
Creative: Colored mosaic
Voronoi.cellId → Colorize (with a ramp) → Output. Each Voronoi region gets a distinct color sampled from the ramp. Great for hexagonal-ish color fills.
Creative: Stained glass from an image/video
Voronoi.cellPosition → ImageSample.uv_in; ImageSample (your image/video) → Output. Every sample in a Voronoi cell reads the image at that cell's feature-point position, so the whole cell flattens to a single color taken from the image. Animating evolution makes the mosaic breathe while sampling different spots of your source.
Creative: Cell-driven motion
Voronoi.cellId → PointAttributes (Scale) on a Grid of points, using Colorize-to-Remap beforehand. Each point in the same cell gets the same scale — giving you chunked-randomness animation.
Creative: Flow around cells
Voronoi.direction → PointAdvect on particles. Particles drift toward the nearest feature point — they cluster into cells. Combine with PointTrail to see the migration paths.
Creative: Water caustics
Animate evolution slowly while keeping scale large (~300). F1 in Euclidean + a blue-white Colorize ramp gives shifting caustic patterns.
Tips
F2-F1distances are typically small — the mode already boosts contrast for you. If it still feels muted, pipe through Levels.jitter=0+metric=Chebyshevgives a perfect square checker field (every cell identical). Useful as a base for repeating patterns.- Metric is a big creative lever —
Manhattangives diamond/crystalline shapes that feel very different from Euclidean blobs. - For animated cells that don't "pop" on loop, keep
evolutionmonotonic rather than usingphase-style cycling. cellIdis a true per-region constant — if you need smooth gradients inside each region, usedistanceinstead.
Related Nodes
- Noise — smooth, continuous procedural alternative (no sharp cell boundaries)
- Random — block-granular per-cell randomness without Voronoi cell shapes
- Colorize — map
cellIdordistanceto a color palette - Remap — reshape distance distribution
- DistanceField — SDF from an input shape (cousin — Voronoi is to points what DistanceField is to shapes)
- DrawField — visualize
direction/cellIdoutputs directly