import type { TSLBoolNode, TSLFloatNode, TSLFunction, TSLMat4Node, TSLNode, TSLStorageNode, TSLUintNode, TSLUniformArrayNode, TSLVec2Node, TSLVec3Node } from '../../../types/tsl.cjs'; export type SpatialLookupVectorNode = TSLVec2Node | TSLVec3Node; export type SpatialLookupCellNode = TSLNode<'ivec2'> | TSLNode<'ivec3'>; export type SpatialLookupVectorStorage = TSLStorageNode<'vec2'> | TSLStorageNode<'vec3'>; type PositionToCellArguments = [ SpatialLookupVectorNode, SpatialLookupVectorNode, SpatialLookupVectorNode, SpatialLookupVectorNode ]; type CellKeyToHashArguments = [SpatialLookupCellNode, SpatialLookupVectorNode]; export interface SpatialLookupHelpers { positionToCellCoords: TSLFunction; cellKeyToHash: TSLFunction; } export interface SpatialLookupBuffers { positions: SpatialLookupVectorStorage; velocities: SpatialLookupVectorStorage; cellHashes: TSLStorageNode<'uint'>; particleIds: TSLStorageNode<'uint'>; cell_offsets: TSLStorageNode<'uint'>; candidateVisits?: TSLStorageNode<'uint'> | null | undefined; } export interface SpatialLookupUniforms { particleCount: TSLUintNode; max_particles: TSLUintNode; grid_cell_size: TSLVec3Node; grid_resolution: TSLVec3Node; domainDimensions: TSLVec3Node; domainMatrix?: TSLMat4Node | null | undefined; delta?: TSLFloatNode | null | undefined; } export interface SpatialLookupSimulation extends SpatialLookupHelpers { buffers: SpatialLookupBuffers; ubos: SpatialLookupUniforms; is3D: boolean; } export type SpatialLookupCallback = (position: SpatialLookupVectorNode, velocity: SpatialLookupVectorNode, particleIndex: TSLUintNode, particlePosition: SpatialLookupVectorNode, distanceSquared: TSLFloatNode) => void; export interface WorkgroupSpatialBuffers { positions: TSLStorageNode<'vec3'>; velocities: TSLStorageNode<'vec3'>; particleIds: TSLStorageNode<'uint'>; cell_offsets: TSLStorageNode<'uint'>; cellCursors: TSLStorageNode<'uint'>; candidateVisits?: TSLStorageNode<'uint'> | null | undefined; } export interface WorkgroupSpatialUniforms { grid_resolution: TSLVec3Node; count_cells: TSLUintNode; } export interface WorkgroupSpatialSimulation { buffers: WorkgroupSpatialBuffers; ubos: WorkgroupSpatialUniforms; cellKeyToHash: TSLFunction; is3D: boolean; lookupWorkgroupSize: number; } export type WorkgroupSpatialVisit = (particleIndex: TSLUintNode, position: TSLVec3Node, distanceSquared: TSLFloatNode) => void; export type WorkgroupSpatialTraverse = (visit: WorkgroupSpatialVisit) => void; export type WorkgroupSpatialCallback = (active: TSLBoolNode, particleIndex: TSLUintNode, position: TSLVec3Node, velocity: TSLVec3Node, traverse: WorkgroupSpatialTraverse) => void; declare const createHelpers: (is3D: boolean) => SpatialLookupHelpers; declare const cell_offsets_2d: TSLUniformArrayNode<"ivec2">; declare const cell_offsets_3d: TSLUniformArrayNode<"ivec3">; /** * TSL spatial-lookup offset nodes exposed for shader precompilation and rehydration. * * These nodes are closure-captured by the lookup kernels and otherwise unreachable * from an instance. */ export declare const spatialLookupInternals: { cell_offsets_2d: TSLUniformArrayNode<"ivec2">; cell_offsets_3d: TSLUniformArrayNode<"ivec3">; }; declare const spatialLookup: (simulation: SpatialLookupSimulation, gid: TSLUintNode, callback: SpatialLookupCallback) => void; declare const workgroupSpatialForEach: (simulation: WorkgroupSpatialSimulation, callback: WorkgroupSpatialCallback) => void; export { createHelpers, spatialLookup, workgroupSpatialForEach, cell_offsets_2d, cell_offsets_3d };