载入中...
搜索中...
未找到
GtsTerrainExportSettings.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
5
6#include <cstdint>
7#include <string>
8#include <vector>
9
10namespace eve::image { class ImageData; }
11
12namespace eve::procgen {
13class Heightmap;
14
16enum class GtsTerrainLodMode : int { Impostor = 0, LowPoly = 1, Custom = 2 };
18enum class GtsTerrainNormalEdgeMode : int { Smooth = 0, Sharp = 1 };
24enum class GtsTerrainAlphaChannel : int { None = 0, Heightmap = 1 };
26enum class GtsTerrainExportShader : int { Standard = 0, VertexColor = 1 };
30enum class GtsSourceTerrainTreatment : int { Nothing = 0, Deactivate = 1, StoreInBackup = 2, Delete = 3 };
34enum class GtsTerrainColliderType : int { Mesh = 0, Heightfield = 1 };
36enum class GtsTerrainObjFaceMode : int { Triangles = 0, Quads = 1 };
37
61
90
95
98public:
100 [[nodiscard]] Result<void> configureWorkflow(const GtsTerrainExportWorkflow& workflow);
102 [[nodiscard]] GtsTerrainExportWorkflow getWorkflow() const noexcept;
104 [[nodiscard]] Result<void> appendSourcePreset(int mode, int level, float quality, float transitionHeight);
106 [[nodiscard]] Result<void> appendImpostorPreset(int mode, int level, float quality, float transitionHeight);
108 [[nodiscard]] Result<void> setSourceLods(std::vector<GtsTerrainExportLodSettings> levels);
110 [[nodiscard]] Result<void> setImpostorLods(std::vector<GtsTerrainExportLodSettings> levels);
112 [[nodiscard]] int getSourceLodCount() const noexcept;
114 [[nodiscard]] int getImpostorLodCount() const noexcept;
119 [[nodiscard]] const GtsTerrainExportLodSettings* sourceLodAt(int index) const noexcept;
124 [[nodiscard]] const GtsTerrainExportLodSettings* impostorLodAt(int index) const noexcept;
126 [[nodiscard]] Result<std::vector<GtsTerrainLodLevelSettings>> compileSourceLevels() const;
128 [[nodiscard]] Result<std::string> snapshotJson() const;
130 [[nodiscard]] Result<void> restoreJson(const std::string& json);
131
132private:
133 GtsTerrainExportWorkflow workflow_{};
134 std::vector<GtsTerrainExportLodSettings> sourceLods_;
135 std::vector<GtsTerrainExportLodSettings> impostorLods_;
136};
137
147 GtsTerrainLodSet& output, const Heightmap& heightmap, const GtsTerrainExportSettings& settings, float sizeX,
148 float sizeY, float sizeZ, int subTiles, GtsMeshPivot pivot = GtsMeshPivot::None);
149
158 MeshBuild& output, const Heightmap& heightmap, const GtsTerrainExportWorkflow& workflow, float sizeX, float sizeY,
159 float sizeZ);
160
169 GtsTerrainSaveResolution resolution,
170 float sizeX, float sizeY, float sizeZ,
171 GtsTerrainObjFaceMode faceMode);
172
182 const Heightmap& heightmap, const Heightmap& maskmap, GtsTerrainSaveResolution resolution, float sizeX, float sizeY,
183 float sizeZ, GtsTerrainObjFaceMode faceMode, float threshold = 0.2f, bool invert = false);
184
196 MeshBuild& output, const MeshBuild& source, const image::ImageData& bakedTexture, GtsTerrainNormalEdgeMode edgeMode,
197 int smoothingIterations, float terrainSizeX, float terrainSizeZ, bool linearize = false);
198
199} // namespace eve::procgen
std::string output
#define EVENGINE_API_DOMAINS
Definition Export.h:110
int level
Move-only, checked operation results for the common layer.
TerrainThermalSettings settings
uint32_t index
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Represents raw pixel data.
Definition ImageData.h:38
Schema-versioned source/impostor terrain export profile.
Owned result of the GTS split-and-sequential-simplify pipeline.
In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from ...
Definition Heightmap.h:21
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:19
GtsTerrainSaveResolution
Pcg/GTS power-of-two sampling reduction used before terrain mesh export.
GtsTerrainAlphaChannel
Optional channel placed in the exported texture alpha channel.
Result< GtsTerrainExportLodSettings > makeGtsTerrainLowPolyLod(int level)
Construct the exact GTS low-poly preset for a zero-based LOD index.
GtsTerrainExportShader
Native material family created for an exported terrain level.
GtsMeshPivot
Pivot translation applied independently to each GTS split mesh.
GtsTerrainConversionAction
Operation performed for the selected source terrain.
GtsTerrainColliderType
Collider representation requested by the export workflow.
GtsTerrainBakeLighting
Lighting state used while baking exported textures.
Result< void > buildGtsTerrainExportLodsFromHeightmapInto(GtsTerrainLodSet &output, const Heightmap &heightmap, const GtsTerrainExportSettings &settings, float sizeX, float sizeY, float sizeZ, int subTiles, GtsMeshPivot pivot)
Build source-terrain LODs using the first export record's SaveResolution and the complete sequential ...
GtsTerrainExportSelection
Source selection scope used by a terrain export.
GtsSourceTerrainTreatment
Treatment applied to a source terrain after a successful conversion commit.
GtsTerrainTextureExportMethod
Texture source used by a terrain export level.
GtsTerrainLodMode
Purpose assigned to one exported terrain LOD.
Result< void > buildGtsTerrainColliderMeshFromHeightmapInto(MeshBuild &output, const Heightmap &heightmap, const GtsTerrainExportWorkflow &workflow, float sizeX, float sizeY, float sizeZ)
Build the independently sampled and simplified MeshCollider geometry requested by a workflow.
Result< int > bakeGtsTerrainVertexColorsInto(MeshBuild &output, const MeshBuild &source, const image::ImageData &bakedTexture, GtsTerrainNormalEdgeMode edgeMode, int smoothingIterations, float terrainSizeX, float terrainSizeZ, bool linearize)
Apply Pcg low-poly edge processing and baked texture vertex colors atomically.
Result< std::string > encodeGtsMaskedTerrainObj(const Heightmap &heightmap, const Heightmap &maskmap, GtsTerrainSaveResolution resolution, float sizeX, float sizeY, float sizeZ, GtsTerrainObjFaceMode faceMode, float threshold, bool invert)
Encode Pcg's cell-classified masked terrain OBJ convention.
Result< std::string > encodeGtsTerrainObj(const Heightmap &heightmap, GtsTerrainSaveResolution resolution, float sizeX, float sizeY, float sizeZ, GtsTerrainObjFaceMode faceMode)
Encode the original Pcg unmasked terrain OBJ coordinate, UV and face convention.
GtsTerrainNormalEdgeMode
Edge-normal treatment requested for an exported terrain mesh.
Result< GtsTerrainExportLodSettings > makeGtsTerrainImpostorLod(int level)
Construct the exact GTS impostor preset for a zero-based LOD index.
GtsTerrainObjFaceMode
Polygon representation written by the Pcg terrain OBJ exporter.
GTS mesh simplification controls supported by MeshBuild streams.
Complete native counterpart of one GTSExportTerrainLODSettings record.
Result< void > validate() const
Validate all persisted and executable values in this record.
Result< GtsTerrainLodLevelSettings > compileLevel() const
Convert this export record to the sequential mesh-LOD contract.
Validated execution plan compiled from top-level Pcg terrain export controls.