Create particle flock
create_particle_flockCreates a boids-style GPU particle flock in TouchDesigner with separation, alignment, and cohesion rules, controlled via live knobs. Returns the container path and controls.
Instructions
Build a boids-style GPU particle flock: position and velocity are simulated entirely on the GPU in two RGBA32float feedback-TOP loops, where the velocity shader implements the three classic boids rules — separation, alignment, cohesion — by scanning a stencil of neighbouring texels in the agent texture (each texel is one agent), then renormalising toward a cruise speed. Positions drive TOP-instancing of a tiny dot once per agent. Creates a new baseCOMP under parent_path holding the velocity/position feedback loops, the instanced Geometry COMP, Camera, Light, and Render TOP ending in a Null output. The behavioural complement to create_gpu_particle_field (use that instead for curl-noise/gravity drift rather than flocking). Exposes live Separation / Alignment / Cohesion / Speed knobs. Note: the flock only evolves while the TD timeline plays. Returns a summary plus a JSON block with the container path, created node paths, the agent count, the output path, exposed controls, any node errors, warnings, and an inline preview image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Edge of the square agent buffer; the flock is count×count agents (agents = count², e.g. 64 → 4096). Each agent is one texel of the RGBA32float position/velocity buffers. Capped at 256 (65 536 agents) because the per-agent neighbour scan cost grows with the texture. | |
| separation | No | Boids separation weight: steer away from close neighbours (collision avoidance). | |
| alignment | No | Boids alignment weight: steer toward the average heading of nearby neighbours. | |
| cohesion | No | Boids cohesion weight: steer toward the centroid (average position) of neighbours. | |
| speed | No | Cruise speed the velocity is renormalised toward each frame, so the school flies at a stable pace. | |
| color | No | RGB colour (0..1) of the instanced dots — the colour of the school. | |
| point_size | No | Radius of each instanced dot (the sphere SOP scale). | |
| expose_controls | No | When true (default), expose live Separation / Alignment / Cohesion / Speed knobs on the system container. | |
| parent_path | No | Parent network where the flock container is created (default '/project1'). | /project1 |