HighMap library (C++)
Loading...
Searching...
No Matches
hydraulic_mcdonald_gpu.cpp File Reference

Namespaces

namespace  hmap
 
namespace  hmap::gpu
 
namespace  hmap::gpu::detail
 

Functions

void hmap::gpu::detail::mcdonald_run_steps (Array &bed, Array &sed, Array &dis, Array &mx, Array &my, int steps, std::uint32_t seed, float world_extent_km, float z_scale_km, int samples, int maxage, float lrate, float time_step, float rainfall, float evap_rate, float gravity, float viscosity, float bed_shear, float crit_slope, float settle_rate, float thermal_rate, float deposition_rate, float suspension_rate, float exit_slope)
 
void hmap::gpu::hydraulic_mcdonald (Array &z, int steps, std::uint32_t seed, Array *p_sediment_map=nullptr, Array *p_discharge_map=nullptr, float world_extent_km=40.f, float z_scale_km=4.f, int samples=8192, int maxage=512, float lrate=0.2f, float time_step=10.f, float rainfall=1.f, float evap_rate=1e-4f, float gravity=9.81f, float viscosity=0.025f, float bed_shear=0.01f, float crit_slope=0.57f, float settle_rate=0.1f, float thermal_rate=2.5e-3f, float deposition_rate=5e-3f, float suspension_rate=2.5e-4f, float exit_slope=0.01f)
 Particle-based hydraulic erosion with flow-field coupling (McDonald's model): persistent per-cell discharge and momentum fields, exponentially filtered across iterations, couple particles through the mean local flow, producing coherent drainage networks; a bank-stability debris flow runs in the same solver loop against a separate sediment layer. Clean-room port of erosiv/soillib (LGPL-3, Nicholas McDonald), https://github.com/erosiv/soillib.
 
void hmap::gpu::hydraulic_mcdonald_multiscale (Array &z, std::uint32_t seed, const std::vector< int > &steps_per_level={512, 256, 128}, Array *p_sediment_map=nullptr, Array *p_discharge_map=nullptr, float world_extent_km=40.f, float z_scale_km=4.f, int samples=8192, int maxage=512, float lrate=0.2f, float time_step=10.f, float rainfall=1.f, float evap_rate=1e-4f, float gravity=9.81f, float viscosity=0.025f, float bed_shear=0.01f, float crit_slope=0.57f, float settle_rate=0.1f, float thermal_rate=2.5e-3f, float deposition_rate=5e-3f, float suspension_rate=2.5e-4f, float exit_slope=0.01f)
 Multiscale driver for hydraulic_mcdonald: erodes on a halving resolution ladder derived from z.shape (coarsest first), resampling the full model state (bedrock, sediment, discharge, momentum) between levels. The numerically stable route to high-resolution erosion with this model. {512, 256, 128} on a 1024^2 input runs 256^2 (512 steps), 512^2 (256), then 1024^2 (128). See hydraulic_mcdonald for the model and parameters.