seedDrainageGraph

function seedDrainageGraph
universe/src/drainage.ts:1180
seedDrainageGraph(surface: SurfaceParameters, graph: DrainageGraph | null) → void

Hand this thread a graph another thread built for the same surface.

The build is 57 to 103 ms in the browser, and every thread that samples the field pays it once per body — on the draw thread, in whichever frame first reads a wet body's ground: the site list on focusing one, the scatter field's one sample a frame as the ground arrives, the GPU producer's first pack. A worker preparing the surface builds it anyway, and the arrays survive a structured clone, so what crosses back is the graph rather than the work.

A graph this thread already holds is kept rather than replaced. Both are the same arithmetic over the same key, and the field and the packed kernel may already be holding the one that is here.

surfaceSurfaceParameters
Undocumented
graphDrainageGraph | null
Undocumented
Returnsvoid