载入中...
搜索中...
未找到
CaveMineralArmoring.cpp
浏览该文件的文档.
2
3#include <algorithm>
4#include <cmath>
5
6namespace eve::procgen {
7namespace {
8
9constexpr float Pi = 3.14159265358979323846f;
10
11float smoothstep(float lo, float hi, float value) {
12 const float t = std::clamp((value - lo) / std::max(hi - lo, 1e-6f), 0.f, 1.f);
13 return t * t * (3.f - 2.f * t);
14}
15
16} // namespace
17
20 if (input.mineralSupply <= 0.f) return result;
21
22 const float phase = float(input.seed % 1013u) * (2.f * Pi / 1013.f);
23 const float patch = 0.5f + 0.3f * std::sin(input.passageAlong * 8.7f + phase) +
24 0.2f * std::sin(input.passageAngle * 3.f - input.passageAlong * 3.9f + phase * 0.61f);
25 result.coatingCoverage =
26 std::clamp(input.mineralSupply * (0.28f + 0.72f * smoothstep(0.18f, 0.82f, patch)), 0.f, 1.f);
27
28 // Fast wall flow inhibits accumulation and strips part of an existing rind;
29 // sheltered wall sectors retain a coherent secondary-mineral shield.
30 const float hydraulicRemoval = smoothstep(0.72f, 1.38f, input.hydraulicIntensity);
31 result.hydraulicRetention = result.coatingCoverage * (1.f - 0.78f * hydraulicRemoval);
32
33 // Dense coatings reduced CaCO3 dissolution by roughly one order of magnitude
34 // in the 2025 limestone microfluidic experiments. The exponential mapping
35 // reaches that bound only for a fully retained coating.
36 result.dissolutionRetention = std::exp(-2.302585093f * result.hydraulicRetention);
37 return result;
38}
39
40} // namespace eve::procgen
double value
float phase
Definition CaveMesh.cpp:58
EvpackChunkInput input
Definition Evpack.cpp:170
float t
CaveMineralArmoringSample sampleCaveMineralArmoring(const CaveMineralArmoringInput &input)
Sample patchy secondary-mineral coating and its protection of carbonate wall rock.
Inputs for secondary-mineral shielding of a dissolving cave wall.
Observable local state of a retained secondary-mineral coating.