import { Expr, GpuFragmentParams } from '../../gpu/contract'; import { Field, Paint, Palette } from './fields'; import { PropRef } from '../values'; /** * One wave: coefficients on the named axes (frequency along x/y, drift speed along t) plus * an optional phase. Every field is serializable data — a wave is `{x: 3.2, t: 0.8}`: * "a wave across x at frequency 3.2, drifting at speed 0.8". Negative coefficients reverse * direction. Coefficient `1` emits the bare axis (no `× 1`). */ export interface Wave { x?: number; y?: number; t?: number; /** Radians, or a `hashPhase(...)` Expr for seeded decorrelation. */ phase?: Expr | number; } /** * One term of a schedule: a single wave, or a product of waves (the "organic" move — an * x-wave × a y-wave interferes instead of striping). `weight` scales the term (default 1, * emitted only when ≠ 1). */ export interface WaveTerm { waves: Wave[]; weight?: number; } /** * `waves` — overlapping traveling sine waves, schedule as data. The engine under every * "organic wobble": evaluates `Σ weightᵢ · Π sin(x·kx + y·ky + t·kt + phase)` over the * named axes, SIGNED output (tone words shape it; `warped` coords warp it — both stay * outside, deliberately). Emission is deterministic — terms sum in schedule order, waves * multiply in wave order, axes emit x → y → t → phase — so a ported schedule reproduces * its original arithmetic. Schedules are the caller's look; `organicWaves` generates one * from intent when nobody has hand-tuned constants to preserve. */ export declare function waves(axes: { x: Expr | number; y?: Expr | number; t?: Expr | number; }, schedule: WaveTerm[]): Expr; /** * `wavyLine` — an animated organic curve: the offset of a line at coordinate `along`, as a * weighted stack of traveling sines. Sugar over {@link waves} on one axis; give each wave a * `hashPhase` to decorrelate a family of lines. Curtain paths, water horizons, wavy * baselines, cloth edges. */ export declare function wavyLine(opts: { along: Expr | number; time: Expr | number; waves: { freq: number; speed: number; amount: number; phase?: Expr | number; }[]; }): Expr; /** * `organicWaves` — generate a {@link waves} schedule from intent, for authors (human or AI) * who don't have hand-tuned constants to preserve. Three knobs + seed, deliberately * (knobs grow under pressure from real use, never speculatively): `frequency` sets the base * scale, `detail` the number of product-pair layers (each ~1.8× finer, half the weight), * `drift` the animation speed. Deterministic per seed. TUNING CANDIDATE — constants pending * an eye pass; treat the output as a starting point, not a spec. */ export declare function organicWaves(opts: { frequency: number; detail?: number; drift?: number; seed?: number; }): WaveTerm[]; /** * The exponential-scale noise framing: aspect-correct the UV, scale by `exp(scale)` (each +1 * on the slider doubles-ish the frequency), offset by `seed`. Hands the inner field a vec2 * pattern position. */ export declare function seededPlane(field: Field, slots: { scale: PropRef; seed: PropRef; }): Field; /** * The RAW-divide exponential-scale framing (Scratches' historical domain — the unguarded * aspect divide is part of its exact arithmetic). */ export declare function rawPlane(field: Field, slots: { scale: PropRef; seed: PropRef; }): Field; /** * The per-pixel framing: floor the device-pixel position into `grain`-sized cells, offset by * `seed` — for patterns defined on the pixel grid (blue noise) rather than in UV space. */ export declare function pixelGrid(field: Field, slots: { grain: PropRef; seed: PropRef; }): Field; /** * The linear-scale noise framing: aspect-correct the UV and multiply by `scale` directly (no * exponential remap), bound as a local — for recipes whose parts read the same plane position * several times. */ export declare function scaledPlane(field: Field, slots: { scale: PropRef; }): Field; /** * Lift a vec2 pattern position into 3D by walking the third axis with time — the difference * between noise that MORPHS in place (this) and noise that slides. `rate` scales the * evolution independently of the node's `speed` prop. */ export declare function evolving(field: Field, opts: { rate: number; }): Field; /** Oriented sine grains at `frequency` waves per cell, phase-driven by the node's clock. Signed. */ export declare function gaborGrains(slots: { frequency: PropRef; }): Field; /** Rotating banded wavelets; `detail` is the per-octave frequency ratio. Phase-animated, signed. */ export declare function waveletBands(slots: { detail: PropRef; }): Field; /** Spatial-high-pass blue-noise speckle over a pixel-grid coordinate. Static, unit range. */ export declare function blueSpeckle(): Field; /** Branching hydraulic-erosion ridge height (the `.x` of the erosion field). Static, signed. */ export declare function erosionRidges(): Field; /** Swirling curl-flow speed (√2-normalized magnitude), morphing in place at `rate` × the clock. */ export declare function curlSpeed(opts: { rate: number; }): Field; /** Fine hairline streaks at `thickness`, flickering on the node's clock. Fragment-only (fwidth). */ export declare function scratchStreaks(slots: { thickness: PropRef; }): Field; /** Remap a signed [-1,1] field to the unit range (`v · 0.5 + 0.5`). */ export declare function unitized(field: Field): Field; /** * The shared noise tone tail: additive contrast about mid-grey + balance shift, inverted so a * ramp's colorA reads as the LOW end. `contrast`/`balance` omitted = 0 (identity) for * textures without tone controls. */ export declare function noiseTone(field: Field, slots?: { contrast?: PropRef; balance?: PropRef; }): Field; /** * The signed tone tail: contrast/balance applied to the RAW [-1,1] field BEFORE the squash to * [0,1] (then inverted), so high contrast rides further before clipping. */ export declare function signedTone(field: Field, slots: { contrast: PropRef; balance: PropRef; }): Field; /** The multiplicative tone tail (contrast is a gain, 1 = identity), non-inverted — Worley's shape. */ export declare function gainTone(field: Field, slots: { contrast: PropRef; balance: PropRef; }): Field; /** Two endpoint colour props mixed in LINEAR space — for definitions without a colour-space prop. */ export declare function linearPair(a: PropRef, b: PropRef): Palette; /** * Multi-octave fractal Brownian motion: rotated centred plane → gated 8-octave golden-angle * fBm over MaterialX simplex → weight-normalized unit field → stop ramp. `octaves` gates the * fixed loop at runtime, so the slider does not recompile. */ export declare function fractalNoise(slots: { angle: PropRef; detail: PropRef; contrast: PropRef; octaves: PropRef; seed: PropRef; space: PropRef; }): Paint; /** * Cellular (Worley) noise: aspect plane → gated 4-octave cellular sum (nearest-2 distances * under a selectable metric, reduced per `mode`) → per-mode normalization → gain tone → ramp. * `mode`/`distance`/`octaves` are compile-time props read as CPU values and folded to literals. */ export declare function worleyNoise(slots: { scale: PropRef; jitter: PropRef; lacunarity: PropRef; persistence: PropRef; contrast: PropRef; balance: PropRef; seed: PropRef; /** Compile-time: the field reduction (f1/f2/…), read from prop values. */ mode: PropRef; /** Compile-time: the distance metric, read from prop values. */ distance: PropRef; /** Compile-time: the octave gate (1–4), read from prop values. */ octaves: PropRef; space: PropRef; }): Paint; /** * Nearest-two cellular distances `vec2(d1, d2)` over the aspect plane at `scale`, the cell * points drifting on the node's clock. Wrap in `share` when a fill and a border mask read * the same evaluation. */ export declare function cellDistances(slots: { scale: PropRef; seed: PropRef; }): Field; /** The F1/F2 fill gradient: `edgeIntensity` sets how far the edge colour reaches into each cell. */ export declare function cellFill(cells: Field, slots: { edgeIntensity: PropRef; }): Field; /** * The cell boundary-line mask (0 on a boundary, 1 inside a cell); `scale` compensates the * line width for the cell count. */ export declare function cellBorders(cells: Field, slots: { softness: PropRef; scale: PropRef; }): Field; /** * Overlay `color` on a paint's rgb where `mask` falls to 0; the base paint keeps its alpha. * The base binds as a local: both the overlay mix and the alpha read it. */ export declare function borderOverlay(paint: Paint, mask: Field, slots: { color: PropRef; }): Paint; /** An rgb-only stage for {@link overRgb} — maps a paint's rgb; alpha passes through. */ export type RgbStage = (rgb: Expr, params: GpuFragmentParams) => Expr; /** Apply rgb-only stages over a paint, threading the base alpha through unchanged. */ export declare function overRgb(paint: Paint, ...stages: RgbStage[]): Paint; /** The closing working-space → P3-linear back-conversion at the compile-time `space` mode. */ export declare function backToP3(slots: { space?: PropRef; }): RgbStage; /** The `pow(rgb, 0.85)` tone lift. */ export declare function tonePow(): RgbStage; /** * `ribbons` — flowing, gradient-colored ribbons between two anchors (the ribbons genre * primitive): an ATOMIC runtime-count reduce — each ribbon's working-space gradient lookup * lives inside the loop — returning working-space rgba. Close it with {@link backToP3} (and * {@link tonePow}) via {@link overRgb}. Reads BOTH of the definition's clocks: the main one * drives the wave motion, the `color` extra clock * (`extraAnimatedTimes: {color: ...}` stays declared on the definition) scrolls the colours. */ export declare function ribbons(slots: { from: PropRef; to: PropRef; count: PropRef; width: PropRef; amplitude: PropRef; frequency: PropRef; softness: PropRef; spread: PropRef; pinEdges: PropRef; colorScale: PropRef; colorVariance: PropRef; }): Paint; /** One entry of {@link reliefBases}: a kit height-field basis for {@link noiseRelief}. */ export interface ReliefBasis { /** The `(vec2f) → f32` height field sampled by the relief filter. */ readonly fn: unknown; /** The emitted WGSL height-fn name. */ readonly hint: string; } /** The height fields {@link noiseRelief} accepts. */ export declare const reliefBases: { /** Marbled stone height field. */ readonly stone: { readonly fn: import('typegpu').TgpuFn<(p: import('typegpu/data').Vec2f) => import('typegpu/data').F32>; readonly hint: "stone12"; }; /** Interwoven fibrous fabric height field. */ readonly wool: { readonly fn: import('typegpu').TgpuFn<(p: import('typegpu/data').Vec2f) => import('typegpu/data').F32>; readonly hint: "wool12"; }; }; /** * Relief filter over child content: sample the child texture through a Perlin-gradient surface * distortion, then modulate its brightness by the `basis` height field (an RTT filter — the * definition keeps `requiresRTT`/`requiresChild` and the shared `reliefStylizeProps` block). */ export declare function noiseRelief(basis: ReliefBasis): (params: GpuFragmentParams) => Expr; /** The Worley prop enum transforms + the historical hash alias, for the shader definition. */ export declare const transformWorleyMode: (value: string) => number; export declare const transformWorleyDistance: (value: string) => number; export declare const worleyHash: import('typegpu').TgpuFn<(p: import('typegpu/data').Vec2f) => import('typegpu/data').Vec2f>; //# sourceMappingURL=noise.d.ts.map