Each filefish carries its own RGB colour. Every frame it blends that colour toward the seagrass pattern directly beneath it โ a low-frequency tiled function of mottled green, teal and brown patches โ at a rate set by the adaptation slider: color += (target โ color) ยท rate ยท dt. A fish's individual camouflage score is 1 โ ฮE(color, target), normalised 0โ1; the panel shows the school average as a percentage.
Motion is simple boid flocking (separation + alignment + cohesion toward the local centroid) plus a current force built from two offset sine fields whose amplitude scales with the current slider โ stronger current stretches the school apart, which the cohesion readout tracks the same way the 3D lab does (spread from centroid, clamped to 18โ99%).
- Predator glance โ click the button (or the canvas) to sweep a detection ring outward from a random point. Any fish it passes over with a camouflage score below 60% is flagged red and counted as detected; well-adapted fish are invisible to the sweep.
- Current strength โ higher values both scatter the school (lower cohesion) and add turbulent drift to each fish's velocity (higher avg speed).