载入中...
搜索中...
未找到
EvpackGraphicsLoader.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
10
11namespace eve::graphics {
12class IResourceFactory;
13class Mesh;
14} // namespace eve::graphics
15
16namespace eve::asset_graphics {
17
21 graphics::Mesh* mesh = nullptr;
24 std::uint32_t texcoordSet = 0;
26 std::vector<std::uint32_t> availableTexcoordSets;
31 std::map<std::string, asset::CanonicalMeshAttribute> attributes;
32};
33
36 std::uint32_t maximumVertices = 4'000'000;
37 std::uint32_t maximumIndices = 12'000'000;
38 std::uint64_t maximumDecodedBytes = 512ull * 1024ull * 1024ull;
39};
40
43public:
47 : factory_(factory) {}
48
55 [[nodiscard]] Result<graphics::Mesh*> uploadMesh(
56 const float* posXYZ, const float* nrmXYZ, const float* uvST, int vertexCount,
57 const std::uint32_t* indices, int indexCount) override;
58
61 [[nodiscard]] Result<graphics::Mesh*> uploadMeshColored(
62 const float* posXYZ, const float* nrmXYZ, const float* uvST, const float* colorRGBA,
63 int vertexCount, const std::uint32_t* indices, int indexCount) override;
64
70 [[nodiscard]] Result<void> releaseMesh(graphics::Mesh* mesh) override;
71
74 [[nodiscard]] Result<void> setMeshTexcoords(graphics::Mesh* mesh, std::uint32_t set,
75 std::span<const float> values) override;
78 [[nodiscard]] Result<void> setMeshTangentFrame(graphics::Mesh* mesh, std::span<const float> tangents,
79 std::span<const float> bitangents) override;
80
81private:
83};
84
87public:
90 graphics::IMeshResourceFactory& factory) noexcept
92 : reader_(reader), factory_(factory) {}
93
105 [[nodiscard]] Result<LoadedGraphicsMesh> loadMesh(const AssetRef& asset,
106 const asset::EvpackCapabilities& capabilities,
108 std::uint32_t texcoordSet = 0,
109 bool preserveAllTexcoords = false) const;
110
111private:
112 const asset::EvpackResourceReader& reader_;
114};
115
116} // namespace eve::asset_graphics
std::map< std::string, Var > values
Typed capability-aware runtime access to admitted packs.
#define EVENGINE_API_WORLD
Definition Export.h:109
std::uint32_t vertexCount
std::uint32_t indexCount
std::vector< std::uint32_t > indices
Narrow backend boundary for canonical mesh resources.
Mesh * mesh
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.
Capability-aware adapter from admitted .evpack assets to graphics resources.
EvpackGraphicsLoader(const asset::EvpackResourceReader &reader, graphics::IMeshResourceFactory &factory) noexcept
Bind a reader and backend factory; both must outlive this adapter.
Result-based adapter over the engine's established graphics resource factory.
GraphicsMeshFactoryAdapter(graphics::IResourceFactory &factory) noexcept
Bind a borrowed graphics factory that must outlive this adapter.
Backend-owned mesh upload and release operations.
Texture / mesh / shader / canvas creation and release.
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:25
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
Result of ordered capability variant selection.
Definition Evpack.h:155
Bounds applied before allocating canonical mesh staging arrays.
Successfully uploaded backend mesh and the selected package variant.
std::uint32_t texcoordSet
Explicit UV channel projected into the backend single-UV vertex stream.
std::map< std::string, asset::CanonicalMeshAttribute > attributes
Detached owning authoring streams; retained for deformation and material adapters....
std::vector< std::uint32_t > availableTexcoordSets
Available source UV channels, validated before upload.