import { d } from '../kit'; import { KitComputePipeline, GuardedComputeOptions } from '../compute'; import { TgpuRoot } from 'typegpu'; export declare const WAVE_GRID = 256; export declare const WAVE_CELLS: number; /** World half-extent the wave grid spans: world uv ±WAVE_HALFEXTENT maps onto the grid 0..1. */ export declare const WAVE_HALFEXTENT = 3; /** Working bound on |wave snapshot| — the slab widening budget while a ripple is live. */ export declare const CURSOR_WAVE_BOUND = 6; export declare const WAVE_DECAY = 10; export declare const WAVE_DECAY_PER_STEP = 0.004; /** Wave-field settle time implied by the decay: ms after the last injection at which the * propagation has damped below 1e-6 and can no longer move the surface. */ export declare const WAVE_SETTLE_MS: number; /** Far cap on the ray parameter — also the range near/far cutoff props map onto. */ export declare const MARCH_FAR = 15; /** Slack added to the height slab so a zero-amplitude (perfectly flat) surface still has a * crossable slab, and bilinear wave taps at the slab boundary can't fall outside it. */ export declare const HEIGHT_SLAB_PAD = 0.02; export declare const HEIGHT_FIELD_STATE_FORMAT: "rgba16float"; export declare const HeightFieldParams: d.WgslStruct<{ amp: d.F32; freq: d.F32; seed: d.F32; edgePin: d.F32; cursorIntensity: d.F32; t: d.F32; aspect: d.F32; focal: d.F32; camPos: d.Vec3f; camForward: d.Vec3f; camRight: d.Vec3f; camUp: d.Vec3f; lighting: d.F32; glossiness: d.F32; highlights: d.F32; lightX: d.F32; lightY: d.F32; lightZ: d.F32; lightColor: d.Vec3f; nearCutoff: d.F32; farCutoff: d.F32; cursorWaveX: d.F32; cursorWaveY: d.F32; mouseSpeed: d.F32; dt: d.F32; decay: d.F32; radius: d.F32; waveSpeed: d.F32; heightEnvelope: d.F32; cursorActive: d.F32; }>; /** Everything in {@link HeightFieldParams}, as plain numbers / number-triples. */ export interface HeightFieldParamsInput { amp: number; freq: number; seed: number; edgePin: number; cursorIntensity: number; t: number; aspect: number; focal: number; camPos: [number, number, number]; camForward: [number, number, number]; camRight: [number, number, number]; camUp: [number, number, number]; lighting: number; glossiness: number; highlights: number; lightX: number; lightY: number; lightZ: number; lightColor: [number, number, number]; nearCutoff: number; farCutoff: number; cursorWaveX: number; cursorWaveY: number; mouseSpeed: number; dt: number; decay: number; radius: number; waveSpeed: number; heightEnvelope: number; cursorActive: number; } export interface HeightFieldParamsUniform { /** The GPU buffer — pass as the `params` entry of the exported layouts' bind groups. */ buffer: unknown; write(p: HeightFieldParamsInput): void; } /** Create the params uniform + a plain-number write helper (the d.vec3f packing lives here). */ export declare function createHeightFieldParamsUniform(root: TgpuRoot): HeightFieldParamsUniform; export declare const waveEquationLayout: import('typegpu').TgpuBindGroupLayout<{ readSrc: { storage: d.WgslArray; access: "readonly"; }; writeBuf: { storage: d.WgslArray; access: "mutable"; }; readBuf: { storage: d.WgslArray; access: "mutable"; }; params: { uniform: d.WgslStruct<{ amp: d.F32; freq: d.F32; seed: d.F32; edgePin: d.F32; cursorIntensity: d.F32; t: d.F32; aspect: d.F32; focal: d.F32; camPos: d.Vec3f; camForward: d.Vec3f; camRight: d.Vec3f; camUp: d.Vec3f; lighting: d.F32; glossiness: d.F32; highlights: d.F32; lightX: d.F32; lightY: d.F32; lightZ: d.F32; lightColor: d.Vec3f; nearCutoff: d.F32; farCutoff: d.F32; cursorWaveX: d.F32; cursorWaveY: d.F32; mouseSpeed: d.F32; dt: d.F32; decay: d.F32; radius: d.F32; waveSpeed: d.F32; heightEnvelope: d.F32; cursorActive: d.F32; }>; }; }>; export declare const heightFieldMarchLayout: import('typegpu').TgpuBindGroupLayout<{ readBuf: { storage: d.WgslArray; access: "readonly"; }; params: { uniform: d.WgslStruct<{ amp: d.F32; freq: d.F32; seed: d.F32; edgePin: d.F32; cursorIntensity: d.F32; t: d.F32; aspect: d.F32; focal: d.F32; camPos: d.Vec3f; camForward: d.Vec3f; camRight: d.Vec3f; camUp: d.Vec3f; lighting: d.F32; glossiness: d.F32; highlights: d.F32; lightX: d.F32; lightY: d.F32; lightZ: d.F32; lightColor: d.Vec3f; nearCutoff: d.F32; farCutoff: d.F32; cursorWaveX: d.F32; cursorWaveY: d.F32; mouseSpeed: d.F32; dt: d.F32; decay: d.F32; radius: d.F32; waveSpeed: d.F32; heightEnvelope: d.F32; cursorActive: d.F32; }>; }; uvMaskTex: { storageTexture: d.WgslStorageTexture2d<"rgba16float", string>; }; litTex: { storageTexture: d.WgslStorageTexture2d<"rgba16float", string>; }; }>; /** Allocate the three f32 wave-field state buffers (ping A, pong B, stable snapshot). */ export declare function createWaveStateBuffers(root: TgpuRoot): { bufferA: import('typegpu').TgpuBuffer> & import('typegpu').StorageFlag; bufferB: import('typegpu').TgpuBuffer> & import('typegpu').StorageFlag; readBuf: import('typegpu').TgpuBuffer> & import('typegpu').StorageFlag; }; /** Global heightfield (any u,v). waveType (0 fractal / 1 sine / 2 ridge) + octaveCount + * cursorEnabled baked. Reads params + (when cursorEnabled) the wave snapshot via manual bilinear. */ export declare function buildSpectralHeightField(waveType: number, octaveCount: number, cursorEnabled: boolean): import('typegpu').TgpuFn<(uv: d.Vec2f) => d.F32>; /** Damped wave-equation propagation kernel factory (per ping-pong direction): a stencil step + * Gaussian injection at the CPU-projected cursor grid position. * * ATOMIC (irreducible): a serial stencil algorithm — each texel's next value is one coupled * expression over its 4-neighbour Laplacian, the previous ping-pong state, the damping and the * injection, with the CFL-bound clamp applied to the SAME intermediate; there is no separable * stage that two consumers could share without re-deriving the recurrence. */ export declare function makeWaveEquationKernel(): import('typegpu').TgpuFn<(cx: d.U32, cy: d.U32) => d.Void>; export interface HeightFieldMarchOptions { /** Spectral family: 0 warped fractal, 1 sine banks, 2 ridge. */ waveType: number; octaveCount: number; /** kit/edges routing on the hit UV: 0 clamp, 1 transparent, 2 mirror, 3 wrap. */ edgeMode: number; lightingEnabled: boolean; cursorEnabled: boolean; /** Fixed march steps across the height slab + bisection refinements. */ marchSteps: number; marchRefine: number; /** Compute-grid dimensions (baked — the grid is sized once at composition). */ computeW: number; computeH: number; } /** Raymarch kernel factory. All options are baked compile-time config. */ export declare function makeHeightFieldMarchKernel(opts: HeightFieldMarchOptions): import('typegpu').TgpuFn<(cx: d.U32, cy: d.U32) => d.Void>; /** Wrap a `(cx, cy)` kernel into a guarded compute pass (the `'use gpu'` dispatch wrapper). */ export declare function createKernelPass(root: TgpuRoot, kernel: unknown, opts?: GuardedComputeOptions): KitComputePipeline; //# sourceMappingURL=heightField.d.ts.map