HighMap library (C++)
Loading...
Searching...
No Matches
erosion.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4#pragma once
5#include <cmath>
6
7#include "highmap/array.hpp"
12
13// neighbor pattern search based on Moore pattern and define diagonal
14// weight coefficients ('c' corresponds to a weight coefficient
15// applied to take into account the longer distance for diagonal
16// comparison between cells)
17
18// clang-format off
19// 6 2 8
20// 1 . 4
21// 5 3 7
22#define HMAP_DI {-1, 0, 0, 1, -1, -1, 1, 1}
23#define HMAP_DJ {0, 1, -1, 0, -1, 1, -1, 1}
24#define HMAP_CD {1.f, 1.f, 1.f, 1.f, M_SQRT2, M_SQRT2, M_SQRT2, M_SQRT2}
25#define HMAP_CD_INV {1.f, 1.f, 1.f, 1.f, M_SQRT2, M_SQRT2, M_SQRT2, M_SQRT2}
26// clang-format on
27
28namespace hmap
29{
30
68void coastal_erosion_diffusion(Array &z,
69 Array &water_depth,
70 float additional_depth,
71 int iterations = 10,
72 const Array *p_mask = nullptr,
73 Array *p_water_mask = nullptr);
74
122void coastal_erosion_profile(Array &z,
123 Array &water_depth,
124 float shore_ground_extent, // pixels
125 float shore_water_extent,
126 float slope_shore = 0.5f,
127 float slope_shore_water = 0.5f,
128 float scarp_extent_ratio = 0.5f, // in [0, 1]
129 bool apply_post_filter = true,
130 int post_filter_iterations = 3,
131 bool solid_shore_mask = true,
132 float scarp_mask_transition_ratio = 0.2f,
133 const Array *p_noise = nullptr,
134 Array *p_shore_mask = nullptr,
135 Array *p_scarp_mask = nullptr);
136
137void coastal_erosion_profile(Array &z,
138 const Array *p_mask,
139 Array &water_depth,
140 float shore_ground_extent, // pixels
141 float shore_water_extent,
142 float slope_shore = 0.5f,
143 float slope_shore_water = 0.5f,
144 float scarp_extent_ratio = 0.5f, // in [0, 1]
145 bool apply_post_filter = true,
146 int post_filter_iterations = 3,
147 bool solid_shore_mask = true,
148 float scarp_mask_transition_ratio = 0.2f,
149 const Array *p_noise = nullptr,
150 Array *p_shore_mask = nullptr,
151 Array *p_scarp_mask = nullptr);
152
170void depression_filling(Array &z, int iterations = 1000, float epsilon = 1e-4f);
171
173
190void erosion_maps(Array &z_before,
191 Array &z_after,
192 Array &erosion_map,
193 Array &deposition_map,
194 float tolerance = 0.f);
195
219Array generate_bedrock(const Array &z,
220 float elevation_strength,
221 float slope_strength,
222 float slope_limit,
223 float zmin = 0.f,
224 float zmax = -1.f);
225
250void hydraulic_algebric(Array &z,
251 Array *p_mask,
252 float talus_ref,
253 int ir,
254 Array *p_bedrock = nullptr,
255 Array *p_erosion_map = nullptr,
256 Array *p_deposition_map = nullptr,
257 float c_erosion = 0.05f,
258 float c_deposition = 0.05f,
259 int iterations = 1);
260
261void hydraulic_algebric(Array &z,
262 float talus_ref,
263 int ir,
264 Array *p_bedrock = nullptr,
265 Array *p_erosion_map = nullptr,
266 Array *p_deposition_map = nullptr,
267 float c_erosion = 0.05f,
268 float c_deposition = 0.05f,
269 int iterations = 1);
270
301void hydraulic_benes(Array &z,
302 Array *p_mask,
303 int iterations = 50,
304 Array *p_bedrock = nullptr,
305 Array *p_moisture_map = nullptr,
306 Array *p_erosion_map = nullptr,
307 Array *p_deposition_map = nullptr,
308 float c_capacity = 40.f,
309 float c_erosion = 0.2f,
310 float c_deposition = 0.8f,
311 float water_level = 0.005f,
312 float evap_rate = 0.01f,
313 float rain_rate = 0.5f);
314
315void hydraulic_benes(Array &z,
316 int iterations = 50,
317 Array *p_bedrock = nullptr,
318 Array *p_moisture_map = nullptr,
319 Array *p_erosion_map = nullptr,
320 Array *p_deposition_map = nullptr,
321 float c_capacity = 40.f,
322 float c_erosion = 0.2f,
323 float c_deposition = 0.8f,
324 float water_level = 0.005f,
325 float evap_rate = 0.01f,
326 float rain_rate = 0.5f);
327
341void hydraulic_blur(Array &z,
342 float radius,
343 float vmax,
344 float k_smoothing = 0.1f);
345
363void hydraulic_diffusion(Array &z,
364 float c_diffusion,
365 float talus,
366 int iterations);
390void hydraulic_musgrave(Array &z,
391 Array &moisture_map,
392 int iterations = 100,
393 float c_capacity = 1.f,
394 float c_erosion = 0.1f,
395 float c_deposition = 0.1f,
396 float water_level = 0.01f,
397 float evap_rate = 0.01f);
398
399void hydraulic_musgrave(Array &z,
400 int iterations = 100,
401 float c_capacity = 1.f,
402 float c_erosion = 0.1f,
403 float c_deposition = 0.1f,
404 float water_level = 0.01f,
405 float evap_rate = 0.01f);
406
427void hydraulic_saleve(TerrainTriMesh &mesh,
428 const std::vector<float> &erodibility,
429 const std::vector<float> &max_slope,
430 float m_exp = 0.8f,
431 float uplift_rate = 1.f,
432 float tolerance = 1e-3f,
433 int max_iterations = 200,
434 float noise_strength = 0.f,
435 std::uint32_t seed = 0,
436 bool enable_post_slope_limiter = false,
437 float post_slope_limit = 0.f,
438 bool enable_post_smoothing = false);
439
470Array hydraulic_saleve(const Array &z,
471 std::uint32_t seed,
472 size_t control_points_count = 10000,
473 float m_exp = 0.8f,
474 float uplift_rate = 1.f,
475 float tolerance = 1e-3f,
476 int max_iterations = 200,
477 float smin = 0.f,
478 float smax = 6.f,
479 float strength = 0.5f,
480 bool scale_erodibility_with_z = true,
481 float erodibility_distrib_exp = 1.f,
482 float noise_strength = 0.f,
483 bool enable_post_slope_limiter = false,
484 float post_slope_limit = 0.f,
485 bool enable_post_smoothing = false,
486 InterpolationMethod2D interpolation_method =
488 const Array *p_noise_x = nullptr,
489 const Array *p_noise_y = nullptr);
490
491Array hydraulic_saleve(const Array &z,
492 const Array *p_mask,
493 std::uint32_t seed,
494 size_t control_points_count = 10000,
495 float m_exp = 0.8f,
496 float uplift_rate = 1.f,
497 float tolerance = 1e-3f,
498 int max_iterations = 200,
499 float smin = 0.f,
500 float smax = 6.f,
501 float strength = 0.5f,
502 bool scale_erodibility_with_z = true,
503 float erodibility_distrib_exp = 1.f,
504 float noise_strength = 0.f,
505 bool enable_post_slope_limiter = false,
506 float post_slope_limit = 0.f,
507 bool enable_post_smoothing = false,
508 InterpolationMethod2D interpolation_method =
510 const Array *p_noise_x = nullptr,
511 const Array *p_noise_y = nullptr);
512
540void hydraulic_stream(Array &z,
541 float c_erosion,
542 float talus_ref,
543 Array *p_bedrock = nullptr,
544 Array *p_moisture_map = nullptr,
545 Array *p_erosion_map = nullptr, // -> out
546 int ir = 1,
547 float clipping_ratio = 10.f);
548
549void hydraulic_stream(Array &z,
550 Array *p_mask,
551 float c_erosion,
552 float talus_ref,
553 Array *p_bedrock = nullptr,
554 Array *p_moisture_map = nullptr,
555 Array *p_erosion_map = nullptr, // -> out
556 int ir = 1,
557 float clipping_ratio = 10.f);
558
597void hydraulic_stream_log(Array &z,
598 float c_erosion,
599 float talus_ref,
600 int deposition_ir = 32,
601 float deposition_scale_ratio = 1.f,
602 float gradient_power = 0.8f,
603 float gradient_scaling_ratio = 1.f,
604 int gradient_prefilter_ir = 16,
605 float saturation_ratio = 1.f,
606 Array *p_bedrock = nullptr,
607 Array *p_moisture_map = nullptr,
608 Array *p_erosion_map = nullptr,
609 Array *p_deposition_map = nullptr,
610 Array *p_flow_map = nullptr);
611
612void hydraulic_stream_log(Array &z,
613 float c_erosion,
614 float talus_ref,
615 const Array *p_mask,
616 int deposition_ir = 32,
617 float deposition_scale_ratio = 1.f,
618 float gradient_power = 0.8f,
619 float gradient_scaling_ratio = 1.f,
620 int gradient_prefilter_ir = 16,
621 float saturation_ratio = 1.f,
622 Array *p_bedrock = nullptr,
623 Array *p_moisture_map = nullptr,
624 Array *p_erosion_map = nullptr,
625 Array *p_deposition_map = nullptr,
626 Array *p_flow_map = nullptr);
627
661 float c_erosion,
662 float talus_ref,
663 int upscaling_levels = 1,
664 float persistence = 1.f,
665 int ir = 1,
666 float clipping_ratio = 10.f);
667
702 Array &z,
703 Array *p_mask,
704 float c_erosion,
705 float talus_ref,
706 int upscaling_levels = 1,
707 float persistence = 1.f,
708 int ir = 1,
709 float clipping_ratio = 10.f);
710
730void stratify(Array &z,
731 Array *p_mask,
732 std::vector<float> hs,
733 std::vector<float> gamma,
734 Array *p_noise = nullptr);
735
736void stratify(Array &z,
737 std::vector<float> hs,
738 std::vector<float> gamma,
739 Array *p_noise = nullptr);
740
741void stratify(Array &z,
742 std::vector<float> hs,
743 float gamma = 0.5f,
744 Array *p_noise = nullptr);
745
746void stratify(Array &z,
747 Array &partition,
748 int nstrata,
749 float strata_noise,
750 float gamma,
751 float gamma_noise,
752 int npartitions,
753 std::uint32_t seed,
754 float mixing_gain_factor = 1.f,
755 Array *p_noise = nullptr,
756 float vmin = 1.f,
757 float vmax = 0.f);
758
782void stratify_multiscale(Array &z,
783 float zmin,
784 float zmax,
785 std::vector<int> n_strata,
786 std::vector<float> strata_noise,
787 std::vector<float> gamma_list,
788 std::vector<float> gamma_noise,
789 std::uint32_t seed,
790 Array *p_mask = nullptr,
791 Array *p_noise = nullptr);
792
813void stratify_oblique(Array &z,
814 Array *p_mask,
815 std::vector<float> hs,
816 std::vector<float> gamma,
817 float talus,
818 float angle,
819 Array *p_noise = nullptr);
820
821void stratify_oblique(Array &z,
822 std::vector<float> hs,
823 std::vector<float> gamma,
824 float talus,
825 float angle,
826 Array *p_noise = nullptr);
827
828} // namespace hmap
829
830namespace hmap::gpu
831{
832
844void deposition_fill_holes(Array &z,
845 int deposition_ir,
846 float deposition_strength,
847 int iterations = 1);
848
849void deposition_fill_holes(Array &z,
850 int deposition_ir,
851 float deposition_strength,
852 const Array *p_mask,
853 int iterations = 1);
854
887void hydraulic_particle(Array &z,
888 int nparticles,
889 std::uint32_t seed,
890 const Array *p_bedrock = nullptr,
891 const Array *p_moisture_map = nullptr,
892 const Array *p_elevation_shift = nullptr,
893 Array *p_erosion_map = nullptr,
894 Array *p_deposition_map = nullptr,
895 float c_capacity = 10.f,
896 float c_erosion = 0.05f,
897 float c_deposition = 0.05f,
898 float c_inertia = 0.1f,
899 float c_gravity = 1.f,
900 float drag_rate = 0.001f,
901 float evap_rate = 0.001f,
902 bool enable_directional_bias = false,
903 float angle_bias = 30.f);
904
906void hydraulic_particle(Array &z,
907 const Array *p_mask,
908 int nparticles,
909 std::uint32_t seed,
910 const Array *p_bedrock = nullptr,
911 const Array *p_moisture_map = nullptr,
912 const Array *p_elevation_shift = nullptr,
913 Array *p_erosion_map = nullptr,
914 Array *p_deposition_map = nullptr,
915 float c_capacity = 10.f,
916 float c_erosion = 0.05f,
917 float c_deposition = 0.05f,
918 float c_inertia = 0.1f,
919 float c_gravity = 1.f,
920 float drag_rate = 0.001f,
921 float evap_rate = 0.001f,
922 bool enable_directional_bias = false,
923 float angle_bias = 30.f);
924
974 Array &z,
975 float kp_global,
976 float c_erosion,
977 std::uint32_t seed,
979 float erosion_profile_parameter = 0.01f,
980 float angle_shift = 0.f, // degs
981 float phase_smoothing = 0.1f,
982 float talus_ref = 0.001f,
983 float gradient_scaling_ratio = 1.f,
984 float gradient_power = 0.8f,
985 bool exclude_ridges = true,
986 bool apply_deposition = false,
987 float deposition_strength = 1.f,
988 bool enable_default_noise = true,
989 float noise_amp = 0.01f,
990 const Array *p_kp_multiplier = nullptr,
991 const Array *p_angle_shift = nullptr,
992 const Array *p_noise_x = nullptr,
993 const Array *p_noise_y = nullptr,
994 Array *p_ridge_mask = nullptr, // ouptput
995 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
996
1036 Array &z,
1037 float kp_global,
1038 float c_erosion,
1039 std::uint32_t seed,
1041 int octaves = 3,
1042 float persistence = 0.5f,
1043 float lacunarity = 2.f,
1044 float erosion_profile_parameter = 0.01f,
1045 float angle_shift = 0.f, // degs
1046 float phase_smoothing = 0.1f,
1047 float talus_ref = 0.001f,
1048 float gradient_scaling_ratio = 1.f,
1049 float gradient_power = 0.8f,
1050 bool exclude_ridges = true,
1051 bool apply_deposition = false,
1052 float deposition_strength = 1.f,
1053 bool enable_default_noise = true,
1054 float noise_amp = 0.01f,
1055 const Array *p_kp_multiplier = nullptr,
1056 const Array *p_angle_shift = nullptr,
1057 const Array *p_noise_x = nullptr,
1058 const Array *p_noise_y = nullptr,
1059 Array *p_ridge_mask = nullptr, // ouptput
1060 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1061
1063 Array &z,
1064 float kp_global,
1065 float c_erosion,
1066 std::uint32_t seed,
1067 const Array *p_mask,
1069 int octaves = 3,
1070 float persistence = 0.5f,
1071 float lacunarity = 2.f,
1072 float erosion_profile_parameter = 0.01f,
1073 float angle_shift = 0.f, // degs
1074 float phase_smoothing = 0.1f,
1075 float talus_ref = 0.001f,
1076 float gradient_scaling_ratio = 1.f,
1077 float gradient_power = 0.8f,
1078 bool exclude_ridges = true,
1079 bool apply_deposition = false,
1080 float deposition_strength = 1.f,
1081 bool enable_default_noise = true,
1082 float noise_amp = 0.01f,
1083 const Array *p_kp_multiplier = nullptr,
1084 const Array *p_angle_shift = nullptr,
1085 const Array *p_noise_x = nullptr,
1086 const Array *p_noise_y = nullptr,
1087 Array *p_ridge_mask = nullptr, // ouptput
1088 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1089
1137void hydraulic_schott(Array &z,
1138 int iterations,
1139 const Array &talus,
1140 float c_erosion = 1.f,
1141 float c_thermal = 0.1f,
1142 float c_deposition = 0.2f,
1143 float flow_acc_exponent = 0.8f,
1144 float flow_acc_exponent_depo = 0.8f,
1145 float flow_routing_exponent = 1.3f,
1146 float thermal_weight = 1.5f,
1147 float deposition_weight = 2.5f,
1148 Array *p_flow = nullptr);
1149
1150void hydraulic_schott(Array &z,
1151 int iterations,
1152 const Array &talus,
1153 Array *p_mask,
1154 float c_erosion = 1.f,
1155 float c_thermal = 0.1f,
1156 float c_deposition = 0.2f,
1157 float flow_acc_exponent = 0.8f,
1158 float flow_acc_exponent_depo = 0.8f,
1159 float flow_routing_exponent = 1.3f,
1160 float thermal_weight = 1.5f,
1161 float deposition_weight = 2.5f,
1162 Array *p_flow = nullptr);
1163
1165void hydraulic_schott_erosion(Array &z,
1166 int iterations,
1167 float c_erosion = 1.f,
1168 float flow_acc_exponent = 0.8f,
1169 float flow_routing_exponent = 1.3f,
1170 const Array *p_moisture_map = nullptr,
1171 Array *p_flow = nullptr);
1172
1174void hydraulic_stream_log(Array &z,
1175 float c_erosion,
1176 float talus_ref,
1177 int deposition_ir = 32,
1178 float deposition_scale_ratio = 1.f,
1179 float gradient_power = 0.8f,
1180 float gradient_scaling_ratio = 1.f,
1181 int gradient_prefilter_ir = 16,
1182 float saturation_ratio = 1.f,
1183 Array *p_bedrock = nullptr,
1184 Array *p_moisture_map = nullptr,
1185 Array *p_erosion_map = nullptr,
1186 Array *p_deposition_map = nullptr,
1187 Array *p_flow_map = nullptr);
1188
1189void hydraulic_stream_log(Array &z,
1190 float c_erosion,
1191 float talus_ref,
1192 const Array *p_mask,
1193 int deposition_ir = 32,
1194 float deposition_scale_ratio = 1.f,
1195 float gradient_power = 0.8f,
1196 float gradient_scaling_ratio = 1.f,
1197 int gradient_prefilter_ir = 16,
1198 float saturation_ratio = 1.f,
1199 Array *p_bedrock = nullptr,
1200 Array *p_moisture_map = nullptr,
1201 Array *p_erosion_map = nullptr,
1202 Array *p_deposition_map = nullptr,
1203 Array *p_flow_map = nullptr);
1204
1206void hydraulic_vpipes(Array &z,
1207 float water_height = 1e-2f,
1208 bool maintain_water_volume = true,
1209 float evap_rate = 0.1f,
1210 int iterations = 50,
1211 float dt = 0.5f,
1212 float k_capacity = 0.5f,
1213 float k_erode = 0.001f,
1214 float k_depose = 0.01f,
1215 float k_discharge_exp = 1.f,
1216 float downcutting_max_depth_ratio = 10.f,
1217 bool flux_diffusion = true,
1218 float flux_diffusion_strength = 0.01f,
1219 Array *p_rain_map = nullptr,
1220 Array *p_water_depth = nullptr,
1221 Array *p_sediment = nullptr,
1222 Array *p_vel_u = nullptr,
1223 Array *p_vel_v = nullptr);
1224
1253void mudslide(Array &z,
1254 const Array &landslide_mask,
1255 float depth,
1256 int iterations,
1257 float depth_map_exponent = 0.5f,
1258 float viscosity_law_power = 1.5f,
1259 Array *p_depth_end = nullptr,
1260 Array *p_depth_init = nullptr);
1261
1263void mudslide(Array &z,
1264 float talus_limit,
1265 float depth,
1266 int iterations,
1267 float depth_map_exponent = 0.5f,
1268 float viscosity_law_power = 1.5f,
1269 Array *p_depth_end = nullptr,
1270 Array *p_depth_init = nullptr);
1271
1323void rifts(Array &z,
1324 const glm::vec2 &kw, // = {4.f, 1.2f},
1325 float angle, // degs
1326 float amplitude,
1327 std::uint32_t seed,
1328 float elevation_noise_shift = 0.f,
1329 float k_smooth_bottom = 0.05f,
1330 float k_smooth_top = 0.05f,
1331 float radial_spread_amp = 0.2f,
1332 float elevation_noise_amp = 0.1f,
1333 float clamp_vmin = 0.f,
1334 float remap_vmin = 0.f,
1335 bool apply_mask = true,
1336 bool reverse_mask = false,
1337 float mask_gamma = 1.f,
1338 const Array *p_noise_x = nullptr,
1339 const Array *p_noise_y = nullptr,
1340 const Array *p_mask = nullptr,
1341 const glm::vec2 &center = {0.5f, 0.5f},
1342 const glm::vec4 &bbox = {0.f, 1.f, 0.f, 1.f});
1343
1366void sediment_deposition(Array &z,
1367 Array *p_mask,
1368 const Array &talus,
1369 Array *p_deposition_map = nullptr,
1370 float max_deposition = 0.01,
1371 int iterations = 5,
1372 int thermal_subiterations = 10);
1373
1374void sediment_deposition(Array &z,
1375 const Array &talus,
1376 Array *p_deposition_map = nullptr,
1377 float max_deposition = 0.01,
1378 int iterations = 5,
1379 int thermal_subiterations = 10);
1380
1402void sediment_layer(Array &z,
1403 const Array &talus_layer,
1404 const Array &talus_upper_limit,
1405 int iterations,
1406 bool apply_post_filter = true,
1407 Array *p_deposition_map = nullptr);
1408
1466void strata(Array &z,
1467 float angle,
1468 float slope,
1469 float gamma, // e.g 0.5f or 1.5f
1470 std::uint32_t seed,
1471 bool linear_gamma = true,
1472 float kz = 1.f,
1473 int octaves = 4,
1474 float lacunarity = 2.f,
1475 float gamma_noise_ratio = 0.5f,
1476 float noise_amp = 0.4f,
1477 const glm::vec2 &noise_kw = {4.f, 4.f},
1478 bool enable_ridge_noise = true,
1479 const glm::vec2 &ridge_noise_kw = {4.f, 1.2f},
1480 float ridge_angle_shift = 45.f,
1481 float ridge_noise_amp = 0.5f,
1482 float ridge_clamp_vmin = 0.f,
1483 float ridge_remap_vmin = 0.f,
1484 bool apply_elevation_mask = true,
1485 bool apply_ridge_mask = true,
1486 float mask_gamma = 0.4f,
1487 const Array *p_mask = nullptr,
1488 const glm::vec4 &bbox = {0.f, 1.f, 0.f, 1.f});
1489
1516void strata_cells(Array &z,
1517 glm::vec2 kw,
1518 float amp,
1519 std::uint32_t seed,
1520 float gamma = 0.5f,
1521 float gamma_lateral = 0.4f,
1522 float angle = 0.f,
1523 float noise_amp = 0.5f,
1524 bool absolute_displacement = true,
1525 float occurence_probability = 0.5f,
1526 const Array *p_noise_x = nullptr,
1527 const Array *p_noise_y = nullptr,
1528 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1529
1557void strata_cells(Array &z,
1558 glm::vec2 kw,
1559 float amp,
1560 std::uint32_t seed,
1561 const Array *p_mask,
1562 float gamma = 0.5f,
1563 float gamma_lateral = 0.4f,
1564 float angle = 0.f,
1565 float noise_amp = 0.5f,
1566 bool absolute_displacement = true,
1567 float occurence_probability = 0.5f,
1568 const Array *p_noise_x = nullptr,
1569 const Array *p_noise_y = nullptr,
1570 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1571
1602void strata_cells_fbm(Array &z,
1603 glm::vec2 kw,
1604 float amp,
1605 std::uint32_t seed,
1606 float gamma = 0.5f,
1607 float gamma_lateral = 0.4f,
1608 float angle = 0.f,
1609 bool enable_default_noise = true,
1610 float default_noise_amp = 0.05f,
1611 bool absolute_displacement = true,
1612 float occurence_probability = 0.5f,
1613 int octaves = 8,
1614 float persistence = 0.4f,
1615 float lacunarity = 2.2f,
1616 const Array *p_noise_x = nullptr,
1617 const Array *p_noise_y = nullptr,
1618 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1619
1651void strata_cells_fbm(Array &z,
1652 glm::vec2 kw,
1653 float amp,
1654 std::uint32_t seed,
1655 const Array *p_mask,
1656 float gamma = 0.5f,
1657 float gamma_lateral = 0.4f,
1658 float angle = 0.f,
1659 bool enable_default_noise = true,
1660 float default_noise_amp = 0.05f,
1661 bool absolute_displacement = true,
1662 float occurence_probability = 0.5f,
1663 int octaves = 8,
1664 float persistence = 0.4f,
1665 float lacunarity = 2.2f,
1666 const Array *p_noise_x = nullptr,
1667 const Array *p_noise_y = nullptr,
1668 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1669
1693void strata_plates(Array &z,
1694 const Array &talus,
1695 int direction_offset = 0,
1696 int direction_count = 3,
1697 bool random_directions = false,
1698 std::uint32_t seed = 0,
1699 float vmin = -FLT_MAX,
1700 float skew = 0.f,
1701 float mix_ratio = 0.9f,
1702 const Array *p_mask = nullptr,
1703 const Array *p_dx = nullptr,
1704 const Array *p_dy = nullptr);
1705
1727void strata_terrace(Array &z,
1728 float gamma, // e.g 0.5f or 1.5f
1729 std::uint32_t seed,
1730 float kz = 4.f, // 4-layers
1731 bool linear_gamma = true,
1732 float gamma_noise_ratio = 0.5f,
1733 const Array *p_noise = nullptr);
1734
1756void strata_terrace(Array &z,
1757 float gamma, // e.g 0.5f or 1.5f
1758 std::uint32_t seed,
1759 const Array *p_mask,
1760 float kz = 4.f, // 4-layers
1761 bool linear_gamma = true,
1762 float gamma_noise_ratio = 0.5f,
1763 const Array *p_noise = nullptr);
1764
1784void thermal(Array &z,
1785 const Array &talus,
1786 int iterations = 10,
1787 Array *p_bedrock = nullptr,
1788 Array *p_deposition_map = nullptr);
1789
1790void thermal(Array &z,
1791 const Array *p_mask,
1792 const Array &talus,
1793 int iterations = 10,
1794 Array *p_bedrock = nullptr,
1795 Array *p_deposition_map = nullptr);
1796
1797void thermal(Array &z,
1798 float talus,
1799 int iterations = 10,
1800 Array *p_bedrock = nullptr,
1801 Array *p_deposition_map = nullptr);
1802
1824void thermal_auto_bedrock(Array &z,
1825 const Array &talus,
1826 int iterations = 10,
1827 Array *p_deposition_map = nullptr);
1828
1829void thermal_auto_bedrock(Array &z,
1830 const Array *p_mask,
1831 const Array &talus,
1832 int iterations = 10,
1833 Array *p_deposition_map = nullptr);
1834
1835void thermal_auto_bedrock(Array &z,
1836 float,
1837 int iterations = 10,
1838 Array *p_deposition_map = nullptr);
1839
1855void thermal_flatten(Array &z,
1856 const Array &talus,
1857 int iterations,
1858 float sigma_inf = 0.5f,
1859 float sigma_sup = 0.f);
1860
1861void thermal_flatten(Array &z,
1862 const Array *p_mask,
1863 const Array &talus,
1864 int iterations,
1865 float sigma_inf = 0.5f,
1866 float sigma_sup = 0.f);
1867
1887void thermal_olsen(Array &z, const Array &talus, int iterations);
1888
1889void thermal_olsen(Array &z,
1890 const Array *p_mask,
1891 const Array &talus,
1892 int iterations);
1893
1911void thermal_inflate(Array &z, const Array &talus, int iterations = 10);
1912
1913void thermal_inflate(Array &z,
1914 const Array *p_mask,
1915 const Array &talus,
1916 int iterations = 10);
1917
1930void thermal_rib(Array &z, int iterations);
1931
1932void thermal_rib(Array &z, const Array *p_mask, int iterations);
1933
1953void thermal_ridge(Array &z,
1954 const Array &talus,
1955 int iterations = 10,
1956 Array *p_deposition_map = nullptr);
1957
1958void thermal_ridge(Array &z,
1959 const Array *p_mask,
1960 const Array &talus,
1961 int iterations = 10,
1962 Array *p_deposition_map = nullptr);
1963
1985void thermal_schott(Array &z,
1986 const Array &talus,
1987 int iterations = 10,
1988 float intensity = 0.2f,
1989 Array *p_deposition_map = nullptr);
1990
1991void thermal_schott(Array &z,
1992 const Array *p_mask,
1993 const Array &talus,
1994 int iterations = 10,
1995 float intensity = 0.2f,
1996 Array *p_deposition_map = nullptr);
1997
2017void thermal_scree(Array &z,
2018 const Array &talus,
2019 const Array &zmax,
2020 int iterations = 10,
2021 Array *p_deposition_map = nullptr);
2022
2023void thermal_scree(Array &z,
2024 const Array *p_mask,
2025 const Array &talus,
2026 const Array &zmax,
2027 int iterations = 10,
2028 Array *p_deposition_map = nullptr);
2029
2050void valley_fill(Array &z,
2051 const Array &talus,
2052 int iterations = 100,
2053 float gamma = 2.f,
2054 float ratio = 0.8f,
2055 float zmin = 0.f,
2056 float zmax = 0.f,
2057 float elevation_max_ratio = 1.f,
2058 bool preserve_elevation_range = true,
2059 const Array *p_noise = nullptr,
2060 Array *p_deposition_map = nullptr);
2061
2062void valley_fill(Array &z,
2063 const Array *p_mask,
2064 const Array &talus,
2065 int iterations = 100,
2066 float gamma = 2.f,
2067 float ratio = 0.8f,
2068 float zmin = 0.f,
2069 float zmax = 0.f,
2070 float elevation_max_ratio = 1.f,
2071 bool preserve_elevation_range = true,
2072 const Array *p_noise = nullptr,
2073 Array *p_deposition_map = nullptr);
2074
2096Array watershed_ridge(
2097 const Array &z,
2098 float amplitude = 0.2f,
2099 float width = 32.f, // pixels
2100 float edt_exponent = 0.5f,
2101 int prefilter_ir = 0,
2103 const Array *p_noise_x = nullptr,
2104 const Array *p_noise_y = nullptr,
2105 const Array *p_scaling = nullptr);
2106
2107Array watershed_ridge(
2108 const Array &z,
2109 const Array *p_mask,
2110 float amplitude = 0.2f,
2111 float width = 32.f,
2112 float edt_exponent = 0.5f,
2113 int prefilter_ir = 0,
2115 const Array *p_noise_x = nullptr,
2116 const Array *p_noise_y = nullptr,
2117 const Array *p_scaling = nullptr);
2118
2119} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Header file for hydrological modeling functions and utilities.
Header file for 2D interpolation methods.
Definition blending.hpp:186
void thermal_olsen(Array &z, const Array &talus, int iterations)
Apply thermal weathering erosion.
Definition thermal_gpu.cpp:221
void thermal_ridge(Array &z, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr)
Apply thermal weathering erosion to give a ridge like effect.
Definition thermal_gpu.cpp:274
void sediment_deposition(Array &z, Array *p_mask, const Array &talus, Array *p_deposition_map=nullptr, float max_deposition=0.01, int iterations=5, int thermal_subiterations=10)
Perform sediment deposition combined with thermal erosion.
Definition deposition.cpp:42
void thermal(Array &z, const Array &talus, int iterations=10, Array *p_bedrock=nullptr, Array *p_deposition_map=nullptr)
Apply thermal weathering erosion.
Definition thermal_gpu.cpp:17
void thermal_auto_bedrock(Array &z, const Array &talus, int iterations=10, Array *p_deposition_map=nullptr)
Apply thermal weathering erosion with automatic determination of the bedrock.
Definition thermal_gpu.cpp:98
void mudslide(Array &z, const Array &landslide_mask, float depth, int iterations, float depth_map_exponent=0.5f, float viscosity_law_power=1.5f, Array *p_depth_end=nullptr, Array *p_depth_init=nullptr)
Simulate a mudslide (landslide-driven material redistribution) on a height field.
Definition mudslide.cpp:18
void thermal_rib(Array &z, int iterations)
Apply thermal erosion using a 'rib' algorithm (taken from Geomorph).
Definition thermal_gpu.cpp:249
void thermal_schott(Array &z, const Array &talus, int iterations=10, float intensity=0.2f, Array *p_deposition_map=nullptr)
Applies the thermal erosion process with a uniform slope threshold.
Definition thermal_gpu.cpp:313
Array watershed_ridge(const Array &z, float amplitude=0.2f, float width=32.f, float edt_exponent=0.5f, int prefilter_ir=0, FlowDirectionMethod fd_method=FlowDirectionMethod::FDM_D8, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_scaling=nullptr)
Carves watershed ridges using basin-wise distance transforms.
Definition watershed_ridge.cpp:22
void hydraulic_vpipes(Array &z, float water_height=1e-2f, bool maintain_water_volume=true, float evap_rate=0.1f, int iterations=50, float dt=0.5f, float k_capacity=0.5f, float k_erode=0.001f, float k_depose=0.01f, float k_discharge_exp=1.f, float downcutting_max_depth_ratio=10.f, bool flux_diffusion=true, float flux_diffusion_strength=0.01f, Array *p_rain_map=nullptr, Array *p_water_depth=nullptr, Array *p_sediment=nullptr, Array *p_vel_u=nullptr, Array *p_vel_v=nullptr)
See hmap::hydraulic_vpipes.
Definition hydraulic_vpipes_gpu.cpp:15
void thermal_flatten(Array &z, const Array &talus, int iterations, float sigma_inf=0.5f, float sigma_sup=0.f)
Apply iterative thermal flattening erosion on a heightmap.
Definition thermal_gpu.cpp:154
void strata_cells_fbm(Array &z, glm::vec2 kw, float amp, std::uint32_t seed, float gamma=0.5f, float gamma_lateral=0.4f, float angle=0.f, bool enable_default_noise=true, float default_noise_amp=0.05f, bool absolute_displacement=true, float occurence_probability=0.5f, int octaves=8, float persistence=0.4f, float lacunarity=2.2f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Applies multi-octave (fBm) stratified cell displacement.
Definition strata_gpu.cpp:178
void strata_terrace(Array &z, float gamma, std::uint32_t seed, float kz=4.f, bool linear_gamma=true, float gamma_noise_ratio=0.5f, const Array *p_noise=nullptr)
Applies a terrace (stratification) filter to a heightmap.
Definition strata_gpu.cpp:326
void hydraulic_stream_log(Array &z, float c_erosion, float talus_ref, int deposition_ir=32, float deposition_scale_ratio=1.f, float gradient_power=0.8f, float gradient_scaling_ratio=1.f, int gradient_prefilter_ir=16, float saturation_ratio=1.f, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr)
See hmap::hydraulic_stream_log.
Definition hydraulic_stream_gpu.cpp:17
void hydraulic_procedural_fbm(Array &z, float kp_global, float c_erosion, std::uint32_t seed, ErosionProfile erosion_profile=ErosionProfile::EP_TRIANGLE_GRENIER, int octaves=3, float persistence=0.5f, float lacunarity=2.f, float erosion_profile_parameter=0.01f, float angle_shift=0.f, float phase_smoothing=0.1f, float talus_ref=0.001f, float gradient_scaling_ratio=1.f, float gradient_power=0.8f, bool exclude_ridges=true, bool apply_deposition=false, float deposition_strength=1.f, bool enable_default_noise=true, float noise_amp=0.01f, const Array *p_kp_multiplier=nullptr, const Array *p_angle_shift=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_ridge_mask=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Multi-octave (fBm) variant of hydraulic_procedural().
Definition hydraulic_procedural.cpp:197
void deposition_fill_holes(Array &z, int deposition_ir, float deposition_strength, int iterations=1)
Fill holes using Gaussian-based deposition.
Definition deposition_fill_holes.cpp:14
void strata_cells(Array &z, glm::vec2 kw, float amp, std::uint32_t seed, float gamma=0.5f, float gamma_lateral=0.4f, float angle=0.f, float noise_amp=0.5f, bool absolute_displacement=true, float occurence_probability=0.5f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Applies procedural stratified cell displacement to a heightmap.
Definition strata_gpu.cpp:79
void hydraulic_schott(Array &z, int iterations, const Array &talus, float c_erosion=1.f, float c_thermal=0.1f, float c_deposition=0.2f, float flow_acc_exponent=0.8f, float flow_acc_exponent_depo=0.8f, float flow_routing_exponent=1.3f, float thermal_weight=1.5f, float deposition_weight=2.5f, Array *p_flow=nullptr)
Simulates hydraulic erosion and deposition on a heightmap using the Schott method.
Definition hydraulic_schott_gpu.cpp:14
void hydraulic_procedural(Array &z, float kp_global, float c_erosion, std::uint32_t seed, ErosionProfile erosion_profile=ErosionProfile::EP_TRIANGLE_GRENIER, float erosion_profile_parameter=0.01f, float angle_shift=0.f, float phase_smoothing=0.1f, float talus_ref=0.001f, float gradient_scaling_ratio=1.f, float gradient_power=0.8f, bool exclude_ridges=true, bool apply_deposition=false, float deposition_strength=1.f, bool enable_default_noise=true, float noise_amp=0.01f, const Array *p_kp_multiplier=nullptr, const Array *p_angle_shift=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, Array *p_ridge_mask=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Apply phase-guided hydraulic procedural erosion to a heightmap.
Definition hydraulic_procedural.cpp:25
void strata_plates(Array &z, const Array &talus, int direction_offset=0, int direction_count=3, bool random_directions=false, std::uint32_t seed=0, float vmin=-FLT_MAX, float skew=0.f, float mix_ratio=0.9f, const Array *p_mask=nullptr, const Array *p_dx=nullptr, const Array *p_dy=nullptr)
Apply stratified talus projection along multiple directions.
Definition strata_plates.cpp:19
void hydraulic_schott_erosion(Array &z, int iterations, float c_erosion=1.f, float flow_acc_exponent=0.8f, float flow_routing_exponent=1.3f, const Array *p_moisture_map=nullptr, Array *p_flow=nullptr)
See hmap::hydraulic_schott.
Definition hydraulic_schott_gpu.cpp:129
void thermal_scree(Array &z, const Array &talus, const Array &zmax, int iterations=10, Array *p_deposition_map=nullptr)
Performs thermal scree erosion on a heightmap.
Definition thermal_gpu.cpp:355
void hydraulic_particle(Array &z, int nparticles, std::uint32_t seed, const Array *p_bedrock=nullptr, const Array *p_moisture_map=nullptr, const Array *p_elevation_shift=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float c_capacity=10.f, float c_erosion=0.05f, float c_deposition=0.05f, float c_inertia=0.1f, float c_gravity=1.f, float drag_rate=0.001f, float evap_rate=0.001f, bool enable_directional_bias=false, float angle_bias=30.f)
Simulates hydraulic erosion on a heightmap using particle-based flow.
Definition hydraulic_particle.cpp:19
void strata(Array &z, float angle, float slope, float gamma, std::uint32_t seed, bool linear_gamma=true, float kz=1.f, int octaves=4, float lacunarity=2.f, float gamma_noise_ratio=0.5f, float noise_amp=0.4f, const glm::vec2 &noise_kw={4.f, 4.f}, bool enable_ridge_noise=true, const glm::vec2 &ridge_noise_kw={4.f, 1.2f}, float ridge_angle_shift=45.f, float ridge_noise_amp=0.5f, float ridge_clamp_vmin=0.f, float ridge_remap_vmin=0.f, bool apply_elevation_mask=true, bool apply_ridge_mask=true, float mask_gamma=0.4f, const Array *p_mask=nullptr, const glm::vec4 &bbox={0.f, 1.f, 0.f, 1.f})
Applies stratification to a heightfield using directional noise and multiscale gamma transformations.
Definition strata_gpu.cpp:19
void rifts(Array &z, const glm::vec2 &kw, float angle, float amplitude, std::uint32_t seed, float elevation_noise_shift=0.f, float k_smooth_bottom=0.05f, float k_smooth_top=0.05f, float radial_spread_amp=0.2f, float elevation_noise_amp=0.1f, float clamp_vmin=0.f, float remap_vmin=0.f, bool apply_mask=true, bool reverse_mask=false, float mask_gamma=1.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_mask=nullptr, const glm::vec2 &center={0.5f, 0.5f}, const glm::vec4 &bbox={0.f, 1.f, 0.f, 1.f})
Applies a "rift" deformation effect to a heightmap array.
Definition rifts_gpu.cpp:15
void thermal_inflate(Array &z, const Array &talus, int iterations=10)
Apply thermal weathering erosion to give a scree like effect.
Definition thermal_gpu.cpp:192
void valley_fill(Array &z, const Array &talus, int iterations=100, float gamma=2.f, float ratio=0.8f, float zmin=0.f, float zmax=0.f, float elevation_max_ratio=1.f, bool preserve_elevation_range=true, const Array *p_noise=nullptr, Array *p_deposition_map=nullptr)
Fill valleys using thermal scree deposition and height-based blending.
Definition valley_fill.cpp:13
void sediment_layer(Array &z, const Array &talus_layer, const Array &talus_upper_limit, int iterations, bool apply_post_filter=true, Array *p_deposition_map=nullptr)
Applies a talus-based sediment deposition layer.
Definition deposition.cpp:70
Definition algebra.hpp:23
void stratify_oblique(Array &z, Array *p_mask, std::vector< float > hs, std::vector< float > gamma, float talus, float angle, Array *p_noise=nullptr)
Stratify the heightmap by creating a series of oblique layers with elevations corrected by a gamma fa...
Definition stratify.cpp:242
FlowDirectionMethod
Definition drainage_basin_cell_based.hpp:14
@ FDM_D8
Definition drainage_basin_cell_based.hpp:15
void coastal_erosion_diffusion(Array &z, Array &water_depth, float additional_depth, int iterations=10, const Array *p_mask=nullptr, Array *p_water_mask=nullptr)
Simulates terrain diffusion due to coastal erosion.
Definition coastal_erosion.cpp:18
void hydraulic_blur(Array &z, float radius, float vmax, float k_smoothing=0.1f)
Apply cell-based hydraulic erosion using a nonlinear diffusion model.
Definition hydraulic_blur.cpp:14
ErosionProfile
Procedural erosion angular profile type.
Definition profiles.hpp:20
@ EP_TRIANGLE_GRENIER
Definition profiles.hpp:29
void hydraulic_stream_log(Array &z, float c_erosion, float talus_ref, int deposition_ir=32, float deposition_scale_ratio=1.f, float gradient_power=0.8f, float gradient_scaling_ratio=1.f, int gradient_prefilter_ir=16, float saturation_ratio=1.f, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr)
Apply hydraulic erosion based on a flow accumulation map, alternative formulation.
Definition hydraulic_stream.cpp:101
void coastal_erosion_profile(Array &z, Array &water_depth, float shore_ground_extent, float shore_water_extent, float slope_shore=0.5f, float slope_shore_water=0.5f, float scarp_extent_ratio=0.5f, bool apply_post_filter=true, int post_filter_iterations=3, bool solid_shore_mask=true, float scarp_mask_transition_ratio=0.2f, const Array *p_noise=nullptr, Array *p_shore_mask=nullptr, Array *p_scarp_mask=nullptr)
Applies a coastal erosion profile to a terrain elevation field.
Definition coastal_erosion.cpp:53
void hydraulic_musgrave(Array &z, Array &moisture_map, int iterations=100, float c_capacity=1.f, float c_erosion=0.1f, float c_deposition=0.1f, float water_level=0.01f, float evap_rate=0.01f)
Apply cell-based hydraulic erosion/deposition of Musgrave et al. (1989).
Definition hydraulic_musgrave.cpp:25
InterpolationMethod2D
Enumeration of 2D interpolation methods.
Definition interpolate2d.hpp:47
@ ITP2D_DELAUNAY_GRADIENT
Delaunay triangulation + linear gradient.
Definition interpolate2d.hpp:53
void hydraulic_stream_upscale_amplification(Array &z, float c_erosion, float talus_ref, int upscaling_levels=1, float persistence=1.f, int ir=1, float clipping_ratio=10.f)
Applies hydraulic erosion with upscaling amplification.
Definition hydraulic_stream_upscale_amplification.cpp:15
Array slope(glm::ivec2 shape, float angle, float slope, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec2 center={0.5f, 0.5f}, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array corresponding to a slope with a given overall.
Definition primitives.cpp:288
void hydraulic_diffusion(Array &z, float c_diffusion, float talus, int iterations)
Apply cell-based hydraulic erosion using a nonlinear diffusion model.
Definition hydraulic_diffusion.cpp:12
void depression_filling(Array &z, int iterations=1000, float epsilon=1e-4f)
Fill the depressions of the heightmap using the Planchon-Darboux algorithm.
Definition depression_filling.cpp:14
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:46
void stratify(Array &z, Array *p_mask, std::vector< float > hs, std::vector< float > gamma, Array *p_noise=nullptr)
Stratify the heightmap by creating a series of layers with elevations corrected by a gamma factor.
Definition stratify.cpp:47
void hydraulic_algebric(Array &z, Array *p_mask, float talus_ref, int ir, Array *p_bedrock=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float c_erosion=0.05f, float c_deposition=0.05f, int iterations=1)
Apply an algerbic formula based on the local gradient to perform erosion/deposition.
Definition hydraulic_algebric.cpp:70
void hydraulic_stream(Array &z, float c_erosion, float talus_ref, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, int ir=1, float clipping_ratio=10.f)
Apply hydraulic erosion based on a flow accumulation map.
Definition hydraulic_stream.cpp:21
void depression_filling_priority_flood(Array &z)
Definition depression_filling_priority_flood.cpp:15
void hydraulic_saleve(TerrainTriMesh &mesh, const std::vector< float > &erodibility, const std::vector< float > &max_slope, float m_exp=0.8f, float uplift_rate=1.f, float tolerance=1e-3f, int max_iterations=200, float noise_strength=0.f, std::uint32_t seed=0, bool enable_post_slope_limiter=false, float post_slope_limit=0.f, bool enable_post_smoothing=false)
Perform hydraulic erosion on a triangulated terrain mesh.
Definition hydraulic_saleve.cpp:23
void stratify_multiscale(Array &z, float zmin, float zmax, std::vector< int > n_strata, std::vector< float > strata_noise, std::vector< float > gamma_list, std::vector< float > gamma_noise, std::uint32_t seed, Array *p_mask=nullptr, Array *p_noise=nullptr)
Stratify the heightmap by creating a multiscale series of layers with elevations corrected by a gamma...
Definition stratify.cpp:63
void hydraulic_benes(Array &z, Array *p_mask, int iterations=50, Array *p_bedrock=nullptr, Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, float c_capacity=40.f, float c_erosion=0.2f, float c_deposition=0.8f, float water_level=0.005f, float evap_rate=0.01f, float rain_rate=0.5f)
Apply cell-based hydraulic erosion/deposition based on Benes et al. procedure.
Definition hydraulic_benes.cpp:207
Array generate_bedrock(const Array &z, float elevation_strength, float slope_strength, float slope_limit, float zmin=0.f, float zmax=-1.f)
Generates a modified bedrock heightmap from an input elevation array.
Definition generate_bedrock.cpp:11
void erosion_maps(Array &z_before, Array &z_after, Array &erosion_map, Array &deposition_map, float tolerance=0.f)
Definition erosion_maps.cpp:11