include/terraingen/layers/boulders/boulder_fields.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | |||
| 3 | /// @file | ||
| 4 | /// @brief The field lists of boulder layers, boulder shapes and manual boulders, and the names of | ||
| 5 | /// their enums. | ||
| 6 | #pragma once | ||
| 7 | |||
| 8 | #include "terraingen/layers/boulders/boulder.h" | ||
| 9 | #include "terraingen/layers/boulders/boulder_options.h" | ||
| 10 | #include "terraingen/layers/boulders/boulder_shape.h" | ||
| 11 | #include "terraingen/layers/layer_fields.h" | ||
| 12 | #include "terraingen/mesh/polyhedra.h" | ||
| 13 | #include "terraingen/util/option_fields.h" | ||
| 14 | |||
| 15 | #include <array> | ||
| 16 | |||
| 17 | namespace terraingen { | ||
| 18 | |||
| 19 | template <> struct EnumNames<EjectaProfile> { | ||
| 20 | static constexpr std::array<EnumEntry<EjectaProfile>, 2> kValues{{ | ||
| 21 | {"smoothstep", EjectaProfile::Smoothstep, | ||
| 22 | "Every block inside the rim, falling along a smoothstep to none at the reach."}, | ||
| 23 | {"exponential", EjectaProfile::Exponential, | ||
| 24 | "Exponential decay outside the rim, a fixed share on the floor and none beyond the reach: " | ||
| 25 | "synthterrain's crater probability map."}, | ||
| 26 | }}; | ||
| 27 | }; | ||
| 28 | |||
| 29 | template <> struct EnumNames<BoulderClusterModel> { | ||
| 30 | static constexpr std::array<EnumEntry<BoulderClusterModel>, 2> kValues{{ | ||
| 31 | {"nearest", BoulderClusterModel::Nearest, | ||
| 32 | "One center per cell of a jittered lattice, each point weighted by its nearest center " | ||
| 33 | "only."}, | ||
| 34 | {"thomas", BoulderClusterModel::Thomas, | ||
| 35 | "A Thomas cluster process: Poisson-scattered centers whose Gaussian clusters add where " | ||
| 36 | "they overlap."}, | ||
| 37 | }}; | ||
| 38 | }; | ||
| 39 | |||
| 40 | template <> struct EnumNames<EjectaAging> { | ||
| 41 | static constexpr std::array<EnumEntry<EjectaAging>, 2> kValues{{ | ||
| 42 | {"freshness", EjectaAging::Freshness, | ||
| 43 | "Blocks wear away with the crater's freshness (current over fresh depth): all when fresh, " | ||
| 44 | "none at or below the minimum freshness."}, | ||
| 45 | {"age", EjectaAging::Age, | ||
| 46 | "Blocks wear away with the crater's age as (1 - age / lifetime)^exponent, synthterrain's " | ||
| 47 | "form."}, | ||
| 48 | }}; | ||
| 49 | }; | ||
| 50 | |||
| 51 | template <> struct EnumNames<BaseSolid> { | ||
| 52 | static constexpr std::array<EnumEntry<BaseSolid>, 5> kValues{{ | ||
| 53 | {"icosahedron", BaseSolid::Icosahedron, | ||
| 54 | "Boulders start from an icosahedron, twenty triangles on the unit sphere: rounder " | ||
| 55 | "shapes."}, | ||
| 56 | {"cube", BaseSolid::Cube, "Boulders start from a cube: blocky shapes."}, | ||
| 57 | {"pyramid", BaseSolid::Pyramid, "Boulders start from a square-based pyramid."}, | ||
| 58 | {"prism", BaseSolid::Prism, "Boulders start from a triangular prism, a wedge."}, | ||
| 59 | {"tetrahedron", BaseSolid::Tetrahedron, | ||
| 60 | "Boulders start from a regular tetrahedron: angular shapes."}, | ||
| 61 | }}; | ||
| 62 | }; | ||
| 63 | |||
| 64 | template <> struct EnumNames<BoulderRest> { | ||
| 65 | static constexpr std::array<EnumEntry<BoulderRest>, 3> kValues{{ | ||
| 66 | {"face", BoulderRest::Face, "On its broadest face: its short axis up."}, | ||
| 67 | {"side", BoulderRest::Side, "On a side: its intermediate axis up."}, | ||
| 68 | {"end", BoulderRest::End, "On an end: its long axis up."}, | ||
| 69 | }}; | ||
| 70 | }; | ||
| 71 | |||
| 72 | template <> struct EnumNames<BoulderRelief> { | ||
| 73 | static constexpr std::array<EnumEntry<BoulderRelief>, 3> kValues{{ | ||
| 74 | {"dome", BoulderRelief::Dome, | ||
| 75 | "Each boulder's exposed part drawn as a dome: cheap, and enough for small boulders."}, | ||
| 76 | {"shape", BoulderRelief::Shape, | ||
| 77 | "The top surface of each boulder's 3D boulder shape drawn into the heights."}, | ||
| 78 | {"none", BoulderRelief::None, | ||
| 79 | "No rock relief in the heights, only fillets when set, for programs that place every " | ||
| 80 | "boulder as a model of its own."}, | ||
| 81 | }}; | ||
| 82 | }; | ||
| 83 | |||
| 84 | 779 | template <typename IO> void Fields(IO& io, BoulderPatches& patches) { | |
| 85 | 779 | io("spread", patches.spread, | |
| 86 | "Boulder abundance varies from 1 / spread to spread times its mean; 1 is the same " | ||
| 87 | "everywhere.", | ||
| 88 | 779 | "", AtLeast(1.0)); | |
| 89 | 777 | io("size_m", patches.size, | |
| 90 | 777 | "Typical width of a patch of richer or poorer boulder cover, in meters.", "m", Above(0.0)); | |
| 91 | 776 | } | |
| 92 | |||
| 93 | 757 | template <typename IO> void Fields(IO& io, BoulderFillet& fillet) { | |
| 94 | 757 | io("height_share", fillet.heightShare, | |
| 95 | "Height of the regolith piled against a boulder, as a share of its exposed height; 0 draws " | ||
| 96 | "no fillets.", | ||
| 97 | 757 | "", UnitInterval()); | |
| 98 | 755 | io("width_ratio", fillet.widthRatio, | |
| 99 | "How far the fillet reaches beyond the boulder's edge, over its diameter; it falls to " | ||
| 100 | "nothing there.", | ||
| 101 | 755 | "", Above(0.0)); | |
| 102 | 754 | } | |
| 103 | |||
| 104 | 1232 | template <typename IO> void Fields(IO& io, BoulderVentifacts& ventifacts) { | |
| 105 | 1232 | io("share", ventifacts.share, | |
| 106 | "Share of boulders with a windward facet planed by sand-laden wind; 0 for none. Gale " | ||
| 107 | "crater: 0.39 (Bridges et al. 2014).", | ||
| 108 | 1232 | "", UnitInterval()); | |
| 109 | 1230 | io("wind_azimuth_deg", ventifacts.windAzimuthDegrees, | |
| 110 | 1230 | WindAzimuthHelp("abrading wind", "facets face the other way"), "deg"); | |
| 111 | 1229 | io("min_angle_deg", ventifacts.minAngleDegrees, | |
| 112 | "Gentlest facet slope from horizontal, in degrees; 50 to 60 on basalt (Laity and Bridges " | ||
| 113 | "2009).", | ||
| 114 | 1229 | "deg", Inside(0.0, 90.0)); | |
| 115 | 1228 | io("max_angle_deg", ventifacts.maxAngleDegrees, | |
| 116 | 1228 | "Steepest facet slope from horizontal, in degrees.", "deg", Inside(0.0, 90.0)); | |
| 117 | 1227 | io("second_wind_azimuth_deg", ventifacts.secondWindAzimuthDegrees, | |
| 118 | "A second abrading wind, where it blows toward, in degrees like the first; some faceted " | ||
| 119 | "boulders get a second facet facing it and a keel between. Unset for none.", | ||
| 120 | "deg"); | ||
| 121 | 1226 | io("keel_share", ventifacts.keelShare, | |
| 122 | "Share of faceted boulders with the second facet. Gale crater: 12 of 39 (Bridges et al. " | ||
| 123 | "2014).", | ||
| 124 | 1226 | "", UnitInterval()); | |
| 125 | 1225 | } | |
| 126 | |||
| 127 | 777 | template <typename IO> void Fields(IO& io, BoulderEjecta& ejecta) { | |
| 128 | 777 | io("min_crater_diameter_m", ejecta.minCraterDiameter, | |
| 129 | "Smallest crater, in meters, that throws blocks out; unset with no regolith thickness, no " | ||
| 130 | "crater throws blocks.", | ||
| 131 | 777 | "m", AtLeast(0.0)); | |
| 132 | 776 | io("regolith_thickness_m", ejecta.regolithThickness, | |
| 133 | "Regolith thickness in meters: craters smaller than it over the excavation depth ratio dig " | ||
| 134 | "no boulder and throw no blocks. Unset ignores the regolith.", | ||
| 135 | 776 | "m", Above(0.0)); | |
| 136 | 775 | io("excavation_depth_ratio", ejecta.excavationDepthRatio, | |
| 137 | "Depth of excavation over crater diameter; with the regolith thickness it sets " | ||
| 138 | "the smallest crater that throws blocks.", | ||
| 139 | 775 | "", AboveUpTo(0.0, 1.0)); | |
| 140 | 774 | io("coverage", ejecta.coverage, | |
| 141 | "Golombek-Rapp k, the fraction of ground covered by blocks at the rim of a fresh crater; " | ||
| 142 | "unset is 0.1. Only golombek_rapp ejecta sizes use it, so set it only " | ||
| 143 | "with them.", | ||
| 144 | 774 | "", Inside(0.0, 1.0)); | |
| 145 | 1405 | io("profile", ejecta.profile, | |
| 146 | "How the share of a crater's blocks falls off with distance from its center."); | ||
| 147 | 773 | io("reach", ejecta.reach, | |
| 148 | "Distance from the crater's center, in crater radii, beyond which it adds no blocks.", "", | ||
| 149 | 773 | Above(1.0)); | |
| 150 | 772 | io("decay_radii", ejecta.decayRadii, | |
| 151 | "With the exponential profile, the e-folding distance of the blocks outside the rim, in " | ||
| 152 | "crater radii.", | ||
| 153 | 772 | "", Above(0.0)); | |
| 154 | 772 | io("floor_share", ejecta.floorShare, | |
| 155 | "With the exponential profile, the crater floor's share of the rim's blocks.", "", | ||
| 156 | 772 | UnitInterval()); | |
| 157 | 1401 | io("aging", ejecta.aging, | |
| 158 | "How a crater's blocks wear away with time, so that few are left around old craters."); | ||
| 159 | 771 | io("min_freshness", ejecta.minFreshness, | |
| 160 | "With freshness aging, the freshness (current over fresh depth) at or below which a crater " | ||
| 161 | "keeps no blocks.", | ||
| 162 | 771 | "", FromBelow(0.0, 1.0)); | |
| 163 | 771 | io("lifetime_gyr", ejecta.lifetimeGyr, | |
| 164 | "With age aging, the crater age in Gyr at which a crater keeps no blocks.", "Gyr", | ||
| 165 | 771 | Above(0.0)); | |
| 166 | 770 | io("aging_exponent", ejecta.agingExponent, | |
| 167 | "With age aging, the exponent of (1 - age / lifetime); higher values strip blocks from " | ||
| 168 | "craters sooner.", | ||
| 169 | 770 | "", AtLeast(0.0)); | |
| 170 | 770 | io("gravity", ejecta.gravity, | |
| 171 | "Surface gravity in m/s^2: with the regolith thickness, it limits how far blocks are " | ||
| 172 | "thrown, after Bart and Melosh (2010). Unset applies no such limit.", | ||
| 173 | 770 | "", Above(0.0)); | |
| 174 | 769 | } | |
| 175 | |||
| 176 | 757 | template <typename IO> void Fields(IO& io, BoulderModelThreshold& models) { | |
| 177 | 757 | io("min_diameter_m", models.minDiameter, | |
| 178 | "Boulders at least this many meters across become 3D models; unset applies no diameter " | ||
| 179 | "threshold.", | ||
| 180 | 757 | "m", Above(0.0)); | |
| 181 | 756 | io("min_px", models.minPixels, | |
| 182 | "Boulders spanning at least this many samples at the spacing evaluated become 3D models, so " | ||
| 183 | "finer levels of detail make more of them; unset applies no such threshold.", | ||
| 184 | 756 | "px", Above(0.0)); | |
| 185 | 754 | io("max_diameter_m", models.maxDiameter, | |
| 186 | "Boulders this many meters across or wider are not models, keeping a band of sizes as " | ||
| 187 | "models; unset applies no upper limit.", | ||
| 188 | 754 | "m", Above(0.0)); | |
| 189 | 753 | io("max_px", models.maxPixels, | |
| 190 | "Boulders spanning this many samples or more are not models; unset applies no such limit.", | ||
| 191 | 753 | "px", Above(0.0)); | |
| 192 | 753 | } | |
| 193 | |||
| 194 | 751 | template <typename IO> void Fields(IO& io, BoulderReliefRange& range) { | |
| 195 | 751 | io("min_diameter_m", range.minDiameter, | |
| 196 | "Smallest boulder drawn into the heights, in meters; smaller ones stay in the lists only, " | ||
| 197 | "for the renderer's surface detail.", | ||
| 198 | 751 | "m", AtLeast(0.0)); | |
| 199 | 751 | io("max_diameter_m", range.maxDiameter, | |
| 200 | "Boulders this many meters across or wider are not drawn into the heights; unset applies no " | ||
| 201 | "upper limit.", | ||
| 202 | 751 | "m", Above(0.0)); | |
| 203 | 751 | io("include_models", range.includeModels, | |
| 204 | "Draws the 3D model boulders into the heights as well, as a stand-in for far views."); | ||
| 205 | 751 | } | |
| 206 | |||
| 207 | 1257 | template <typename IO> void Fields(IO& io, BoulderClusters& clusters) { | |
| 208 | 1257 | io("share", clusters.share, | |
| 209 | "Share of the boulders between craters gathered in clusters; 0 leaves them scattered.", "", | ||
| 210 | 1257 | UnitInterval()); | |
| 211 | 1257 | io("center_spacing_m", clusters.centerSpacing, | |
| 212 | "Typical distance between cluster centers, in meters; with thomas, one center per spacing " | ||
| 213 | "squared on average.", | ||
| 214 | 1257 | "m", Above(0.0)); | |
| 215 | 1257 | io("radius_m", clusters.radius, | |
| 216 | "Gaussian radius of a cluster, in meters; below the spacing with nearest, at most twice it " | ||
| 217 | "with thomas.", | ||
| 218 | 1257 | "m", Above(0.0)); | |
| 219 | 1256 | io("model", clusters.model, "How cluster centers are laid out and their clusters combine."); | |
| 220 | 1256 | } | |
| 221 | |||
| 222 | 62 | template <typename IO> void Fields(IO& io, BoulderFragmentation& fragmentation) { | |
| 223 | 62 | io("min_diameter_m", fragmentation.minDiameter, "Smallest boulder that breaks, in meters.", "m", | |
| 224 | 62 | Above(0.0)); | |
| 225 | 62 | io("split_wear", fragmentation.splitWear, | |
| 226 | "Wear from 0 (fresh) to 1 from which boulders split into pieces that still fit; 0.5 by " | ||
| 227 | "default.", | ||
| 228 | 62 | "", UnitInterval()); | |
| 229 | 62 | io("rubble_wear", fragmentation.rubbleWear, | |
| 230 | "Wear from which the pieces scatter as rubble, turn and sink; at least split_wear.", "", | ||
| 231 | 62 | UnitInterval()); | |
| 232 | 62 | io("min_pieces", fragmentation.minPieces, "Fewest pieces a boulder breaks into.", "", | |
| 233 | 62 | Between(2.0, 12.0)); | |
| 234 | 60 | io("max_pieces", fragmentation.maxPieces, "Most pieces a boulder breaks into.", "", | |
| 235 | 60 | Between(2.0, 12.0)); | |
| 236 | 60 | io("gap_ratio", fragmentation.gapRatio, | |
| 237 | "Widest crack between split pieces, as a share of the boulder's diameter.", "", | ||
| 238 | 60 | AtLeast(0.0)); | |
| 239 | 60 | io("spread_ratio", fragmentation.spreadRatio, | |
| 240 | "How far rubble scatters beyond the cracks, as a share of the boulder's diameter.", "", | ||
| 241 | 60 | AtLeast(0.0)); | |
| 242 | 60 | io("slab_share", fragmentation.slabShare, | |
| 243 | "Share of broken boulders split by roughly parallel cracks right through them; the rest " | ||
| 244 | "crack out from the middle.", | ||
| 245 | 60 | "", UnitInterval()); | |
| 246 | 59 | } | |
| 247 | |||
| 248 | 144248 | template <typename IO> void Fields(IO& io, ValueRange& range) { | |
| 249 | 144248 | io("min", range.min, "Lower end of the interval the value is drawn uniformly from."); | |
| 250 | 144233 | io("max", range.max, "Upper end of the interval the value is drawn uniformly from."); | |
| 251 | 144234 | } | |
| 252 | |||
| 253 | 28853 | template <typename IO> void Fields(IO& io, BoulderStyle& style) { | |
| 254 | 56554 | io("name", style.name, "Label of the style, for reference; it does not change the shapes."); | |
| 255 | 28853 | io("weight", style.weight, | |
| 256 | "Relative share of boulders given this style; the styles' weights must not all be 0.", "", | ||
| 257 | 28853 | AtLeast(0.0)); | |
| 258 | 28851 | io("solid", style.solid, | |
| 259 | "Solid the shape starts from, before it is stretched, rounded, roughened and fractured."); | ||
| 260 | 28852 | io("intermediate", style.intermediate, | |
| 261 | "Range of the intermediate axis over the long one, b / a, within (0, 1]; lower values " | ||
| 262 | "give more elongated boulders."); | ||
| 263 | 28852 | io("short_axis", style.shortAxis, | |
| 264 | "Range of the short, vertical axis over the long one, c / a, within (0, 1] and at most " | ||
| 265 | "the intermediate ratio; lower values give flatter boulders."); | ||
| 266 | 28852 | io("rounding", style.rounding, | |
| 267 | "Range of the share, from 0 to 1, by which the shape is rounded toward the ellipsoid of " | ||
| 268 | "its axes: 0 keeps the solid's edges and corners, 1 is the ellipsoid."); | ||
| 269 | 28852 | io("min_fractures", style.minFractures, | |
| 270 | "Fewest flat fracture planes cutting a boulder; each boulder's count is drawn between the " | ||
| 271 | "two.", | ||
| 272 | 28852 | "", Between(0.0, 64.0)); | |
| 273 | 28852 | io("max_fractures", style.maxFractures, | |
| 274 | 28852 | "Most flat fracture planes cutting a boulder; at least the fewest.", "", Between(0.0, 64.0)); | |
| 275 | 28852 | io("fracture_depth", style.fractureDepth, | |
| 276 | "Range of where each fracture plane lies, as a share of the shape's reach along its " | ||
| 277 | "normal, within (0, 1]; lower values cut more away."); | ||
| 278 | 28852 | io("max_fracture_tilt", style.maxFractureTilt, | |
| 279 | "Largest vertical component of a fracture plane's unit normal: 0 keeps normals horizontal, " | ||
| 280 | "cutting a slab about its rim only.", | ||
| 281 | 28852 | "", UnitInterval()); | |
| 282 | 28850 | io("noise_amplitude", style.noiseAmplitude, | |
| 283 | "Largest relative change of the radius by the roughening noise; 0 leaves the surface " | ||
| 284 | "unroughened.", | ||
| 285 | 28850 | "", FromBelow(0.0, 1.0)); | |
| 286 | 28850 | io("noise_wavelength", style.noiseWavelength, | |
| 287 | "Wavelength of the roughening noise's first octave, in long-axis lengths; smaller values " | ||
| 288 | "give finer bumps.", | ||
| 289 | 28850 | "", Above(0.0)); | |
| 290 | 28850 | io("noise_octaves", style.noiseOctaves, | |
| 291 | "Octaves of the roughening noise, each halving in wavelength; more add finer detail.", "", | ||
| 292 | 28850 | Between(1.0, 12.0)); | |
| 293 | 28849 | io("edge_softness", style.edgeSoftness, | |
| 294 | "Range of how far edges and corners are worn back where faces meet, as weathering rounds " | ||
| 295 | "them, in long-axis lengths from 0 to 0.5; 0 keeps them sharp."); | ||
| 296 | 28848 | io("face_roughness", style.faceRoughness, | |
| 297 | "How far fracture faces undulate, as a share of each plane's offset; 0 keeps them flat.", "", | ||
| 298 | 28848 | Between(0.0, 0.5)); | |
| 299 | 28848 | } | |
| 300 | |||
| 301 | 4568 | template <typename IO> void Fields(IO& io, BoulderShapeOptions& shapes) { | |
| 302 | 4568 | io("styles", shapes.styles, "Kinds of boulder each shape is drawn from, picked by weight.", "", | |
| 303 | 4568 | MinLength(1)); | |
| 304 | 4561 | io("subdivisions", shapes.subdivisions, | |
| 305 | "Times the solid's triangles are split in four; more give finer, smoother shapes with more " | ||
| 306 | "triangles.", | ||
| 307 | 4561 | "", Between(0.0, 6.0)); | |
| 308 | 4560 | io("weathering", shapes.weathering, | |
| 309 | "Scales every style's edge softness: 0 gives sharp edges, 1 the styles' own, more is more " | ||
| 310 | "worn.", | ||
| 311 | 4560 | "", AtLeast(0.0)); | |
| 312 | 4559 | io("seed", shapes.seed, | |
| 313 | "Seed the shapes are drawn with, along with each shape's own seed; changing it reshapes " | ||
| 314 | "every boulder."); | ||
| 315 | 4559 | } | |
| 316 | |||
| 317 | /// The fields of whether a boulder layer draws random boulders, and their Golombek-Rapp terms | ||
| 318 | /// and diameter range. | ||
| 319 | 822 | template <typename IO> void BoulderSizeRangeFields(IO& io, BoulderLayerOptions& boulders) { | |
| 320 | 822 | BoulderSizes& sizes = boulders.sizes; | |
| 321 | 1465 | io("generate_random", boulders.generateRandom, | |
| 322 | "Draws random boulders from the size distribution, between craters and around them; off " | ||
| 323 | "places only the manual boulders, and the sizes, coverage and ejecta go unused."); | ||
| 324 | if constexpr (BindsNative<IO>) { | ||
| 325 | 3 | if (io.Group("sizes", sizes, "Sizes of the boulders between craters.")) { | |
| 326 | return; | ||
| 327 | } | ||
| 328 | } | ||
| 329 | 819 | io("coverage", sizes.coverage, | |
| 330 | "Golombek-Rapp k, the fraction of the ground covered by boulders, above 0 when generating " | ||
| 331 | "random boulders; higher values give more boulders. Unset is " | ||
| 332 | "0.02. Only golombek_rapp sizes use it, so set it only with them.", | ||
| 333 | 819 | "", FromBelow(0.0, 1.0)); | |
| 334 | 816 | io("qa", sizes.qConstant, | |
| 335 | "Constant term of the Golombek-Rapp q = qa + qb / k, per meter; a larger q leaves fewer " | ||
| 336 | "large boulders. Unset is 1.79. Only golombek_rapp sizes or ejecta sizes use it, so set " | ||
| 337 | "it only with them.", | ||
| 338 | "1/m"); | ||
| 339 | 816 | io("qb", sizes.qCoverageCoefficient, | |
| 340 | "Term of the Golombek-Rapp q = qa + qb / k divided by the coverage k, per meter; unset is " | ||
| 341 | "0.152, and it is used as qa is.", | ||
| 342 | "1/m"); | ||
| 343 | 816 | io("min_diameter_m", sizes.minDiameter, | |
| 344 | "Smallest boulder generated, in meters; lower values add many more small boulders.", "m", | ||
| 345 | 816 | Above(0.0)); | |
| 346 | 815 | io("max_diameter_m", sizes.maxDiameter, | |
| 347 | 815 | "Largest boulder generated, in meters, exclusive; above the smallest.", "m", Above(0.0)); | |
| 348 | 815 | } | |
| 349 | |||
| 350 | /// The fields of where a boulder layer's boulders gather: patches, clusters and crater ejecta. | ||
| 351 | 820 | template <typename IO> void BoulderGatheringFields(IO& io, BoulderLayerOptions& boulders) { | |
| 352 | 820 | io("seed", boulders.seed, | |
| 353 | "Seed of the boulders, their attributes and the patches; changing it gives a different " | ||
| 354 | "boulder field of the same statistics."); | ||
| 355 | 820 | io("patches", boulders.patches, | |
| 356 | "Patches of richer and poorer boulder cover across the ground."); | ||
| 357 | 819 | io("clusters", boulders.clusters, | |
| 358 | "Clusters of the boulders between craters around scattered centers; off unless share is " | ||
| 359 | "set."); | ||
| 360 | 818 | io("ejecta", boulders.ejecta, | |
| 361 | "Blocks thrown out by craters of every top-level crater layer before this one that dug into " | ||
| 362 | "boulder, densest at the rim and thinning outward; none with generate_random off."); | ||
| 363 | 810 | } | |
| 364 | |||
| 365 | /// The fields of the boulders a layer adds where the ground beneath is bedrock. | ||
| 366 | 806 | template <typename IO> void BoulderBedrockFields(IO& io, BoulderBedrock& bedrock) { | |
| 367 | if constexpr (BindsNative<IO>) { | ||
| 368 | 3 | if (io.Group("bedrock", bedrock, "Extra boulders where the ground beneath is bedrock.")) { | |
| 369 | return; | ||
| 370 | } | ||
| 371 | } | ||
| 372 | 803 | io("exposure", bedrock.exposure, | |
| 373 | "Raises the abundance of boulders where the ground beneath is bedrock, judged from its " | ||
| 374 | "shape; unset disables it."); | ||
| 375 | 801 | io("bedrock_abundance", bedrock.abundance, | |
| 376 | "Boulder abundance on bedrock over that on soil, and in between in proportion; used with " | ||
| 377 | "the exposure field.", | ||
| 378 | 801 | "", Above(0.0)); | |
| 379 | 799 | io("bedrock_mean_size_m", bedrock.meanSize, | |
| 380 | "With a density map, the side in meters of the squares bedrock is held to the map's mean " | ||
| 381 | "over, so it gathers boulders without adding any; a GeoTIFF map uses its own cells.", | ||
| 382 | 799 | "m", Above(0.0)); | |
| 383 | 798 | } | |
| 384 | |||
| 385 | /// The fields of how a boulder layer's boulders sit on the ground. | ||
| 386 | 801 | template <typename IO> void BoulderPoseFields(IO& io, BoulderPose& pose) { | |
| 387 | if constexpr (BindsNative<IO>) { | ||
| 388 | 3 | if (io.Group("pose", pose, "How the boulders sit on the ground: heights, burial, lean.")) { | |
| 389 | return; | ||
| 390 | } | ||
| 391 | } | ||
| 392 | 798 | io("min_height_ratio", pose.minHeightRatio, | |
| 393 | "Smallest boulder height over diameter; each boulder's is drawn uniformly between the two " | ||
| 394 | "ratios.", | ||
| 395 | 798 | "", Above(0.0)); | |
| 396 | 797 | io("max_height_ratio", pose.maxHeightRatio, | |
| 397 | 797 | "Largest boulder height over diameter; at least the smallest.", "", Above(0.0)); | |
| 398 | 797 | io("min_burial", pose.minBurial, | |
| 399 | "Smallest buried share of a boulder's height; each boulder's is drawn uniformly between the " | ||
| 400 | "two shares.", | ||
| 401 | 797 | "", FromBelow(0.0, 1.0)); | |
| 402 | 797 | io("max_burial", pose.maxBurial, | |
| 403 | "Largest buried share of a boulder's height; more burial leaves less of the boulder " | ||
| 404 | "exposed.", | ||
| 405 | 797 | "", FromBelow(0.0, 1.0)); | |
| 406 | 796 | io("max_lean_deg", pose.maxLeanDegrees, | |
| 407 | 796 | "Largest tilt of a boulder from the vertical, in degrees.", "deg", AtLeast(0.0)); | |
| 408 | 795 | io("side_share", pose.sideShare, | |
| 409 | "Share of boulders resting on a side, their intermediate axis up, rather than on their " | ||
| 410 | "broadest face.", | ||
| 411 | 795 | "", UnitInterval()); | |
| 412 | 795 | io("end_share", pose.endShare, | |
| 413 | "Share of boulders standing on an end, their long axis up; with side_share, at most 1.", "", | ||
| 414 | 795 | UnitInterval()); | |
| 415 | 795 | io("max_tilt_deg", pose.maxTiltDegrees, | |
| 416 | "Largest tilt of a boulder's up axis from the vertical in a random direction, after its " | ||
| 417 | "lean, in degrees; tilts are spread evenly over that cap of directions.", | ||
| 418 | 795 | "deg", Between(0.0, 180.0)); | |
| 419 | 795 | io("follow_slope", pose.followSlope, | |
| 420 | "Settles each boulder on the slope of the ground beneath it before its tilt."); | ||
| 421 | 1415 | io("settle", pose.settle, | |
| 422 | "Tips each boulder model over until it rests stably on a face, its center of mass over " | ||
| 423 | "what it stands on, rather than balanced on an edge or corner."); | ||
| 424 | 795 | io("max_slope_deg", pose.maxSlopeDegrees, | |
| 425 | "Steepest ground, across a boulder's diameter, that boulders stay on, in degrees; steeper " | ||
| 426 | "ground has none, models and drawn boulders alike. Unset keeps boulders on any slope.", | ||
| 427 | 795 | "deg", Inside(0.0, 90.0)); | |
| 428 | 793 | io("roll_distance_m", pose.rollDistance, | |
| 429 | "With max_slope_deg, boulders on steeper ground roll down it and rest where it is gentle " | ||
| 430 | "enough, gathering at the foot of slopes; those that would roll farther than this many " | ||
| 431 | "meters are left out. Unset leaves out every boulder on steeper ground.", | ||
| 432 | 793 | "m", Above(0.0)); | |
| 433 | 793 | io("burial_by_wear", pose.burialByWear, | |
| 434 | "How far wear sets burial: blocks of fresh craters sit near the smallest " | ||
| 435 | "burial and those of worn ones sink toward the largest, while boulders between craters " | ||
| 436 | "span every stage; 0 draws burial uniformly.", | ||
| 437 | 793 | "", UnitInterval()); | |
| 438 | 792 | } | |
| 439 | |||
| 440 | /// The fields of how wear and wind change a boulder layer's boulders. | ||
| 441 | 795 | template <typename IO> void BoulderWearFields(IO& io, BoulderLayerOptions& boulders) { | |
| 442 | 795 | io("fillet", boulders.fillet, | |
| 443 | "Regolith piled against each boulder's base, around relief and models alike; off unless " | ||
| 444 | "height_share is set."); | ||
| 445 | 795 | io("ventifacts", boulders.ventifacts, | |
| 446 | "Windward facets planed on boulders by sand-laden wind, from wear; off unless share is " | ||
| 447 | "set."); | ||
| 448 | 795 | io("fragmentation", boulders.fragmentation, | |
| 449 | "Boulders broken by wear into pieces that replace them, split and then scattered as " | ||
| 450 | "rubble; leave it out for none to break."); | ||
| 451 | 795 | } | |
| 452 | |||
| 453 | /// The fields of how a boulder layer's boulders are drawn: as relief in the heights or as models. | ||
| 454 | 795 | template <typename IO> void BoulderRenderingFields(IO& io, BoulderRendering& rendering) { | |
| 455 | if constexpr (BindsNative<IO>) { | ||
| 456 | 3 | if (io.Group("rendering", rendering, | |
| 457 | "How the boulders are drawn: relief or models, and shapes.")) { | ||
| 458 | return; | ||
| 459 | } | ||
| 460 | } | ||
| 461 | 792 | io("relief", rendering.relief, "How the boulders drawn into the heights look there."); | |
| 462 | 791 | io("model_threshold", rendering.modelThreshold, | |
| 463 | "Which boulders become 3D models of their own rather than relief in the heights; neither " | ||
| 464 | "threshold set means no models."); | ||
| 465 | 787 | io("relief_range", rendering.reliefRange, | |
| 466 | "Which boulders are drawn into the heights by diameter: none below min_diameter_m or " | ||
| 467 | "from max_diameter_m, and models only when asked."); | ||
| 468 | 787 | io("shapes", rendering.shapes, | |
| 469 | "The boulders' 3D boulder shapes, used by shape relief and by models."); | ||
| 470 | 787 | } | |
| 471 | |||
| 472 | 224 | template <typename IO> void Fields(IO& io, ManualBoulder& boulder) { | |
| 473 | 224 | io("x", boulder.x, | |
| 474 | "Center along x in the surface's coordinates; the longitude in degrees on a sphere."); | ||
| 475 | 222 | io("y", boulder.y, | |
| 476 | "Center along y in the surface's coordinates; the latitude in degrees on a sphere."); | ||
| 477 | 222 | io("diameter_m", boulder.diameter, "Length of the long axis, in meters.", "m", Above(0.0)); | |
| 478 | 216 | io("id", boulder.id, | |
| 479 | "Stable ID that seeds what is drawn for the boulder; unset derives one from its position " | ||
| 480 | "and " | ||
| 481 | "diameter."); | ||
| 482 | 216 | io("height_m", boulder.height, | |
| 483 | "Vertical extent in meters, buried part included; unset draws it from the height ratios.", | ||
| 484 | 216 | "m", Above(0.0)); | |
| 485 | 211 | io("burial", boulder.burial, "Buried share of the height; unset draws it.", "", | |
| 486 | 211 | FromBelow(0.0, 1.0)); | |
| 487 | 205 | io("yaw_deg", boulder.yawDegrees, | |
| 488 | "Rotation about the vertical, degrees counter-clockwise from east; unset draws it.", "deg"); | ||
| 489 | 202 | io("lean_deg", boulder.leanDegrees, | |
| 490 | "Tilt of the boulder's vertical axis from the vertical, degrees; unset draws it.", "deg"); | ||
| 491 | 200 | io("tilt_deg", boulder.tiltDegrees, | |
| 492 | "Angle of the up axis from the vertical after lean, degrees; unset draws it. A followed " | ||
| 493 | "slope tips it further.", | ||
| 494 | "deg"); | ||
| 495 | 198 | io("tilt_azimuth_deg", boulder.tiltAzimuthDegrees, | |
| 496 | "Direction the up axis tips toward, degrees counter-clockwise from east; unset draws it.", | ||
| 497 | "deg"); | ||
| 498 | 196 | io("wear", boulder.wear, | |
| 499 | "How worn it is, 0 fresh; unset draws it. With burial_by_wear it sets a drawn " | ||
| 500 | "burial.", | ||
| 501 | 196 | "", UnitInterval()); | |
| 502 | 193 | io("model", boulder.model, | |
| 503 | "Whether it is a 3D model rather than relief in the heights; unset follows the layer's " | ||
| 504 | "model threshold."); | ||
| 505 | 193 | io("rest", boulder.rest, | |
| 506 | "Which axis it stands along; unset draws it. A fixed lean, tilt, tilt azimuth or rest " | ||
| 507 | "keeps a model from being tipped over by settle."); | ||
| 508 | 193 | io("shape_seed", boulder.shapeSeed, | |
| 509 | "Seed of its 3D shape, as a generated boulder's derived one; unset derives it from the " | ||
| 510 | "ID."); | ||
| 511 | 193 | } | |
| 512 | |||
| 513 | /// The fields of how a boulder layer shares shapes, reads the ground and fades its boulders. | ||
| 514 | 786 | template <typename IO> void BoulderSharingFields(IO& io, BoulderLayerOptions& boulders) { | |
| 515 | if constexpr (!BindsNative<IO>) { | ||
| 516 | 783 | io("shape_prototypes", boulders.rendering.shapePrototypes, | |
| 517 | "How many shapes the boulders share, so they can be drawn as instances; 0 gives every " | ||
| 518 | "boulder a shape of its own."); | ||
| 519 | } | ||
| 520 | 786 | io("ground_spacing_m", boulders.groundSpacing, | |
| 521 | "Spacing in meters at which the layer reads the ground beneath it, for the exposure field, " | ||
| 522 | "placement, settling, slopes and breaking; fixed so that which boulders exist does not " | ||
| 523 | "depend on the level of detail.", | ||
| 524 | 786 | "m", Above(0.0)); | |
| 525 | 784 | FadePixelFields(io, boulders.fade, | |
| 526 | "Which boulders are drawn into the heightmap by their size in output samples " | ||
| 527 | "(pixels): the first count is the smallest drawn (2 by default, the fewest " | ||
| 528 | "that resolve a boulder) and the second the size from which they are drawn in " | ||
| 529 | "full. Smaller boulders exist only in the boulder lists and 3D models."); | ||
| 530 | 782 | SourceResolvesField(io, boulders.sourceResolvesPixels, | |
| 531 | "boulders (the smaller of this and completeness when both are set)", | ||
| 532 | "diameter"); | ||
| 533 | 780 | } | |
| 534 | |||
| 535 | /// The fields of a boulder layer's options, without the size models, maps, files and catalog, | ||
| 536 | /// which a configuration gives in their own fields. | ||
| 537 | 539 | template <typename IO> void Fields(IO& io, BoulderLayerOptions& boulders) { | |
| 538 | 539 | BoulderSizeRangeFields(io, boulders); | |
| 539 | 536 | BoulderGatheringFields(io, boulders); | |
| 540 | 526 | BoulderBedrockFields(io, boulders.bedrock); | |
| 541 | 522 | BoulderPoseFields(io, boulders.pose); | |
| 542 | 516 | BoulderWearFields(io, boulders); | |
| 543 | 516 | BoulderRenderingFields(io, boulders.rendering); | |
| 544 | 512 | BoulderSharingFields(io, boulders); | |
| 545 | 509 | } | |
| 546 | |||
| 547 | } // namespace terraingen | ||
| 548 |