Spatial Substrate — a matrix field that lives

Every pixel holds a 2-vector s. Every cell also holds its own local 2×2 M(x,y) — a matrix field you paint. Each tick: s ← φ( M·s ) diffused with neighbors. Color = the vector's direction, brightness = its magnitude. Rotations make pinwheels, shear makes streaks, det≈0 flattens to lines. Toggle agents to release walkers that ride the local flow and feed back into it.

brush — paint a local map

agents — walkers on the field

Each agent turns its heading by the local matrix (h ← M·h), steps forward, and deposits a vector back into the field — stigmergy. The matrix field steers the agents; the agents reshape the field.

reading it

swirl — local rotation; eigenvalues complex, magnitude conserved → persistent spiral waves.
expand / contract — det > 1 grows, < 1 decays; the saturation φ keeps it from blowing up.
flatten — det = 0; the cell projects onto one eigen-line → streaks.
shear — repeated eigenvalue; combs the field into bands.