49 glm::vec2 center = {0.5f, 0.5f},
58 glm::vec2 center = {0.5f, 0.5f},
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},
102 Array *p_mask =
nullptr);
142 glm::vec2 center = {0.5f, 0.5f},
144 float inner_depth = 0.1f,
145 float inner_exp = 3.f,
146 float lip_height = 0.02f,
147 float lip_extent = 0.25f,
149 float asym_ratio = 0.8f,
150 float central_peak_height = 0.01f,
151 float central_peak_extent = 0.4f,
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,
158 Array *p_crater_mask =
nullptr,
159 Array *p_inner_crater_mask =
nullptr);
193 const std::vector<glm::vec2> ¢ers,
194 const std::vector<float> &radii,
196 float inner_depth = 0.5f,
197 float inner_exp = 3.f,
198 float lip_height = 0.1f,
199 float lip_extent = 0.25f,
201 float asym_ratio = 0.8f,
202 float central_peak_height = 0.05f,
203 float central_peak_extent = 0.4f,
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,
210 Array *p_crater_mask =
nullptr,
211 Array *p_inner_crater_mask =
nullptr,
212 bool scale_elevation_with_radius =
true);
252 float inner_depth = 0.5f,
253 float inner_exp = 3.f,
254 float lip_height = 0.1f,
255 float lip_extent = 0.25f,
257 float asym_ratio = 0.8f,
258 float central_peak_height = 0.05f,
259 float central_peak_extent = 0.4f,
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,
266 Array *p_crater_mask =
nullptr,
267 Array *p_inner_crater_mask =
nullptr,
268 bool scale_elevation_with_radius =
true);
301 float displacement = 0.2f,
306 float persistence = 0.5f,
307 float lacunarity = 2.f,
308 const glm::vec2 ¢er = {0.5f, 0.5f},
350 int island_count = 5,
351 float island_radius = 0.1f,
352 float size_falloff = 0.5f,
353 float size_jitter = 0.3f,
355 float displacement = 0.2f,
360 float persistence = 0.5f,
361 float lacunarity = 2.f,
405 float axial_slope = 0.2f,
407 bool scale_with_depth =
true,
409 float profile_param = 0.f,
410 float bottom_extent = 0.1,
411 float bottom_depth = 0.05f,
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},
420 Array *p_rift_mask =
nullptr,
421 Array *p_bottom_mask =
nullptr);
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},
470 Array *p_mask =
nullptr);
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,
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,
622 const Array *p_noise_x =
nullptr,
623 const Array *p_noise_y =
nullptr,
664Array
island(
const Array &land_mask,
665 const Array *p_noise_r =
nullptr,
666 float apex_elevation = 1.f,
667 bool filter_distance =
true,
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,
681 float uplift_amp = 0.f,
682 Array *p_water_depth =
nullptr,
683 Array *p_inland_mask =
nullptr);
728Array
island(
const Array &land_mask,
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,
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,
751 float uplift_amp = 0.f,
752 Array *p_water_depth =
nullptr,
753 Array *p_inland_mask =
nullptr);
811 float k_smoothing = 0.f,
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,
874 bool round_shape =
false,
875 bool add_deposition =
true,
876 float bulk_amp = 0.2f,
877 float base_noise_amp = 0.2f,
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,
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},
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,
1000 float peak_kw = 6.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,
1062 float peak_kw = 20.f,
1065 float angle_spread_ratio = 0.25f,
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,
1102Array
plates(glm::ivec2 shape,
1107 float mix_ratio = 0.9f,
1109 float base_noise_amp = 0.05f,
1110 float kw_multiplier = 2.f,
1164 float peak_kw = 4.f,
1168 bool add_deposition =
true,
1169 float bulk_amp = 0.3f,
1170 float base_noise_amp = 0.1f,
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,
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
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 > ¢ers, 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 ¢er={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