import type { TSLFloatNode, TSLFunction, TSLIntNode, TSLNode, TSLVec4Node } from '../types/tsl.cjs'; /** Integer 2D coordinate node consumed by Hilbert indexing. */ export type BlueNoiseCoordinateNode = TSLNode<'ivec2'>; type HilbertArguments = [p: BlueNoiseCoordinateNode, level: TSLIntNode]; /** Arguments accepted by {@link blueNoise}. */ export type BlueNoiseArguments = HilbertArguments; /** * Hilbert R1 Blue Noise generator with normalized float output. * Combines Hilbert curve spatial ordering with R1 low-discrepancy sequence * to produce high-quality blue noise values in [0,1] range. * * **Algorithm** * - Maps 2D coordinates to 1D via Hilbert curve (space-filling curve) * - Applies R1 sequence (low-discrepancy) for temporal stability * - Produces blue noise spectrum (minimal low-frequency content) * * **Use Cases** * - Temporal anti-aliasing (TAA) jitter patterns * - Dithering and ordered dithering * - Stochastic sampling for ray tracing * - Volumetric noise without banding * * This implementation-level API is intentionally internal and has no public package import. * * @function blueNoise * @tags WebGPU, WebGL * @short Hilbert R1 blue-noise scalar generator from integer coords for stable jitter/dither in TSL. * @category TSL * @tsl * @param {Node.} p 2D screen-space integer coordinates. * @param {Node.} level Hilbert curve recursion level (typically 5-10, higher = finer pattern). * @returns {Node.} Normalized blue noise value in [0..1]. */ declare const hilbert_r1_blue_noisef: TSLFunction; /** * Vectorized Hilbert R1 blue noise: four decorrelated values from a single Hilbert walk. * The 2D coordinate is mapped to a 1D Hilbert index once, then the R1 hash is chained * (`x1 = kmhf(x0)`, …) so the three extra channels cost two integer ops each instead of * a full curve traversal. Use this when a shader needs several jitter values per pixel * (LOD dithering plus UV jitter, for example) — it is ~4× cheaper than four * {@link blueNoise} calls. * * This implementation-level API is intentionally internal and has no public package import. * * @function blueNoiseVec4 * @tags WebGPU, WebGL * @short Four decorrelated blue-noise values from one Hilbert walk for multi-channel jitter. * @category TSL * @tsl * @param {Node.} p 2D integer coordinates. * @param {Node.} level Hilbert curve recursion level (typically 5-10, higher = finer pattern). * @returns {Node.} Four normalized blue-noise values in [0..1]. */ declare const hilbert_r1_blue_noise4: TSLFunction; export { hilbert_r1_blue_noisef as blueNoise, hilbert_r1_blue_noise4 as blueNoiseVec4 };