载入中...
搜索中...
未找到
VegetationSceneInstance.h
浏览该文件的文档.
1#pragma once
2
7
8namespace eve::asset_graphics {
9
16
19public:
21 explicit VegetationSceneAssociationLoader(const asset::EvpackResourceReader& reader) noexcept : reader_(reader) {}
22
30 [[nodiscard]] Result<VegetationSceneAssociation> load(
31 const AssetRef& sceneTemplate, const asset::EvpackCapabilities& capabilities) const;
32
33private:
34 const asset::EvpackResourceReader& reader_;
35};
36
42public:
56 [[nodiscard]] static Result<std::unique_ptr<VegetationSceneInstance>> create(
58 const AssetRef& sceneTemplate, const asset::EvpackCapabilities& capabilities,
60 const VegetationSceneGpuBuild& build, std::uint64_t owner);
61
63 [[nodiscard]] const asset_scene::LoadedSceneTemplate& scene() const noexcept { return association_.scene; }
65 [[nodiscard]] const graphics::PbrSurface& surface() const noexcept { return runtime_->surface(); }
67 [[nodiscard]] const VegetationSceneLiveElements& liveElements() const noexcept { return *liveElements_; }
68
70 [[nodiscard]] Result<VegetationSceneElementPublication> registerElement(
71 std::uint64_t expectedRevision, const VegetationSceneElement& element,
72 const VegetationSceneGpuBuild& build);
74 [[nodiscard]] Result<VegetationSceneElementPublication> withdrawElement(
75 std::uint64_t expectedRevision, VegetationSceneElementHandle handle,
76 const VegetationSceneGpuBuild& build);
78 [[nodiscard]] Result<void> release() { return runtime_->release(); }
79
80private:
83 std::unique_ptr<VegetationSceneGpuRuntime> runtime,
84 std::unique_ptr<VegetationSceneLiveElements> liveElements) noexcept
85 : association_(std::move(association)), baseSurface_(std::move(baseSurface)),
86 baseMotion_(std::move(baseMotion)), runtime_(std::move(runtime)),
87 liveElements_(std::move(liveElements)) {}
88
89 VegetationSceneAssociation association_;
90 graphics::PbrSurface baseSurface_;
92 std::unique_ptr<VegetationSceneGpuRuntime> runtime_;
93 std::unique_ptr<VegetationSceneLiveElements> liveElements_;
94};
95
96} // namespace eve::asset_graphics
Runtime decoding of canonical scene templates.
#define EVENGINE_API_WORLD
Definition Export.h:109
PrimitiveHandle handle
std::string element
Transactional runtime registration of TVE Element volumes.
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.
Resolve a Scene Template to exactly one manager asset in the same admitted EVPACK.
VegetationSceneAssociationLoader(const asset::EvpackResourceReader &reader) noexcept
Bind a borrowed immutable reader which must outlive this loader.
Instance-qualified handle for one dynamically registered TVE Element volume.
Owning executable instance coupling one Scene Template, its manager fields and live Element registry....
Result< void > release()
Invalidate surface borrows and release manager GPU resources.
const VegetationSceneLiveElements & liveElements() const noexcept
Borrow the dynamic Element registry.
const graphics::PbrSurface & surface() const noexcept
Borrow the currently bound manager material snapshot.
const asset_scene::LoadedSceneTemplate & scene() const noexcept
Borrow the associated declarative scene for this instance lifetime.
Owning registry that atomically couples dynamic Element state to a scene GPU runtime....
Texture / mesh / shader / canvas creation and release.
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
Fully validated, detached scene-manager candidate with no archive or GPU borrows.
Owning decoded result of one unique source-GUID scene-manager association.
std::map< std::string, graphics::VegetationMask > masks
One normalized Unity TVEElement definition awaiting texture realization.
Explicit detached inputs for publishing all nine TVE scene-manager field layers.
Owning declarative scene tree and render bindings; neither mutates a Scene or retains GPU objects.
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...
Definition PbrSurface.h:218
Source-equivalent plant motion parameters with explicit time and texture inputs. All data is owned....