---
title: "worleyNoise"
description: "A complete cellular-noise paint: distances to drifting cell points, read through the color ramp."
group: "light"
groupTitle: "Noise, light & materials"
categoryId: "noise"
categorySlug: "noise"
categoryTitle: "Noise"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/noise.ts#L805"
---

# worleyNoise

A complete cellular-noise paint: distances to drifting cell points, read through the color ramp.

```ts
worleyNoise(slots: {
    scale: PropRef
    jitter: PropRef
    lacunarity: PropRef
    persistence: PropRef
    contrast: PropRef
    balance: PropRef
    seed: PropRef
    /** Compile-time prop: `'f1' | 'f2' | 'f2MinusF1' | 'f1PlusF2' | 'f1TimesF2'`. */
    mode: PropRef
    /** Compile-time prop: `'euclidean' | 'manhattan' | 'chebyshev'`. */
    distance: PropRef
    /** Compile-time prop: 1 to 4. */
    octaves: PropRef
    space: PropRef
}): Paint
```

Import `noise` from `shaders/std` and use `noise.worleyNoise`.

`scale` is the number of cells across (1 to 30) and `jitter` how far the points wander from a grid (0 = rigid grid, 1 = random). `mode` picks the distance field: `'f1'` (cells), `'f2'`, `'f2MinusF1'` (edges), `'f1PlusF2'`, `'f1TimesF2'`. `distance` picks the cell shape: `'euclidean'` (round), `'manhattan'` (diamond), `'chebyshev'` (square). `octaves` (1 to 4) stacks finer layers, with `lacunarity` and `persistence` setting how much finer and weaker. `contrast` is a multiplier (1 = unchanged) and `balance` a shift. Low values read the first color. `mode`, `distance` and `octaves` are compile-time props. Reads the definition's `colorA`, `colorB` and, when present, `stops` props.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `slots` | `{
    scale: PropRef
    jitter: PropRef
    lacunarity: PropRef
    persistence: PropRef
    contrast: PropRef
    balance: PropRef
    seed: PropRef
    /** Compile-time prop: `'f1' \| 'f2' \| 'f2MinusF1' \| 'f1PlusF2' \| 'f1TimesF2'`. */
    mode: PropRef
    /** Compile-time prop: `'euclidean' \| 'manhattan' \| 'chebyshev'`. */
    distance: PropRef
    /** Compile-time prop: 1 to 4. */
    octaves: PropRef
    space: PropRef
}` |  |

## Example

```ts
paint: worleyNoise({scale: p('scale'), jitter: p('jitter'), lacunarity: p('lacunarity'), persistence: p('persistence'), contrast: p('contrast'), balance: p('balance'), seed: p('seed'), mode: p('mode'), distance: p('distance'), octaves: p('octaves'), space: p('colorSpace')})
```

> **Tip.** Give the `mode` and `distance` props `transformWorleyMode` and `transformWorleyDistance` as their `transform`.

## See also

- [`cellDistances`](/docs/primitives/noise/celldistances) — Distances from each pixel to its nearest two cell points, as `(d1, d2)`: the raw material for Voronoi fills and borders.
- [`transformWorleyMode`](/docs/primitives/noise/transformworleymode) — The `transform` for a `worleyNoise` `mode` prop: maps `'f1'`, `'f2'`, `'f2MinusF1'`, `'f1PlusF2'` or `'f1TimesF2'` to the number the paint reads.
- [`transformWorleyDistance`](/docs/primitives/noise/transformworleydistance) — The `transform` for a `worleyNoise` `distance` prop: maps `'euclidean'`, `'manhattan'` or `'chebyshev'` to the number the paint reads.
- [`fractalNoise`](/docs/primitives/noise/fractalnoise) — A complete fractal-noise paint: layered simplex noise that morphs over time, read through the color ramp.

## Used by

[WorleyNoise](/docs/components/worleynoise)