Flood Fill

Flood-fill regions by spatial or attribute proximity.

What it does

Flood Fill spreads outward from a seed point, marking every element it can reach and recording how far it travelled to get there.

On an image it walks pixel by pixel, crossing only into neighbours close enough in colour (Tolerance), a bucket-fill selection with a soft edge rather than a hard boundary. On a collection of points or a mesh it walks a connectivity graph, nearby points, K-nearest-neighbours, or real mesh edges, and reports geodesic distance rather than straight-line distance. Every element reached carries a Distance value and a Mask value (1 reached, 0 not reached), and Count reports how many elements the flood touched. Images also produce a tinted Overlay, showing the selection in the viewport.

When to use it

ParameterTypeDefault
sourceOneOf([FieldOf(Raster), Collection])
seed_indexOneOf([Number])
seed_positionOneOf([Transform, Vec3, Vec2])
toleranceNumber0.100
pixel_connectivityString"8-Connected"
connectivityString"Radius"
connection_radiusNumber50
kNumber6
max_distanceNumber0
normalizeBooleantrue
overlay_colorColorrgba(0.20, 0.60, 1.00, 0.40)
strengthNumber1

Gotchas

Max Distance at 0 lets the flood run until every reachable element is exhausted. Raise it to cap how far the flood travels from the seed, for a bounded ripple or a fixed-radius selection.

Delaunay connectivity (collection mode) currently behaves like Radius connectivity. True triangulation-based connectivity is not yet implemented.

Seed Position expects a world-space position. Wire a Null's transform, or any 3D or 2D position, and the seed tracks that handle in the scene. Left disconnected, the seed defaults to the centre of the image.

Seed Index, picking a starting element by number, works only when flooding a collection of points or a mesh. On an image the seed always comes from Seed Position, and Seed Index is ignored.

Worked example

  1. Add a Flood Fill and wire an image into Source.

  2. Wire a Null's transform into Seed Position and move it in the viewport. The flood's origin follows the handle.

  3. Raise Tolerance so the flood accepts a wider range of colours, growing the selection past hard edges.

  4. Take Distance into a Gradient to colour the selection by how far it spread from the seed, or take Mask into a Blend to composite only the reached region.

See also

Contour · SDF · Field Analysis · Rasters (images)