import { GpuFragmentParams } from '../../gpu/contract'; import { d } from '../../gpu/kit/index'; import { GridSimConfig, GridRoot } from '../sim/grids'; import { PropRef } from '../values'; /** The smallest grid `pointerSplatField` runs on: 8 cells per side. */ export declare const SPLAT_MIN_GRID = 8; /** The largest grid `pointerSplatField` runs on: 128 cells per side. */ export declare const SPLAT_MAX_GRID = 128; /** * The grid size `pointerSplatField` really uses for a prop value: floored, then held to 8–128. * * Use it in the `gridSize` prop's recompile rule, so the simulation rebuilds only when the cell * count changes and not on every drag of the slider. * * @example * ```ts * gridSize: {default: 20, recompile: recompileWhen((prev, next) => clampSplatGridSize(prev as number) !== clampSplatGridSize(next as number))} * ``` * @see pointerSplatField */ export declare const clampSplatGridSize: (v: number) => number; /** @internal The splat update kernel factory behind `pointerSplatField`. */ export declare function makeSplatUpdateKernel(gridSize: number): import('typegpu').TgpuFn<(cx: d.U32, cy: d.U32) => d.Void>; /** @internal The splat output kernel factory behind `pointerSplatField`. */ export declare function makeSplatOutputKernel(gridSize: number): import('typegpu').TgpuFn<(cx: d.U32, cy: d.U32) => d.Void>; /** * A field the cursor smears: cells near the pointer move with it, then fade back to rest. * * Spread it with `...sim.grids.gridSim(...)`. `gridSize` is the cells per side (8 to 128, * see `clampSplatGridSize`). `decay` (about 0 to 10) is how fast the smear fades; `intensity` * (about 0 to 5) how hard the cursor pushes; `radius` the brush size (1 is about 5% of the * canvas). The field is published under `output` for a warp map such as * `warps.gridCellDisplace`. * * @example * ```ts * ...sim.grids.gridSim(pointerSplatField({gridSize: p('gridSize'), decay: p('decay'), intensity: p('intensity'), radius: p('radius'), output: 'displacement'})) * ``` * @tip Add `uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.displacement` so the warp is a no-op before the field exists. * @see springLatticeField, clampSplatGridSize */ export declare function pointerSplatField(slots: { gridSize: PropRef; decay: PropRef; intensity: PropRef; radius: PropRef; output: string; }): (params: GpuFragmentParams, root: GridRoot) => GridSimConfig; /** @internal The spring-lattice step kernel behind `springLatticeField`. */ export declare const springLatticeKernel: import('typegpu').TgpuFn<(cx: d.U32, cy: d.U32) => d.Void>; /** @internal The spring-lattice output kernel behind `springLatticeField`. */ export declare const springLatticeOutputKernel: import('typegpu').TgpuFn<(cx: d.U32, cy: d.U32) => d.Void>; /** * A cloth of springs the cursor pushes: it stretches, rings and settles like fabric. * * Spread it with `...sim.grids.gridSim(...)`. `stiffness` (about 1 to 30) is how rigid the cloth * is; `damping` (about 0 to 10) how quickly it stops moving; `radius` the push area (1 is about * 8% of the canvas). The grid is fixed at 64 cells per side. The field is published under * `output` for a warp map such as `warps.liquidDisplace`. * * @example * ```ts * ...sim.grids.gridSim(springLatticeField({stiffness: p('stiffness'), damping: p('damping'), radius: p('radius'), output: 'displacement'})) * ``` * @tip Add `uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.displacement` so the warp is a no-op before the field exists. * @see pointerSplatField */ export declare function springLatticeField(slots: { stiffness: PropRef; damping: PropRef; radius: PropRef; output: string; }): (params: GpuFragmentParams, root: GridRoot) => GridSimConfig; //# sourceMappingURL=pointerFields.d.ts.map