载入中...
搜索中...
未找到
TerrainMask.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
4
5namespace eve::procgen {
6class Heightmap;
9 float spacingX = 1, spacingZ = 1, heightScale = 1;
10 float maxSlopeDegrees = 45, slopeCost = 0;
11};
30 const Heightmap& heights,
31 const Heightmap& baseCosts,
33
34class Heightmap;
36enum class TerrainMaskBlend;
37
40 float featureSize = 10, concavity = 1;
41};
42
59 const Heightmap& heights,
60 const Heightmap& curve,
62 TerrainMaskBlend mode);
63
66 float radius = 0.001F, worldUnits = -400, intensity = 0.7F;
67 int steps = 32, directions = 16;
68};
69
87 const Heightmap& heights,
88 const Heightmap& curve,
90 TerrainMaskBlend mode);
91
107 const Heightmap& curve, float distance);
108
111
124[[nodiscard]] EVENGINE_API_DOMAINS Result<int> applyTerrainStrength(Heightmap& target, const Heightmap& source,
125 const Heightmap& curve, TerrainStrengthMode mode,
126 float strength, bool invert);
127
140[[nodiscard]] EVENGINE_API_DOMAINS Result<int> smoothTerrainMask(Heightmap& target, const Heightmap& input,
141 float verticality, float blurRadius);
142
145 float heightXX = 1, heightXZ = 0, heightZX = 0, heightZZ = 1;
147 float brushXX = 1, brushXZ = 0, brushZX = 0, brushZZ = 1;
149 float strength = 1;
150};
151
154 double originX = 0, originZ = 0, spacingX = 1, spacingZ = 1;
155 int width = 1, height = 1;
156};
157
173 const TerrainStampSettings& world,
174 int contextWidth, int contextHeight,
175 const TerrainSampleGrid& heights);
176
192 const Heightmap& newHeights, const Heightmap& brush,
194
212 Heightmap& target, const Heightmap& oldHeights, const Heightmap& erosion, const Heightmap& brush,
213 const TerrainBrushBlendSettings& spatial, const Heightmap& curve, TerrainStrengthMode mode, float strength,
214 bool userInvert);
215
218
227
239 const Heightmap& curve);
240
254 float minimum, float maximum,
255 const Heightmap& filterCurve,
256 const Heightmap& strengthCurve);
257
273 float spacingX, float spacingZ,
274 float heightScale = 1);
275
290 const Heightmap& filterCurve,
291 const Heightmap& strengthCurve);
292} // namespace eve::procgen
LogicalId target
EvpackChunkInput input
Definition Evpack.cpp:170
#define EVENGINE_API_DOMAINS
Definition Export.h:110
float strength
float maximum[3]
float minimum[3]
float distance
OceanWakeSettings settings
Move-only, checked operation results for the common layer.
std::string_view source
Heightmap curve
double spacingZ
double spacingX
float heightScale
Move-only operation result carrying either a value or Status.
Definition Result.h:176
In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from ...
Definition Heightmap.h:21
TerrainStrengthMode
StrengthTransform pass order; source pass 0 named Multiply actually replaces with the curve value.
Result< int > generateTerrainDistanceMask(Heightmap &target, const TerrainDistanceMaskSettings &s, const Heightmap &filterCurve, const Heightmap &strengthCurve)
Generate a transformed distance mask using circle, X, Z or rounded-square coordinates.
Result< int > transformTerrainMask(Heightmap &target, const Heightmap &source, const Heightmap &curve)
Transform scalar input through a clamped bilinear one-row curve texture.
Result< int > generateTerrainRangeMask(Heightmap &target, const Heightmap &source, float minimum, float maximum, const Heightmap &filterCurve, const Heightmap &strengthCurve)
Generate height/range fitness with smoothstep followed by filter and strength curves.
Result< int > generateTerrainCurvatureMask(Heightmap &target, const Heightmap &input, const Heightmap &heights, const Heightmap &curve, const TerrainCurvatureSettings &s, TerrainMaskBlend mode)
Radially blur heights, derive source curvature, transform its curve and combine with an input mask.
Result< int > configureTerrainBrushWorld(TerrainBrushBlendSettings &target, const TerrainStampSettings &w, int contextWidth, int contextHeight, const TerrainSampleGrid &h)
Configure paint-context UV matrices from world sample centers and a rotated stamp footprint.
Result< int > generateTerrainTraversalCosts(Heightmap &target, const Heightmap &heights, const Heightmap &baseCosts, const TerrainTraversalSettings &settings)
Bake a separate terrain cost raster for one actor policy.
Result< int > blendTerrainBrush(Heightmap &target, const Heightmap &oldHeights, const Heightmap &newHeights, const Heightmap &brush, const TerrainBrushBlendSettings &s)
Blend an erosion scalar output with old heights through transformed brush UVs.
TerrainMaskBlend
Ordered scalar-mask arithmetic; intermediate values are not clamped.
Definition TerrainStamp.h:9
Result< int > smoothTerrainMask(Heightmap &target, const Heightmap &input, float verticality, float blurRadius)
Apply Pcg's two-pass Smooth ImageMask operation to a scalar mask.
Result< int > applyTerrainStrength(Heightmap &target, const Heightmap &source, const Heightmap &curve, TerrainStrengthMode mode, float strength, bool invert)
Apply the reference strength curve, inversion, mode and final interpolation.
Result< int > deriveTerrainSlope(Heightmap &target, const Heightmap &heights, float spacingX, float spacingZ, float heightScale)
Derive the shader's slope metric 1-normal.y from world-scaled height gradients.
Result< int > generateTerrainErosionMask(Heightmap &target, const Heightmap &oldHeights, const Heightmap &erosion, const Heightmap &brush, const TerrainBrushBlendSettings &spatial, const Heightmap &curve, TerrainStrengthMode mode, float strength, bool userInvert)
Compose spatial erosion-output blending and the source's inverted strength filter atomically.
Result< int > generateTerrainConcavityMask(Heightmap &target, const Heightmap &input, const Heightmap &heights, const Heightmap &curve, const TerrainConcavitySettings &s, TerrainMaskBlend mode)
Generate source normalized-gradient concavity with border attenuation and indexed curve lookup.
TerrainDistanceAxis
Distance coordinates used by the Pcg distance-mask shader.
Result< int > growShrinkTerrainMask(Heightmap &target, const Heightmap &source, const Heightmap &curve, float distance)
Ordered radial Grow/Shrink followed by the reference strength curve.
Paint-context affine UV mappings, evaluated at destination pixel centers.
Concavity source controls; featureSize is in height texels, concavity is signed.
Definition TerrainMask.h:39
Radial curvature controls; radius is UV distance, worldUnits scales signed height-minus-blur.
Definition TerrainMask.h:65
Value-only UV transform; distances are relative to the target raster, rotation in radians.
World X/Z positions of height sample centers, with positive spacing and dimensions.
Value configuration for a rectangular stamp in world X/Z coordinates.
Actor traversal policy in world metres; degrees from horizontal.
Definition TerrainMask.h:8