Create fluid sim
create_fluid_simBuild a real-time 2D fluid/ink/dye simulation in TouchDesigner using semi-Lagrangian advection and Jacobi pressure solve. Supports auto, mouse, or audio-driven injection with artist controls for viscosity and dissipation.
Instructions
Build a real-time 2D fluid/ink/dye simulation (stable-fluids style: semi-Lagrangian advection + Jacobi pressure solve + gradient-subtract projection + dye advection) as a stack of GLSL TOPs in feedback loops inside a new baseCOMP under parent_path. Exposes artist-facing controls (dye color, injection radius/strength, viscosity, dissipation, pressure iterations, inject U/V) and optionally binds a CHOP at audio_path so audio drives the dye injection strength. With injection_mode='auto', a slow LFO drives the splat point so the sim shows life with no input. Returns a summary plus a JSON block with the container path, created node paths, the dye_out output path, exposed controls, any node errors, warnings, and an inline preview image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resolution | No | Sim grid resolution (square). 512 is safe on integrated GPUs. | 512 |
| dye_color | No | Injected dye color as a '#rrggbb' hex string. | #ff3a8c |
| injection_radius | No | Radius of the dye/force splat in UV units (0.01–0.5). | |
| injection_strength | No | Multiplier on dye + velocity splat per frame (0–2). | |
| viscosity | No | Velocity dissipation per frame (0–1). Higher = thicker fluid. | |
| dissipation | No | Dye decay per frame (0.9–1.0). <1 fades trails. | |
| pressure_iterations | No | Jacobi iterations per frame (1–60). Higher = more incompressible. | |
| injection_mode | No | How the splat point/strength is driven. | auto |
| audio_path | No | Optional CHOP path; channel 0 multiplies injection strength when set. | |
| expose_controls | No | Auto-expose an artist-facing control panel on the container. | |
| parent_path | No | Parent network where the fluid_sim container is created. | /project1 |