Texture types and palettes
Import these types and texturePalettes from @pibbl/core/textures.
ReactionDiffusionProps
Section titled “ReactionDiffusionProps”Optional seed, preset, resolution, palette, paused, resetRevision,
brush, and render inputs. Reset revision must be a safe integer.
ProceduralTextureProps
Section titled “ProceduralTextureProps”Required kind, optional seed, resolution, scale, detail, palette,
and render. Materials idle until inputs change.
TextureBrush
Section titled “TextureBrush”{ radius, strength }: finite radius in (0,128] simulation cells and strength
in [0,1]. false disables the reaction–diffusion brush.
TexturePalette
Section titled “TexturePalette”A readonly array of 2–16 opaque #RRGGBB strings, evenly interpolated in sRGB.
texturePalettes
Section titled “texturePalettes”Frozen lagoon, porcelain, and ember palettes. Pass an ordinary palette array
for custom colors.
TextureResolution
Section titled “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
Section titled “TextureKind”'marble' | 'paper' | 'cellular'.
TextureRenderer
Section titled “TextureRenderer”Synchronous (context, texture) => void callback. Its context uses logical display
units; state is saved/restored. No promises, hooks, or signal writes.
TextureRenderFrame
Section titled “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
Section titled “MaterialOptions”Seed, scale, and detail for marble, paper, and cellular recipe factories.
ReactionDiffusionOptions
Section titled “ReactionDiffusionOptions”Seed and spots/stripes preset for the reactionDiffusion recipe factory.
InkMessage
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “marble”Creates a seamless warped-band material recipe.
Creates a seamless fiber and grain recipe.
cellular
Section titled “cellular”Creates a seamless toroidal cell-field recipe.
reactionDiffusion
Section titled “reactionDiffusion”Creates a living Gray–Scott recipe that accepts InkMessage values.
waterWaves
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “API details from source”
ReactionDiffusionProps
Section titled “ReactionDiffusionProps”Authored inputs for ReactionDiffusion, including the declared data and presentation options.
interface ReactionDiffusionPropsRelated API: ReactionDiffusionProps.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:33
Properties and methods
Section titled “Properties and methods”
render (optional)
readonly render?: TextureRenderer | undefinedRelated API: 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
resolution (optional)
readonly resolution?: TextureResolution | undefinedRelated API: TextureResolution.
Dimensions of the simulation or raster grid. See TextureResolution.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:40
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See ReactionDiffusionProps.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:45
preset (optional)
readonly preset?: "spots" | "stripes" | undefinedNamed pattern configuration used to initialize the simulation. See ReactionDiffusionProps.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:50
palette (optional)
readonly palette?: TexturePalette | undefinedRelated API: TexturePalette.
Ordered colors used to present texture intensity. See TexturePalette.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:52
paused (optional)
readonly paused?: boolean | undefinedWhether simulation or playback advancement is suspended. See ReactionDiffusionProps.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:56
resetRevision (optional)
readonly resetRevision?: number | undefinedChanging this revision requests a fresh simulation initialization. See ReactionDiffusionProps.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:61
brush (optional)
readonly brush?: false | TextureBrush | undefinedRelated API: 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
TextureBrush
Section titled “TextureBrush”Radius and strength of a reaction-diffusion brush stroke.
interface TextureBrushRelated API: TextureBrush.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:18
Properties and methods
Section titled “Properties and methods”
radius
readonly radius: numberRadius in the coordinate system of this geometry or effect. See TextureBrush.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:20
strength
readonly strength: numberMagnitude of the displacement or brush effect. See TextureBrush.
View source — packages/core/src/features/textures/lib/reaction-diffusion.ts:22
texturePalettes
Section titled “texturePalettes”Built-in immutable color ramps for procedural texture presentation.
texturePalettes: Readonly<{ lagoon: readonly string[]; porcelain: readonly string[]; ember: readonly string[]; }>Related API: texturePalettes.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/palette.ts:16
TexturePalette
Section titled “TexturePalette”Ordered colors forming a texture’s presentation ramp.
type TexturePalette = readonly string[]Related API: TexturePalette.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/palette.ts:10
TextureResolution
Section titled “TextureResolution”The width and height of a texture’s raster grid.
interface TextureResolutionRelated API: TextureResolution.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/palette.ts:56
Properties and methods
Section titled “Properties and methods”
width
readonly width: numberHorizontal extent in the units of the containing geometry or surface. See TextureResolution.
View source — packages/core/src/features/textures/lib/palette.ts:61
height
readonly height: numberVertical extent in the units of the containing geometry or surface. See TextureResolution.
View source — packages/core/src/features/textures/lib/palette.ts:66
ProceduralTextureProps
Section titled “ProceduralTextureProps”Authored inputs for ProceduralTexture, including the declared data and presentation options.
interface ProceduralTexturePropsRelated API: ProceduralTextureProps.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/procedural-texture.ts:23
Properties and methods
Section titled “Properties and methods”
kind
readonly kind: TextureKindRelated API: TextureKind.
Selects the kind of geometry, material, or result. See TextureKind.
View source — packages/core/src/features/textures/lib/procedural-texture.ts:25
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See ProceduralTextureProps.
View source — packages/core/src/features/textures/lib/procedural-texture.ts:30
resolution (optional)
readonly resolution?: TextureResolution | undefinedRelated API: TextureResolution.
Dimensions of the simulation or raster grid. See TextureResolution.
View source — packages/core/src/features/textures/lib/procedural-texture.ts:32
scale (optional)
readonly scale?: number | undefinedFeature frequency across the texture, from 1 to 32.
View source — packages/core/src/features/textures/lib/procedural-texture.ts:34
detail (optional)
readonly detail?: number | undefinedDistortion, grain strength, or cellular jitter, from 0 to 1.
View source — packages/core/src/features/textures/lib/procedural-texture.ts:36
palette (optional)
readonly palette?: TexturePalette | undefinedRelated API: TexturePalette.
Ordered colors used to present texture intensity. See TexturePalette.
View source — packages/core/src/features/textures/lib/procedural-texture.ts:38
render (optional)
readonly render?: TextureRenderer | undefinedRelated API: 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
TextureKind
Section titled “TextureKind”The supported static material generators: marble, paper, and cellular.
type TextureKind = "marble" | "paper" | "cellular"Related API: TextureKind, marble, paper, cellular.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/material-field.ts:11
TextureRenderer
Section titled “TextureRenderer”Custom presentation callback receiving an offscreen context and the current texture raster frame.
type TextureRenderer = ( context: OffscreenCanvasRenderingContext2D, texture: Readonly<TextureRenderFrame>,) => voidRelated API: TextureRenderer, TextureRenderFrame.
Parameters
Section titled “Parameters”-
context— Offscreen drawing context to paint into. -
texture— Current texture surface and frame metadata. See TextureRenderFrame.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/presentation.ts:40
TextureRenderFrame
Section titled “TextureRenderFrame”Borrowed sources are valid only during the synchronous renderer callback.
interface TextureRenderFrameRelated API: TextureRenderFrame.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/presentation.ts:9
Properties and methods
Section titled “Properties and methods”
source
readonly source: OffscreenCanvasCurrent offscreen texture raster available to the presentation callback. See TextureRenderFrame.
View source — packages/core/src/features/textures/lib/presentation.ts:11
mask
readonly mask: OffscreenCanvasWhite with texture intensity as alpha, allocated lazily on first access.
View source — packages/core/src/features/textures/lib/presentation.ts:13
width
readonly width: numberHorizontal extent in the units of the containing geometry or surface. See TextureRenderFrame.
View source — packages/core/src/features/textures/lib/presentation.ts:18
height
readonly height: numberVertical extent in the units of the containing geometry or surface. See TextureRenderFrame.
View source — packages/core/src/features/textures/lib/presentation.ts:23
textureWidth
readonly textureWidth: numberWidth of the underlying texture raster in pixels. See TextureRenderFrame.
View source — packages/core/src/features/textures/lib/presentation.ts:25
textureHeight
readonly textureHeight: numberHeight of the underlying texture raster in pixels. See TextureRenderFrame.
View source — packages/core/src/features/textures/lib/presentation.ts:27
marble
Section titled “marble”Creates a seeded marble texture recipe with configurable feature scale and distortion.
marble: (options?: MaterialOptions) => TextureRecipe<never>Related API: marble, MaterialOptions, TextureRecipe.
Parameters
Section titled “Parameters”options— Seed, feature scale, and detail settings. See MaterialOptions.
Returns
Section titled “Returns”A procedural material recipe for useTexture. See TextureRecipe.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:163
Creates a seeded paper texture recipe with configurable feature scale and grain.
paper: (options?: MaterialOptions) => TextureRecipe<never>Related API: paper, MaterialOptions, TextureRecipe.
Parameters
Section titled “Parameters”options— Seed, feature scale, and detail settings. See MaterialOptions.
Returns
Section titled “Returns”A procedural material recipe for useTexture. See TextureRecipe.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:173
cellular
Section titled “cellular”Creates a seeded cellular texture recipe with configurable feature scale and jitter.
cellular: (options?: MaterialOptions) => TextureRecipe<never>Related API: cellular, MaterialOptions, TextureRecipe.
Parameters
Section titled “Parameters”options— Seed, feature scale, and detail settings. See MaterialOptions.
Returns
Section titled “Returns”A procedural material recipe for useTexture. See TextureRecipe.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:183
reactionDiffusion
Section titled “reactionDiffusion”Creates a stateful reaction-diffusion texture recipe supporting paint, stirring, pause, and reset messages.
reactionDiffusion: (options?: ReactionDiffusionOptions) => TextureRecipe<InkMessage>Related API: reactionDiffusion, ReactionDiffusionOptions, TextureRecipe, InkMessage.
Parameters
Section titled “Parameters”options— Reaction and diffusion parameters, initialization, and rendering options. See ReactionDiffusionOptions .
Returns
Section titled “Returns”A reaction-diffusion texture recipe for useTexture.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:326
MaterialOptions
Section titled “MaterialOptions”Seed, feature scale, and detail controls shared by static material recipes.
interface MaterialOptionsRelated API: MaterialOptions.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:20
Properties and methods
Section titled “Properties and methods”
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See MaterialOptions .
View source — packages/core/src/features/textures/lib/definitions.ts:25
scale (optional)
readonly scale?: number | undefinedFeature frequency across the generated material. See MaterialOptions.
View source — packages/core/src/features/textures/lib/definitions.ts:27
detail (optional)
readonly detail?: number | undefinedMaterial-specific distortion, grain strength, or cellular jitter. See MaterialOptions.
View source — packages/core/src/features/textures/lib/definitions.ts:29
ReactionDiffusionOptions
Section titled “ReactionDiffusionOptions”Seed and pattern preset for a reaction-diffusion recipe.
interface ReactionDiffusionOptionsRelated API: ReactionDiffusionOptions.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:36
Properties and methods
Section titled “Properties and methods”
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See ReactionDiffusionOptions.
View source — packages/core/src/features/textures/lib/definitions.ts:41
preset (optional)
readonly preset?: "spots" | "stripes" | undefinedNamed pattern configuration used to initialize the simulation. See ReactionDiffusionOptions.
View source — packages/core/src/features/textures/lib/definitions.ts:46
InkMessage
Section titled “InkMessage”Paint, stir, pause, or reset commands accepted by a reaction-diffusion texture.
Full type declaration
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"; }Related API: InkMessage, displacement.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/definitions.ts:53
Properties and methods
Section titled “Properties and methods”
type
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
waterWaves
Section titled “waterWaves”Creates an animated water-wave texture recipe that accepts ripple, pause, and reset commands.
waterWaves: (options?: WaterWavesOptions) => TextureRecipe<WaterWavesMessage>Related API: waterWaves, WaterWavesOptions, TextureRecipe, WaterWavesMessage.
Parameters
Section titled “Parameters”options— Wave simulation and rendering settings. See WaterWavesOptions.
Returns
Section titled “Returns”A water-wave texture recipe accepting wave messages. See TextureRecipe , WaterWavesMessage .
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-waves.ts:250
WaterWavesOptions
Section titled “WaterWavesOptions”Seed, animation speed, feature scale, ripple strength, and initial pause state of water waves.
interface WaterWavesOptionsRelated API: WaterWavesOptions.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-waves.ts:14
Properties and methods
Section titled “Properties and methods”
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See WaterWavesOptions.
View source — packages/core/src/features/textures/lib/water-waves.ts:19
speed (optional)
readonly speed?: number | undefinedMultiplier controlling the simulation’s animation rate. See WaterWavesOptions.
View source — packages/core/src/features/textures/lib/water-waves.ts:21
scale (optional)
readonly scale?: number | undefinedSpatial scale of the generated wave pattern. See WaterWavesOptions.
View source — packages/core/src/features/textures/lib/water-waves.ts:23
rippleStrength (optional)
readonly rippleStrength?: number | undefinedStrength of injected wave disturbances. See WaterWavesOptions.
View source — packages/core/src/features/textures/lib/water-waves.ts:25
paused (optional)
readonly paused?: boolean | undefinedWhether simulation or playback advancement is suspended. See WaterWavesOptions.
View source — packages/core/src/features/textures/lib/water-waves.ts:27
WaterWavesMessage
Section titled “WaterWavesMessage”Ripple, pause, and reset commands for a water-wave texture.
Full type declaration
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; }Related API: WaterWavesMessage, displacement.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-waves.ts:35
Properties and methods
Section titled “Properties and methods”
type
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
waterSurface
Section titled “waterSurface”A WASM-only, bounded reflective height-field displacement map.
waterSurface: (options?: WaterSurfaceOptions) => TextureRecipe<WaterSurfaceMessage>Related API: waterSurface, WaterSurfaceOptions, TextureRecipe, WaterSurfaceMessage.
Parameters
Section titled “Parameters”options— Water appearance and simulation settings. See WaterSurfaceOptions.
Returns
Section titled “Returns”A water-surface texture recipe accepting surface messages. See TextureRecipe , WaterSurfaceMessage .
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-surface.ts:617
WaterSurfaceMessage
Section titled “WaterSurfaceMessage”Ripple, pause, and reset commands for a water-surface simulation.
Full type declaration
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; }Related API: WaterSurfaceMessage, displacement.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-surface.ts:68
Properties and methods
Section titled “Properties and methods”
type
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
WaterSurfaceObstacle
Section titled “WaterSurfaceObstacle”An axis-aligned obstacle rectangle in a water-surface simulation.
interface WaterSurfaceObstacleRelated API: WaterSurfaceObstacle.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-surface.ts:14
Properties and methods
Section titled “Properties and methods”
x
readonly x: numberHorizontal coordinate or displacement in the containing coordinate system. See WaterSurfaceObstacle.
View source — packages/core/src/features/textures/lib/water-surface.ts:19
y
readonly y: numberVertical coordinate or displacement in the containing coordinate system. See WaterSurfaceObstacle.
View source — packages/core/src/features/textures/lib/water-surface.ts:24
width
readonly width: numberHorizontal extent in the units of the containing geometry or surface. See WaterSurfaceObstacle.
View source — packages/core/src/features/textures/lib/water-surface.ts:29
height
readonly height: numberVertical extent in the units of the containing geometry or surface. See WaterSurfaceObstacle.
View source — packages/core/src/features/textures/lib/water-surface.ts:34
WaterSurfaceOptions
Section titled “WaterSurfaceOptions”Water simulation controls including wave motion, viscosity, pause state, and obstacles.
interface WaterSurfaceOptionsRelated API: WaterSurfaceOptions.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/water-surface.ts:43
Properties and methods
Section titled “Properties and methods”
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See WaterSurfaceOptions.
View source — packages/core/src/features/textures/lib/water-surface.ts:48
speed (optional)
readonly speed?: number | undefinedMultiplier controlling the simulation’s animation rate. See WaterSurfaceOptions.
View source — packages/core/src/features/textures/lib/water-surface.ts:50
scale (optional)
readonly scale?: number | undefinedSpatial scale of the generated water pattern. See WaterSurfaceOptions.
View source — packages/core/src/features/textures/lib/water-surface.ts:52
rippleStrength (optional)
readonly rippleStrength?: number | undefinedStrength of injected wave disturbances. See WaterSurfaceOptions.
View source — packages/core/src/features/textures/lib/water-surface.ts:54
viscosity (optional)
readonly viscosity?: number | undefinedArtistic thickness from 0 (water) to 1 (slow, strongly damped).
View source — packages/core/src/features/textures/lib/water-surface.ts:56
paused (optional)
readonly paused?: boolean | undefinedWhether simulation or playback advancement is suspended. See WaterSurfaceOptions.
View source — packages/core/src/features/textures/lib/water-surface.ts:58
obstacles (optional)
readonly obstacles?: readonly WaterSurfaceObstacle[] | undefinedRelated API: WaterSurfaceObstacle.
Obstacle geometry used by the flow or water simulation. See WaterSurfaceObstacle.
View source — packages/core/src/features/textures/lib/water-surface.ts:60
rainDrops
Section titled “rainDrops”A seeded rain-on-glass displacement map, advanced by Pibbl’s scheduler.
rainDrops: (options?: RainDropsOptions) => TextureRecipe<RainDropsMessage>Related API: rainDrops, RainDropsOptions, TextureRecipe, RainDropsMessage.
Parameters
Section titled “Parameters”options— Raindrop simulation and appearance settings. See RainDropsOptions.
Returns
Section titled “Returns”A raindrop texture recipe accepting raindrop messages. See TextureRecipe , RainDropsMessage .
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/rain-drops.ts:401
RainDropsOptions
Section titled “RainDropsOptions”Rain rate, gravity, initial drops, condensation, trail, and outline controls for a raindrop texture.
interface RainDropsOptionsRelated API: RainDropsOptions.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/rain-drops.ts:9
Properties and methods
Section titled “Properties and methods”
seed (optional)
readonly seed?: number | undefinedSeed used for deterministic sampling or simulation initialization. See RainDropsOptions.
View source — packages/core/src/features/textures/lib/rain-drops.ts:14
rainRate (optional)
readonly rainRate?: number | undefinedNew beads per second, from 0 through 120.
View source — packages/core/src/features/textures/lib/rain-drops.ts:16
gravity (optional)
readonly gravity?: number | undefinedDownward acceleration multiplier, from 0 through 10.
View source — packages/core/src/features/textures/lib/rain-drops.ts:18
initialDrops (optional)
readonly initialDrops?: number | undefinedNumber of drops seeded before continuous rain starts. See RainDropsOptions.
View source — packages/core/src/features/textures/lib/rain-drops.ts:20
paused (optional)
readonly paused?: boolean | undefinedWhether simulation or playback advancement is suspended. See RainDropsOptions.
View source — packages/core/src/features/textures/lib/rain-drops.ts:22
condensation (optional)
readonly condensation?: number | undefinedFine droplet film coverage, from 0 (clear) through 1 (mist).
View source — packages/core/src/features/textures/lib/rain-drops.ts:24
trailPersistence (optional)
readonly trailPersistence?: number | undefinedSeconds controlling trail drying and condensation recovery, from 0 through 60.
View source — packages/core/src/features/textures/lib/rain-drops.ts:26
trailStrength (optional)
readonly trailStrength?: number | undefinedResidual water left behind a moving drop, from 0 through 1.
View source — packages/core/src/features/textures/lib/rain-drops.ts:28
irregularity (optional)
readonly irregularity?: number | undefinedOutline and path variation, from 0 (smooth) through 1.
View source — packages/core/src/features/textures/lib/rain-drops.ts:30
RainDropsMessage
Section titled “RainDropsMessage”Pause, reset, finger-wipe, release, and localized nudge commands for a raindrop texture.
Full type declaration
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; }Related API: RainDropsMessage, wipe, displacement.
See also
Section titled “See also”View source — packages/core/src/features/textures/lib/rain-drops.ts:38
Properties and methods
Section titled “Properties and methods”
type
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
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Textures and reaction-diffusion companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Paint reaction diffusion: Mount an interactive reaction-diffusion layer with a typed brush. Plain source
- Render a procedural material: Paint a marble material with a typed palette, resolution, and synchronous renderer. Plain source
- Compare three material recipes: Compare labeled marble, paper, and cellular swatches with palettes that reveal their surface detail. Plain source
- Send paint to a living ink texture: Create a reaction-diffusion recipe and send a typed paint command on click. Plain source
- Refract through rain glass: Use a rain map for displacement and localized condensation blur. Plain source
- Ripple a wave map: Refract and light a tiled sign through fine, fast-moving waves, with an unfiltered comparison toggle. Plain source
- Ripple around an obstacle: Use a bounded water surface with a normalized rectangular obstacle. Plain source
Interactive examples
Section titled “Interactive examples”Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.