载入中...
搜索中...
未找到
EvpackTerrainMaterialLoader.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
7
8#include <array>
9#include <cstdint>
10#include <optional>
11#include <string>
12#include <vector>
13
14namespace eve::asset_procgen {
15
18 std::string name;
19 std::string diffuseSource;
20 std::string normalSource;
21 std::string weightSource;
22 std::string maskSource;
23 std::optional<AssetRef> diffuseAsset, normalAsset, weightAsset, maskAsset;
24 std::string normalConvention;
25 float tileSizeMeters = 1.f;
26 std::array<float, 2> tileScaleMeters{1.f, 1.f};
27 std::array<float, 2> tileOffsetMeters{};
28 std::array<float, 4> maskRemapMinimum{};
29 std::array<float, 4> maskRemapMaximum{1.f, 1.f, 1.f, 1.f};
30 std::array<float, 4> specular{};
31 float metallic = 0.f;
32 float normalScale = 1.f;
33 float smoothness = 0.f;
34};
35
38 std::uint32_t maximumLayers = 4096;
39 std::uint32_t maximumStringBytes = 1024 * 1024;
40 std::uint64_t maximumDecodedBytes = 64ull * 1024ull * 1024ull;
41};
42
46 std::vector<RuntimeTerrainLayer> layers;
47 std::string holesSource;
48 std::optional<AssetRef> holesAsset;
49 std::array<std::string, 4> controlSources;
50 std::array<std::optional<AssetRef>, 4> controlAssets;
51 float boundsMultiplier = 1.f;
53};
54
57public:
59 explicit EvpackTerrainMaterialLoader(const asset::EvpackResourceReader& reader) noexcept : reader_(reader) {}
60
66 [[nodiscard]] Result<LoadedTerrainMaterial> load(const AssetRef& material,
67 const asset::EvpackCapabilities& capabilities,
68 const TerrainMaterialLoadLimits& limits = {}) const;
69
70private:
71 const asset::EvpackResourceReader& reader_;
72};
73
74} // namespace eve::asset_procgen
Typed capability-aware runtime access to admitted packs.
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
Material * material
const AssetImportLimits & limits
Stable asset identity backed by PersistentId.
Definition ResourceRef.h:53
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Immutable reader retaining an admitted pack by shared ownership.
Strict eve.terrain-material/3 EVDEF loader with one-version compatibility.
EvpackTerrainMaterialLoader(const asset::EvpackResourceReader &reader) noexcept
Bind a borrowed immutable reader that must outlive this loader.
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
Result of ordered capability variant selection.
Definition Evpack.h:155
Owning capability-selected terrain material candidate.
std::array< std::optional< AssetRef >, 4 > controlAssets
One owning canonical terrain layer independent of its source engine.
Admission budgets for terrain material definitions.