threejs-worldgen
    Preparing search index...

    Function fillDepressions

    • Priority-Flood depression filling (Barnes, Lehman & Mulla 2014). Every cell is raised to the lowest level water there could spill out at, through the map edge or into the sea. With epsilon > 0 filled flats also get a tiny gradient (Priority-Flood+ε), so every cell has a strictly lower neighbour and flow routing never gets stuck.

      Parameters

      • heights: ArrayLike<number>
      • cols: number
      • rows: number
      • epsilon: number = 0
      • seaLevel: number = -Infinity

      Returns Float64Array