> simulations

Physarum

simulations/physarum·v1.3.0
IN:2  OUT:3

Physarum is a GPU-accelerated simulation that creates organic network patterns inspired by the Physarum polycephalum slime mold organism. This operator simulates particles (agents) that sense their environment through forward-facing sensors, rotate toward higher concentrations of deposited trails, and move while depositing their own trails. The emergent behavior produces vein-like networks, branching patterns, and maze-solving structures as particles collectively optimize paths through space, creating patterns similar to biological transportation networks, neural systems, and fungal mycelium.

The simulation operates in 2D or 3D space with a volumetric trail map that stores deposited pheromone-like values. Each particle extends sensors at specified distances and angles to sample trail concentrations, rotates toward the strongest signal using configurable rotation angles, and moves forward depositing trail substance. The trail map undergoes diffusion and decay each iteration, spreading and fading the deposited trails to create smooth gradients that guide particle movement. You control particle behavior through sensor parameters (distance, angle), rotation parameters (turning angle based on sensor readings), move distance, and diffusion settings (blur type, decay rate, filter size).

Physarum supports optional volume constraints to confine particle movement within texture-defined regions using force-based repulsion (2D texture in 2D mode, 3D texture in 3D mode). The simulation outputs both particle positions and the trail texture, allowing visualization of the particle swarm itself or just the accumulated trail patterns. Boundary behaviors (off, clamp, loop, zigzag) control how particles interact with simulation bounds. This makes Physarum ideal for generative network art, organic vein patterns, maze generation, path optimization visualization, neural network aesthetics, and procedural mycelium textures.

PAGEPhysarum
Target Particles Update POPParticlesupdatepopReference to a POP node downstream in the network. This reference will cause a feedback loop and re-injects the particles next frame.
Target Trail Update TOPTrailupdatetopReference to a TOP node downstream in the network. This reference will cause a feedback loop and re-injects the trail deposit texture next frame.
Max Axis ResolutionMaxaxisresMaximum voxel/pixel resolution for longest axis of trail texture.
Number of ParticlesNumberofparticlesParticle count when no input connected (spawned at initialization).
SeedSeedRandom seed for particle spawn positions and directions.
Point SizePointsizeParticle render size in 2D mode for trail deposition.
Sensor Distance BaseSensordistancebaseBase distance for sensor probe ahead of particle.
Sensor Distance PowerSensordistancepowerPower function applied to trial-sampled sensor distance variation.
Sensor Distance ScaleSensordistancescaleMultiplier for trial-sampled sensor distance variation range.
Sensor Angle BaseSensoranglebaseBase angle offset for sensors from forward direction (degrees).
Sensor Angle PowerSensoranglepowerPower function applied to trial-sampled sensor angle variation.
Sensor Angle ScaleSensoranglescaleMultiplier for trial-sampled sensor angle variation range (degrees).
Rotation Angle BaseRotationanglebaseBase rotation angle when turning toward detected trails (degrees).
Rotation Angle PowerRotationanglepowerPower function applied to trial-sampled rotation angle variation.
Rotation Angle ScaleRotationanglescaleMultiplier for trial-sampled rotation angle variation range (degrees).
Move Distance BaseMovedistancebaseBase distance particles move forward per iteration.
Move Distance PowerMovedistancepowerPower function applied to trial-sampled move distance variation.
Move Distance ScaleMovedistancescaleMultiplier for trial-sampled move distance variation range.
Decay RateDecayRate at which trails fade over time (0 = permanent, 1 = instant).
Diffuse PassesDiffusepassesNumber of blur iterations to spread trails (0 = no diffusion).
PAGEConstraint Volume
Filter SizeSizeBlur kernel radius (larger = wider spread).
PAGEPhysarum
InitializeInitializepulsePulse to reset simulation and spawn initial particles.
StartStartpulsePulse to begin simulation from initialized state.
PlayPlayToggle continuous simulation playback.
StepSteppulsePulse to advance simulation by one iteration while paused.
PAGEConstraint Volume
Constraint to VolumeConstrainttovolumeConfines particle movement within texture-defined regions.
Constraint VolumeConstraintvolumeReference to a 2D/3D texture TOP to use as constraint volume when no third input is connected.
Force StrengthForcestrengthStrength of repulsion force from volume boundaries.
Pre-ShrinkPreshrinkDownsamples volume before blur for performance.
Filter SizeFiltersizeBlur kernel size for smoothing volume constraint field.
PAGECommon
Free Extra GPU MemoryFreeextragpumemFree memory that has accumulated when output memory has grown and shrunk.
Input 0 POP Particles In
Input 1 TOP Constraint Volume
Output 0 POP Particles Out
Output 1 TOP Trail
Output 2 TOP Deposit