pub enum RiverThreshold {
Density(f32),
MinUpstreamCells(f32),
PerEdge(f32),
}Expand description
How the river network is cut out of the flow accumulation map.
Which one to use:
Densityasks for an area share — “about 1% of the land should be river”. It adapts to any terrain, but it does not transfer between map sizes: catchments grow with area while channels grow with length, so the same share yields a visually denser network on a small map than on a large one. Good for one-off renders.MinUpstreamCellsis absolute — “a channel starts once 500 cells drain through”. Physically meaningful and comparable across maps of the same cell size, so it is the right choice when cells have a fixed real-world size (a game world tiled from several maps).PerEdgescales the absolute threshold with the map edge, i.e. required upstream cells =factor * max(width, height). Use it when a map always represents “one island”, whatever its resolution, and you want the same-looking network at every resolution.
Variants§
Density(f32)
Approximate fraction of land cells covered by rivers, in [0, 1].
MinUpstreamCells(f32)
Minimum upstream catchment, in cells, for a cell to be a river.
PerEdge(f32)
Minimum upstream catchment as a multiple of the longer map edge.
Trait Implementations§
Source§impl Clone for RiverThreshold
impl Clone for RiverThreshold
impl Copy for RiverThreshold
Source§impl Debug for RiverThreshold
impl Debug for RiverThreshold
Source§impl PartialEq for RiverThreshold
impl PartialEq for RiverThreshold
impl StructuralPartialEq for RiverThreshold
Auto Trait Implementations§
impl Freeze for RiverThreshold
impl RefUnwindSafe for RiverThreshold
impl Send for RiverThreshold
impl Sync for RiverThreshold
impl Unpin for RiverThreshold
impl UnsafeUnpin for RiverThreshold
impl UnwindSafe for RiverThreshold
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more