Create particle flock
create_particle_flockSimulate a boids-style GPU particle flock with separation, alignment, and cohesion. Creates a TouchDesigner network with instanced dots, camera, live controls, and returns node paths and preview.
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); also pick a sibling for other motion: image_to_particles to spring particles onto the pixels of an image/video, create_pop_particle_system for TouchDesigner's native POP particle network, create_particle_system for a simple CPU emitter. 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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create_particle_flock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | RGB colour (0..1) of the instanced dots — the colour of the school. | |
| 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. | |
| speed | No | Cruise speed the velocity is renormalised toward each frame, so the school flies at a stable pace. | |
| cohesion | No | Boids cohesion weight: steer toward the centroid (average position) of neighbours. | |
| alignment | No | Boids alignment weight: steer toward the average heading of nearby neighbours. | |
| point_size | No | Radius of each instanced dot (the sphere SOP scale). | |
| separation | No | Boids separation weight: steer away from close neighbours (collision avoidance). | |
| parent_path | No | Parent network where the flock container is created (default '/project1'). | /project1 |
| expose_controls | No | When true (default), expose live Separation / Alignment / Cohesion / Speed knobs on the system container. |