import * as THREE from 'three/webgpu'; import type { ComputeNode, Node, UniformNode } from 'three/webgpu'; /** Three-dimensional compute workgroup or dispatch dimensions. */ export type SDFGridWorkgroupSize = [number, number, number]; /** Configuration for rasterizing an SDF container into SmokeVolume's solid field. */ export interface SDFSmokeSolidRasterOptions { gridResolution: number; threshold?: number; merge?: boolean; subcellFractions?: boolean; workgroupSize?: SDFGridWorkgroupSize; } /** Configuration for enforcing an SDF boundary on a velocity grid. */ export interface SDFGridBoundaryOptions { gridResolution: number; threshold?: number; tangentProjection?: number; workgroupSize?: SDFGridWorkgroupSize; } /** Externally mutable uniforms attached to an SDF velocity-grid boundary pass. */ export interface SDFGridBoundaryUniforms { inverseBoundsMatrix: UniformNode<'mat4', THREE.Matrix4>; boundsMatrix: UniformNode<'mat4', THREE.Matrix4>; threshold: UniformNode<'float', number>; tangentProjection: UniformNode<'float', number>; } /** Compute pass and controls returned by {@link createSDFGridBoundaryPass}. */ export interface SDFGridBoundaryPass extends ComputeNode { uniforms: SDFGridBoundaryUniforms; } /** * Rasterize a container SDF into the shared SmokeVolume solid field. * Solid voxels store zero surface velocity and occupancy in alpha. * * @param {THREE.Storage3DTexture} solidTexture Shared smoke solid field. * @param {THREE.Storage3DTexture} sdfTexture Container SDF texture. * @param {THREE.Matrix4} inverseBoundsMatrix World-to-SDF transform. * @param {Node} volumeToWorld Volume-UVW-to-world matrix node. * @param {Object} options Configuration. * @param {number} options.gridResolution Smoke velocity-grid resolution. * @param {number} [options.threshold=0] SDF container threshold. * @param {boolean} [options.merge=false] Preserve existing dynamic solids inside the SDF container. * @param {boolean} [options.subcellFractions=false] Estimate solid volume fraction from eight subcell samples. * @returns {ComputeNode} TSL compute node. */ export declare function createSDFSmokeSolidRasterPass(solidTexture: THREE.Storage3DTexture, sdfTexture: THREE.Storage3DTexture, inverseBoundsMatrix: THREE.Matrix4, volumeToWorld: Node<'mat4'>, options: SDFSmokeSolidRasterOptions): ComputeNode; /** * Creates a compute pass that enforces SDF volume boundaries on a 3D velocity grid. * Used for grid-based simulations like SmokeVolume. * * This enforces boundary conditions by: * 1. Sampling SDF at each grid cell * 2. Zeroing velocity if outside boundary (sdf > threshold) * 3. Projecting velocity to tangent direction near boundaries * * @param {THREE.Storage3DTexture} velocityTextureRead - Input velocity field * @param {THREE.Storage3DTexture} velocityTextureWrite - Output velocity field * @param {THREE.Storage3DTexture} sdfTexture - SDF 3D texture * @param {THREE.Matrix4} inverseBoundsMatrix - World to SDF local space * @param {THREE.Matrix4} boundsMatrix - SDF local to world space * @param {Object} options - Configuration * @param {number} options.gridResolution - Velocity grid resolution (e.g., 96) * @param {number} [options.threshold=0.0] - SDF boundary threshold * @param {number} [options.tangentProjection=0.5] - How much to project velocity to tangent (0=unchanged, 1=full projection) * @returns {ComputeNode} TSL compute node with externally mutable boundary uniforms. */ export declare function createSDFGridBoundaryPass(velocityTextureRead: THREE.Storage3DTexture, velocityTextureWrite: THREE.Storage3DTexture, sdfTexture: THREE.Storage3DTexture, inverseBoundsMatrix: THREE.Matrix4, boundsMatrix: THREE.Matrix4, options: SDFGridBoundaryOptions): SDFGridBoundaryPass;