import { Vector2 } from 'three/webgpu'; import type { TSLFloatNode, TSLFunction, TSLTextureInput, TSLVec4Node } from '../types/tsl.js'; /** Seed argument accepted by {@link noiseRandom}. */ export type NoiseRandomArguments = [seed: TSLVec4Node]; /** Minimal light-shadow state read by {@link shadowMapFastNoise}. */ export interface ShadowMapFastNoiseShadow { mapSize: Vector2; } /** Object-form inputs accepted by {@link shadowMapFastNoise}. */ export type ShadowMapFastNoiseParameters = { depthTexture: TSLTextureInput; shadowCoord: TSLVec4Node; shadow: ShadowMapFastNoiseShadow; }; /** Callable arguments accepted by {@link shadowMapFastNoise}. */ export type ShadowMapFastNoiseArguments = [parameters: ShadowMapFastNoiseParameters]; /** * Fast pseudo-random number generator for shadow map noise. * Generates deterministic noise based on 4D seed (position + iteration). * * @function noiseRandom * @short Fast shadow filter that uses two Poisson disk taps rotated by noise for softer shadows. * @category TSL * @tags WebGPU, WebGL * @tsl * @param {Node.} seed4 4D seed vector for hash function. * @returns {Node.} Random value in [0..1]. * @private */ export declare const noiseRandom: TSLFunction; /** * Fast shadow map filtering using spatial noise and Poisson disk sampling. * * **Algorithm** * - Generates 2 Poisson disk samples per fragment * - Uses world-position-based noise to rotate sample pattern * - Reduces banding artifacts with minimal performance cost * - Provides softer shadow edges than standard PCF * * This implementation-level API is intentionally internal and has no public package import. * * **Performance** * - Only 2 shadow map samples per fragment (vs 4-16 for standard PCF) * - Noise rotation provides perceptual quality of more samples * - Suitable for real-time applications * * @function shadowMapFastNoise * @category TSL * @tags WebGPU, WebGL * @tsl * @param {Object} params Shadow sampling parameters. * @param {Node.} params.depthTexture Shadow depth texture. * @param {Node.} params.shadowCoord Projected shadow coordinates. * @param {Object} params.shadow Shadow reference object containing `mapSize`. * @returns {Node.} Shadow factor in [0..1] (0=fully shadowed, 1=fully lit). */ declare const shadowMapFastNoise: TSLFunction; export { shadowMapFastNoise };