import { Expr, GpuComputeNode, GpuFragmentParams } from '../../gpu/contract'; import { d } from '../../gpu/kit/index'; import { AgentPipelineSpec, AgentSystem, AgentSystemConfig, DeviceTier } from '../../gpu/scaffolds/agentSystem'; import { ComputeStep } from '../../gpu/compute'; import { splat, resolve, OrientedWorldSplatConfig, PointWorldSplatConfig, VolumeSplatConfig, ReliefSplatConfig, RampResolveConfig, WorldSplatLayout, PointWorldSplatLayout, RampResolveLayout } from './agentRender'; type AnyWgslStruct = d.AnyWgslStruct; /** The two render pipelines every agent shader ends its frame program with. */ export interface RenderAgentsPipelines { splat: AgentPipelineSpec; resolve: AgentPipelineSpec; } /** * The render subsystem as one declared part: a splat variant + its matching resolve, returned * as ready pipeline specs for the frame program. Kernel factories live in `agentRender`. */ export declare const renderAgents: { /** Heading-oriented world-space agents with the rest→excited colour ramp (Boids, * MagneticFilings, ParticleFlow). */ readonly orientedWorld: (layout: WorldSplatLayout & RampResolveLayout, cfg: Omit & { ramp: Omit & { invGain?: number; }; names: { splat: string; resolve: string; }; /** Chain the extra bind group onto the splat (a shape family's own resources). */ extraOnSplat?: boolean; }) => RenderAgentsPipelines; /** Un-oriented point motes with a live softness and a single tint (FloatingParticles). */ readonly pointWorld: (layout: PointWorldSplatLayout & Parameters[0], cfg: Omit & { names: { splat: string; resolve: string; }; }) => RenderAgentsPipelines; /** Perspective-projected 3D swarm with the speed-driven colour ramp (Particles). */ readonly volume: (layout: Parameters[0] & RampResolveLayout, cfg: Omit & { ramp: Omit; names: VolumeSplatConfig["names"] & { resolve: string; }; extraOnSplat?: boolean; }) => RenderAgentsPipelines; /** Camera-projected image relief with depth-weighted colour averaging (ParticleField). */ readonly relief: (layout: Parameters[0], cfg: Omit & { out: [number, number]; weightedColor: { alphaK: number; }; names: { splat: string; resolve: string; }; }) => RenderAgentsPipelines; }; /** What `bake` assembles at composition time from the declared parts. */ export interface AgentSimBaked { pipelines: Record; /** Per-frame execution order (keys of `pipelines`). */ program: readonly string[]; /** One-shot spawn step, prepended on the first frame and on a reseed. */ initStep?: string; /** Override the declared output extent (an aspect-fitted target decided per composition). */ outputSize?: [number, number]; /** A second bind group chained onto every pipeline marked `extra` (shape-family SDFs). */ extraBindGroup?: unknown; /** Resources already available at composition to bind onto `externalKeys` immediately. */ bindNow?: Record; /** A composition payload handed to `frame` (fluid solvers, per-shape CPU resolvers…). */ setup?: unknown; } export interface AgentSimFragmentConfig { /** The compute output the fragment bilinear-samples full-canvas (rgba16f is filterable). */ output: string; /** GPU-free fallback: transparent (generators) or the raw child (child-driven effects). */ fallback: 'transparent' | 'child'; /** Optional compose over the sampled field (e.g. straight-alpha over the child). */ compose?: (field: Expr, params: GpuFragmentParams) => Expr; } export interface AgentSimConfig { layout: AgentSystemConfig['layout']; params: TParams; maxAgents: number; /** Effective count ceiling per device tier (the prop's declared range is unchanged). */ countCap?: DeviceTier; output: AgentSystemConfig['output']; /** Layout keys bound late or via `bake.bindNow` (a child RTT, a solver handoff texture). */ externalKeys?: readonly string[]; /** Read the child as a texture and late-bind it onto this external key (ParticleField). */ childTexture?: { externalKey: string; }; /** Composition-time baking: assemble the declared parts. Null = no simulation composes. */ bake: (params: GpuFragmentParams) => AgentSimBaked | null; /** The per-frame CPU program: write uniforms, return the frame's steps (usually via * `sys.frame(...)`, prepending any extra passes the shader owns). */ frame: (sys: AgentSystem, params: GpuFragmentParams, setup: unknown) => (frameParams: unknown) => ComputeStep[] | null; fragment: AgentSimFragmentConfig; } /** The two definition halves the spread contributes (the ComputeBackedEffect shape). */ export interface AgentSimSpread { compute: GpuComputeNode; gpu: { fragment: (params: GpuFragmentParams) => Expr; }; } /** * Compose an agent simulation: `bake` the declared parts into kernels, wire them through the * `createAgentSystem` harness, and sample the resolved field in the fragment. */ export declare function agentSim(cfg: AgentSimConfig): AgentSimSpread; export { force, torque, field, drift, channel, integrator, composeForces3, composeSteer2, composeTorques, restOrientationAngle } from './agentForces'; export type { AgentForce3, AgentSteer2, AgentTorque, AgentFieldAt, AgentHome2, AgentDrift, AgentChannel, ShapeField3, } from './agentForces'; export { splat, resolve, pointSlot } from './agentRender'; export { shapeField } from './shapeFields'; export * as agentFrame from './agentFrame'; //# sourceMappingURL=agents.d.ts.map