# Texture types and palettes

Import these types and `texturePalettes` from `@pibbl/core/textures`.

## `ReactionDiffusionProps`

Optional `seed`, `preset`, `resolution`, `palette`, `paused`, `resetRevision`,
`brush`, and `render` inputs. Reset revision must be a safe integer.

## `ProceduralTextureProps`

Required `kind`, optional `seed`, `resolution`, `scale`, `detail`, `palette`,
and `render`. Materials idle until inputs change.

## `TextureBrush`

`{ radius, strength }`: finite radius in (0,128] simulation cells and strength
in [0,1]. `false` disables the reaction–diffusion brush.

## `TexturePalette`

A readonly array of 2–16 opaque `#RRGGBB` strings, evenly interpolated in sRGB.

## `texturePalettes`

Frozen `lagoon`, `porcelain`, and `ember` palettes. Pass an ordinary palette array
for custom colors.

## `TextureResolution`

Readonly integer `width`/`height`, each from 8 to 1024, and at most 262,144 cells.
Independent of the display box. Seed values are unsigned 32-bit integers.

## `TextureKind`

`'marble' | 'paper' | 'cellular'`.

## `TextureRenderer`

Synchronous `(context, texture) => void` callback. Its context uses logical display
units; state is saved/restored. No promises, hooks, or signal writes.

## `TextureRenderFrame`

`source` is the low-resolution color canvas; `mask` is a lazily allocated white
canvas with normalized field intensity as alpha. `width`/`height` describe the
display allocation; `textureWidth`/`textureHeight` describe generation resolution.
Sources are read-only, callback-scoped borrows. Do not retain, transfer, resize,
or dispose them. Copy to an application-owned surface for a still image.

## MaterialOptions

Seed, scale, and detail for `marble`, `paper`, and `cellular` recipe factories.

## ReactionDiffusionOptions

Seed and spots/stripes preset for the `reactionDiffusion` recipe factory.

## InkMessage

Typed `paint`, `stir`, `pause`, and `reset` messages delivered through the texture's
`send` method. Paint uses normalized `u`/`v`, a radius in cells (default 6), and
strength in [0, 1] (default 0.8). Stir uses normalized `u`/`v`, normalized `du`/`dv`
displacements in [-1, 1], and a radius in cells (default 16). Radii must be finite,
greater than zero, and at most 128. All coordinates/vectors must be finite;
centers outside [0, 1] are ignored.

Stir displaces existing ink with smooth local falloff; it adds no ink. Pause stops
reaction stepping while explicit paint/stir commands still apply. Reset repeats
the seed and preserves pause. Messages run in send order on the next eligible
texture frame, and sends after disposal are inert.

## WaterWavesOptions

Optional unsigned `seed`, finite nonnegative `speed`, integer `scale` from 1
through 32, finite nonnegative `rippleStrength` (default 1), and initial `paused`
state. Ripple strength changes existing ripples independently of ambient waves.
This numeric displacement map rejects palettes.

## WaterWavesMessage

Typed `pause`, `reset`, and `{ type: "ripple", x, y }` messages with normalized
coordinates in `[0, 1]`. Reset returns phase to its seeded initial state and clears
ripples while preserving the current pause state.

## WaterSurfaceObstacle

A normalized axis-aligned `{ x, y, width, height }` rectangle within `[0, 1]`.
It is a visual water boundary only and has no hit-testing or physics effect.

## WaterSurfaceOptions

The same seed, speed, scale, ripple-strength, and paused inputs as
`waterWaves`, plus optional `obstacles` and `viscosity`. Viscosity defaults to 0
and accepts 0–1: increasing it slows wave propagation and ambient motion and
increases damping. It is an artistic thickness control, not physical density
or a mass-conserving fluid solver. Changes preserve existing waves and pause state.
For colored or textured liquid, paint a decorative Rectangle with a color or
Pibbl texture and `style.opacity` inside the displaced group; keep
`pointerEvents="none"` so it does not intercept scene input.

`waterSurface` is a WASM-backed,
bounded reflective height field: it uses a maximum 128-cell short edge and
256-cell long edge, while preserving the source aspect ratio.

## WaterSurfaceMessage

The same typed `pause`, `reset`, and normalized `ripple` messages as
`waterWaves`. A ripple can keep a speed-zero field active until its damped
energy settles; a paused field discards elapsed time.

## Recipe factories

`marble`, `paper`, `cellular`, `reactionDiffusion`, `waterWaves`, and `waterSurface` create inert recipes consumed
by `useTexture` from core (also re-exported by this package). Use the returned
resource directly as `style.fill` or `style.stroke`; no renderer callback is needed.

## marble

Creates a seamless warped-band material recipe.

## paper

Creates a seamless fiber and grain recipe.

## cellular

Creates a seamless toroidal cell-field recipe.

## reactionDiffusion

Creates a living Gray–Scott recipe that accepts `InkMessage` values.

## waterWaves

Creates a periodic numeric RG displacement map for the `displacement` filter.
It advances through Pibbl's scheduler and remains static when paused. Speed zero
stops ambient motion while active ripples continue to spread.

## waterSurface

Creates a numeric RG displacement map with bounded, reflecting outer and
rectangle-obstacle boundaries. Solid obstacle pixels are transparent. It is
appearance-only and does not couple to Pibbl physics.

## rainDrops

`rainDrops(options?)` creates a seeded rain-on-glass displacement map. Mount it
with `useTexture` and pass its stretched paint to `displacement({ map, strength,
region, blurRadius })`. Blue encodes local condensation blur. Small beads cling, overlapping beads merge conserving volume, and
larger beads slide downward. This is a droplet simulation, not Gray–Scott ink.

## RainDropsOptions

`seed` is an unsigned 32-bit integer (default 7). `rainRate` is new beads per
second, 0–120 (default 24); `gravity` is a multiplier, 0–10 (default 1).
`initialDrops` is an integer, 0–256 (default 100). `paused` defaults to false.
At most 256 free beads and one held finger bead are live. Radius and motion scale with the shorter texture
side. Palettes are rejected because red/green encode displacement data.

`condensation` is film coverage, 0–1 (default 0). `trailPersistence` is the
exponential recovery/drying time in seconds, 0–60 (default 8); zero clears old
trails at the next advancing frame. `trailStrength` controls newly deposited
residual water, 0–1 (default 0.65). `irregularity` controls outline and path
variation, 0–1 (default 0.8). These controls update without resetting the field.
Moving beads gather film along their swept footprints, leaving clearer paths
and uneven residual water. Film recovery and trail drying pause with the drops.
The bounded, stylized height field models visual behavior, not fluid pressure.

Use a positive displacement `blurRadius` to soften only misted regions. At zero
condensation the dry map is transparent; with condensation it is opaque and
neutral in cleared regions, preserving blue-channel coverage independently
from the displacement normals.

## RainDropsMessage

`pause` carries `paused`; `reset` repeats the configured seed. `nudge` carries
normalized `x`/`y` in [0, 1], normalized width/height movement `dx`/`dy` in
[-1, 1], and optional `radius` in (0, 2], measured against the shorter side
(default 0.12). Nudges work while paused. Seed or initial-count changes reset
simulation state; display resizing alone does not. Long frame gaps are capped
at 50 ms. Refraction affects only filtered Pibbl content, not arbitrary HTML.

`finger` begins or moves one contact with normalized `x`/`y` in [0, 1] and
optional positive `radius` up to 2 (default 0.045, relative to the shorter side).
It wipes a continuous swept path through condensation and residual trails,
collecting that water and intersected beads into one droplet pinned to the
contact. It works while paused. `release` leaves the gathered bead at the last
contact position with zero initial velocity; gravity resumes on advancement.
Repeated release is harmless. Reset cancels the contact. Applications own
pointer capture and should send release on up, cancel, or lost capture.
At free-bead capacity, release coalesces the nearest free pair to make room,
preserving their combined volume.

## API details from source

<span id="api-ReactionDiffusionProps"></span>

### ReactionDiffusionProps

Authored inputs for ReactionDiffusion, including the declared data and presentation options.

```ts
interface ReactionDiffusionProps
```

Related API: [ReactionDiffusionProps](/reference/types/textures/#reactiondiffusionprops).

#### See also

[TextureRenderer](/reference/types/textures/#texturerenderer)

[TextureResolution](/reference/types/textures/#textureresolution)

[TexturePalette](/reference/types/textures/#texturepalette)

[TextureBrush](/reference/types/textures/#texturebrush)

[ReactionDiffusion](/reference/components/reaction-diffusion/)

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:33](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L33)

#### Properties and methods

<span id="api-ReactionDiffusionProps-render"></span>
<details>
<summary>render (optional)</summary>


```ts
readonly render?: TextureRenderer | undefined
```

Related API: [TextureRenderer](/reference/types/textures/#texturerenderer).

Renders the current data or resources using the supplied context. See TextureRenderer
.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:38](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L38)

</details>

<span id="api-ReactionDiffusionProps-resolution"></span>
<details>
<summary>resolution (optional)</summary>


```ts
readonly resolution?: TextureResolution | undefined
```

Related API: [TextureResolution](/reference/types/textures/#textureresolution).

Dimensions of the simulation or raster grid. See TextureResolution.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:40](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L40)

</details>

<span id="api-ReactionDiffusionProps-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See
ReactionDiffusionProps.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:45](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L45)

</details>

<span id="api-ReactionDiffusionProps-preset"></span>
<details>
<summary>preset (optional)</summary>


```ts
readonly preset?: "spots" | "stripes" | undefined
```

Named pattern configuration used to initialize the simulation. See
ReactionDiffusionProps.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:50](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L50)

</details>

<span id="api-ReactionDiffusionProps-palette"></span>
<details>
<summary>palette (optional)</summary>


```ts
readonly palette?: TexturePalette | undefined
```

Related API: [TexturePalette](/reference/types/textures/#texturepalette).

Ordered colors used to present texture intensity. See TexturePalette.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:52](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L52)

</details>

<span id="api-ReactionDiffusionProps-paused"></span>
<details>
<summary>paused (optional)</summary>


```ts
readonly paused?: boolean | undefined
```

Whether simulation or playback advancement is suspended. See ReactionDiffusionProps.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:56](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L56)

</details>

<span id="api-ReactionDiffusionProps-resetRevision"></span>
<details>
<summary>resetRevision (optional)</summary>


```ts
readonly resetRevision?: number | undefined
```

Changing this revision requests a fresh simulation initialization. See
ReactionDiffusionProps.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:61](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L61)

</details>

<span id="api-ReactionDiffusionProps-brush"></span>
<details>
<summary>brush (optional)</summary>


```ts
readonly brush?: false | TextureBrush | undefined
```

Related API: [TextureBrush](/reference/types/textures/#texturebrush).

Brush configuration for interactive reaction-diffusion input, or false to disable it. See
TextureBrush.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:66](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L66)

</details>

<span id="api-TextureBrush"></span>

### TextureBrush

Radius and strength of a reaction-diffusion brush stroke.

```ts
interface TextureBrush
```

Related API: [TextureBrush](/reference/types/textures/#texturebrush).

#### See also

[ReactionDiffusionProps](/reference/types/textures/#reactiondiffusionprops)

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:18](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L18)

#### Properties and methods

<span id="api-TextureBrush-radius"></span>
<details>
<summary>radius</summary>


```ts
readonly radius: number
```

Radius in the coordinate system of this geometry or effect. See TextureBrush.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:20](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L20)

</details>

<span id="api-TextureBrush-strength"></span>
<details>
<summary>strength</summary>


```ts
readonly strength: number
```

Magnitude of the displacement or brush effect. See TextureBrush.

[View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:22](/source/packages/core/src/features/textures/lib/reaction-diffusion-ts/#L22)

</details>

<span id="api-texturePalettes"></span>

### texturePalettes

Built-in immutable color ramps for procedural texture presentation.

```ts
texturePalettes: Readonly<{ lagoon: readonly string[]; porcelain: readonly string[]; ember: readonly string[]; }>
```

Related API: [texturePalettes](/reference/types/textures/#texturepalettes).

#### See also

[TexturePalette](/reference/types/textures/#texturepalette)

[View source — packages/core/src/features/textures/lib/palette.ts:16](/source/packages/core/src/features/textures/lib/palette-ts/#L16)

<span id="api-TexturePalette"></span>

### TexturePalette

Ordered colors forming a texture's presentation ramp.

```ts
type TexturePalette = readonly string[]
```

Related API: [TexturePalette](/reference/types/textures/#texturepalette).

#### See also

[texturePalettes](/reference/types/textures/#texturepalettes)

[ProceduralTextureProps](/reference/types/textures/#proceduraltextureprops)

[ReactionDiffusionProps](/reference/types/textures/#reactiondiffusionprops)

[View source — packages/core/src/features/textures/lib/palette.ts:10](/source/packages/core/src/features/textures/lib/palette-ts/#L10)

<span id="api-TextureResolution"></span>

### TextureResolution

The width and height of a texture's raster grid.

```ts
interface TextureResolution
```

Related API: [TextureResolution](/reference/types/textures/#textureresolution).

#### See also

[TexturePalette](/reference/types/textures/#texturepalette)

[ReactionDiffusionProps](/reference/types/textures/#reactiondiffusionprops)

[ProceduralTextureProps](/reference/types/textures/#proceduraltextureprops)

[View source — packages/core/src/features/textures/lib/palette.ts:56](/source/packages/core/src/features/textures/lib/palette-ts/#L56)

#### Properties and methods

<span id="api-TextureResolution-width"></span>
<details>
<summary>width</summary>


```ts
readonly width: number
```

Horizontal extent in the units of the containing geometry or surface. See
TextureResolution.

[View source — packages/core/src/features/textures/lib/palette.ts:61](/source/packages/core/src/features/textures/lib/palette-ts/#L61)

</details>

<span id="api-TextureResolution-height"></span>
<details>
<summary>height</summary>


```ts
readonly height: number
```

Vertical extent in the units of the containing geometry or surface. See
TextureResolution.

[View source — packages/core/src/features/textures/lib/palette.ts:66](/source/packages/core/src/features/textures/lib/palette-ts/#L66)

</details>

<span id="api-ProceduralTextureProps"></span>

### ProceduralTextureProps

Authored inputs for ProceduralTexture, including the declared data and presentation options.

```ts
interface ProceduralTextureProps
```

Related API: [ProceduralTextureProps](/reference/types/textures/#proceduraltextureprops).

#### See also

[TextureKind](/reference/types/textures/#texturekind)

[TextureResolution](/reference/types/textures/#textureresolution)

[TexturePalette](/reference/types/textures/#texturepalette)

[TextureRenderer](/reference/types/textures/#texturerenderer)

[ProceduralTexture](/reference/components/procedural-texture/)

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:23](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L23)

#### Properties and methods

<span id="api-ProceduralTextureProps-kind"></span>
<details>
<summary>kind</summary>


```ts
readonly kind: TextureKind
```

Related API: [TextureKind](/reference/types/textures/#texturekind).

Selects the kind of geometry, material, or result. See TextureKind.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:25](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L25)

</details>

<span id="api-ProceduralTextureProps-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See
ProceduralTextureProps.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:30](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L30)

</details>

<span id="api-ProceduralTextureProps-resolution"></span>
<details>
<summary>resolution (optional)</summary>


```ts
readonly resolution?: TextureResolution | undefined
```

Related API: [TextureResolution](/reference/types/textures/#textureresolution).

Dimensions of the simulation or raster grid. See TextureResolution.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:32](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L32)

</details>

<span id="api-ProceduralTextureProps-scale"></span>
<details>
<summary>scale (optional)</summary>


```ts
readonly scale?: number | undefined
```

Feature frequency across the texture, from 1 to 32.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:34](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L34)

</details>

<span id="api-ProceduralTextureProps-detail"></span>
<details>
<summary>detail (optional)</summary>


```ts
readonly detail?: number | undefined
```

Distortion, grain strength, or cellular jitter, from 0 to 1.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:36](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L36)

</details>

<span id="api-ProceduralTextureProps-palette"></span>
<details>
<summary>palette (optional)</summary>


```ts
readonly palette?: TexturePalette | undefined
```

Related API: [TexturePalette](/reference/types/textures/#texturepalette).

Ordered colors used to present texture intensity. See TexturePalette.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:38](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L38)

</details>

<span id="api-ProceduralTextureProps-render"></span>
<details>
<summary>render (optional)</summary>


```ts
readonly render?: TextureRenderer | undefined
```

Related API: [TextureRenderer](/reference/types/textures/#texturerenderer).

Renders the current data or resources using the supplied context. See TextureRenderer
.

[View source — packages/core/src/features/textures/lib/procedural-texture.ts:43](/source/packages/core/src/features/textures/lib/procedural-texture-ts/#L43)

</details>

<span id="api-TextureKind"></span>

### TextureKind

The supported static material generators: marble, paper, and cellular.

```ts
type TextureKind = "marble" | "paper" | "cellular"
```

Related API: [TextureKind](/reference/types/textures/#texturekind), [marble](/reference/types/textures/#marble), [paper](/reference/types/textures/#paper), [cellular](/reference/types/textures/#cellular).

#### See also

[ProceduralTextureProps](/reference/types/textures/#proceduraltextureprops)

[View source — packages/core/src/features/textures/lib/material-field.ts:11](/source/packages/core/src/features/textures/lib/material-field-ts/#L11)

<span id="api-TextureRenderer"></span>

### TextureRenderer

Custom presentation callback receiving an offscreen context and the current texture raster
frame.

```ts
type TextureRenderer = (
  context: OffscreenCanvasRenderingContext2D,
  texture: Readonly<TextureRenderFrame>,
) => void
```

Related API: [TextureRenderer](/reference/types/textures/#texturerenderer), [TextureRenderFrame](/reference/types/textures/#texturerenderframe).

#### Parameters

- **`context`** — Offscreen drawing context to paint into.

- **`texture`** — Current texture surface and frame metadata. See [TextureRenderFrame](/reference/types/textures/#texturerenderframe).

#### See also

[TextureRenderFrame](/reference/types/textures/#texturerenderframe)

[ReactionDiffusionProps](/reference/types/textures/#reactiondiffusionprops)

[ProceduralTextureProps](/reference/types/textures/#proceduraltextureprops)

[View source — packages/core/src/features/textures/lib/presentation.ts:40](/source/packages/core/src/features/textures/lib/presentation-ts/#L40)

<span id="api-TextureRenderFrame"></span>

### TextureRenderFrame

Borrowed sources are valid only during the synchronous renderer callback.

```ts
interface TextureRenderFrame
```

Related API: [TextureRenderFrame](/reference/types/textures/#texturerenderframe).

#### See also

[TextureRenderer](/reference/types/textures/#texturerenderer)

[View source — packages/core/src/features/textures/lib/presentation.ts:9](/source/packages/core/src/features/textures/lib/presentation-ts/#L9)

#### Properties and methods

<span id="api-TextureRenderFrame-source"></span>
<details>
<summary>source</summary>


```ts
readonly source: OffscreenCanvas
```

Current offscreen texture raster available to the presentation callback. See TextureRenderFrame.

[View source — packages/core/src/features/textures/lib/presentation.ts:11](/source/packages/core/src/features/textures/lib/presentation-ts/#L11)

</details>

<span id="api-TextureRenderFrame-mask"></span>
<details>
<summary>mask</summary>


```ts
readonly mask: OffscreenCanvas
```

White with texture intensity as alpha, allocated lazily on first access.

[View source — packages/core/src/features/textures/lib/presentation.ts:13](/source/packages/core/src/features/textures/lib/presentation-ts/#L13)

</details>

<span id="api-TextureRenderFrame-width"></span>
<details>
<summary>width</summary>


```ts
readonly width: number
```

Horizontal extent in the units of the containing geometry or surface. See
TextureRenderFrame.

[View source — packages/core/src/features/textures/lib/presentation.ts:18](/source/packages/core/src/features/textures/lib/presentation-ts/#L18)

</details>

<span id="api-TextureRenderFrame-height"></span>
<details>
<summary>height</summary>


```ts
readonly height: number
```

Vertical extent in the units of the containing geometry or surface. See
TextureRenderFrame.

[View source — packages/core/src/features/textures/lib/presentation.ts:23](/source/packages/core/src/features/textures/lib/presentation-ts/#L23)

</details>

<span id="api-TextureRenderFrame-textureWidth"></span>
<details>
<summary>textureWidth</summary>


```ts
readonly textureWidth: number
```

Width of the underlying texture raster in pixels. See TextureRenderFrame.

[View source — packages/core/src/features/textures/lib/presentation.ts:25](/source/packages/core/src/features/textures/lib/presentation-ts/#L25)

</details>

<span id="api-TextureRenderFrame-textureHeight"></span>
<details>
<summary>textureHeight</summary>


```ts
readonly textureHeight: number
```

Height of the underlying texture raster in pixels. See TextureRenderFrame.

[View source — packages/core/src/features/textures/lib/presentation.ts:27](/source/packages/core/src/features/textures/lib/presentation-ts/#L27)

</details>

<span id="api-marble"></span>

### marble

Creates a seeded marble texture recipe with configurable feature scale and distortion.

```ts
marble: (options?: MaterialOptions) => TextureRecipe<never>
```

Related API: [marble](/reference/types/textures/#marble), [MaterialOptions](/reference/types/textures/#materialoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe).

#### Parameters

- **`options`** — Seed, feature scale, and detail settings. See [MaterialOptions](/reference/types/textures/#materialoptions).

#### Returns

A procedural material recipe for useTexture. See [TextureRecipe](/reference/types/texture-resources/#texturerecipe).

#### See also

[MaterialOptions](/reference/types/textures/#materialoptions)

[TextureRecipe](/reference/types/texture-resources/#texturerecipe)

[View source — packages/core/src/features/textures/lib/definitions.ts:163](/source/packages/core/src/features/textures/lib/definitions-ts/#L163)

<span id="api-paper"></span>

### paper

Creates a seeded paper texture recipe with configurable feature scale and grain.

```ts
paper: (options?: MaterialOptions) => TextureRecipe<never>
```

Related API: [paper](/reference/types/textures/#paper), [MaterialOptions](/reference/types/textures/#materialoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe).

#### Parameters

- **`options`** — Seed, feature scale, and detail settings. See [MaterialOptions](/reference/types/textures/#materialoptions).

#### Returns

A procedural material recipe for useTexture. See [TextureRecipe](/reference/types/texture-resources/#texturerecipe).

#### See also

[MaterialOptions](/reference/types/textures/#materialoptions)

[TextureRecipe](/reference/types/texture-resources/#texturerecipe)

[View source — packages/core/src/features/textures/lib/definitions.ts:173](/source/packages/core/src/features/textures/lib/definitions-ts/#L173)

<span id="api-cellular"></span>

### cellular

Creates a seeded cellular texture recipe with configurable feature scale and jitter.

```ts
cellular: (options?: MaterialOptions) => TextureRecipe<never>
```

Related API: [cellular](/reference/types/textures/#cellular), [MaterialOptions](/reference/types/textures/#materialoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe).

#### Parameters

- **`options`** — Seed, feature scale, and detail settings. See [MaterialOptions](/reference/types/textures/#materialoptions).

#### Returns

A procedural material recipe for useTexture. See [TextureRecipe](/reference/types/texture-resources/#texturerecipe).

#### See also

[MaterialOptions](/reference/types/textures/#materialoptions)

[TextureRecipe](/reference/types/texture-resources/#texturerecipe)

[View source — packages/core/src/features/textures/lib/definitions.ts:183](/source/packages/core/src/features/textures/lib/definitions-ts/#L183)

<span id="api-reactionDiffusion"></span>

### reactionDiffusion

Creates a stateful reaction-diffusion texture recipe supporting paint, stirring, pause, and
reset
messages.

```ts
reactionDiffusion: (options?: ReactionDiffusionOptions) => TextureRecipe<InkMessage>
```

Related API: [reactionDiffusion](/reference/types/textures/#reactiondiffusion), [ReactionDiffusionOptions](/reference/types/textures/#reactiondiffusionoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe), [InkMessage](/reference/types/textures/#inkmessage).

#### Parameters

- **`options`** — Reaction and diffusion parameters, initialization, and rendering options. See
[ReactionDiffusionOptions](/reference/types/textures/#reactiondiffusionoptions) .

#### Returns

A reaction-diffusion texture recipe for useTexture.

#### See also

[ReactionDiffusionOptions](/reference/types/textures/#reactiondiffusionoptions)

[View source — packages/core/src/features/textures/lib/definitions.ts:326](/source/packages/core/src/features/textures/lib/definitions-ts/#L326)

<span id="api-MaterialOptions"></span>

### MaterialOptions

Seed, feature scale, and detail controls shared by static material recipes.

```ts
interface MaterialOptions
```

Related API: [MaterialOptions](/reference/types/textures/#materialoptions).

#### See also

[marble](/reference/types/textures/#marble)

[paper](/reference/types/textures/#paper)

[cellular](/reference/types/textures/#cellular)

[View source — packages/core/src/features/textures/lib/definitions.ts:20](/source/packages/core/src/features/textures/lib/definitions-ts/#L20)

#### Properties and methods

<span id="api-MaterialOptions-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See MaterialOptions
.

[View source — packages/core/src/features/textures/lib/definitions.ts:25](/source/packages/core/src/features/textures/lib/definitions-ts/#L25)

</details>

<span id="api-MaterialOptions-scale"></span>
<details>
<summary>scale (optional)</summary>


```ts
readonly scale?: number | undefined
```

Feature frequency across the generated material. See MaterialOptions.

[View source — packages/core/src/features/textures/lib/definitions.ts:27](/source/packages/core/src/features/textures/lib/definitions-ts/#L27)

</details>

<span id="api-MaterialOptions-detail"></span>
<details>
<summary>detail (optional)</summary>


```ts
readonly detail?: number | undefined
```

Material-specific distortion, grain strength, or cellular jitter. See MaterialOptions.

[View source — packages/core/src/features/textures/lib/definitions.ts:29](/source/packages/core/src/features/textures/lib/definitions-ts/#L29)

</details>

<span id="api-ReactionDiffusionOptions"></span>

### ReactionDiffusionOptions

Seed and pattern preset for a reaction-diffusion recipe.

```ts
interface ReactionDiffusionOptions
```

Related API: [ReactionDiffusionOptions](/reference/types/textures/#reactiondiffusionoptions).

#### See also

[reactionDiffusion](/reference/types/textures/#reactiondiffusion)

[View source — packages/core/src/features/textures/lib/definitions.ts:36](/source/packages/core/src/features/textures/lib/definitions-ts/#L36)

#### Properties and methods

<span id="api-ReactionDiffusionOptions-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See
ReactionDiffusionOptions.

[View source — packages/core/src/features/textures/lib/definitions.ts:41](/source/packages/core/src/features/textures/lib/definitions-ts/#L41)

</details>

<span id="api-ReactionDiffusionOptions-preset"></span>
<details>
<summary>preset (optional)</summary>


```ts
readonly preset?: "spots" | "stripes" | undefined
```

Named pattern configuration used to initialize the simulation. See
ReactionDiffusionOptions.

[View source — packages/core/src/features/textures/lib/definitions.ts:46](/source/packages/core/src/features/textures/lib/definitions-ts/#L46)

</details>

<span id="api-InkMessage"></span>

### InkMessage

Paint, stir, pause, or reset commands accepted by a reaction-diffusion texture.

<details>
<summary>Full type declaration</summary>

```ts
type InkMessage = | {
      /** The literal "paint" identifying this variant. See {@link InkMessage}. */
      readonly type: "paint";
      /** Normalized horizontal texture coordinate. See {@link InkMessage}. */
      readonly u: number;
      /** Normalized vertical texture coordinate. See {@link InkMessage}. */
      readonly v: number;
      /** Radius in the coordinate system of this geometry or effect. See {@link InkMessage}. */
      readonly radius?: number;
      /** Magnitude of the displacement or brush effect. See {@link InkMessage}. */
      readonly strength?: number;
    }
  | {
      /** The literal "stir" identifying this variant. See {@link InkMessage}. */
      readonly type: "stir";
      /** Normalized horizontal texture coordinate. See {@link InkMessage}. */
      readonly u: number;
      /** Normalized vertical texture coordinate. See {@link InkMessage}. */
      readonly v: number;
      /** Normalized displacement of the existing field, not a paint dose. */
      readonly du: number;
      /** Normalized vertical displacement of the texture field. See {@link InkMessage}. */
      readonly dv: number;
      /** Influence radius in texture cells. */
      readonly radius?: number;
    }
  | {
      /** The literal "pause" identifying this variant. See {@link InkMessage}. */
      readonly type: "pause";
      /** Whether simulation or playback advancement is suspended. See {@link InkMessage}. */
      readonly paused: boolean;
    }
  | {
      /** The literal "reset" identifying this variant. See {@link InkMessage}. */
      readonly type: "reset";
    }
```

</details>

Related API: [InkMessage](/reference/types/textures/#inkmessage), [displacement](/reference/types/filters/#displacement).

#### See also

[reactionDiffusion](/reference/types/textures/#reactiondiffusion)

[View source — packages/core/src/features/textures/lib/definitions.ts:53](/source/packages/core/src/features/textures/lib/definitions-ts/#L53)

#### Properties and methods

<span id="api-InkMessage-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "paint" | "pause" | "reset" | "stir"
```

The literal "paint" identifying this variant. See InkMessage.
The literal "stir" identifying this variant. See InkMessage.
The literal "pause" identifying this variant. See InkMessage.
The literal "reset" identifying this variant. See InkMessage.

[View source — packages/core/src/features/textures/lib/definitions.ts:56](/source/packages/core/src/features/textures/lib/definitions-ts/#L56)

</details>

<span id="api-waterWaves"></span>

### waterWaves

Creates an animated water-wave texture recipe that accepts ripple, pause, and reset commands.

```ts
waterWaves: (options?: WaterWavesOptions) => TextureRecipe<WaterWavesMessage>
```

Related API: [waterWaves](/reference/types/textures/#waterwaves), [WaterWavesOptions](/reference/types/textures/#waterwavesoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe), [WaterWavesMessage](/reference/types/textures/#waterwavesmessage).

#### Parameters

- **`options`** — Wave simulation and rendering settings. See [WaterWavesOptions](/reference/types/textures/#waterwavesoptions).

#### Returns

A water-wave texture recipe accepting wave messages. See [TextureRecipe](/reference/types/texture-resources/#texturerecipe) ,
[WaterWavesMessage](/reference/types/textures/#waterwavesmessage) .

#### See also

[WaterWavesOptions](/reference/types/textures/#waterwavesoptions)

[TextureRecipe](/reference/types/texture-resources/#texturerecipe)

[WaterWavesMessage](/reference/types/textures/#waterwavesmessage)

[View source — packages/core/src/features/textures/lib/water-waves.ts:250](/source/packages/core/src/features/textures/lib/water-waves-ts/#L250)

<span id="api-WaterWavesOptions"></span>

### WaterWavesOptions

Seed, animation speed, feature scale, ripple strength, and initial pause state of water waves.

```ts
interface WaterWavesOptions
```

Related API: [WaterWavesOptions](/reference/types/textures/#waterwavesoptions).

#### See also

[waterWaves](/reference/types/textures/#waterwaves)

[View source — packages/core/src/features/textures/lib/water-waves.ts:14](/source/packages/core/src/features/textures/lib/water-waves-ts/#L14)

#### Properties and methods

<span id="api-WaterWavesOptions-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See
WaterWavesOptions.

[View source — packages/core/src/features/textures/lib/water-waves.ts:19](/source/packages/core/src/features/textures/lib/water-waves-ts/#L19)

</details>

<span id="api-WaterWavesOptions-speed"></span>
<details>
<summary>speed (optional)</summary>


```ts
readonly speed?: number | undefined
```

Multiplier controlling the simulation's animation rate. See WaterWavesOptions.

[View source — packages/core/src/features/textures/lib/water-waves.ts:21](/source/packages/core/src/features/textures/lib/water-waves-ts/#L21)

</details>

<span id="api-WaterWavesOptions-scale"></span>
<details>
<summary>scale (optional)</summary>


```ts
readonly scale?: number | undefined
```

Spatial scale of the generated wave pattern. See WaterWavesOptions.

[View source — packages/core/src/features/textures/lib/water-waves.ts:23](/source/packages/core/src/features/textures/lib/water-waves-ts/#L23)

</details>

<span id="api-WaterWavesOptions-rippleStrength"></span>
<details>
<summary>rippleStrength (optional)</summary>


```ts
readonly rippleStrength?: number | undefined
```

Strength of injected wave disturbances. See WaterWavesOptions.

[View source — packages/core/src/features/textures/lib/water-waves.ts:25](/source/packages/core/src/features/textures/lib/water-waves-ts/#L25)

</details>

<span id="api-WaterWavesOptions-paused"></span>
<details>
<summary>paused (optional)</summary>


```ts
readonly paused?: boolean | undefined
```

Whether simulation or playback advancement is suspended. See WaterWavesOptions.

[View source — packages/core/src/features/textures/lib/water-waves.ts:27](/source/packages/core/src/features/textures/lib/water-waves-ts/#L27)

</details>

<span id="api-WaterWavesMessage"></span>

### WaterWavesMessage

Ripple, pause, and reset commands for a water-wave texture.

<details>
<summary>Full type declaration</summary>

```ts
type WaterWavesMessage = | {
      /** The literal "pause" identifying this variant. See {@link WaterWavesMessage}. */
      readonly type: "pause";
      /** Whether simulation or playback advancement is suspended. See {@link WaterWavesMessage}. */
      readonly paused: boolean;
    }
  | {
      /** The literal "reset" identifying this variant. See {@link WaterWavesMessage}. */
      readonly type: "reset";
    }
  | {
      /** The literal "ripple" identifying this variant. See {@link WaterWavesMessage}. */
      readonly type: "ripple";
      /**
       * Horizontal coordinate or displacement in the containing coordinate system. See
       * {@link WaterWavesMessage}.
       */
      readonly x: number;
      /**
       * Vertical coordinate or displacement in the containing coordinate system. See
       * {@link WaterWavesMessage}.
       */
      readonly y: number;
    }
```

</details>

Related API: [WaterWavesMessage](/reference/types/textures/#waterwavesmessage), [displacement](/reference/types/filters/#displacement).

#### See also

[waterWaves](/reference/types/textures/#waterwaves)

[View source — packages/core/src/features/textures/lib/water-waves.ts:35](/source/packages/core/src/features/textures/lib/water-waves-ts/#L35)

#### Properties and methods

<span id="api-WaterWavesMessage-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "pause" | "reset" | "ripple"
```

The literal "pause" identifying this variant. See WaterWavesMessage.
The literal "reset" identifying this variant. See WaterWavesMessage.
The literal "ripple" identifying this variant. See WaterWavesMessage.

[View source — packages/core/src/features/textures/lib/water-waves.ts:38](/source/packages/core/src/features/textures/lib/water-waves-ts/#L38)

</details>

<span id="api-waterSurface"></span>

### waterSurface

A WASM-only, bounded reflective height-field displacement map.

```ts
waterSurface: (options?: WaterSurfaceOptions) => TextureRecipe<WaterSurfaceMessage>
```

Related API: [waterSurface](/reference/types/textures/#watersurface), [WaterSurfaceOptions](/reference/types/textures/#watersurfaceoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe), [WaterSurfaceMessage](/reference/types/textures/#watersurfacemessage).

#### Parameters

- **`options`** — Water appearance and simulation settings. See [WaterSurfaceOptions](/reference/types/textures/#watersurfaceoptions).

#### Returns

A water-surface texture recipe accepting surface messages. See [TextureRecipe](/reference/types/texture-resources/#texturerecipe) ,
[WaterSurfaceMessage](/reference/types/textures/#watersurfacemessage) .

#### See also

[WaterSurfaceOptions](/reference/types/textures/#watersurfaceoptions)

[TextureRecipe](/reference/types/texture-resources/#texturerecipe)

[WaterSurfaceMessage](/reference/types/textures/#watersurfacemessage)

[View source — packages/core/src/features/textures/lib/water-surface.ts:617](/source/packages/core/src/features/textures/lib/water-surface-ts/#L617)

<span id="api-WaterSurfaceMessage"></span>

### WaterSurfaceMessage

Ripple, pause, and reset commands for a water-surface simulation.

<details>
<summary>Full type declaration</summary>

```ts
type WaterSurfaceMessage = | {
      /** The literal "pause" identifying this variant. See {@link WaterSurfaceMessage}. */
      readonly type: "pause";
      /** Whether simulation or playback advancement is suspended. See {@link WaterSurfaceMessage}. */
      readonly paused: boolean;
    }
  | {
      /** The literal "reset" identifying this variant. See {@link WaterSurfaceMessage}. */
      readonly type: "reset";
    }
  | {
      /** The literal "ripple" identifying this variant. See {@link WaterSurfaceMessage}. */
      readonly type: "ripple";
      /**
       * Horizontal coordinate or displacement in the containing coordinate system. See
       * {@link WaterSurfaceMessage}.
       */
      readonly x: number;
      /**
       * Vertical coordinate or displacement in the containing coordinate system. See
       * {@link WaterSurfaceMessage}.
       */
      readonly y: number;
    }
```

</details>

Related API: [WaterSurfaceMessage](/reference/types/textures/#watersurfacemessage), [displacement](/reference/types/filters/#displacement).

#### See also

[waterSurface](/reference/types/textures/#watersurface)

[View source — packages/core/src/features/textures/lib/water-surface.ts:68](/source/packages/core/src/features/textures/lib/water-surface-ts/#L68)

#### Properties and methods

<span id="api-WaterSurfaceMessage-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "pause" | "reset" | "ripple"
```

The literal "pause" identifying this variant. See WaterSurfaceMessage.
The literal "reset" identifying this variant. See WaterSurfaceMessage.
The literal "ripple" identifying this variant. See WaterSurfaceMessage.

[View source — packages/core/src/features/textures/lib/water-surface.ts:71](/source/packages/core/src/features/textures/lib/water-surface-ts/#L71)

</details>

<span id="api-WaterSurfaceObstacle"></span>

### WaterSurfaceObstacle

An axis-aligned obstacle rectangle in a water-surface simulation.

```ts
interface WaterSurfaceObstacle
```

Related API: [WaterSurfaceObstacle](/reference/types/textures/#watersurfaceobstacle).

#### See also

[WaterSurfaceOptions](/reference/types/textures/#watersurfaceoptions)

[View source — packages/core/src/features/textures/lib/water-surface.ts:14](/source/packages/core/src/features/textures/lib/water-surface-ts/#L14)

#### Properties and methods

<span id="api-WaterSurfaceObstacle-x"></span>
<details>
<summary>x</summary>


```ts
readonly x: number
```

Horizontal coordinate or displacement in the containing coordinate system. See
WaterSurfaceObstacle.

[View source — packages/core/src/features/textures/lib/water-surface.ts:19](/source/packages/core/src/features/textures/lib/water-surface-ts/#L19)

</details>

<span id="api-WaterSurfaceObstacle-y"></span>
<details>
<summary>y</summary>


```ts
readonly y: number
```

Vertical coordinate or displacement in the containing coordinate system. See
WaterSurfaceObstacle.

[View source — packages/core/src/features/textures/lib/water-surface.ts:24](/source/packages/core/src/features/textures/lib/water-surface-ts/#L24)

</details>

<span id="api-WaterSurfaceObstacle-width"></span>
<details>
<summary>width</summary>


```ts
readonly width: number
```

Horizontal extent in the units of the containing geometry or surface. See
WaterSurfaceObstacle.

[View source — packages/core/src/features/textures/lib/water-surface.ts:29](/source/packages/core/src/features/textures/lib/water-surface-ts/#L29)

</details>

<span id="api-WaterSurfaceObstacle-height"></span>
<details>
<summary>height</summary>


```ts
readonly height: number
```

Vertical extent in the units of the containing geometry or surface. See
WaterSurfaceObstacle.

[View source — packages/core/src/features/textures/lib/water-surface.ts:34](/source/packages/core/src/features/textures/lib/water-surface-ts/#L34)

</details>

<span id="api-WaterSurfaceOptions"></span>

### WaterSurfaceOptions

Water simulation controls including wave motion, viscosity, pause state, and obstacles.

```ts
interface WaterSurfaceOptions
```

Related API: [WaterSurfaceOptions](/reference/types/textures/#watersurfaceoptions).

#### See also

[WaterSurfaceObstacle](/reference/types/textures/#watersurfaceobstacle)

[waterSurface](/reference/types/textures/#watersurface)

[View source — packages/core/src/features/textures/lib/water-surface.ts:43](/source/packages/core/src/features/textures/lib/water-surface-ts/#L43)

#### Properties and methods

<span id="api-WaterSurfaceOptions-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See
WaterSurfaceOptions.

[View source — packages/core/src/features/textures/lib/water-surface.ts:48](/source/packages/core/src/features/textures/lib/water-surface-ts/#L48)

</details>

<span id="api-WaterSurfaceOptions-speed"></span>
<details>
<summary>speed (optional)</summary>


```ts
readonly speed?: number | undefined
```

Multiplier controlling the simulation's animation rate. See WaterSurfaceOptions.

[View source — packages/core/src/features/textures/lib/water-surface.ts:50](/source/packages/core/src/features/textures/lib/water-surface-ts/#L50)

</details>

<span id="api-WaterSurfaceOptions-scale"></span>
<details>
<summary>scale (optional)</summary>


```ts
readonly scale?: number | undefined
```

Spatial scale of the generated water pattern. See WaterSurfaceOptions.

[View source — packages/core/src/features/textures/lib/water-surface.ts:52](/source/packages/core/src/features/textures/lib/water-surface-ts/#L52)

</details>

<span id="api-WaterSurfaceOptions-rippleStrength"></span>
<details>
<summary>rippleStrength (optional)</summary>


```ts
readonly rippleStrength?: number | undefined
```

Strength of injected wave disturbances. See WaterSurfaceOptions.

[View source — packages/core/src/features/textures/lib/water-surface.ts:54](/source/packages/core/src/features/textures/lib/water-surface-ts/#L54)

</details>

<span id="api-WaterSurfaceOptions-viscosity"></span>
<details>
<summary>viscosity (optional)</summary>


```ts
readonly viscosity?: number | undefined
```

Artistic thickness from 0 (water) to 1 (slow, strongly damped).

[View source — packages/core/src/features/textures/lib/water-surface.ts:56](/source/packages/core/src/features/textures/lib/water-surface-ts/#L56)

</details>

<span id="api-WaterSurfaceOptions-paused"></span>
<details>
<summary>paused (optional)</summary>


```ts
readonly paused?: boolean | undefined
```

Whether simulation or playback advancement is suspended. See WaterSurfaceOptions.

[View source — packages/core/src/features/textures/lib/water-surface.ts:58](/source/packages/core/src/features/textures/lib/water-surface-ts/#L58)

</details>

<span id="api-WaterSurfaceOptions-obstacles"></span>
<details>
<summary>obstacles (optional)</summary>


```ts
readonly obstacles?: readonly WaterSurfaceObstacle[] | undefined
```

Related API: [WaterSurfaceObstacle](/reference/types/textures/#watersurfaceobstacle).

Obstacle geometry used by the flow or water simulation. See WaterSurfaceObstacle.

[View source — packages/core/src/features/textures/lib/water-surface.ts:60](/source/packages/core/src/features/textures/lib/water-surface-ts/#L60)

</details>

<span id="api-rainDrops"></span>

### rainDrops

A seeded rain-on-glass displacement map, advanced by Pibbl's scheduler.

```ts
rainDrops: (options?: RainDropsOptions) => TextureRecipe<RainDropsMessage>
```

Related API: [rainDrops](/reference/types/textures/#raindrops), [RainDropsOptions](/reference/types/textures/#raindropsoptions), [TextureRecipe](/reference/types/texture-resources/#texturerecipe), [RainDropsMessage](/reference/types/textures/#raindropsmessage).

#### Parameters

- **`options`** — Raindrop simulation and appearance settings. See [RainDropsOptions](/reference/types/textures/#raindropsoptions).

#### Returns

A raindrop texture recipe accepting raindrop messages. See [TextureRecipe](/reference/types/texture-resources/#texturerecipe) ,
[RainDropsMessage](/reference/types/textures/#raindropsmessage) .

#### See also

[RainDropsOptions](/reference/types/textures/#raindropsoptions)

[TextureRecipe](/reference/types/texture-resources/#texturerecipe)

[RainDropsMessage](/reference/types/textures/#raindropsmessage)

[View source — packages/core/src/features/textures/lib/rain-drops.ts:401](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L401)

<span id="api-RainDropsOptions"></span>

### RainDropsOptions

Rain rate, gravity, initial drops, condensation, trail, and outline controls for a raindrop texture.

```ts
interface RainDropsOptions
```

Related API: [RainDropsOptions](/reference/types/textures/#raindropsoptions).

#### See also

[rainDrops](/reference/types/textures/#raindrops)

[View source — packages/core/src/features/textures/lib/rain-drops.ts:9](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L9)

#### Properties and methods

<span id="api-RainDropsOptions-seed"></span>
<details>
<summary>seed (optional)</summary>


```ts
readonly seed?: number | undefined
```

Seed used for deterministic sampling or simulation initialization. See
RainDropsOptions.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:14](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L14)

</details>

<span id="api-RainDropsOptions-rainRate"></span>
<details>
<summary>rainRate (optional)</summary>


```ts
readonly rainRate?: number | undefined
```

New beads per second, from 0 through 120.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:16](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L16)

</details>

<span id="api-RainDropsOptions-gravity"></span>
<details>
<summary>gravity (optional)</summary>


```ts
readonly gravity?: number | undefined
```

Downward acceleration multiplier, from 0 through 10.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:18](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L18)

</details>

<span id="api-RainDropsOptions-initialDrops"></span>
<details>
<summary>initialDrops (optional)</summary>


```ts
readonly initialDrops?: number | undefined
```

Number of drops seeded before continuous rain starts. See RainDropsOptions.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:20](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L20)

</details>

<span id="api-RainDropsOptions-paused"></span>
<details>
<summary>paused (optional)</summary>


```ts
readonly paused?: boolean | undefined
```

Whether simulation or playback advancement is suspended. See RainDropsOptions.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:22](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L22)

</details>

<span id="api-RainDropsOptions-condensation"></span>
<details>
<summary>condensation (optional)</summary>


```ts
readonly condensation?: number | undefined
```

Fine droplet film coverage, from 0 (clear) through 1 (mist).

[View source — packages/core/src/features/textures/lib/rain-drops.ts:24](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L24)

</details>

<span id="api-RainDropsOptions-trailPersistence"></span>
<details>
<summary>trailPersistence (optional)</summary>


```ts
readonly trailPersistence?: number | undefined
```

Seconds controlling trail drying and condensation recovery, from 0 through 60.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:26](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L26)

</details>

<span id="api-RainDropsOptions-trailStrength"></span>
<details>
<summary>trailStrength (optional)</summary>


```ts
readonly trailStrength?: number | undefined
```

Residual water left behind a moving drop, from 0 through 1.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:28](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L28)

</details>

<span id="api-RainDropsOptions-irregularity"></span>
<details>
<summary>irregularity (optional)</summary>


```ts
readonly irregularity?: number | undefined
```

Outline and path variation, from 0 (smooth) through 1.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:30](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L30)

</details>

<span id="api-RainDropsMessage"></span>

### RainDropsMessage

Pause, reset, finger-wipe, release, and localized nudge commands for a raindrop texture.

<details>
<summary>Full type declaration</summary>

```ts
type RainDropsMessage = | {
      /** The literal "pause" identifying this variant. See {@link RainDropsMessage}. */
      readonly type: "pause";
      /** Whether simulation or playback advancement is suspended. See {@link RainDropsMessage}. */
      readonly paused: boolean;
    }
  | {
      /** The literal "reset" identifying this variant. See {@link RainDropsMessage}. */
      readonly type: "reset";
    }
  /** Begin or move one finger contact; successive positions wipe a continuous path. */
  | {
      /** The literal "finger" identifying this variant. See {@link RainDropsMessage}. */
      readonly type: "finger";
      /**
       * Horizontal coordinate or displacement in the containing coordinate system. See
       * {@link RainDropsMessage}.
       */
      readonly x: number;
      /**
       * Vertical coordinate or displacement in the containing coordinate system. See
       * {@link RainDropsMessage}.
       */
      readonly y: number;
      /** Radius in the coordinate system of this geometry or effect. See {@link RainDropsMessage}. */
      readonly radius?: number;
    }
  | {
      /** The literal "release" identifying this variant. See {@link RainDropsMessage}. */
      readonly type: "release";
    }
  /** Center and movement use normalized width/height; radius uses the shorter side. */
  | {
      /** The literal "nudge" identifying this variant. See {@link RainDropsMessage}. */
      readonly type: "nudge";
      /**
       * Horizontal coordinate or displacement in the containing coordinate system. See
       * {@link RainDropsMessage}.
       */
      readonly x: number;
      /**
       * Vertical coordinate or displacement in the containing coordinate system. See
       * {@link RainDropsMessage}.
       */
      readonly y: number;
      /** Horizontal displacement applied by the interaction. See {@link RainDropsMessage}. */
      readonly dx: number;
      /** Vertical displacement applied by the interaction. See {@link RainDropsMessage}. */
      readonly dy: number;
      /** Radius in the coordinate system of this geometry or effect. See {@link RainDropsMessage}. */
      readonly radius?: number;
    }
```

</details>

Related API: [RainDropsMessage](/reference/types/textures/#raindropsmessage), [wipe](/reference/hooks/use-visibility-transition/), [displacement](/reference/types/filters/#displacement).

#### See also

[rainDrops](/reference/types/textures/#raindrops)

[View source — packages/core/src/features/textures/lib/rain-drops.ts:38](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L38)

#### Properties and methods

<span id="api-RainDropsMessage-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "finger" | "nudge" | "pause" | "release" | "reset"
```

The literal "pause" identifying this variant. See RainDropsMessage.
The literal "reset" identifying this variant. See RainDropsMessage.
The literal "finger" identifying this variant. See RainDropsMessage.
The literal "release" identifying this variant. See RainDropsMessage.
The literal "nudge" identifying this variant. See RainDropsMessage.

[View source — packages/core/src/features/textures/lib/rain-drops.ts:41](/source/packages/core/src/features/textures/lib/rain-drops-ts/#L41)

</details>

## Implementation guidance for agents

Read the [Textures and reaction-diffusion companion](/agents/topics/textures/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Paint reaction diffusion](/minimal-examples/textures/texture-reaction-component/): Mount an interactive reaction-diffusion layer with a typed brush. [Plain source](/minimal/textures/texture-reaction-component.tsx)
- [Render a procedural material](/minimal-examples/textures/texture-procedural-component/): Paint a marble material with a typed palette, resolution, and synchronous renderer. [Plain source](/minimal/textures/texture-procedural-component.tsx)
- [Compare three material recipes](/minimal-examples/textures/texture-material-recipes/): Compare labeled marble, paper, and cellular swatches with palettes that reveal their surface detail. [Plain source](/minimal/textures/texture-material-recipes.tsx)
- [Send paint to a living ink texture](/minimal-examples/textures/texture-ink-recipe/): Create a reaction-diffusion recipe and send a typed paint command on click. [Plain source](/minimal/textures/texture-ink-recipe.tsx)
- [Refract through rain glass](/minimal-examples/textures/texture-rain-drops/): Use a rain map for displacement and localized condensation blur. [Plain source](/minimal/textures/texture-rain-drops.tsx)
- [Ripple a wave map](/minimal-examples/textures/texture-water-waves/): Refract and light a tiled sign through fine, fast-moving waves, with an unfiltered comparison toggle. [Plain source](/minimal/textures/texture-water-waves.tsx)
- [Ripple around an obstacle](/minimal-examples/textures/texture-water-surface/): Use a bounded water surface with a normalized rectangular obstacle. [Plain source](/minimal/textures/texture-water-surface.tsx)
## Interactive examples

- [Stirred Ink](/examples/stirred-ink/) · [Full page](/experience/stirred-ink/)
- [Rainy Window](/examples/rainy-window/) · [Full page](/experience/rainy-window/)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
