import type { SmokePointerInput, SmokeSimulationResult } from './SmokeNode.cjs'; /** RTT-specific result returned by {@link smokeRTT}. */ export type SmokeNodeRTTResult = SmokeSimulationResult; /** * Smoke RTT Simulation (TSL) – a 2D velocity–pressure solver using RenderTargets. * * This is an RTT-based variant of the smoke simulation that uses RenderTarget + fragment shaders * instead of StorageTexture + compute shaders. This provides broader WebGPU compatibility * as it doesn't require Tier2 read-write storage texture support. * * The API is identical to `smoke()` - drop-in replacement for environments without Tier2 support. * * **Features** * - Semi-Lagrangian advection for velocity and density * - Vorticity confinement (curl) and divergence-free projection (pressure solve) * - Configurable dissipation, pressure iterations and curl strength * - Optional pointer-driven splats via a `vec2` uniform * - Drop-in for a render pipeline: `renderPipeline.outputNode = smokeRTT(pointer, 128, 512, ...)` * * **Example: Basic render pipeline setup** * * ```js * import * as THREE from 'three/webgpu'; * import { smokeRTT } from 'three-blocks/smoke'; * * const renderer = new THREE.WebGPURenderer(); * await renderer.init(); * * const renderPipeline = new THREE.RenderPipeline(renderer); * const pointer = new THREE.Vector2(); * * // smokeRTT(pointer, simRes, dyeRes, iterations, densityDissipation, velocityDissipation, * // pressureDissipation, curlStrength, pressureFactor, radius, useBoundaries, pointerScale) * const fluidNode = smokeRTT(pointer, 128, 512, 3, 0.97, 0.98, 0.8, 20, 0.2, 0.1, true, 45); * * renderPipeline.outputNode = fluidNode; * * renderer.setAnimationLoop(() => renderPipeline.render()); * ``` * * **Example: Interactive pointer-driven splats** * * ```js * import * as THREE from 'three/webgpu'; * import { smokeRTT } from 'three-blocks/smoke'; * * const pointer = new THREE.Vector2(); * * // Pass pointer as first argument - motion automatically injects splats * const fluidNode = smokeRTT(pointer, 128, 512, 3, 0.97, 0.98, 0.8, 20, 0.2, 0.1, true, 45); * * // Update pointer on mouse move (NDC coordinates: -1 to +1) * document.addEventListener('mousemove', (e) => { * pointer.x = (e.clientX / window.innerWidth) * 2 - 1; * pointer.y = -(e.clientY / window.innerHeight) * 2 + 1; * }); * ``` * * @function smokeRTT * @short RTT-based 2D fluid smoke sim node (broader WebGPU compatibility than compute-based smoke). * @category TSL * @tsl * @tags WebGPU, RTT * @demo docs/demos/fluid.html * * @param {THREE.Vector2} [pointer] - NDC-like pointer in [-1, 1]; when present, motion injects splats. * @param {number} [simRes=128] - Square resolution for velocity/pressure buffers. * @param {number} [dyeRes=512] - Square resolution for density buffer. * @param {number} [iterations=3] - Pressure Jacobi iterations per solve. * @param {number} [densityDissipation=0.97] - Density dissipation factor in [0, 1]. * @param {number} [velocityDissipation=0.98] - Velocity dissipation factor in [0, 1]. * @param {number} [pressureDissipation=0.8] - Damp factor for pressure clear step. * @param {number} [curlStrength=20] - Vorticity confinement scale. * @param {number} [pressureFactor=0.2] - Pressure factor constant in Jacobi updates. * @param {number} [radius=0.1] - Gaussian splat radius in UV^2. Increase for larger splats. * @param {boolean} [useBoundaries=true] - Mirror-velocity boundary conditions at screen edges. * @param {number} [pointerScale=45] - Multiplier applied to pointer delta when generating splats. * @param {number} [neighborStride=1] - Multiplier for curl/divergence/pressure neighbor texel offsets. * @param {number} [speedFactor=1] - Scales sub-stepping relative to frame time (lower = more substeps). * @returns {Node} Color node sampling the current dye texture of the fluid simulation. */ export declare const smokeRTT: (pointer?: SmokePointerInput | undefined, simRes?: number, dyeRes?: number, iterations?: number, densityDissipation?: number, velocityDissipation?: number, pressureDissipation?: number, curlStrength?: number, pressureFactor?: number, radius?: number, useBoundaries?: boolean, pointerScale?: number, neighborStride?: number, speedFactor?: number) => SmokeNodeRTTResult;