Region boundaries: iso-line contours of the blurred region field

Marching squares over each cluster's own contribution to the shared
blurred bitmap, recovered by projecting premultiplied pixels onto the
cluster's paint color (blends split proportionally between overlapping
halos — the natural divider). Boundary level = fraction of the
cluster's peak field, user-adjustable in the settings panel; 0 = off.

One paint, one blur, one readback; contouring is cheap typed-array
math over small per-cluster crops (stride-2 sampling: measured 1.2ms
for all 26 clusters, vs 7.3ms naive). During the live sim boundaries
recompute every 2nd region rebuild and stale paths ride along — drag
cadence matches the pre-boundary baseline (avg 8.46ms vs 8.37ms).
This commit is contained in:
amosblomqvist
2026-09-13 16:00:28 +03:00
parent 652a25e382
commit c7c1148989
4 changed files with 507 additions and 3 deletions
+6
View File
@@ -656,6 +656,12 @@ export function GraphView() {
step={0.05}
onChange={(v) => setRegionTuning((t) => ({ ...t, edgeAlpha: v }))}
/>
<NumberField
label="Boundary level (fraction of peak, 0 = off)"
value={regionTuning.boundary}
step={0.05}
onChange={(v) => setRegionTuning((t) => ({ ...t, boundary: v }))}
/>
</div>
{/* Physics (user-facing): the live sim's forces. Every value feeds
the SAME engine the server settle runs (createGraphSimulation);