HighMap library (C++)
Loading...
Searching...
No Matches
deprecated.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
6#include <cstdint>
7#include <vector>
8
9#include "highmap/array.hpp"
13
14namespace hmap
15{
16
17// --- Deprecated Hydraulic Functions
18
43// this function is going to be removed at some point
44[[deprecated("This function is going to be removed at some point.")]]
46 Array *p_mask,
47 float talus_ref,
48 int ir,
49 Array *p_bedrock = nullptr,
50 Array *p_erosion_map = nullptr,
51 Array *p_deposition_map = nullptr,
52 float c_erosion = 0.05f,
53 float c_deposition = 0.05f,
54 int iterations = 1);
55
57// this function is going to be removed at some point
58[[deprecated("This function is going to be removed at some point.")]]
60 float talus_ref,
61 int ir,
62 Array *p_bedrock = nullptr,
63 Array *p_erosion_map = nullptr,
64 Array *p_deposition_map = nullptr,
65 float c_erosion = 0.05f,
66 float c_deposition = 0.05f,
67 int iterations = 1);
68
99// this function is going to be removed at some point
100[[deprecated("This function is going to be removed at some point.")]]
101void hydraulic_benes(Array &z,
102 Array *p_mask,
103 int iterations = 50,
104 Array *p_bedrock = nullptr,
105 Array *p_moisture_map = nullptr,
106 Array *p_erosion_map = nullptr,
107 Array *p_deposition_map = nullptr,
108 float c_capacity = 40.f,
109 float c_erosion = 0.2f,
110 float c_deposition = 0.8f,
111 float water_level = 0.005f,
112 float evap_rate = 0.01f,
113 float rain_rate = 0.5f);
114
116// this function is going to be removed at some point
117[[deprecated("This function is going to be removed at some point.")]]
118void hydraulic_benes(Array &z,
119 int iterations = 50,
120 Array *p_bedrock = nullptr,
121 Array *p_moisture_map = nullptr,
122 Array *p_erosion_map = nullptr,
123 Array *p_deposition_map = nullptr,
124 float c_capacity = 40.f,
125 float c_erosion = 0.2f,
126 float c_deposition = 0.8f,
127 float water_level = 0.005f,
128 float evap_rate = 0.01f,
129 float rain_rate = 0.5f);
130
144// this function is going to be removed at some point
145[[deprecated("This function is going to be removed at some point.")]]
146void hydraulic_blur(Array &z,
147 float radius,
148 float vmax,
149 float k_smoothing = 0.1f);
150
168// this function is going to be removed at some point
169[[deprecated("This function is going to be removed at some point.")]]
171 float c_diffusion,
172 float talus,
173 int iterations);
174
198// this function is going to be removed at some point
199[[deprecated("This function is going to be removed at some point.")]]
201 Array &moisture_map,
202 int iterations = 100,
203 float c_capacity = 1.f,
204 float c_erosion = 0.1f,
205 float c_deposition = 0.1f,
206 float water_level = 0.01f,
207 float evap_rate = 0.01f);
208
210// this function is going to be removed at some point
211[[deprecated("This function is going to be removed at some point.")]]
213 int iterations = 100,
214 float c_capacity = 1.f,
215 float c_erosion = 0.1f,
216 float c_deposition = 0.1f,
217 float water_level = 0.01f,
218 float evap_rate = 0.01f);
219
245// this function is going to be removed at some point
246[[deprecated("This function is going to be removed at some point.")]]
247void hydraulic_stream(Array &z,
248 float c_erosion,
249 float talus_ref,
250 const Array *p_bedrock = nullptr,
251 const Array *p_moisture_map = nullptr,
252 Array *p_erosion_map = nullptr, // -> out
253 int ir = 1,
254 float clipping_ratio = 10.f);
255
257// this function is going to be removed at some point
258[[deprecated("This function is going to be removed at some point.")]]
259void hydraulic_stream(Array &z,
260 const Array *p_mask,
261 float c_erosion,
262 float talus_ref,
263 const Array *p_bedrock = nullptr,
264 const Array *p_moisture_map = nullptr,
265 Array *p_erosion_map = nullptr,
266 int ir = 1,
267 float clipping_ratio = 10.f);
268
307// this function is going to be removed at some point
308[[deprecated("This function is going to be removed at some point.")]]
310 float c_erosion,
311 float talus_ref,
312 int deposition_ir = 32,
313 float deposition_scale_ratio = 1.f,
314 float gradient_power = 0.8f,
315 float gradient_scaling_ratio = 1.f,
316 int gradient_prefilter_ir = 16,
317 float saturation_ratio = 1.f,
318 const Array *p_bedrock = nullptr,
319 const Array *p_erodibility = nullptr,
320 const Array *p_moisture_map = nullptr,
321 Array *p_erosion_map = nullptr,
322 Array *p_deposition_map = nullptr,
323 Array *p_flow_map = nullptr);
324
326// this function is going to be removed at some point
327[[deprecated("This function is going to be removed at some point.")]]
329 float c_erosion,
330 float talus_ref,
331 const Array *p_mask,
332 int deposition_ir = 32,
333 float deposition_scale_ratio = 1.f,
334 float gradient_power = 0.8f,
335 float gradient_scaling_ratio = 1.f,
336 int gradient_prefilter_ir = 16,
337 float saturation_ratio = 1.f,
338 const Array *p_bedrock = nullptr,
339 const Array *p_erodibility = nullptr,
340 const Array *p_moisture_map = nullptr,
341 Array *p_erosion_map = nullptr,
342 Array *p_deposition_map = nullptr,
343 Array *p_flow_map = nullptr);
344
375// this function is going to be removed at some point
376[[deprecated("This function is going to be removed at some point.")]]
378 float c_erosion,
379 float talus_ref,
380 int levels = 3,
381 int deposition_ir = 32,
382 float deposition_scale_ratio = 1.f,
383 float gradient_power = 0.8f,
384 float gradient_scaling_ratio = 1.f,
385 int gradient_prefilter_ir = 16,
386 float saturation_ratio = 1.f,
387 const Array *p_bedrock = nullptr,
388 const Array *p_erodibility = nullptr,
389 const Array *p_moisture_map = nullptr,
390 Array *p_erosion_map = nullptr,
391 Array *p_deposition_map = nullptr,
392 Array *p_flow_map = nullptr,
393 float mix = 1.f,
394 float warp = 0.35f,
395 std::uint32_t seed = 1);
396
398// this function is going to be removed at some point
399[[deprecated("This function is going to be removed at some point.")]]
401 float c_erosion,
402 float talus_ref,
403 const Array *p_mask,
404 int levels = 3,
405 int deposition_ir = 32,
406 float deposition_scale_ratio = 1.f,
407 float gradient_power = 0.8f,
408 float gradient_scaling_ratio = 1.f,
409 int gradient_prefilter_ir = 16,
410 float saturation_ratio = 1.f,
411 const Array *p_bedrock = nullptr,
412 const Array *p_erodibility = nullptr,
413 const Array *p_moisture_map = nullptr,
414 Array *p_erosion_map = nullptr,
415 Array *p_deposition_map = nullptr,
416 Array *p_flow_map = nullptr,
417 float mix = 1.f,
418 float warp = 0.35f,
419 std::uint32_t seed = 1);
420
441// this function is going to be removed at some point
442[[deprecated("This function is going to be removed at some point.")]]
444 const std::vector<float> &erodibility,
445 const std::vector<float> &max_slope,
446 float m_exp = 0.8f,
447 float uplift_rate = 1.f,
448 float tolerance = 1e-3f,
449 int max_iterations = 200,
450 float noise_strength = 0.f,
451 std::uint32_t seed = 0,
452 bool enable_post_slope_limiter = false,
453 float post_slope_limit = 0.f,
454 bool enable_post_smoothing = false);
455
486// this function is going to be removed at some point
487[[deprecated("This function is going to be removed at some point.")]]
489 std::uint32_t seed,
490 size_t control_points_count = 10000,
491 float m_exp = 0.8f,
492 float uplift_rate = 1.f,
493 float tolerance = 1e-3f,
494 int max_iterations = 200,
495 float smin = 0.f,
496 float smax = 6.f,
497 float strength = 0.5f,
498 bool scale_erodibility_with_z = true,
499 float erodibility_distrib_exp = 1.f,
500 float noise_strength = 0.f,
501 bool enable_post_slope_limiter = false,
502 float post_slope_limit = 0.f,
503 bool enable_post_smoothing = false,
504 InterpolationMethod2D interpolation_method =
506 const Array *p_noise_x = nullptr,
507 const Array *p_noise_y = nullptr);
508
510// this function is going to be removed at some point
511[[deprecated("This function is going to be removed at some point.")]]
513 const Array *p_mask,
514 std::uint32_t seed,
515 size_t control_points_count = 10000,
516 float m_exp = 0.8f,
517 float uplift_rate = 1.f,
518 float tolerance = 1e-3f,
519 int max_iterations = 200,
520 float smin = 0.f,
521 float smax = 6.f,
522 float strength = 0.5f,
523 bool scale_erodibility_with_z = true,
524 float erodibility_distrib_exp = 1.f,
525 float noise_strength = 0.f,
526 bool enable_post_slope_limiter = false,
527 float post_slope_limit = 0.f,
528 bool enable_post_smoothing = false,
529 InterpolationMethod2D interpolation_method =
531 const Array *p_noise_x = nullptr,
532 const Array *p_noise_y = nullptr);
533
534} // namespace hmap
535
536namespace hmap::gpu
537{
538
539// --- Deprecated GPU Hydraulic Functions
540
551// this function is going to be removed at some point
552[[deprecated("This function is going to be removed at some point.")]]
553void hydraulic_musgrave(Array &z,
554 Array &moisture_map,
555 int iterations = 100,
556 float c_capacity = 1.f,
557 float c_erosion = 0.1f,
558 float c_deposition = 0.1f,
559 float water_level = 0.01f,
560 float evap_rate = 0.01f);
561
563// this function is going to be removed at some point
564[[deprecated("This function is going to be removed at some point.")]]
565void hydraulic_musgrave(Array &z,
566 int iterations = 100,
567 float c_capacity = 1.f,
568 float c_erosion = 0.1f,
569 float c_deposition = 0.1f,
570 float water_level = 0.01f,
571 float evap_rate = 0.01f);
572
573} // namespace hmap::gpu
574
575namespace hmap::va
576{
577
578// --- Deprecated VirtualArray Hydraulic Functions
579
580// this function is going to be removed at some point
581[[deprecated("This function is going to be removed at some point.")]]
583 const ComputeMode &cm,
584 const VirtualArray &z,
585 std::uint32_t seed,
586 size_t control_points_count = 10000,
587 float m_exp = 0.8f,
588 float uplift_rate = 1.f,
589 float tolerance = 1e-3f,
590 int max_iterations = 200,
591 float smin = 0.f,
592 float smax = 6.f,
593 float strength = 0.5f,
594 bool scale_erodibility_with_z = true,
595 float erodibility_distrib_exp = 1.f,
596 float noise_strength = 0.f,
597 bool enable_post_slope_limiter = false,
598 float post_slope_limit = 0.f,
599 bool enable_post_smoothing = false,
600 InterpolationMethod2D interpolation_method =
602 const VirtualArray *p_noise_x = nullptr,
603 const VirtualArray *p_noise_y = nullptr,
604 const VirtualArray *p_mask = nullptr);
605
606} // namespace hmap::va
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Array class, helper to manipulate 2D float array with "(i, j)" indexing.
Definition array.hpp:31
Triangle mesh representation of a terrain surface.
Definition terrain_tri_mesh.hpp:32
Header file for 2D interpolation methods.
Definition array_blending.hpp:225
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) on GPU.
Definition hydraulic_musgrave_gpu.cpp:21
Definition deprecated.hpp:576
VirtualArray hydraulic_saleve(const ComputeMode &cm, const VirtualArray &z, std::uint32_t seed, size_t control_points_count=10000, float m_exp=0.8f, float uplift_rate=1.f, float tolerance=1e-3f, int max_iterations=200, float smin=0.f, float smax=6.f, float strength=0.5f, bool scale_erodibility_with_z=true, float erodibility_distrib_exp=1.f, float noise_strength=0.f, bool enable_post_slope_limiter=false, float post_slope_limit=0.f, bool enable_post_smoothing=false, InterpolationMethod2D interpolation_method=InterpolationMethod2D::ITP2D_DELAUNAY_GRADIENT, const VirtualArray *p_noise_x=nullptr, const VirtualArray *p_noise_y=nullptr, const VirtualArray *p_mask=nullptr)
Definition opencv.hpp:20
void warp(Array &array, const Array *p_dx, const Array *p_dy)
Apply a warping effect to the array.
Definition warp.cpp:17
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:16
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, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const 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:115
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:21
InterpolationMethod2D
Enumeration of 2D interpolation methods.
Definition interpolate2d.hpp:43
@ ITP2D_DELAUNAY_GRADIENT
Delaunay triangulation + linear gradient.
Definition interpolate2d.hpp:49
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:13
void hydraulic_stream(Array &z, float c_erosion, float talus_ref, const Array *p_bedrock=nullptr, const 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:26
void hydraulic_stream_log_multiscale(Array &z, float c_erosion, float talus_ref, int levels=3, 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, const Array *p_bedrock=nullptr, const Array *p_erodibility=nullptr, const Array *p_moisture_map=nullptr, Array *p_erosion_map=nullptr, Array *p_deposition_map=nullptr, Array *p_flow_map=nullptr, float mix=1.f, float warp=0.35f, std::uint32_t seed=1)
Multiscale stream-power hydraulic erosion cascade.
Definition hydraulic_stream.cpp:260
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:74
Texture mix(const Texture &tex1, const Texture &tex2, MixMethod method=MM_SQRT_AVG)
Mix two textures into an output texture.
Definition colorize.cpp:561
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.
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:212
Definition virtual_array.hpp:54
Definition virtual_array.hpp:65