HighMap library (C++)
Loading...
Searching...
No Matches
primitives.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
16#pragma once
17
18#include "FastNoiseLite.h"
19
20#include "highmap/array.hpp"
21#include "highmap/erosion.hpp"
22#include "highmap/functions.hpp"
23
24#define HMAP_GRADIENT_OFFSET 0.001f
25
26namespace hmap
27{
28
47
61
73Array get_primitive_base(const PrimitiveType &primitive_type,
74 const glm::ivec2 &shape,
75 const Array *p_noise_x = nullptr,
76 const Array *p_noise_y = nullptr,
77 glm::vec2 center = {0.5f, 0.5f},
78 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
79
98Array biquad_pulse(glm::ivec2 shape,
99 float gain = 1.f,
100 const Array *p_ctrl_param = nullptr,
101 const Array *p_noise_x = nullptr,
102 const Array *p_noise_y = nullptr,
103 const Array *p_stretching = nullptr,
104 glm::vec2 center = {0.5f, 0.5f},
105 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
106
126Array bump(glm::ivec2 shape,
127 float gain = 1.f,
128 const Array *p_ctrl_param = nullptr, // gain multiplier
129 const Array *p_noise_x = nullptr,
130 const Array *p_noise_y = nullptr,
131 const Array *p_stretching = nullptr,
132 glm::vec2 center = {0.5f, 0.5f},
133 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
134
178Array bump_lorentzian(
179 glm::ivec2 shape,
180 float shape_factor = 0.5f,
181 float radius = 0.5f,
182 const Array *p_ctrl_param = nullptr, // shape_factor multiplier
183 const Array *p_noise_x = nullptr,
184 const Array *p_noise_y = nullptr,
185 glm::vec2 center = {0.5f, 0.5f},
186 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
187
209Array caldera(glm::ivec2 shape,
210 float radius,
211 float sigma_inner,
212 float sigma_outer,
213 float z_bottom,
214 const Array *p_noise,
215 float noise_amp_r,
216 float noise_ratio_z,
217 glm::vec2 center = {0.5f, 0.5f},
218 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
219
220Array caldera(glm::ivec2 shape,
221 float radius,
222 float sigma_inner,
223 float sigma_outer,
224 float z_bottom,
225 glm::vec2 center = {0.5f, 0.5f},
226 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
227
244Array checkerboard(glm::ivec2 shape,
245 glm::vec2 kw,
246 const Array *p_noise_x = nullptr,
247 const Array *p_noise_y = nullptr,
248 const Array *p_stretching = nullptr,
249 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
250
278Array cone(glm::ivec2 shape,
279 float slope,
280 float apex_elevation = 1.f,
281 bool smooth_profile = false,
282 glm::vec2 center = {0.5f, 0.5f},
283 const Array *p_noise_x = nullptr,
284 const Array *p_noise_y = nullptr,
285 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
286
340Array cone_complex(
341 glm::ivec2 shape,
342 float alpha,
343 float radius = 0.5f,
344 bool smooth_profile = true,
345 float valley_amp = 0.2f,
346 int valley_nb = 5,
347 float valley_decay_ratio = 0.5f,
348 float valley_angle0 = 15.f,
349 const ErosionProfile &erosion_profile = ErosionProfile::TRIANGLE_GRENIER,
350 float erosion_delta = 0.01f,
351 float radial_waviness_amp = 0.05f,
352 float radial_waviness_kw = 2.f,
353 float bias_angle = 30.f,
354 float bias_amp = 0.75f,
355 float bias_exponent = 1.f,
356 glm::vec2 center = {0.5f, 0.5f},
357 const Array *p_ctrl_param = nullptr,
358 const Array *p_noise_x = nullptr,
359 const Array *p_noise_y = nullptr,
360 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
361
393Array cone_sigmoid(glm::ivec2 shape,
394 float alpha,
395 float radius = 0.5f,
396 glm::vec2 center = {0.5f, 0.5f},
397 const Array *p_noise_x = nullptr,
398 const Array *p_noise_y = nullptr,
399 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
400
408Array constant(glm::ivec2 shape, float value = 0.f);
409
432Array crater(glm::ivec2 shape,
433 float radius,
434 float depth,
435 float lip_decay,
436 float lip_height_ratio = 0.5f,
437 const Array *p_ctrl_param = nullptr,
438 const Array *p_noise_x = nullptr,
439 const Array *p_noise_y = nullptr,
440 glm::vec2 center = {0.5f, 0.5f},
441 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
442
446Array cubic_pulse(glm::ivec2 shape,
447 const Array *p_noise_x,
448 const Array *p_noise_y,
449 glm::vec2 center = {0.5f, 0.5f},
450 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
451
488Array dendry(glm::ivec2 shape,
489 glm::vec2 kw,
490 uint seed,
491 Array &control_function,
492 float eps = 0.05,
493 int resolution = 1,
494 float displacement = 0.075,
495 int primitives_resolution_steps = 3,
496 float slope_power = 2.f,
497 float noise_amplitude_proportion = 0.01,
498 bool add_control_function = true,
499 float control_function_overlap = 0.5f,
500 const Array *p_noise_x = nullptr,
501 const Array *p_noise_y = nullptr,
502 const Array *p_stretching = nullptr,
503 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
504 int subsampling = 1);
505
506Array dendry(glm::ivec2 shape,
507 glm::vec2 kw,
508 uint seed,
509 NoiseFunction &noise_function,
510 float noise_function_offset = 0.f,
511 float noise_function_scaling = 1.f,
512 float eps = 0.05,
513 int resolution = 1,
514 float displacement = 0.075,
515 int primitives_resolution_steps = 3,
516 float slope_power = 2.f,
517 float noise_amplitude_proportion = 0.01,
518 bool add_control_function = true,
519 float control_function_overlap = 0.5f,
520 const Array *p_noise_x = nullptr,
521 const Array *p_noise_y = nullptr,
522 const Array *p_stretching = nullptr,
523 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
524
567Array diffusion_limited_aggregation(glm::ivec2 shape,
568 float scale,
569 uint seed,
570 float seeding_radius = 0.4f,
571 float seeding_outer_radius_ratio = 0.2f,
572 float slope = 8.f,
573 float noise_ratio = 0.2f);
574
609Array disk(glm::ivec2 shape,
610 float radius,
611 float slope = 1.f,
612 const Array *p_ctrl_param = nullptr,
613 const Array *p_noise_x = nullptr,
614 const Array *p_noise_y = nullptr,
615 const Array *p_stretching = nullptr,
616 glm::vec2 center = {0.5f, 0.5f},
617 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
618
636Array gabor_noise(glm::ivec2 shape,
637 float kw,
638 float angle,
639 int width,
640 float density,
641 uint seed);
642
663Array gaussian_pulse(glm::ivec2 shape,
664 float sigma,
665 const Array *p_ctrl_param = nullptr,
666 const Array *p_noise_x = nullptr,
667 const Array *p_noise_y = nullptr,
668 const Array *p_stretching = nullptr,
669 glm::vec2 center = {0.5f, 0.5f},
670 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
671
700Array island_land_mask(glm::ivec2 shape,
701 float radius,
702 uint seed,
703 float displacement = 0.2f,
704 NoiseType noise_type = NoiseType::SIMPLEX2S,
705 float kw = 4.f,
706 int octaves = 8,
707 float weight = 0.f,
708 float persistence = 0.5f,
709 float lacunarity = 2.f,
710 const glm::vec2 &center = {0.5f, 0.5f},
711 const glm::vec4 &bbox = {0.f, 1.f, 0.f, 1.f});
712
742Array multisteps(glm::ivec2 shape,
743 float angle,
744 float r = 1.2f,
745 int nsteps = 8,
746 float elevation_exponent = 0.7f,
747 float shape_gain = 4.f,
748 float scale = 0.5f,
749 float outer_slope = 0.1f,
750 const Array *p_ctrl_param = nullptr,
751 const Array *p_noise_x = nullptr,
752 const Array *p_noise_y = nullptr,
753 const glm::vec2 &center = {0.5f, 0.5f},
754 const glm::vec4 &bbox = {0.f, 1.f, 0.f, 1.f});
755
774Array noise(NoiseType noise_type,
775 glm::ivec2 shape,
776 glm::vec2 kw,
777 uint seed,
778 const Array *p_noise_x = nullptr,
779 const Array *p_noise_y = nullptr,
780 const Array *p_stretching = nullptr,
781 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
782
814Array noise_fbm(NoiseType noise_type,
815 glm::ivec2 shape,
816 glm::vec2 kw,
817 uint seed,
818 int octaves = 8,
819 float weight = 0.7f,
820 float persistence = 0.5f,
821 float lacunarity = 2.f,
822 const Array *p_ctrl_param = nullptr,
823 const Array *p_noise_x = nullptr,
824 const Array *p_noise_y = nullptr,
825 const Array *p_stretching = nullptr,
826 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
827
860Array noise_iq(NoiseType noise_type,
861 glm::ivec2 shape,
862 glm::vec2 kw,
863 uint seed,
864 int octaves = 8,
865 float weight = 0.7f,
866 float persistence = 0.5f,
867 float lacunarity = 2.f,
868 float gradient_scale = 0.05f,
869 const Array *p_ctrl_param = nullptr,
870 const Array *p_noise_x = nullptr,
871 const Array *p_noise_y = nullptr,
872 const Array *p_stretching = nullptr,
873 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
874
910Array noise_jordan(NoiseType noise_type,
911 glm::ivec2 shape,
912 glm::vec2 kw,
913 uint seed,
914 int octaves = 8,
915 float weight = 0.7f,
916 float persistence = 0.5f,
917 float lacunarity = 2.f,
918 float warp0 = 0.4f,
919 float damp0 = 1.f,
920 float warp_scale = 0.4f,
921 float damp_scale = 1.f,
922 const Array *p_ctrl_param = nullptr,
923 const Array *p_noise_x = nullptr,
924 const Array *p_noise_y = nullptr,
925 const Array *p_stretching = nullptr,
926 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
927
960Array noise_parberry(glm::ivec2 shape,
961 glm::vec2 kw,
962 uint seed,
963 int octaves = 8,
964 float weight = 0.7f,
965 float persistence = 0.5f,
966 float lacunarity = 2.f,
967 float mu = 1.02f,
968 const Array *p_ctrl_param = nullptr,
969 const Array *p_noise_x = nullptr,
970 const Array *p_noise_y = nullptr,
971 const Array *p_stretching = nullptr,
972 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
973
1005Array noise_pingpong(NoiseType noise_type,
1006 glm::ivec2 shape,
1007 glm::vec2 kw,
1008 uint seed,
1009 int octaves = 8,
1010 float weight = 0.7f,
1011 float persistence = 0.5f,
1012 float lacunarity = 2.f,
1013 const Array *p_ctrl_param = nullptr,
1014 const Array *p_noise_x = nullptr,
1015 const Array *p_noise_y = nullptr,
1016 const Array *p_stretching = nullptr,
1017 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1018
1051Array noise_ridged(NoiseType noise_type,
1052 glm::ivec2 shape,
1053 glm::vec2 kw,
1054 uint seed,
1055 int octaves = 8,
1056 float weight = 0.7f,
1057 float persistence = 0.5f,
1058 float lacunarity = 2.f,
1059 float k_smoothing = 0.1f,
1060 const Array *p_ctrl_param = nullptr,
1061 const Array *p_noise_x = nullptr,
1062 const Array *p_noise_y = nullptr,
1063 const Array *p_stretching = nullptr,
1064 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1065
1098Array noise_swiss(NoiseType noise_type,
1099 glm::ivec2 shape,
1100 glm::vec2 kw,
1101 uint seed,
1102 int octaves = 8,
1103 float weight = 0.7f,
1104 float persistence = 0.5f,
1105 float lacunarity = 2.f,
1106 float warp_scale = 0.1f,
1107 const Array *p_ctrl_param = nullptr,
1108 const Array *p_noise_x = nullptr,
1109 const Array *p_noise_y = nullptr,
1110 const Array *p_stretching = nullptr,
1111 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1112
1136Array paraboloid(glm::ivec2 shape,
1137 float angle,
1138 float a,
1139 float b,
1140 float v0 = 0.f,
1141 bool reverse_x = false,
1142 bool reverse_y = false,
1143 const Array *p_noise_x = nullptr,
1144 const Array *p_noise_y = nullptr,
1145 const Array *p_stretching = nullptr,
1146 glm::vec2 center = {0.5f, 0.5f},
1147 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1148
1167Array peak(glm::ivec2 shape,
1168 float radius,
1169 const Array *p_noise,
1170 float noise_r_amp,
1171 float noise_z_ratio,
1172 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1173
1225Array phasor(PhasorProfile phasor_profile,
1226 glm::ivec2 shape,
1227 float kw,
1228 const Array &angle,
1229 uint seed,
1230 float profile_delta = 0.1f,
1231 float density_factor = 1.f,
1232 float kernel_width_ratio = 2.f,
1233 float phase_smoothing = 2.f);
1234
1279Array phasor_fbm(PhasorProfile phasor_profile,
1280 glm::ivec2 shape,
1281 float kw,
1282 const Array &angle,
1283 uint seed,
1284 float profile_delta = 0.1f,
1285 float density_factor = 1.f,
1286 float kernel_width_ratio = 2.f,
1287 float phase_smoothing = 2.f,
1288 int octaves = 8,
1289 float weight = 0.7f,
1290 float persistence = 0.5f,
1291 float lacunarity = 2.f);
1292
1331Array rectangle(glm::ivec2 shape,
1332 float rx,
1333 float ry,
1334 float angle,
1335 float slope = 1.f,
1336 const Array *p_ctrl_param = nullptr,
1337 const Array *p_noise_x = nullptr,
1338 const Array *p_noise_y = nullptr,
1339 const Array *p_stretching = nullptr,
1340 glm::vec2 center = {0.5f, 0.5f},
1341 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1342
1366Array rift(glm::ivec2 shape,
1367 float angle,
1368 float slope,
1369 float width,
1370 bool sharp_bottom = false,
1371 const Array *p_ctrl_param = nullptr,
1372 const Array *p_noise_x = nullptr,
1373 const Array *p_noise_y = nullptr,
1374 const Array *p_stretching = nullptr,
1375 glm::vec2 center = {0.5f, 0.5f},
1376 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1377
1398Array slope(glm::ivec2 shape,
1399 float angle,
1400 float slope,
1401 const Array *p_ctrl_param = nullptr,
1402 const Array *p_noise_x = nullptr,
1403 const Array *p_noise_y = nullptr,
1404 const Array *p_stretching = nullptr,
1405 glm::vec2 center = {0.5f, 0.5f},
1406 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1407
1411Array smooth_cosine(glm::ivec2 shape,
1412 const Array *p_noise_x,
1413 const Array *p_noise_y,
1414 glm::vec2 center = {0.5f, 0.5f},
1415 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1416
1438Array step(glm::ivec2 shape,
1439 float angle,
1440 float slope,
1441 const Array *p_ctrl_param = nullptr,
1442 const Array *p_noise_x = nullptr,
1443 const Array *p_noise_y = nullptr,
1444 const Array *p_stretching = nullptr,
1445 glm::vec2 center = {0.5f, 0.5f},
1446 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1447
1465void swirl(Array &dx,
1466 Array &dy,
1467 float amplitude = 1.f,
1468 float exponent = 1.f,
1469 const Array *p_noise = nullptr,
1470 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1471
1488Array wave_dune(glm::ivec2 shape,
1489 float kw,
1490 float angle,
1491 float xtop,
1492 float xbottom,
1493 float phase_shift = 0.f,
1494 const Array *p_noise_x = nullptr,
1495 const Array *p_noise_y = nullptr,
1496 const Array *p_stretching = nullptr,
1497 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1498
1518Array wave_sine(glm::ivec2 shape,
1519 float kw,
1520 float angle,
1521 float phase_shift = 0.f,
1522 const Array *p_noise_x = nullptr,
1523 const Array *p_noise_y = nullptr,
1524 const Array *p_stretching = nullptr,
1525 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1526
1546Array wave_square(glm::ivec2 shape,
1547 float kw,
1548 float angle,
1549 float phase_shift = 0.f,
1550 const Array *p_noise_x = nullptr,
1551 const Array *p_noise_y = nullptr,
1552 const Array *p_stretching = nullptr,
1553 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1554
1576Array wave_triangular(glm::ivec2 shape,
1577 float kw,
1578 float angle,
1579 float slant_ratio,
1580 float phase_shift = 0.f,
1581 const Array *p_noise_x = nullptr,
1582 const Array *p_noise_y = nullptr,
1583 const Array *p_stretching = nullptr,
1584 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1585
1603Array white(glm::ivec2 shape, float a, float b, uint seed);
1604
1618Array white_density_map(const Array &density_map, uint seed);
1619
1639Array white_sparse(glm::ivec2 shape,
1640 float a,
1641 float b,
1642 float density,
1643 uint seed);
1644
1654Array white_sparse_binary(glm::ivec2 shape, float density, uint seed);
1655
1679Array worley_double(glm::ivec2 shape,
1680 glm::vec2 kw,
1681 uint seed,
1682 float ratio = 0.5f,
1683 float k = 0.f,
1684 const Array *p_ctrl_param = nullptr,
1685 const Array *p_noise_x = nullptr,
1686 const Array *p_noise_y = nullptr,
1687 const Array *p_stretching = nullptr,
1688 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1689
1690} // namespace hmap
1691
1692namespace hmap::gpu
1693{
1694
1728Array badlands(glm::ivec2 shape,
1729 glm::vec2 kw,
1730 uint seed,
1731 int octaves = 8,
1732 float rugosity = 0.2f,
1733 float angle = 30.f,
1734 float k_smoothing = 0.1f,
1735 float base_noise_amp = 0.2f,
1736 const Array *p_noise_x = nullptr,
1737 const Array *p_noise_y = nullptr,
1738 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1739
1816Array basalt_field(glm::ivec2 shape,
1817 glm::vec2 kw,
1818 uint seed,
1819 float warp_kw = 4.f,
1820 float large_scale_warp_amp = 0.2f,
1821 float large_scale_gain = 6.f,
1822 float large_scale_amp = 0.2f,
1823 float medium_scale_kw_ratio = 3.f,
1824 float medium_scale_warp_amp = 1.f,
1825 float medium_scale_gain = 7.f,
1826 float medium_scale_amp = 0.08f,
1827 float small_scale_kw_ratio = 10.f,
1828 float small_scale_amp = 0.1f,
1829 float small_scale_overlay_amp = 0.002f,
1830 float rugosity_kw_ratio = 1.f,
1831 float rugosity_amp = 1.f,
1832 bool flatten_activate = true,
1833 float flatten_kw_ratio = 1.f,
1834 float flatten_amp = 0.f,
1835 const Array *p_noise_x = nullptr,
1836 const Array *p_noise_y = nullptr,
1837 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1838
1862Array gabor_wave(glm::ivec2 shape,
1863 glm::vec2 kw,
1864 uint seed,
1865 const Array &angle,
1866 float angle_spread_ratio = 1.f,
1867 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1868
1869Array gabor_wave(glm::ivec2 shape,
1870 glm::vec2 kw,
1871 uint seed,
1872 float angle = 0.f,
1873 float angle_spread_ratio = 1.f,
1874 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1875
1908Array gabor_wave_fbm(glm::ivec2 shape,
1909 glm::vec2 kw,
1910 uint seed,
1911 const Array &angle,
1912 float angle_spread_ratio = 1.f,
1913 int octaves = 8,
1914 float weight = 0.7f,
1915 float persistence = 0.5f,
1916 float lacunarity = 2.f,
1917 const Array *p_ctrl_param = nullptr,
1918 const Array *p_noise_x = nullptr,
1919 const Array *p_noise_y = nullptr,
1920 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1921
1922Array gabor_wave_fbm(glm::ivec2 shape,
1923 glm::vec2 kw,
1924 uint seed,
1925 float angle = 0.f,
1926 float angle_spread_ratio = 1.f,
1927 int octaves = 8,
1928 float weight = 0.7f,
1929 float persistence = 0.5f,
1930 float lacunarity = 2.f,
1931 const Array *p_ctrl_param = nullptr,
1932 const Array *p_noise_x = nullptr,
1933 const Array *p_noise_y = nullptr,
1934 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
1935
1983Array gavoronoise(glm::ivec2 shape,
1984 glm::vec2 kw,
1985 uint seed,
1986 const Array &angle,
1987 float amplitude = 0.05f,
1988 float angle_spread_ratio = 1.f,
1989 glm::vec2 kw_multiplier = {4.f, 4.f},
1990 float slope_strength = 1.f,
1991 float branch_strength = 2.f,
1992 float z_cut_min = 0.2f,
1993 float z_cut_max = 1.f,
1994 int octaves = 8,
1995 float persistence = 0.4f,
1996 float lacunarity = 2.f,
1997 const Array *p_ctrl_param = nullptr,
1998 const Array *p_noise_x = nullptr,
1999 const Array *p_noise_y = nullptr,
2000 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2001
2002Array gavoronoise(glm::ivec2 shape,
2003 glm::vec2 kw,
2004 uint seed,
2005 float angle = 0.f,
2006 float amplitude = 0.05f,
2007 float angle_spread_ratio = 1.f,
2008 glm::vec2 kw_multiplier = {4.f, 4.f},
2009 float slope_strength = 1.f,
2010 float branch_strength = 2.f,
2011 float z_cut_min = 0.2f,
2012 float z_cut_max = 1.f,
2013 int octaves = 8,
2014 float persistence = 0.4f,
2015 float lacunarity = 2.f,
2016 const Array *p_ctrl_param = nullptr,
2017 const Array *p_noise_x = nullptr,
2018 const Array *p_noise_y = nullptr,
2019 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2020
2021Array gavoronoise(const Array &base,
2022 glm::vec2 kw,
2023 uint seed,
2024 float amplitude = 0.05f,
2025 glm::vec2 kw_multiplier = {4.f, 4.f},
2026 float slope_strength = 1.f,
2027 float branch_strength = 2.f,
2028 float z_cut_min = 0.2f,
2029 float z_cut_max = 1.f,
2030 int octaves = 8,
2031 float persistence = 0.4f,
2032 float lacunarity = 2.f,
2033 const Array *p_ctrl_param = nullptr,
2034 const Array *p_noise_x = nullptr,
2035 const Array *p_noise_y = nullptr,
2036 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2037
2066Array hemisphere_field(glm::ivec2 shape,
2067 glm::vec2 kw,
2068 uint seed,
2069 float rmin = 0.05f,
2070 float rmax = 0.8f,
2071 float amplitude_random_ratio = 1.f,
2072 float density = 0.1f,
2073 glm::vec2 jitter = {1.f, 1.f},
2074 float shift = 0.f,
2075 const Array *p_noise_x = nullptr,
2076 const Array *p_noise_y = nullptr,
2077 const Array *p_noise_distance = nullptr,
2078 const Array *p_density_multiplier = nullptr,
2079 const Array *p_size_multiplier = nullptr,
2080 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2081
2083Array hemisphere_field_fbm(glm::ivec2 shape,
2084 glm::vec2 kw,
2085 uint seed,
2086 float rmin = 0.05f,
2087 float rmax = 0.8f,
2088 float amplitude_random_ratio = 1.f,
2089 float density = 0.1f,
2090 glm::vec2 jitter = {0.5f, 0.5f},
2091 float shift = 0.1f,
2092 int octaves = 8,
2093 float persistence = 0.5f,
2094 float lacunarity = 2.f,
2095 const Array *p_noise_x = nullptr,
2096 const Array *p_noise_y = nullptr,
2097 const Array *p_noise_distance = nullptr,
2098 const Array *p_density_multiplier = nullptr,
2099 const Array *p_size_multiplier = nullptr,
2100 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2101
2140Array island(const Array &land_mask,
2141 const Array *p_noise_r = nullptr,
2142 float apex_elevation = 1.f,
2143 bool filter_distance = true,
2144 int filter_ir = 32,
2145 float slope_min = 0.1f,
2146 float slope_max = 8.f,
2147 float slope_start = 0.5f,
2148 float slope_end = 1.f,
2149 float slope_noise_intensity = 0.5f,
2150 float k_smooth = 0.05f,
2151 float radial_noise_intensity = 0.3f,
2152 float radial_profile_gain = 2.f,
2153 float water_decay = 0.05f,
2154 float water_depth = 0.3f,
2155 float lee_angle = 30.f,
2156 float lee_amp = 0.f,
2157 float uplift_amp = 0.f,
2158 Array *p_water_depth = nullptr,
2159 Array *p_inland_mask = nullptr);
2160
2204Array island(const Array &land_mask,
2205 uint seed,
2206 float noise_amp = 0.07f,
2207 glm::vec2 noise_kw = {4.f, 4.f},
2208 int noise_octaves = 8,
2209 float noise_rugosity = 0.7f,
2210 float noise_angle = 45.f,
2211 float noise_k_smoothing = 0.05f,
2212 float apex_elevation = 1.f,
2213 bool filter_distance = true,
2214 int filter_ir = 32,
2215 float slope_min = 0.1f,
2216 float slope_max = 8.f,
2217 float slope_start = 0.5f,
2218 float slope_end = 1.f,
2219 float slope_noise_intensity = 0.5f,
2220 float k_smooth = 0.05f,
2221 float radial_noise_intensity = 0.3f,
2222 float radial_profile_gain = 2.f,
2223 float water_decay = 0.05f,
2224 float water_depth = 0.3f,
2225 float lee_angle = 30.f,
2226 float lee_amp = 0.f,
2227 float uplift_amp = 0.f,
2228 Array *p_water_depth = nullptr,
2229 Array *p_inland_mask = nullptr);
2230
2278Array mountain_cone(glm::ivec2 shape,
2279 uint seed,
2280 float scale = 1.f,
2281 int octaves = 8,
2282 float peak_kw = 4.f,
2283 float rugosity = 0.f,
2284 float angle = 45.f,
2285 float k_smoothing = 0.f,
2286 float gamma = 0.5f,
2287 float cone_alpha = 1.f,
2288 float ridge_amp = 0.4f,
2289 float base_noise_amp = 0.05f,
2290 glm::vec2 center = {0.5f, 0.5f},
2291 const Array *p_noise_x = nullptr,
2292 const Array *p_noise_y = nullptr,
2293 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2294
2340Array mountain_inselberg(glm::ivec2 shape,
2341 uint seed,
2342 float scale = 1.f,
2343 int octaves = 8,
2344 float rugosity = 0.2f,
2345 float angle = 45.f,
2346 float gamma = 1.1f,
2347 bool round_shape = false,
2348 bool add_deposition = true,
2349 float bulk_amp = 0.2f,
2350 float base_noise_amp = 0.2f,
2351 float k_smoothing = 0.1f,
2352 glm::vec2 center = {0.5f, 0.5f},
2353 const Array *p_noise_x = nullptr,
2354 const Array *p_noise_y = nullptr,
2355 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2356
2406Array mountain_range_radial(glm::ivec2 shape,
2407 glm::vec2 kw,
2408 uint seed,
2409 float half_width = 0.2f,
2410 float angle_spread_ratio = 0.5f,
2411 float core_size_ratio = 1.f,
2412 glm::vec2 center = {0.5f, 0.5f},
2413 int octaves = 8,
2414 float weight = 0.7f,
2415 float persistence = 0.5f,
2416 float lacunarity = 2.f,
2417 const Array *p_ctrl_param = nullptr,
2418 const Array *p_noise_x = nullptr,
2419 const Array *p_noise_y = nullptr,
2420 const Array *p_angle = nullptr,
2421 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2422
2468Array mountain_stump(glm::ivec2 shape,
2469 uint seed,
2470 float scale = 1.f,
2471 int octaves = 8,
2472 float peak_kw = 6.f,
2473 float rugosity = 0.f,
2474 float angle = 45.f,
2475 float k_smoothing = 0.f,
2476 float gamma = 0.25f,
2477 bool add_deposition = true,
2478 float ridge_amp = 0.75f,
2479 float base_noise_amp = 0.1f,
2480 glm::vec2 center = {0.5f, 0.5f},
2481 const Array *p_noise_x = nullptr,
2482 const Array *p_noise_y = nullptr,
2483 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2484
2530Array mountain_tibesti(glm::ivec2 shape,
2531 uint seed,
2532 float scale = 1.f,
2533 int octaves = 8,
2534 float peak_kw = 20.f,
2535 float rugosity = 0.f,
2536 float angle = 30.f,
2537 float angle_spread_ratio = 0.25f,
2538 float gamma = 1.f,
2539 bool add_deposition = true,
2540 float bulk_amp = 1.f,
2541 float base_noise_amp = 0.1f,
2542 glm::vec2 center = {0.5f, 0.5f},
2543 const Array *p_noise_x = nullptr,
2544 const Array *p_noise_y = nullptr,
2545 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2546
2579Array multisteps(glm::ivec2 shape,
2580 float angle,
2581 uint seed,
2582 glm::vec2 kw = {2.f, 2.f},
2583 float noise_amp = 0.1f,
2584 float noise_rugosity = 0.f,
2585 bool noise_inflate = true,
2586 float r = 1.2f,
2587 int nsteps = 8,
2588 float elevation_exponent = 0.7f,
2589 float shape_gain = 4.f,
2590 float scale = 0.5f,
2591 float outer_slope = 0.1f,
2592 const Array *p_ctrl_param = nullptr,
2593 const glm::vec2 &center = {0.5f, 0.5f},
2594 const glm::vec4 &bbox = {0.f, 1.f, 0.f, 1.f});
2595
2597Array noise(NoiseType noise_type,
2598 glm::ivec2 shape,
2599 glm::vec2 kw,
2600 uint seed,
2601 const Array *p_noise_x = nullptr,
2602 const Array *p_noise_y = nullptr,
2603 const Array *p_stretching = nullptr,
2604 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2605
2607Array noise_fbm(NoiseType noise_type,
2608 glm::ivec2 shape,
2609 glm::vec2 kw,
2610 uint seed,
2611 int octaves = 8,
2612 float weight = 0.7f,
2613 float persistence = 0.5f,
2614 float lacunarity = 2.f,
2615 const Array *p_ctrl_param = nullptr,
2616 const Array *p_noise_x = nullptr,
2617 const Array *p_noise_y = nullptr,
2618 const Array *p_stretching = nullptr,
2619 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2620
2647Array plates(glm::ivec2 shape,
2648 glm::vec2 kw,
2649 uint seed,
2650 float talus,
2651 int direction = 0,
2652 float mix_ratio = 0.9f,
2653 float base_noise_amp = 0.05f,
2654 float kw_multiplier = 2.f,
2655 int octaves = 8,
2656 float rugosity = 0.f,
2657 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2658
2704Array polygon_field(glm::ivec2 shape,
2705 glm::vec2 kw,
2706 uint seed,
2707 float rmin = 0.05f,
2708 float rmax = 0.8f,
2709 float clamping_dist = 0.1f,
2710 float clamping_k = 0.1f,
2711 int n_vertices_min = 3,
2712 int n_vertices_max = 16,
2713 float density = 0.5f,
2714 glm::vec2 jitter = {0.5f, 0.5f},
2715 float shift = 0.1f,
2716 const Array *p_noise_x = nullptr,
2717 const Array *p_noise_y = nullptr,
2718 const Array *p_noise_distance = nullptr,
2719 const Array *p_density_multiplier = nullptr,
2720 const Array *p_size_multiplier = nullptr,
2721 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2722
2767Array polygon_field_fbm(glm::ivec2 shape,
2768 glm::vec2 kw,
2769 uint seed,
2770 float rmin = 0.05f,
2771 float rmax = 0.8f,
2772 float clamping_dist = 0.1f,
2773 float clamping_k = 0.1f,
2774 int n_vertices_min = 3,
2775 int n_vertices_max = 16,
2776 float density = 0.1f,
2777 glm::vec2 jitter = {0.5f, 0.5f},
2778 float shift = 0.1f,
2779 int octaves = 8,
2780 float persistence = 0.5f,
2781 float lacunarity = 2.f,
2782 const Array *p_noise_x = nullptr,
2783 const Array *p_noise_y = nullptr,
2784 const Array *p_noise_distance = nullptr,
2785 const Array *p_density_multiplier = nullptr,
2786 const Array *p_size_multiplier = nullptr,
2787 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2788
2833Array shattered_peak(glm::ivec2 shape,
2834 uint seed,
2835 float scale = 1.f,
2836 int octaves = 8,
2837 float peak_kw = 4.f,
2838 float rugosity = 0.f,
2839 float angle = 30.f,
2840 float gamma = 1.f,
2841 bool add_deposition = true,
2842 float bulk_amp = 0.3f,
2843 float base_noise_amp = 0.1f,
2844 float k_smoothing = 0.f,
2845 glm::vec2 center = {0.5f, 0.5f},
2846 const Array *p_noise_x = nullptr,
2847 const Array *p_noise_y = nullptr,
2848 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
2849
2895Array vorolines(glm::ivec2 shape,
2896 float density,
2897 uint seed,
2898 float k_smoothing = 0.f,
2899 float exp_sigma = 0.f,
2900 float alpha = 0.f,
2901 float alpha_span = M_PI,
2903 const Array *p_noise_x = nullptr,
2904 const Array *p_noise_y = nullptr,
2905 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
2906 glm::vec4 bbox_points = {0.f, 1.f, 0.f, 1.f});
2907
2963Array vorolines_fbm(
2964 glm::ivec2 shape,
2965 float density,
2966 uint seed,
2967 float k_smoothing = 0.f,
2968 float exp_sigma = 0.f,
2969 float alpha = 0.f,
2970 float alpha_span = M_PI,
2972 int octaves = 8,
2973 float weight = 0.7f,
2974 float persistence = 0.5f,
2975 float lacunarity = 2.f,
2976 const Array *p_noise_x = nullptr,
2977 const Array *p_noise_y = nullptr,
2978 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
2979 glm::vec4 bbox_points = {0.f, 1.f, 0.f, 1.f});
2980
3020Array voronoi(glm::ivec2 shape,
3021 glm::vec2 kw,
3022 uint seed,
3023 glm::vec2 jitter = {0.5f, 0.5f},
3024 float k_smoothing = 0.f,
3025 float exp_sigma = 0.f,
3027 const Array *p_ctrl_param = nullptr,
3028 const Array *p_noise_x = nullptr,
3029 const Array *p_noise_y = nullptr,
3030 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3031
3078Array voronoi_fbm(glm::ivec2 shape,
3079 glm::vec2 kw,
3080 uint seed,
3081 glm::vec2 jitter = {0.5f, 0.5f},
3082 float k_smoothing = 0.f,
3083 float exp_sigma = 0.f,
3085 int octaves = 8,
3086 float weight = 0.7f,
3087 float persistence = 0.5f,
3088 float lacunarity = 2.f,
3089 const Array *p_ctrl_param = nullptr,
3090 const Array *p_noise_x = nullptr,
3091 const Array *p_noise_y = nullptr,
3092 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3093
3120Array voronoi_edge_distance(glm::ivec2 shape,
3121 glm::vec2 kw,
3122 uint seed,
3123 glm::vec2 jitter = {0.5f, 0.5f},
3124 const Array *p_ctrl_param = nullptr,
3125 const Array *p_noise_x = nullptr,
3126 const Array *p_noise_y = nullptr,
3127 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3128
3165Array voronoise(glm::ivec2 shape,
3166 glm::vec2 kw,
3167 float u_param,
3168 float v_param,
3169 uint seed,
3170 const Array *p_noise_x = nullptr,
3171 const Array *p_noise_y = nullptr,
3172 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3173
3201Array voronoise_fbm(glm::ivec2 shape,
3202 glm::vec2 kw,
3203 float u_param,
3204 float v_param,
3205 uint seed,
3206 int octaves = 8,
3207 float weight = 0.7f,
3208 float persistence = 0.5f,
3209 float lacunarity = 2.f,
3210 const Array *p_ctrl_param = nullptr,
3211 const Array *p_noise_x = nullptr,
3212 const Array *p_noise_y = nullptr,
3213 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3214
3263Array vororand(glm::ivec2 shape,
3264 float density,
3265 float variability,
3266 uint seed,
3267 float k_smoothing = 0.f,
3268 float exp_sigma = 0.f,
3270 const Array *p_noise_x = nullptr,
3271 const Array *p_noise_y = nullptr,
3272 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f},
3273 glm::vec4 bbox_points = {0.f, 1.f, 0.f, 1.f});
3274
3275Array vororand(glm::ivec2 shape,
3276 const std::vector<float> &xp,
3277 const std::vector<float> &yp,
3278 float k_smoothing = 0.f,
3279 float exp_sigma = 0.f,
3281 const Array *p_noise_x = nullptr,
3282 const Array *p_noise_y = nullptr,
3283 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3284
3341Array wavelet_noise(glm::ivec2 shape,
3342 glm::vec2 kw,
3343 uint seed,
3344 float kw_multiplier = 2.f,
3345 float vorticity = 0.f,
3346 float density = 1.f,
3347 int octaves = 8,
3348 float weight = 0.7f,
3349 float persistence = 0.5f,
3350 float lacunarity = 2.f,
3351 const Array *p_ctrl_param = nullptr,
3352 const Array *p_noise_x = nullptr,
3353 const Array *p_noise_y = nullptr,
3354 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
3355
3356} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
unsigned int uint
Definition array.hpp:14
Implements hydraulic and thermal erosion algorithms for terrain modeling, including particle-based fl...
Defines modular function objects for procedural generation, including noise algorithms (Perlin,...
Definition blending.hpp:186
Array voronoi(glm::ivec2 shape, glm::vec2 kw, uint seed, glm::vec2 jitter={0.5f, 0.5f}, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a Voronoi diagram in a 2D array with configurable properties.
Definition primitives_gpu.cpp:828
Array mountain_cone(glm::ivec2 shape, uint seed, float scale=1.f, int octaves=8, float peak_kw=4.f, float rugosity=0.f, float angle=45.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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a procedural "mountain cone" heightmap using fractal noise and Voronoi patterns.
Definition mountain_cone.cpp:13
Array noise_fbm(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, 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_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
See hmap::noise_fbm.
Definition primitives_gpu.cpp:530
Array polygon_field_fbm(glm::ivec2 shape, glm::vec2 kw, uint seed, float rmin=0.05f, float rmax=0.8f, float clamping_dist=0.1f, float clamping_k=0.1f, int n_vertices_min=3, int n_vertices_max=16, float density=0.1f, glm::vec2 jitter={0.5f, 0.5f}, float shift=0.1f, int octaves=8, float persistence=0.5f, float lacunarity=2.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_noise_distance=nullptr, const Array *p_density_multiplier=nullptr, const Array *p_size_multiplier=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a scalar field representing the signed distance to randomly generated polygons combined wit...
Definition primitives_gpu.cpp:638
Array wavelet_noise(glm::ivec2 shape, glm::vec2 kw, uint seed, float kw_multiplier=2.f, float vorticity=0.f, float density=1.f, 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates 2D wavelet noise using an OpenCL kernel.
Definition primitives_gpu.cpp:1129
Array voronoi_edge_distance(glm::ivec2 shape, glm::vec2 kw, uint seed, glm::vec2 jitter={0.5f, 0.5f}, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Computes the Voronoi edge distance.
Definition primitives_gpu.cpp:1001
Array gabor_wave_fbm(glm::ivec2 shape, glm::vec2 kw, uint seed, const Array &angle, float angle_spread_ratio=1.f, 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence Gabor noise.
Definition primitives_gpu.cpp:85
Array hemisphere_field(glm::ivec2 shape, glm::vec2 kw, uint seed, float rmin=0.05f, float rmax=0.8f, float amplitude_random_ratio=1.f, float density=0.1f, glm::vec2 jitter={1.f, 1.f}, float shift=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_noise_distance=nullptr, const Array *p_density_multiplier=nullptr, const Array *p_size_multiplier=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a scalar field representing the signed distance to randomly generated hemispheres.
Definition primitives_gpu.cpp:324
Array mountain_range_radial(glm::ivec2 shape, glm::vec2 kw, uint 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a heightmap representing a radial mountain range.
Definition primitives_gpu.cpp:438
Array vorolines(glm::ivec2 shape, float density, uint seed, float k_smoothing=0.f, float exp_sigma=0.f, float alpha=0.f, float alpha_span=M_PI, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, glm::vec4 bbox_points={0.f, 1.f, 0.f, 1.f})
Generates a Voronoi-based pattern where cells are defined by proximity to random lines.
Definition primitives_gpu.cpp:704
Array gabor_wave(glm::ivec2 shape, glm::vec2 kw, uint seed, const Array &angle, float angle_spread_ratio=1.f, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence Gabor noise.
Definition primitives_gpu.cpp:42
Array mountain_inselberg(glm::ivec2 shape, uint 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 k_smoothing=0.1f, glm::vec2 center={0.5f, 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})
Generates a synthetic mountain-like inselberg (isolated hill) heightmap.
Definition mountain_inselberg.cpp:13
Array gavoronoise(glm::ivec2 shape, glm::vec2 kw, uint seed, const Array &angle, float amplitude=0.05f, float angle_spread_ratio=1.f, glm::vec2 kw_multiplier={4.f, 4.f}, float slope_strength=1.f, float branch_strength=2.f, float z_cut_min=0.2f, float z_cut_max=1.f, int octaves=8, float persistence=0.4f, float lacunarity=2.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a 2D array using the GavoroNoise algorithm, which is a procedural noise technique for terra...
Definition primitives_gpu.cpp:166
Array badlands(glm::ivec2 shape, glm::vec2 kw, uint seed, int octaves=8, float rugosity=0.2f, float angle=30.f, float k_smoothing=0.1f, float base_noise_amp=0.2f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a synthetic "badlands" terrain heightmap.
Definition badlands.cpp:13
Array mountain_stump(glm::ivec2 shape, uint 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a mountain-like heightmap with a flattened (stump-shaped) peak.
Definition mountain_stump.cpp:13
Array rugosity(const Array &z, int ir, bool convex=true)
See hmap::rugosity.
Definition features_gpu.cpp:72
Array multisteps(glm::ivec2 shape, float angle, uint seed, glm::vec2 kw={2.f, 2.f}, float noise_amp=0.1f, float noise_rugosity=0.f, bool noise_inflate=true, float r=1.2f, int nsteps=8, float elevation_exponent=0.7f, float shape_gain=4.f, float scale=0.5f, float outer_slope=0.1f, const Array *p_ctrl_param=nullptr, const glm::vec2 &center={0.5f, 0.5f}, const glm::vec4 &bbox={0.f, 1.f, 0.f, 1.f})
GPU-accelerated multi-step height generation with procedural noise.
Definition multisteps.cpp:83
Array voronoise(glm::ivec2 shape, glm::vec2 kw, float u_param, float v_param, uint seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a 2D Voronoi noise array.
Definition primitives_gpu.cpp:920
Array mountain_tibesti(glm::ivec2 shape, uint 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a synthetic "Tibesti" mountain heightmap.
Definition mountain_tibesti.cpp:13
Array noise(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
See hmap::noise.
Definition primitives_gpu.cpp:493
Array shattered_peak(glm::ivec2 shape, uint 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 k_smoothing=0.f, glm::vec2 center={0.5f, 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})
Generates a synthetic "shattered peak" terrain heightmap.
Definition shattered_peak.cpp:13
Array polygon_field(glm::ivec2 shape, glm::vec2 kw, uint seed, float rmin=0.05f, float rmax=0.8f, float clamping_dist=0.1f, float clamping_k=0.1f, int n_vertices_min=3, int n_vertices_max=16, float density=0.5f, glm::vec2 jitter={0.5f, 0.5f}, float shift=0.1f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_noise_distance=nullptr, const Array *p_density_multiplier=nullptr, const Array *p_size_multiplier=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a scalar field representing the signed distance to randomly generated polygons.
Definition primitives_gpu.cpp:578
Array vorolines_fbm(glm::ivec2 shape, float density, uint seed, float k_smoothing=0.f, float exp_sigma=0.f, float alpha=0.f, float alpha_span=M_PI, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, glm::vec4 bbox_points={0.f, 1.f, 0.f, 1.f})
Generates a Voronoi-based pattern using distances to lines defined by random points and angles,...
Definition primitives_gpu.cpp:783
Array voronoi_fbm(glm::ivec2 shape, glm::vec2 kw, uint seed, glm::vec2 jitter={0.5f, 0.5f}, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a Voronoi diagram in a 2D array with configurable properties.
Definition primitives_gpu.cpp:870
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:108
Array hemisphere_field_fbm(glm::ivec2 shape, glm::vec2 kw, uint seed, float rmin=0.05f, float rmax=0.8f, float amplitude_random_ratio=1.f, float density=0.1f, glm::vec2 jitter={0.5f, 0.5f}, float shift=0.1f, int octaves=8, float persistence=0.5f, float lacunarity=2.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_noise_distance=nullptr, const Array *p_density_multiplier=nullptr, const Array *p_size_multiplier=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
See hmap::hemisphere_field.
Definition primitives_gpu.cpp:378
Array voronoise_fbm(glm::ivec2 shape, glm::vec2 kw, float u_param, float v_param, uint seed, 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, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence Voronoise.
Definition primitives_gpu.cpp:955
Array vororand(glm::ivec2 shape, float density, float variability, uint seed, float k_smoothing=0.f, float exp_sigma=0.f, VoronoiReturnType return_type=VoronoiReturnType::F1_SQUARED, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, glm::vec4 bbox_points={0.f, 1.f, 0.f, 1.f})
Generates a 2D Voronoi-based scalar field using OpenCL.
Definition primitives_gpu.cpp:1037
Array basalt_field(glm::ivec2 shape, glm::vec2 kw, uint 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, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a synthetic procedural terrain resembling basaltic landforms.
Definition basalt_field.cpp:13
Array plates(glm::ivec2 shape, glm::vec2 kw, uint seed, float talus, int direction=0, float mix_ratio=0.9f, float base_noise_amp=0.05f, float kw_multiplier=2.f, int octaves=8, float rugosity=0.f, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generate a tectonic plate–like heightfield using Voronoi FBM and directional talus projection.
Definition plates.cpp:11
Definition algebra.hpp:22
Array white(glm::ivec2 shape, float a, float b, uint seed)
Return an array filled with white noise.
Definition white.cpp:12
Array noise_pingpong(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, 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_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence fbm pingpong noise.
Definition noise.cpp:194
Array bump(glm::ivec2 shape, float gain=1.f, 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 a bump.
Definition primitives.cpp:41
Array noise_ridged(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float k_smoothing=0.1f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence fbm ridged noise.
Definition noise.cpp:230
ErosionProfile
Procedural erosion angular profile type.
Definition erosion.hpp:44
@ TRIANGLE_GRENIER
Definition erosion.hpp:50
Array dendry(glm::ivec2 shape, glm::vec2 kw, uint seed, Array &control_function, float eps=0.05, int resolution=1, float displacement=0.075, int primitives_resolution_steps=3, float slope_power=2.f, float noise_amplitude_proportion=0.01, bool add_control_function=true, float control_function_overlap=0.5f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f}, int subsampling=1)
Dendry is a locally computable procedural function that generates branching patterns at various scale...
Definition dendry.cpp:19
Array constant(glm::ivec2 shape, float value=0.f)
Return a constant value array.
Definition primitives.cpp:102
Array biquad_pulse(glm::ivec2 shape, float gain=1.f, 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 a 'biquadratic pulse'.
Definition primitives.cpp:19
Array cubic_pulse(glm::ivec2 shape)
Generates a cubic pulse kernel array.
Definition kernels.cpp:97
Array worley_double(glm::ivec2 shape, glm::vec2 kw, uint seed, float ratio=0.5f, float k=0.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with the maximum of two Worley (cellular) noises.
Definition worley.cpp:15
Array bump_lorentzian(glm::ivec2 shape, float shape_factor=0.5f, float radius=0.5f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec2 center={0.5f, 0.5f}, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a 2D Lorentzian bump pattern.
Definition primitives.cpp:63
Array diffusion_limited_aggregation(glm::ivec2 shape, float scale, uint seed, float seeding_radius=0.4f, float seeding_outer_radius_ratio=0.2f, float slope=8.f, float noise_ratio=0.2f)
Generates a diffusion-limited aggregation (DLA) pattern.
Definition diffusion_limited_aggregation.cpp:14
Array checkerboard(glm::ivec2 shape, glm::vec2 kw, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a checkerboard heightmap.
Definition checkerboard.cpp:12
Array crater(glm::ivec2 shape, float radius, float depth, float lip_decay, float lip_height_ratio=0.5f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec2 center={0.5f, 0.5f}, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a crater-shaped heightmap.
Definition geo.cpp:94
PrimitiveType
Defines the primitive shape used for synthesis.
Definition primitives.hpp:53
@ PRIM_BIQUAD_PULSE
Definition primitives.hpp:54
@ PRIM_CONE_SMOOTH
Definition primitives.hpp:57
@ PRIM_BUMP
Definition primitives.hpp:55
@ PRIM_SMOOTH_COSINE
Definition primitives.hpp:59
@ PRIM_CUBIC_PULSE
Definition primitives.hpp:58
@ PRIM_CONE
Definition primitives.hpp:56
Array noise_parberry(glm::ivec2 shape, glm::vec2 kw, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float mu=1.02f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherent fbm Parberry variant of Perlin noise.
Definition noise.cpp:159
Array phasor(PhasorProfile phasor_profile, glm::ivec2 shape, float kw, const Array &angle, uint seed, float profile_delta=0.1f, float density_factor=1.f, float kernel_width_ratio=2.f, float phase_smoothing=2.f)
Generates a phasor noise field based on a Gabor noise model and phase profile.
Definition phasor.cpp:16
Array noise(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence noise.
Definition noise.cpp:16
Array white_density_map(const Array &density_map, uint seed)
Return an array filled 1 with a probability based on a density map.
Definition white.cpp:24
PhasorProfile
Phasor angular profile type.
Definition math.hpp:54
Array wave_dune(glm::ivec2 shape, float kw, float angle, float xtop, float xbottom, float phase_shift=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a dune shape wave.
Definition wave.cpp:15
Array gaussian_pulse(glm::ivec2 shape, float sigma, 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 a gaussian_decay pulse kernel.
Definition primitives.cpp:163
Array peak(glm::ivec2 shape, float radius, const Array *p_noise, float noise_r_amp, float noise_z_ratio, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a peak-shaped heightmap.
Definition geo.cpp:122
Array cone_complex(glm::ivec2 shape, float alpha, float radius=0.5f, bool smooth_profile=true, float valley_amp=0.2f, int valley_nb=5, float valley_decay_ratio=0.5f, float valley_angle0=15.f, const ErosionProfile &erosion_profile=ErosionProfile::TRIANGLE_GRENIER, float erosion_delta=0.01f, float radial_waviness_amp=0.05f, float radial_waviness_kw=2.f, float bias_angle=30.f, float bias_amp=0.75f, float bias_exponent=1.f, glm::vec2 center={0.5f, 0.5f}, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a complex conical heightfield with valleys, directional bias, and radial waviness.
Definition cone.cpp:73
Array cone_sigmoid(glm::ivec2 shape, float alpha, float radius=0.5f, glm::vec2 center={0.5f, 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})
Generates a smooth conical heightmap using a sigmoid-based profile.
Definition cone.cpp:154
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:279
void swirl(Array &dx, Array &dy, float amplitude=1.f, float exponent=1.f, const Array *p_noise=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generate displacements dx and dy to apply a swirl effect to another primitve.
Definition swirl.cpp:16
Array rift(glm::ivec2 shape, float angle, float slope, float width, bool sharp_bottom=false, 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 a rift function (Heaviside with an optional talus slope at the transition).
Definition primitives.cpp:250
Array step(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 a step function (Heaviside with an optional talus slope at the transition).
Definition primitives.cpp:332
Array island_land_mask(glm::ivec2 shape, float radius, uint 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 glm::vec4 &bbox={0.f, 1.f, 0.f, 1.f})
Generates a 2D island mask by perturbing a radial boundary with noise.
Definition island.cpp:16
Array noise_jordan(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float warp0=0.4f, float damp0=1.f, float warp_scale=0.4f, float damp_scale=1.f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence fbm noise.
Definition noise.cpp:115
Array phasor_fbm(PhasorProfile phasor_profile, glm::ivec2 shape, float kw, const Array &angle, uint seed, float profile_delta=0.1f, float density_factor=1.f, float kernel_width_ratio=2.f, float phase_smoothing=2.f, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f)
Generates a fractal Brownian motion (fBm) noise field using layered phasor profiles.
Definition phasor.cpp:111
VoronoiReturnType
Selects the value returned by the Voronoi evaluation.
Definition primitives.hpp:36
@ EDGE_DISTANCE_SQUARED
Squared edge distance.
Definition primitives.hpp:43
@ F1_SQUARED
Returns F1^2.
Definition primitives.hpp:37
@ CONSTANT_F2MF1_SQUARED
Constant × (F2 - F1)^2.
Definition primitives.hpp:45
@ F2_SQUARED
Returns F2^2.
Definition primitives.hpp:38
@ CONSTANT
Constant value.
Definition primitives.hpp:44
@ F1TF2_SQUARED
Returns (F1 * F2)^2.
Definition primitives.hpp:39
@ F2MF1_SQUARED
Returns (F2 - F1)^2.
Definition primitives.hpp:41
@ F1DF2_SQUARED
Returns (F1 / F2)^2.
Definition primitives.hpp:40
@ EDGE_DISTANCE_EXP
Exponential edge distance.
Definition primitives.hpp:42
Array paraboloid(glm::ivec2 shape, float angle, float a, float b, float v0=0.f, bool reverse_x=false, bool reverse_y=false, 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 a paraboloid.
Definition primitives.cpp:185
Array caldera(glm::ivec2 shape, float radius, float sigma_inner, float sigma_outer, float z_bottom, const Array *p_noise, float noise_amp_r, float noise_ratio_z, glm::vec2 center={0.5f, 0.5f}, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a caldera-shaped heightmap.
Definition geo.cpp:16
Array get_primitive_base(const PrimitiveType &primitive_type, const glm::ivec2 &shape, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, glm::vec2 center={0.5f, 0.5f}, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Generates a primitive shape as a 2D array.
Definition primitives.cpp:357
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:42
void gain(Array &array, float factor, const Array *p_mask)
Apply a gain correction to the array elements.
Definition filters.cpp:189
NoiseType
Enumeration of various noise types used for procedural generation.
Definition functions.hpp:62
@ SIMPLEX2S
OpenSimplex2S.
Definition functions.hpp:68
Array disk(glm::ivec2 shape)
Generates a disk-shaped kernel footprint.
Definition kernels.cpp:225
Array noise_iq(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float gradient_scale=0.05f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence fbm noise.
Definition noise.cpp:77
Array noise_fbm(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, 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_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence fbm noise.
Definition noise.cpp:41
Array smooth_cosine(glm::ivec2 shape)
Generate a smooth cosine kernel.
Definition kernels.cpp:431
Array noise_swiss(NoiseType noise_type, glm::ivec2 shape, glm::vec2 kw, uint seed, int octaves=8, float weight=0.7f, float persistence=0.5f, float lacunarity=2.f, float warp_scale=0.1f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return an array filled with coherence fbm swiss noise.
Definition noise.cpp:268
Array white_sparse(glm::ivec2 shape, float a, float b, float density, uint seed)
Return an array sparsely filled with white noise.
Definition white.cpp:39
Array white_sparse_binary(glm::ivec2 shape, float density, uint seed)
Return an array sparsely filled with random 0 and 1.
Definition white.cpp:53
Array rectangle(glm::ivec2 shape, float rx, float ry, float angle, float slope=1.f, 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})
Generates a rectangle-shaped heightmap with optional modifications.
Definition primitives.cpp:225
Array wave_triangular(glm::ivec2 shape, float kw, float angle, float slant_ratio, float phase_shift=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a triangular wave.
Definition wave.cpp:91
Array wave_square(glm::ivec2 shape, float kw, float angle, float phase_shift=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a square wave.
Definition wave.cpp:67
Array multisteps(glm::ivec2 shape, float angle, float r=1.2f, int nsteps=8, float elevation_exponent=0.7f, float shape_gain=4.f, float scale=0.5f, float outer_slope=0.1f, const Array *p_ctrl_param=nullptr, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const glm::vec2 &center={0.5f, 0.5f}, const glm::vec4 &bbox={0.f, 1.f, 0.f, 1.f})
Generate a multi-step height profile along a rotated axis.
Definition multisteps.cpp:14
Array wave_sine(glm::ivec2 shape, float kw, float angle, float phase_shift=0.f, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Return a sine wave.
Definition wave.cpp:43
Array gabor_noise(glm::ivec2 shape, float kw, float angle, int width, float density, uint seed)
Return a sparse Gabor noise.
Definition gabor.cpp:19
Array cone(glm::ivec2 shape)
Generates a cone-shaped kernel array.
Definition kernels.cpp:56