HighMap library (C++)
Loading...
Searching...
No Matches
geo.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
10#pragma once
11
12#include "highmap/array.hpp"
13#include "highmap/functions.hpp"
16
17namespace hmap
18{
19
41Array caldera(glm::ivec2 shape,
42 float radius,
43 float sigma_inner,
44 float sigma_outer,
45 float z_bottom,
46 const Array *p_noise,
47 float noise_r_amp,
48 float noise_ratio_z,
49 glm::vec2 center = {0.5f, 0.5f},
50 const UvRect &uv_rect = UvRect::unit());
51
53Array caldera(glm::ivec2 shape,
54 float radius,
55 float sigma_inner,
56 float sigma_outer,
57 float z_bottom,
58 glm::vec2 center = {0.5f, 0.5f},
59 const UvRect &uv_rect = UvRect::unit());
60
90Array circus(glm::ivec2 shape,
91 float radius = 0.4f,
92 float angle = 0.f,
93 float exit_width = 0.35f,
94 float exit_depth = 0.f,
95 float center_depth = 0.1f,
96 float ridge_height = 1.f,
97 float ridge_width = 0.15f,
98 float outer_falloff = 2.f,
99 const Array *p_noise_r = nullptr,
100 glm::vec2 center = {0.5f, 0.5f},
101 const UvRect &uv_rect = UvRect::unit(),
102 Array *p_mask = nullptr);
103
140Array crater(glm::ivec2 shape,
141 float radius,
142 glm::vec2 center = {0.5f, 0.5f},
143 float angle = 30.f, // degs,
144 float inner_depth = 0.1f,
145 float inner_exp = 3.f,
146 float lip_height = 0.02f,
147 float lip_extent = 0.25f,
148 float lip_exp = 2.f,
149 float asym_ratio = 0.8f,
150 float central_peak_height = 0.01f,
151 float central_peak_extent = 0.4f,
152 int n_terraces = 0,
153 float terrace_extent = 0.1f,
154 float terrace_exp = 2.f,
155 float terrace_persistence = 0.5f,
156 const Array *p_noise_r = nullptr,
157 const UvRect &uv_rect = UvRect::unit(),
158 Array *p_crater_mask = nullptr,
159 Array *p_inner_crater_mask = nullptr);
160
192Array crater_field(glm::ivec2 shape,
193 const std::vector<glm::vec2> &centers,
194 const std::vector<float> &radii,
195 float angle = 30.f,
196 float inner_depth = 0.5f,
197 float inner_exp = 3.f,
198 float lip_height = 0.1f,
199 float lip_extent = 0.25f,
200 float lip_exp = 2.f,
201 float asym_ratio = 0.8f,
202 float central_peak_height = 0.05f,
203 float central_peak_extent = 0.4f,
204 int n_terraces = 0,
205 float terrace_extent = 0.1f,
206 float terrace_exp = 2.f,
207 float terrace_persistence = 0.5f,
208 const Array *p_noise_r = nullptr,
209 const UvRect &uv_rect = UvRect::unit(),
210 Array *p_crater_mask = nullptr,
211 Array *p_inner_crater_mask = nullptr,
212 bool scale_elevation_with_radius = true);
213
246Array crater_field(glm::ivec2 shape,
247 std::uint32_t seed,
248 int n_craters,
249 float r_min = 0.02f,
250 float r_max = 0.2f,
251 float angle = 30.f,
252 float inner_depth = 0.5f,
253 float inner_exp = 3.f,
254 float lip_height = 0.1f,
255 float lip_extent = 0.25f,
256 float lip_exp = 2.f,
257 float asym_ratio = 0.8f,
258 float central_peak_height = 0.05f,
259 float central_peak_extent = 0.4f,
260 int n_terraces = 0,
261 float terrace_extent = 0.1f,
262 float terrace_exp = 2.f,
263 float terrace_persistence = 0.5f,
264 const Array *p_noise_r = nullptr,
265 const UvRect &uv_rect = UvRect::unit(),
266 Array *p_crater_mask = nullptr,
267 Array *p_inner_crater_mask = nullptr,
268 bool scale_elevation_with_radius = true);
269
298Array island_land_mask(glm::ivec2 shape,
299 float radius,
300 std::uint32_t seed,
301 float displacement = 0.2f,
302 NoiseType noise_type = NoiseType::SIMPLEX2S,
303 float kw = 4.f,
304 int octaves = 8,
305 float weight = 0.f,
306 float persistence = 0.5f,
307 float lacunarity = 2.f,
308 const glm::vec2 &center = {0.5f, 0.5f},
309 const BBox2D &bbox = BBox2D::unit());
310
347Array island_chain_land_mask(glm::ivec2 shape,
348 const Path &path,
349 std::uint32_t seed,
350 int island_count = 5,
351 float island_radius = 0.1f,
352 float size_falloff = 0.5f,
353 float size_jitter = 0.3f,
354 float scatter = 0.f,
355 float displacement = 0.2f,
356 NoiseType noise_type = NoiseType::SIMPLEX2S,
357 float kw = 4.f,
358 int octaves = 8,
359 float weight = 0.f,
360 float persistence = 0.5f,
361 float lacunarity = 2.f,
362 const UvRect &uv_rect = UvRect::unit());
363
402Array rift(glm::ivec2 shape,
403 float angle,
404 float radius = 0.1f,
405 float axial_slope = 0.2f,
406 float depth = 0.5f,
407 bool scale_with_depth = true,
409 float profile_param = 0.f,
410 float bottom_extent = 0.1,
411 float bottom_depth = 0.05f,
412 RadialProfile bottom_profile = RadialProfile::RP_SQRT,
413 float bottom_profile_param = 0.f,
414 bool bottom_force_minimum_depth = true,
415 float outer_slope = 0.5f,
416 const Array *p_noise_r = nullptr,
417 const Array *p_noise_offset = nullptr,
418 glm::vec2 center = {0.5f, 0.5f},
419 const UvRect &uv_rect = UvRect::unit(),
420 Array *p_rift_mask = nullptr,
421 Array *p_bottom_mask = nullptr);
422
456Array valley_head(glm::ivec2 shape,
457 float angle = 0.f,
458 float min_depth = 0.f,
459 float max_depth = 0.2f,
460 float min_width = 0.02f,
461 float max_width = 0.15f,
462 float depth_length = 0.5f,
463 float width_length = 0.5f,
464 float development_power = 2.f,
465 float profile_power = 1.3f,
466 const Array *p_noise_offset = nullptr,
467 const Array *p_noise_r = nullptr,
468 glm::vec2 center = {0.5f, 0.5f},
469 const UvRect &uv_rect = UvRect::unit(),
470 Array *p_mask = nullptr);
471
472} // namespace hmap
473
474namespace hmap::gpu
475{
476
511Array badlands(glm::ivec2 shape,
512 glm::vec2 kw,
513 std::uint32_t seed,
514 int octaves = 8,
515 float rugosity = 0.2f,
516 float angle = 30.f,
517 float bias = 0.f,
518 float k_smoothing = 0.1f,
519 float base_noise_amp = 0.2f,
520 const Array *p_noise_x = nullptr,
521 const Array *p_noise_y = nullptr,
522 const UvRect &uv_rect = UvRect::unit());
523
602Array basalt_field(glm::ivec2 shape,
603 glm::vec2 kw,
604 std::uint32_t seed,
605 float warp_kw = 4.f,
606 float large_scale_warp_amp = 0.2f,
607 float large_scale_gain = 6.f,
608 float large_scale_amp = 0.2f,
609 float medium_scale_kw_ratio = 3.f,
610 float medium_scale_warp_amp = 1.f,
611 float medium_scale_gain = 7.f,
612 float medium_scale_amp = 0.08f,
613 float small_scale_kw_ratio = 10.f,
614 float small_scale_amp = 0.1f,
615 float small_scale_overlay_amp = 0.002f,
616 float rugosity_kw_ratio = 1.f,
617 float rugosity_amp = 1.f,
618 bool flatten_activate = true,
619 float flatten_kw_ratio = 1.f,
620 float flatten_amp = 0.f,
621 float bias = 0.f,
622 const Array *p_noise_x = nullptr,
623 const Array *p_noise_y = nullptr,
624 const UvRect &uv_rect = UvRect::unit());
625
664Array island(const Array &land_mask,
665 const Array *p_noise_r = nullptr,
666 float apex_elevation = 1.f,
667 bool filter_distance = true,
668 int filter_ir = 32,
669 float slope_min = 0.1f,
670 float slope_max = 8.f,
671 float slope_start = 0.5f,
672 float slope_end = 1.f,
673 float slope_noise_intensity = 0.5f,
674 float k_smooth = 0.05f,
675 float radial_noise_intensity = 0.3f,
676 float radial_profile_gain = 2.f,
677 float water_decay = 0.05f,
678 float water_depth = 0.3f,
679 float lee_angle = 30.f,
680 float lee_amp = 0.f,
681 float uplift_amp = 0.f,
682 Array *p_water_depth = nullptr,
683 Array *p_inland_mask = nullptr);
684
728Array island(const Array &land_mask,
729 std::uint32_t seed,
730 float noise_amp = 0.07f,
731 glm::vec2 noise_kw = {4.f, 4.f},
732 int noise_octaves = 8,
733 float noise_rugosity = 0.7f,
734 float noise_angle = 45.f,
735 float noise_k_smoothing = 0.05f,
736 float apex_elevation = 1.f,
737 bool filter_distance = true,
738 int filter_ir = 32,
739 float slope_min = 0.1f,
740 float slope_max = 8.f,
741 float slope_start = 0.5f,
742 float slope_end = 1.f,
743 float slope_noise_intensity = 0.5f,
744 float k_smooth = 0.05f,
745 float radial_noise_intensity = 0.3f,
746 float radial_profile_gain = 2.f,
747 float water_decay = 0.05f,
748 float water_depth = 0.3f,
749 float lee_angle = 30.f,
750 float lee_amp = 0.f,
751 float uplift_amp = 0.f,
752 Array *p_water_depth = nullptr,
753 Array *p_inland_mask = nullptr);
754
803Array mountain_cone(glm::ivec2 shape,
804 std::uint32_t seed,
805 float scale = 1.f,
806 int octaves = 8,
807 float peak_kw = 4.f,
808 float rugosity = 0.f,
809 float angle = 45.f,
810 float bias = 0.f,
811 float k_smoothing = 0.f,
812 float gamma = 0.5f,
813 float cone_alpha = 1.f,
814 float ridge_amp = 0.4f,
815 float base_noise_amp = 0.05f,
816 glm::vec2 center = {0.5f, 0.5f},
817 const Array *p_noise_x = nullptr,
818 const Array *p_noise_y = nullptr,
819 const UvRect &uv_rect = UvRect::unit());
820
867Array mountain_inselberg(glm::ivec2 shape,
868 std::uint32_t seed,
869 float scale = 1.f,
870 int octaves = 8,
871 float rugosity = 0.2f,
872 float angle = 45.f,
873 float gamma = 1.1f,
874 bool round_shape = false,
875 bool add_deposition = true,
876 float bulk_amp = 0.2f,
877 float base_noise_amp = 0.2f,
878 float bias = 0.f,
879 float k_smoothing = 0.1f,
880 glm::vec2 center = {0.5f, 0.5f},
881 const Array *p_noise_x = nullptr,
882 const Array *p_noise_y = nullptr,
883 const UvRect &uv_rect = UvRect::unit());
884
934Array mountain_range_radial(glm::ivec2 shape,
935 glm::vec2 kw,
936 std::uint32_t seed,
937 float half_width = 0.2f,
938 float angle_spread_ratio = 0.5f,
939 float core_size_ratio = 1.f,
940 glm::vec2 center = {0.5f, 0.5f},
941 int octaves = 8,
942 float weight = 0.7f,
943 float persistence = 0.5f,
944 float lacunarity = 2.f,
945 const Array *p_ctrl_param = nullptr,
946 const Array *p_noise_x = nullptr,
947 const Array *p_noise_y = nullptr,
948 const Array *p_angle = nullptr,
949 const UvRect &uv_rect = UvRect::unit());
950
996Array mountain_stump(glm::ivec2 shape,
997 std::uint32_t seed,
998 float scale = 1.f,
999 int octaves = 8,
1000 float peak_kw = 6.f,
1001 float rugosity = 0.f,
1002 float angle = 45.f,
1003 float k_smoothing = 0.f,
1004 float gamma = 0.25f,
1005 bool add_deposition = true,
1006 float ridge_amp = 0.75f,
1007 float base_noise_amp = 0.1f,
1008 glm::vec2 center = {0.5f, 0.5f},
1009 const Array *p_noise_x = nullptr,
1010 const Array *p_noise_y = nullptr,
1011 const UvRect &uv_rect = UvRect::unit());
1012
1058Array mountain_tibesti(glm::ivec2 shape,
1059 std::uint32_t seed,
1060 float scale = 1.f,
1061 int octaves = 8,
1062 float peak_kw = 20.f,
1063 float rugosity = 0.f,
1064 float angle = 30.f,
1065 float angle_spread_ratio = 0.25f,
1066 float gamma = 1.f,
1067 bool add_deposition = true,
1068 float bulk_amp = 1.f,
1069 float base_noise_amp = 0.1f,
1070 glm::vec2 center = {0.5f, 0.5f},
1071 const Array *p_noise_x = nullptr,
1072 const Array *p_noise_y = nullptr,
1073 const UvRect &uv_rect = UvRect::unit());
1074
1102Array plates(glm::ivec2 shape,
1103 glm::vec2 kw,
1104 std::uint32_t seed,
1105 float talus,
1106 int direction = 0,
1107 float mix_ratio = 0.9f,
1108 float bias = 0.f,
1109 float base_noise_amp = 0.05f,
1110 float kw_multiplier = 2.f,
1111 int octaves = 8,
1112 float rugosity = 0.f,
1113 const UvRect &uv_rect = UvRect::unit());
1114
1160Array shattered_peak(glm::ivec2 shape,
1161 std::uint32_t seed,
1162 float scale = 1.f,
1163 int octaves = 8,
1164 float peak_kw = 4.f,
1165 float rugosity = 0.f,
1166 float angle = 30.f,
1167 float gamma = 1.f,
1168 bool add_deposition = true,
1169 float bulk_amp = 0.3f,
1170 float base_noise_amp = 0.1f,
1171 float bias = 0.f,
1172 float k_smoothing = 0.f,
1173 glm::vec2 center = {0.5f, 0.5f},
1174 const Array *p_noise_x = nullptr,
1175 const Array *p_noise_y = nullptr,
1176 const UvRect &uv_rect = UvRect::unit());
1177
1178} // namespace hmap::gpu
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
Represents an ordered set of points in 2D, forming a polyline (open or closed).
Definition path.hpp:43
Definition array_blending.hpp:225
Array mountain_range_radial(glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float half_width=0.2f, float angle_spread_ratio=0.5f, float core_size_ratio=1.f, glm::vec2 center={0.5f, 0.5f}, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_angle=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a heightmap representing a radial mountain range.
Definition primitives_gpu.cpp:511
Array basalt_field(glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float warp_kw=4.f, float large_scale_warp_amp=0.2f, float large_scale_gain=6.f, float large_scale_amp=0.2f, float medium_scale_kw_ratio=3.f, float medium_scale_warp_amp=1.f, float medium_scale_gain=7.f, float medium_scale_amp=0.08f, float small_scale_kw_ratio=10.f, float small_scale_amp=0.1f, float small_scale_overlay_amp=0.002f, float rugosity_kw_ratio=1.f, float rugosity_amp=1.f, bool flatten_activate=true, float flatten_kw_ratio=1.f, float flatten_amp=0.f, float bias=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a synthetic procedural terrain resembling basaltic landforms.
Definition basalt_field.cpp:18
Array mountain_cone(glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=4.f, float rugosity=0.f, float angle=45.f, float bias=0.f, float k_smoothing=0.f, float gamma=0.5f, float cone_alpha=1.f, float ridge_amp=0.4f, float base_noise_amp=0.05f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a procedural "mountain cone" heightmap using fractal noise and Voronoi patterns.
Definition mountain_cone.cpp:20
Array plates(glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, float talus, int direction=0, float mix_ratio=0.9f, float bias=0.f, float base_noise_amp=0.05f, float kw_multiplier=2.f, int octaves=8, float rugosity=0.f, const UvRect &uv_rect=UvRect::unit())
Generate a tectonic plate–like heightfield using Voronoi FBM and directional talus projection.
Definition plates.cpp:17
Array shattered_peak(glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=4.f, float rugosity=0.f, float angle=30.f, float gamma=1.f, bool add_deposition=true, float bulk_amp=0.3f, float base_noise_amp=0.1f, float bias=0.f, float k_smoothing=0.f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a synthetic "shattered peak" terrain heightmap.
Definition shattered_peak.cpp:18
Array mountain_inselberg(glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float rugosity=0.2f, float angle=45.f, float gamma=1.1f, bool round_shape=false, bool add_deposition=true, float bulk_amp=0.2f, float base_noise_amp=0.2f, float bias=0.f, float k_smoothing=0.1f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a synthetic mountain-like inselberg (isolated hill) heightmap.
Definition mountain_inselberg.cpp:19
Array mountain_tibesti(glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=20.f, float rugosity=0.f, float angle=30.f, float angle_spread_ratio=0.25f, float gamma=1.f, bool add_deposition=true, float bulk_amp=1.f, float base_noise_amp=0.1f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a synthetic "Tibesti" mountain heightmap.
Definition mountain_tibesti.cpp:19
Array rugosity(const Array &z, int ir, bool convex=true)
See hmap::rugosity.
Definition local_metrics_gpu.cpp:437
Array mountain_stump(glm::ivec2 shape, std::uint32_t seed, float scale=1.f, int octaves=8, float peak_kw=6.f, float rugosity=0.f, float angle=45.f, float k_smoothing=0.f, float gamma=0.25f, bool add_deposition=true, float ridge_amp=0.75f, float base_noise_amp=0.1f, glm::vec2 center={0.5f, 0.5f}, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a mountain-like heightmap with a flattened (stump-shaped) peak.
Definition mountain_stump.cpp:19
Array island(const Array &land_mask, const Array *p_noise_r=nullptr, float apex_elevation=1.f, bool filter_distance=true, int filter_ir=32, float slope_min=0.1f, float slope_max=8.f, float slope_start=0.5f, float slope_end=1.f, float slope_noise_intensity=0.5f, float k_smooth=0.05f, float radial_noise_intensity=0.3f, float radial_profile_gain=2.f, float water_decay=0.05f, float water_depth=0.3f, float lee_angle=30.f, float lee_amp=0.f, float uplift_amp=0.f, Array *p_water_depth=nullptr, Array *p_inland_mask=nullptr)
Generates an island heightmap from a land mask using radial profiles, slope shaping,...
Definition island.cpp:116
Array badlands(glm::ivec2 shape, glm::vec2 kw, std::uint32_t seed, int octaves=8, float rugosity=0.2f, float angle=30.f, float bias=0.f, float k_smoothing=0.1f, float base_noise_amp=0.2f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const UvRect &uv_rect=UvRect::unit())
Generates a synthetic "badlands" terrain heightmap.
Definition badlands.cpp:16
Definition opencv.hpp:20
Array rift(glm::ivec2 shape, float angle, float radius=0.1f, float axial_slope=0.2f, float depth=0.5f, bool scale_with_depth=true, RadialProfile profile=RadialProfile::RP_SMOOTHSTEP, float profile_param=0.f, float bottom_extent=0.1, float bottom_depth=0.05f, RadialProfile bottom_profile=RadialProfile::RP_SQRT, float bottom_profile_param=0.f, bool bottom_force_minimum_depth=true, float outer_slope=0.5f, const Array *p_noise_r=nullptr, const Array *p_noise_offset=nullptr, glm::vec2 center={0.5f, 0.5f}, const UvRect &uv_rect=UvRect::unit(), Array *p_rift_mask=nullptr, Array *p_bottom_mask=nullptr)
Generate a rift-shaped primitive.
Definition rift.cpp:18
Array island_chain_land_mask(glm::ivec2 shape, const Path &path, std::uint32_t seed, int island_count=5, float island_radius=0.1f, float size_falloff=0.5f, float size_jitter=0.3f, float scatter=0.f, float displacement=0.2f, NoiseType noise_type=NoiseType::SIMPLEX2S, float kw=4.f, int octaves=8, float weight=0.f, float persistence=0.5f, float lacunarity=2.f, const UvRect &uv_rect=UvRect::unit())
Generates a land mask of an island chain scattered along a path.
Definition island_chain.cpp:22
RadialProfile
Radial profile type.
Definition profiles.hpp:51
@ RP_SMOOTHSTEP
Definition profiles.hpp:55
@ RP_SQRT
Definition profiles.hpp:58
Array valley_head(glm::ivec2 shape, float angle=0.f, float min_depth=0.f, float max_depth=0.2f, float min_width=0.02f, float max_width=0.15f, float depth_length=0.5f, float width_length=0.5f, float development_power=2.f, float profile_power=1.3f, const Array *p_noise_offset=nullptr, const Array *p_noise_r=nullptr, glm::vec2 center={0.5f, 0.5f}, const UvRect &uv_rect=UvRect::unit(), Array *p_mask=nullptr)
Generate a procedural natural valley head / valley incision deformation heightmap.
Definition valley_head.cpp:16
Array crater_field(glm::ivec2 shape, const std::vector< glm::vec2 > &centers, const std::vector< float > &radii, float angle=30.f, float inner_depth=0.5f, float inner_exp=3.f, float lip_height=0.1f, float lip_extent=0.25f, float lip_exp=2.f, float asym_ratio=0.8f, float central_peak_height=0.05f, float central_peak_extent=0.4f, int n_terraces=0, float terrace_extent=0.1f, float terrace_exp=2.f, float terrace_persistence=0.5f, const Array *p_noise_r=nullptr, const UvRect &uv_rect=UvRect::unit(), Array *p_crater_mask=nullptr, Array *p_inner_crater_mask=nullptr, bool scale_elevation_with_radius=true)
Generate a field of procedural impact craters from explicit centers and radii.
Definition crater_field.cpp:39
Array island_land_mask(glm::ivec2 shape, float radius, std::uint32_t seed, float displacement=0.2f, NoiseType noise_type=NoiseType::SIMPLEX2S, float kw=4.f, int octaves=8, float weight=0.f, float persistence=0.5f, float lacunarity=2.f, const glm::vec2 &center={0.5f, 0.5f}, const BBox2D &bbox=BBox2D::unit())
Generates a 2D island mask by perturbing a radial boundary with noise.
Definition island.cpp:25
Array crater(glm::ivec2 shape, float radius, glm::vec2 center={0.5f, 0.5f}, float angle=30.f, float inner_depth=0.1f, float inner_exp=3.f, float lip_height=0.02f, float lip_extent=0.25f, float lip_exp=2.f, float asym_ratio=0.8f, float central_peak_height=0.01f, float central_peak_extent=0.4f, int n_terraces=0, float terrace_extent=0.1f, float terrace_exp=2.f, float terrace_persistence=0.5f, const Array *p_noise_r=nullptr, const UvRect &uv_rect=UvRect::unit(), Array *p_crater_mask=nullptr, Array *p_inner_crater_mask=nullptr)
Generate a procedural impact crater heightmap.
Definition crater.cpp:126
Array caldera(glm::ivec2 shape, float radius, float sigma_inner, float sigma_outer, float z_bottom, const Array *p_noise, float noise_r_amp, float noise_ratio_z, glm::vec2 center={0.5f, 0.5f}, const UvRect &uv_rect=UvRect::unit())
Return a caldera-shaped heightmap.
Definition caldera.cpp:16
Cloud scale(const Cloud &cloud, glm::vec2 scale, glm::vec2 center={0.5f, 0.5f})
Scales the point coordinates in a cloud relative to a center point.
Definition cloud_functions.cpp:163
Array r_max(const Array &array1, const Array &array2, float alpha=0.f)
Generalized Rvachev R-function for smooth maximum / union (exact zero-set).
Definition math.cpp:436
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:65
NoiseType
Enumeration of various noise types used for procedural generation.
Definition functions.hpp:67
@ SIMPLEX2S
OpenSimplex2S.
Definition functions.hpp:73
Array r_min(const Array &array1, const Array &array2, float alpha=0.f)
Generalized Rvachev R-function for smooth minimum / intersection (exact zero-set).
Definition math.cpp:422
Array circus(glm::ivec2 shape, float radius=0.4f, float angle=0.f, float exit_width=0.35f, float exit_depth=0.f, float center_depth=0.1f, float ridge_height=1.f, float ridge_width=0.15f, float outer_falloff=2.f, const Array *p_noise_r=nullptr, glm::vec2 center={0.5f, 0.5f}, const UvRect &uv_rect=UvRect::unit(), Array *p_mask=nullptr)
Generate a procedural circus (glacial cirque / amphitheatre basin) heightmap.
Definition circus.cpp:17
Path class for manipulating and analyzing paths in 2D space.
Axis-aligned 2D bounding box in world coordinates.
Definition bbox2d.hpp:25
static constexpr BBox2D unit()
Definition bbox2d.hpp:39
Axis-aligned rectangle in normalized [0, 1]^2 domain/UV space.
Definition uv_rect.hpp:30
static constexpr UvRect unit()
Definition uv_rect.hpp:46