import { Storage3DTexture, Matrix3, Matrix4, Vector3, Box3 } from 'three/webgpu'; import type { ComputeNode, Object3D, Renderer } from 'three/webgpu'; import type { TSLFloatNode, TSLStorageNode, TSLUniformNode, TSLVec3Node } from '../types/tsl.cjs'; import type { SDFVolumeConstraint, SDFVolumeConstraintSource } from './SDFVolumeConstraint.cjs'; import type { GPUInteractionSmokeCapabilityReport } from './Interaction/GPUInteractionCapabilityReport.cjs'; import type { GPUInteractionWorld } from './Interaction/GPUInteractionWorld.cjs'; import type { SmokeColliderInteractionOptions, SmokeColliderPasses } from './Interaction/compute/createSmokeColliderRasterPass.cjs'; import type { SmokeSolidBoundaryPasses } from './Interaction/compute/createSmokeSolidBoundaryPasses.cjs'; import type { SmokeMultigridLevel, SmokeMultigridProjectionPasses } from './Smoke/compute/createSmokeMultigridProjectionPasses.cjs'; export type SmokePressureSolver = 'sor' | 'multigrid'; export type SmokeMultigridPreset = 'quality' | 'balanced'; export type SmokeTurbulenceMode = 'low-resolution' | 'full-resolution'; export type SmokeSplatMode = 'auto' | 'batched' | 'sparse' | 'sequential'; export type SmokeSplatExecutionPath = Exclude | 'none'; /** * Optional light-visibility hook for the light optical-depth cache: world position of a cache * voxel → 0..1 fraction of the light reaching it past scene occluders (e.g. a shadow-map test). * Baked into the cache's `.y` channel so renderers get scene shadows for one texture fetch. */ export type SmokeLightVisibilityNode = (worldPosition: TSLVec3Node) => TSLFloatNode; export type SmokeSplatBlendMode = 'add' | 'inflow'; export interface SmokeSDFGeneratorSource extends SDFVolumeConstraintSource { sdfTexture: Storage3DTexture; inverseBoundsMatrix: Matrix4; boundsMatrix: Matrix4; resolution: number; } export interface SmokeSDFVolumeConstraintSource { threshold: number; sdfGenerator: SmokeSDFGeneratorSource; } export type SmokeSDFVolumeConstraintInput = SDFVolumeConstraint | SmokeSDFVolumeConstraintSource; export interface SmokeInteractionOptions extends SmokeColliderInteractionOptions { enabled?: boolean | undefined; feedbackResolution?: number | undefined; } export interface SmokeResolvedInteractionOptions extends SmokeColliderInteractionOptions { enabled: boolean; layer: number; mask: number; feedback: false; feedbackResolution: number; queryMode: 'grid' | 'scan'; } export interface SmokeVolumeOptions { speedFactor?: number | undefined; simRes?: number | undefined; dyeRes?: number | undefined; iterations?: number | undefined; pressureSolver?: SmokePressureSolver | undefined; multigridPreset?: SmokeMultigridPreset | undefined; multigridCycles?: number | undefined; multigridPreSmooth?: number | undefined; multigridPostSmooth?: number | undefined; multigridCoarseIterations?: number | undefined; multigridMinResolution?: number | undefined; multigridMaxLevels?: number | undefined; multigridCorrectionScale?: number | undefined; multigridRecursiveCorrectionScale?: number | undefined; multigridAutoTune?: boolean | undefined; densityDissipation?: number | undefined; temperatureDissipation?: number | undefined; densityDiffusion?: number | undefined; densityAdvectionCorrection?: number | undefined; velocityDissipation?: number | undefined; pressureDissipation?: number | undefined; curlStrength?: number | undefined; turbulenceStrength?: number | undefined; turbulenceFrequency?: number | undefined; turbulenceSpeed?: number | undefined; turbulenceOctaves?: number | undefined; turbulenceDensityScale?: number | undefined; turbulenceDensityThreshold?: number | undefined; turbulenceThermalBoost?: number | undefined; turbulenceMode?: SmokeTurbulenceMode | undefined; turbulenceResolutionScale?: number | undefined; turbulenceUpdateInterval?: number | undefined; boundaryFade?: number | undefined; maxSplatSources?: number | undefined; splatMode?: SmokeSplatMode | undefined; sparseSplatSourceThreshold?: number | undefined; sparseSplatTouchedRatioThreshold?: number | undefined; sparseSplatMinimumResolution?: number | undefined; sparseSplatCutoff?: number | undefined; buoyancyStrength?: number | undefined; buoyancyDirection?: Vector3 | undefined; densityWeight?: number | undefined; occupancyBlockSize?: number | undefined; enableOccupancyCache?: boolean | undefined; enableLightOpticalDepthCache?: boolean | undefined; lightVisibilityNode?: SmokeLightVisibilityNode | null | undefined; lightRes?: number | undefined; lightSteps?: number | undefined; lightDirection?: Vector3 | undefined; pressureFactor?: number | undefined; radius?: number | undefined; useBoundaries?: boolean | undefined; neighborStride?: number | undefined; subcellSolidFractions?: boolean | undefined; sdfVolumeConstraint?: SmokeSDFVolumeConstraintInput | null | undefined; sdfAutoDomain?: boolean | undefined; interactionWorld?: GPUInteractionWorld | null | undefined; interaction?: SmokeInteractionOptions | undefined; } export interface SmokeSplatOptions { temperatureAmount?: number | undefined; velocityMode?: SmokeSplatBlendMode | undefined; velocityBlend?: number | undefined; densityMode?: SmokeSplatBlendMode | undefined; densityBlend?: number | undefined; radius?: number | undefined; } interface SmokeSplat { x: number; y: number; z: number; fx: number; fy: number; fz: number; densityAmount: number; temperatureAmount: number; velocityMode: 0 | 1; velocityBlend: number; densityMode: 0 | 1; densityBlend: number; radius: number; } export interface SmokeSplatDispatchStats { dispatches: number; submissions: number; copies: number; uploadBytes: number; uploadMs: number; } export interface SmokeSplatStats extends SmokeSplatDispatchStats { sourceCount: number; path: SmokeSplatExecutionPath; touchedVoxelEstimate: number; cpuSubmissionMs: number; } export interface SmokeStepStats { dispatches: number; submissions: number; sources: SmokeSplatStats; turbulenceMode: SmokeTurbulenceMode; turbulenceResolution: number; turbulenceFieldRefreshed?: boolean | undefined; pressureSolver: SmokePressureSolver; multigridPreset?: SmokeMultigridPreset | null | undefined; pressureSweeps: number; finePressureSweeps: number; coarsePressureSweeps: number; multigridCycles: number; multigridLevels: number; } export interface SmokeRenderCacheOptions { occupancy?: boolean | undefined; lightOpticalDepth?: boolean | undefined; } export interface SmokeRenderCacheState { occupancy: boolean; lightOpticalDepth: boolean; } export interface SmokeStepOptions { refreshRenderCaches?: boolean | SmokeRenderCacheOptions | undefined; } export interface SmokePressureSolverOptions { preset?: SmokeMultigridPreset | undefined; cycles?: number | undefined; preSmooth?: number | undefined; postSmooth?: number | undefined; coarseIterations?: number | undefined; minResolution?: number | undefined; maxLevels?: number | undefined; correctionScale?: number | undefined; recursiveCorrectionScale?: number | undefined; autoTune?: boolean | undefined; } export interface SmokeDebugPasses { runCurl: boolean; runVorticity: boolean; runTurbulence: boolean; runDivergence: boolean; runPressureClear: boolean; runPressureJacobi: boolean; runProjection: boolean; runAdvectVelocity: boolean; runAdvectDensity: boolean; runBuoyancy: boolean; autoStep: boolean; } export type SmokeDebugPassOverrides = Partial; export interface SmokeDomainBindingOptions { autoUpdate?: boolean | undefined; } interface SmokeTextureDimensions { width?: number | undefined; height?: number | undefined; depth?: number | undefined; } interface SmokeStorageTextureOptions extends SmokeTextureDimensions { format?: Storage3DTexture['format'] | undefined; type?: Storage3DTexture['type'] | undefined; minFilter?: Storage3DTexture['minFilter'] | undefined; magFilter?: Storage3DTexture['magFilter'] | undefined; generateMipmaps?: boolean | undefined; } interface SmokeStorageTextureTargetOptions extends SmokeStorageTextureOptions { wrap?: Storage3DTexture['wrapS'] | undefined; } interface SmokeSplatArrays { positionRadius: Float32Array; velocityDensity: Float32Array; temperatureModes: Float32Array; blend: Float32Array; } interface SmokeSplatNodes { positionRadius: TSLStorageNode<'vec4'>; velocityDensity: TSLStorageNode<'vec4'>; temperatureModes: TSLStorageNode<'vec4'>; blend: TSLStorageNode<'vec4'>; } interface SmokeSplatBounds { minimum: [number, number, number]; size: [number, number, number]; voxels: number; } interface SmokeDensityVelocityForcePasses { densityReadVelocityRead: ComputeNode; densityReadVelocityWrite: ComputeNode; densityWriteVelocityRead: ComputeNode; densityWriteVelocityWrite: ComputeNode; } type SmokeFloatUniform = TSLUniformNode<'float', number>; type SmokeIntUniform = TSLUniformNode<'int', number>; type SmokeUintUniform = TSLUniformNode<'uint', number>; type SmokeBoolUniform = TSLUniformNode<'bool', boolean>; type SmokeVec3Uniform = TSLUniformNode<'vec3', Vector3>; type SmokeUVec3Uniform = TSLUniformNode<'uvec3', Vector3>; type SmokeMat4Uniform = TSLUniformNode<'mat4', Matrix4>; declare class Storage3DTexturePingPong { width: number; height: number; depth: number; size: number; read: Storage3DTexture; write: Storage3DTexture; phase: boolean; private _config; constructor({ width, height, depth, format, type, minFilter, magFilter, generateMipmaps, }?: SmokeStorageTextureOptions); private _createTexture; setSize(width: number, height: number, depth: number): void; swap(): void; dispose(): void; } declare class Storage3DTextureTarget { width: number; height: number; depth: number; size: number; texture: Storage3DTexture; private _config; constructor({ width, height, depth, format, type, minFilter, magFilter, generateMipmaps, wrap, }?: SmokeStorageTextureTargetOptions); private _createTexture; setSize(width: number, height: number, depth: number): void; dispose(): void; } /** * Single storage texture updated in place through a read_write binding. * Exposes the phase-indexed ping-pong surface (read/write/phase/swap) so external drivers that * used to alternate between two textures keep working — both faces resolve to the same texture. */ declare class Storage3DTextureInPlace { phase: boolean; private _target; constructor(config: SmokeStorageTextureTargetOptions); get texture(): Storage3DTexture; get read(): Storage3DTexture; get write(): Storage3DTexture; swap(): void; dispose(): void; } declare class SmokeSplatBuffer { capacity: number; arrays: SmokeSplatArrays; nodes: SmokeSplatNodes; constructor(capacity: number); upload(splats: readonly SmokeSplat[]): number; dispose(): void; } export declare class SmokeVolume { is3D: true; useBoundaries: boolean; _uUseBoundaries: SmokeBoolUniform; sdfVolumeConstraint: SmokeSDFVolumeConstraintInput | null; sdfAutoDomain: boolean; simRes: number; dyeRes: number; iterations: number; pressureSolver: SmokePressureSolver; multigridPreset: SmokeMultigridPreset; multigridCycles: number; multigridPreSmooth: number; multigridPostSmooth: number; multigridCoarseIterations: number; multigridMinResolution: number; multigridMaxLevels: number; multigridCorrectionScale: SmokeFloatUniform; multigridRecursiveCorrectionScale: SmokeFloatUniform; multigridAutoTune: boolean; _baseIterations: number; _speedFactor: number; densityDissipation: SmokeFloatUniform; temperatureDissipation: SmokeFloatUniform; densityDiffusion: SmokeFloatUniform; densityAdvectionCorrection: SmokeFloatUniform; velocityDissipation: SmokeFloatUniform; pressureDissipation: SmokeFloatUniform; pressureFactor: SmokeFloatUniform; curlStrength: SmokeFloatUniform; turbulenceStrength: SmokeFloatUniform; turbulenceFrequency: SmokeFloatUniform; turbulenceSpeed: SmokeFloatUniform; turbulenceOctaves: SmokeIntUniform; turbulenceDensityScale: SmokeFloatUniform; turbulenceDensityThreshold: SmokeFloatUniform; turbulenceThermalBoost: SmokeFloatUniform; turbulenceTime: SmokeFloatUniform; turbulenceMode: SmokeTurbulenceMode; turbulenceRes: number; turbulenceUpdateInterval: number; _turbulenceStep: number; _turbulenceBakeKey: string | null; boundaryFade: SmokeFloatUniform; _uApplyVorticity: SmokeBoolUniform; _uApplyTurbulence: SmokeBoolUniform; _uApplyBuoyancy: SmokeBoolUniform; maxSplatSources: number; splatMode: SmokeSplatMode; sparseSplatSourceThreshold: number; sparseSplatTouchedRatioThreshold: number; sparseSplatMinimumResolution: number; sparseSplatCutoff: number; radius: SmokeFloatUniform; neighborStride: SmokeFloatUniform; subcellSolidFractions: boolean; deltaTime: SmokeFloatUniform; dissipationTimeScale: SmokeFloatUniform; buoyancyStrength: SmokeFloatUniform; buoyancyDirection: SmokeVec3Uniform; buoyancyDirectionVolume: SmokeVec3Uniform; densityWeight: SmokeFloatUniform; occupancyBlockSize: number; occupancyRes: number; lightRes: number; lightSteps: SmokeIntUniform; lightVisibilityNode: SmokeLightVisibilityNode | null; lightDirection: SmokeVec3Uniform; lightDirectionVolume: SmokeVec3Uniform; cellSize: SmokeVec3Uniform; inverseCellSizeSquared: SmokeVec3Uniform; renderCaches: SmokeRenderCacheState; point3D: SmokeVec3Uniform; force3D: SmokeVec3Uniform; splatVelocityMode: SmokeFloatUniform; splatVelocityBlend: SmokeFloatUniform; splatDensityMode: SmokeFloatUniform; splatDensityBlend: SmokeFloatUniform; densityAmount3D: SmokeFloatUniform; temperatureAmount3D: SmokeFloatUniform; splatSourceCount: SmokeUintUniform; splatDispatchOffset: SmokeUVec3Uniform; splatDensityDispatchOffset: SmokeUVec3Uniform; _splatBuffer: SmokeSplatBuffer; splats3D: SmokeSplat[]; domainObject: Object3D | null; domainAutoUpdate: boolean; domainMatrix: Matrix4; domainMatrixInverse: Matrix4; worldToVolumeMatrix: Matrix4; volumeToWorldMatrix: Matrix4; _worldToVolumeVelocityMatrix: Matrix3; _volumeToWorldVelocityMatrix: Matrix3; _volumeTranslationMatrix: Matrix4; _volumeResolution: Vector3; _domainAxisX: Vector3; _domainAxisY: Vector3; _domainAxisZ: Vector3; _worldSplatUVW: Vector3; _worldSplatVelocity: Vector3; _velocityCopyRegion: Box3; _densityCopyRegion: Box3; _accumulatedTime: number; _timeStep: number; _sorOmegaValue: number; sorOmega: SmokeFloatUniform; lastStepStats: SmokeStepStats; _velocity3D: Storage3DTexturePingPong; _density3D: Storage3DTexturePingPong; _pressure3D: Storage3DTextureInPlace; _curl3D: Storage3DTextureTarget; _divergence3D: Storage3DTextureTarget; _turbulence3D: Storage3DTextureTarget; _occupancy3D: Storage3DTextureTarget; _lightOpticalDepth3D: Storage3DTextureTarget; _interactionSolid3D: Storage3DTextureTarget | null; _macCormackTemp3D: Storage3DTextureTarget; _macCormackTempDensity: Storage3DTextureTarget; interactionWorld: GPUInteractionWorld | null; interaction: Readonly | null; _interactionComputes: SmokeColliderPasses | null; _solidBoundaryComputes: SmokeSolidBoundaryPasses | null; _multigridComputes: SmokeMultigridProjectionPasses | null; _solidMultigridComputes: SmokeMultigridProjectionPasses | null; _sdfSolidRaster: ComputeNode | null; _sdfSolidMerge: ComputeNode | null; _interactionVolumeToWorld: SmokeMat4Uniform; _interactionWorldToVolume: SmokeMat4Uniform; initialized: boolean; debug: SmokeDebugPasses; _computeSplatVelocity3DRead: ComputeNode; _computeSplatVelocity3DWrite: ComputeNode; _computeSplatDensity3DRead: ComputeNode; _computeSplatDensity3DWrite: ComputeNode; _computeSparseSplatVelocity3DRead: ComputeNode; _computeSparseSplatVelocity3DWrite: ComputeNode; _computeSparseSplatDensity3DRead: ComputeNode; _computeSparseSplatDensity3DWrite: ComputeNode; _computeBatchedSplatVelocity3DRead: ComputeNode; _computeBatchedSplatVelocity3DWrite: ComputeNode; _computeBatchedSplatDensity3DRead: ComputeNode; _computeBatchedSplatDensity3DWrite: ComputeNode; _computeCurl3DReadVel: ComputeNode; _computeCurl3DWriteVel: ComputeNode; _computeDivergence3DReadVel: ComputeNode; _computeDivergence3DWriteVel: ComputeNode; _computeClear3DPressure: ComputeNode; _computeClear3DRead: ComputeNode; _computeClear3DWrite: ComputeNode; _computePressure3DRed: ComputeNode; _computePressure3DBlack: ComputeNode; _computePressure3DReadRed: ComputeNode; _computePressure3DWriteRed: ComputeNode; _computePressure3DReadBlack: ComputeNode; _computePressure3DWriteBlack: ComputeNode; _computeGradient3D_VelReadToWrite: ComputeNode; _computeGradient3D_VelWriteToRead: ComputeNode; _computeGradient3D_PRead_VelReadToWrite: ComputeNode; _computeGradient3D_PWrite_VelReadToWrite: ComputeNode; _computeGradient3D_PRead_VelWriteToRead: ComputeNode; _computeGradient3D_PWrite_VelWriteToRead: ComputeNode; _computeVelocityForward_Read: ComputeNode; _computeVelocityForward_Write: ComputeNode; _computeVelocityBackward_ReadToWrite: ComputeNode; _computeVelocityBackward_WriteToRead: ComputeNode; _computeDensityForward_VelRead: ComputeNode; _computeDensityForward_VelWrite: ComputeNode; _computeDensityBackward_VelRead: ComputeNode; _computeDensityBackward_VelWrite: ComputeNode; _computeDensityDiffuse_ReadToWrite: ComputeNode; _computeDensityDiffuse_WriteToRead: ComputeNode; _computeTurbulence3D: SmokeDensityVelocityForcePasses; _computeTurbulenceField3D: ComputeNode; _computeApplyTurbulence3D: SmokeDensityVelocityForcePasses; _computeOccupancy3DRead: ComputeNode; _computeOccupancy3DWrite: ComputeNode; _computeLightOpticalDepth3DRead: ComputeNode; _computeLightOpticalDepth3DWrite: ComputeNode; _clearComputes: ComputeNode[]; static get type(): 'SmokeVolume'; constructor(parameters?: SmokeVolumeOptions); /** Attach a shared moving-collider interaction world. */ setInteractionWorld(interactionWorld: GPUInteractionWorld | null, options?: SmokeInteractionOptions): this; /** Disable shared moving-collider interaction. */ clearInteractionWorld(): this; /** * Report whether moving-collider smoke interaction is available on a renderer. * * @param {THREE.WebGPURenderer|null} [renderer=this.interactionWorld.renderer] Optional renderer for capability checks. * @returns {Readonly} Smoke interaction capability report. */ getInteractionCapabilityReport(renderer?: Renderer | null): Readonly; _ensureInteractionComputes(renderer: Renderer): SmokeColliderPasses | null; _ensureSolidBoundaryComputes(interactionComputes?: SmokeColliderPasses | null): SmokeSolidBoundaryPasses | null; _ensureMultigridComputes(solidComputes?: SmokeSolidBoundaryPasses | null): SmokeMultigridProjectionPasses | null; _canUseMultigrid(): boolean; _resetMultigridComputes(): void; _queuePressureSweeps(computeNodes: ComputeNode[], solidComputes: SmokeSolidBoundaryPasses | null, iterations: number): void; _queueMultigridPressure(computeNodes: ComputeNode[], solidComputes: SmokeSolidBoundaryPasses | null): void; _queueMultigridLevel(computeNodes: ComputeNode[], multigrid: SmokeMultigridProjectionPasses, levelIndex: number, solidComputes: SmokeSolidBoundaryPasses | null): void; _queueMultigridLevelSweeps(computeNodes: ComputeNode[], level: SmokeMultigridLevel, solidComputes: SmokeSolidBoundaryPasses | null, iterations: number): void; _updateSpeedFactor(value: number): void; _buildComputes(): void; splat3D(renderer: Renderer, computeNodes?: ComputeNode[] | null): SmokeSplatStats; _splatHasVelocity(splat: SmokeSplat): boolean; _setSplatUniforms(splat: SmokeSplat): void; _getSplatBounds(splat: SmokeSplat, resolution: number): SmokeSplatBounds; _splatSequential(renderer: Renderer, computeNodes: ComputeNode[] | null, splats: readonly SmokeSplat[]): SmokeSplatDispatchStats; _splatBatched(renderer: Renderer, computeNodes: ComputeNode[] | null, splats: readonly SmokeSplat[]): SmokeSplatDispatchStats; _splatSparse(renderer: Renderer, splats: readonly SmokeSplat[]): SmokeSplatDispatchStats & { touchedVoxelEstimate: number; }; /** * Queue a normalized-volume smoke source for the next step. * * @param {number} x Normalized volume X coordinate. * @param {number} y Normalized volume Y coordinate. * @param {number} z Normalized volume Z coordinate. * @param {number} [fx=0] Grid-cell X velocity impulse or inflow target. * @param {number} [fy=0] Grid-cell Y velocity impulse or inflow target. * @param {number} [fz=0] Grid-cell Z velocity impulse or inflow target. * @param {number} [densityAmount=1] Density impulse or inflow target. * @param {Object} [options={}] Source blend and temperature options. * @param {number} [options.temperatureAmount=densityAmount] Temperature impulse or inflow target. * @param {'add'|'inflow'} [options.velocityMode='add'] Velocity accumulation mode. * @param {number} [options.velocityBlend=1] Velocity inflow blend strength. * @param {'add'|'inflow'} [options.densityMode='add'] Scalar accumulation mode. * @param {number} [options.densityBlend=1] Scalar inflow blend strength. * @param {number} [options.radius=this.radius.value] Source radius used by the Gaussian falloff. * @returns {this} */ addSplat(x: number, y: number, z: number, fx?: number, fy?: number, fz?: number, densityAmount?: number, { temperatureAmount, velocityMode, velocityBlend, densityMode, densityBlend, radius }?: SmokeSplatOptions): this; /** * Bind the normalized smoke volume to an object's world transform. * The object should render the volume as a unit local-space cube centered at the origin. * * @param {THREE.Object3D} object Volume display object. * @param {Object} [options={}] Configuration options. * @param {boolean} [options.autoUpdate=true] Refresh the transform before world-space conversions. * @returns {this} */ setDomainFromObject(object: Object3D, { autoUpdate }?: SmokeDomainBindingOptions): this; /** * Bind the normalized smoke volume to a world matrix. * * @param {THREE.Matrix4} matrixWorld Unit-cube local-to-world transform. * @returns {this} */ setDomainTransform(matrixWorld: Matrix4): this; /** * Set the world-space direction used for cached smoke lighting. * * @param {THREE.Vector3} direction Non-zero world-space direction toward the light. * @returns {this} */ setLightDirection(direction: Vector3): this; /** * Set the world-space direction used by thermal buoyancy. * * @param {THREE.Vector3} direction Non-zero world-space buoyancy direction. * @returns {this} */ setBuoyancyDirection(direction: Vector3): this; /** * Refresh matrices for a bound domain object. * * @param {boolean} [force=false] Refresh even when automatic updates are disabled. * @returns {this} */ syncDomainTransform(force?: boolean): this; _applyDomainTransform(matrixWorld: Matrix4): this; _updateDomainDerivedUniforms(): void; _updateMultigridDomainTuning(anisotropy?: number): void; /** * Convert a world-space position into normalized smoke texture coordinates. * * @param {THREE.Vector3} worldPosition World-space point. * @param {THREE.Vector3} [target] Output UVW vector. * @returns {THREE.Vector3} */ worldToVolumeUVW(worldPosition: Vector3, target?: Vector3): Vector3; /** * Convert normalized smoke texture coordinates into a world-space position. * * @param {THREE.Vector3} uvw Normalized smoke texture coordinates. * @param {THREE.Vector3} [target] Output world-space point. * @returns {THREE.Vector3} */ volumeUVWToWorld(uvw: Vector3, target?: Vector3): Vector3; /** * Convert a world-space velocity into the grid-cell velocity units used by SmokeVolume. * * @param {THREE.Vector3} worldVelocity World-space velocity vector. * @param {THREE.Vector3} [target] Output grid-cell velocity vector. * @returns {THREE.Vector3} */ worldVectorToVolumeVelocity(worldVelocity: Vector3, target?: Vector3): Vector3; /** * Convert a grid-cell velocity into world-space units. * * @param {THREE.Vector3} volumeVelocity Grid-cell velocity vector. * @param {THREE.Vector3} [target] Output world-space velocity vector. * @returns {THREE.Vector3} */ volumeVelocityToWorldVector(volumeVelocity: Vector3, target?: Vector3): Vector3; /** * Queue a density and velocity splat using world-space inputs. * * @param {THREE.Vector3} worldPosition World-space splat position. * @param {THREE.Vector3} [worldVelocity] World-space velocity impulse or inflow target. * @param {number} [densityAmount=1] Density impulse. * @param {Object} [options={}] Velocity splat options. * @param {number} [options.temperatureAmount=densityAmount] Temperature impulse or inflow target. * @param {'add'|'inflow'} [options.velocityMode='add'] Add an impulse or blend toward a target velocity. * @param {number} [options.velocityBlend=1] Inflow blend weight at the source center. * @param {'add'|'inflow'} [options.densityMode='add'] Add an impulse or blend toward a bounded source density. * @param {number} [options.densityBlend=1] Density inflow blend weight at the source center. * @returns {this} */ addWorldSplat(worldPosition: Vector3, worldVelocity?: Vector3 | null, densityAmount?: number, options?: SmokeSplatOptions): this; /** * Clear all simulation textures before their first use. * * @param {THREE.WebGPURenderer} renderer WebGPU renderer used to dispatch the clear passes. * @returns {this} */ initialize(renderer: Renderer): this; clearPressure(renderer: Renderer): void; setPressureIterations(iterations: number): this; /** * Configure the pressure projection solver. * * @param {'sor'|'multigrid'} solver Pressure solver selection. * @param {Object} [options={}] Multigrid configuration overrides. * @param {'quality'|'balanced'} [options.preset] Quality-first or warmed 64³ balanced preset. * @param {number} [options.cycles] V-cycle count. * @param {number} [options.preSmooth] Fine-grid pre-smoothing iterations. * @param {number} [options.postSmooth] Fine-grid post-smoothing iterations. * @param {number} [options.coarseIterations] Intermediate and coarsest-grid smoothing iterations. * @param {number} [options.minResolution] Smallest target grid resolution. * @param {number} [options.maxLevels] Maximum hierarchy level count, including the fine grid. * @param {number} [options.correctionScale] Restricted residual scale. * @param {number} [options.recursiveCorrectionScale] Restricted residual scale below the first coarse level. * @param {boolean} [options.autoTune] Adapt pre-smoothing and correction scale to domain anisotropy. * @returns {this} */ setPressureSolver(solver: SmokePressureSolver, options?: SmokePressureSolverOptions): this; getLastStepStats(): SmokeStepStats; _selectDensityVelocityForcePass(passes: SmokeDensityVelocityForcePasses): ComputeNode; /** Refresh configured density-derived render caches without advancing the simulation. */ refreshRenderCaches(renderer: Renderer, options?: SmokeRenderCacheOptions): this; /** * Compile and dispatch both density ping-pong variants of the configured render caches. * The inactive variants run first and the active variants run last, so the final cache * contents still correspond to the density texture currently exposed by this volume. */ prewarmRenderCacheVariants(renderer: Renderer, options?: SmokeRenderCacheOptions): this; /** * Compile and dispatch both ping-pong variants of the batched splat kernels. * A zero source count makes each pair copy the active field to the inactive field * and back, so both pipelines are prepared without changing the visible state. */ prewarmBatchedSplatVariants(renderer: Renderer): this; _getRenderCacheComputes({ occupancy, lightOpticalDepth, }?: SmokeRenderCacheOptions, densityPhase?: boolean): ComputeNode[]; step(renderer: Renderer, dt?: number, { refreshRenderCaches }?: SmokeStepOptions): this; getDensityTexture3D(): Storage3DTexture; getVelocityTexture3D(): Storage3DTexture; /** Single-channel r32float pressure field, solved in place. */ getPressureTexture3D(): Storage3DTexture; /** Single-channel r32float divergence field. */ getDivergenceTexture3D(): Storage3DTexture; /** Curl of the advected velocity (pre-projection), refreshed every step for vorticity confinement. */ getCurlTexture3D(): Storage3DTexture; getOccupancyTexture3D(): Storage3DTexture; getOccupancyGridSize(target?: Vector3): Vector3; getLightOpticalDepthTexture3D(): Storage3DTexture; setDebugPasses(passes: SmokeDebugPassOverrides): this; setUseBoundaries(enabled: boolean): this; /** Configure which density-derived render caches are refreshed by default. */ setRenderCacheOptions({ occupancy, lightOpticalDepth }?: SmokeRenderCacheOptions): this; /** Select automatic, batched, sparse, or sequential splat execution. */ setSplatMode(mode?: SmokeSplatMode): this; /** Select low-resolution turbulence or the full-resolution quality reference. */ setTurbulenceMode(mode?: SmokeTurbulenceMode): this; setSize(): this; dispose(): void; } export {};