载入中...
搜索中...
未找到
MeshEffectRenderer.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
4#include "graphics/Color.h"
9
10#include <glm/mat4x4.hpp>
11
12#include <cstdint>
13#include <span>
14#include <string>
15#include <unordered_map>
16#include <vector>
17
18namespace eve::graphics {
19class Graphics;
20class Mesh;
21class Shader;
22class Texture;
23}
24
25namespace eve::stylize {
26
35
42
45 std::vector<float> positions;
46 std::vector<float> normals;
47 std::vector<float> uvs;
48 std::vector<std::uint32_t> indices;
49};
50
53
68
71 std::vector<MeshVfxLodCandidate> lodCandidates;
72 std::vector<MeshVfxRenderItem> renderItems;
73 std::vector<MeshVfxRendererCommand> commands;
74};
75
91 std::span<const MeshParticleInstance> instances, MeshEffectInstance* effect, graphics::Mesh* mesh,
92 graphics::Texture* albedo, const MeshVfxBatchKey& key, std::uint64_t emitterStableId,
93 const glm::vec3& cameraPosition, float projectionScalePixels, float maximumDistance, std::int32_t priority = 0);
94
103
114public:
116 explicit MeshEffectRenderer(graphics::Graphics& graphics) noexcept;
117
120
128 [[nodiscard]] eve::Result<MeshEffectSubmitStatus> submitOverlay(
130
140 [[nodiscard]] eve::Result<MeshEffectSubmitStatus> submitTrail(
142 const glm::mat4& model = glm::mat4(1.f), const graphics::Color& tint = graphics::Color(1.f));
143
151 [[nodiscard]] eve::Result<MeshEffectSubmitStatus> submitParticle(
153
162 [[nodiscard]] eve::Result<MeshVfxSubmissionReport> submitQueue(
163 const MeshVfxRenderQueue& queue, std::span<const MeshVfxRendererCommand> commands);
164
166 MeshVfxSubmitStatus beginBatch(const MeshVfxBatchKey& key) override;
167
169 MeshVfxSubmitStatus submitDraw(const MeshVfxBatchedDraw& draw) override;
170
172 MeshVfxSubmitStatus endBatch() override;
173
175 [[nodiscard]] graphics::Mesh* trailMesh() const noexcept { return trailMesh_; }
176
177private:
179
180 graphics::Graphics& graphics_;
181 graphics::Mesh* trailMesh_ = nullptr;
182 std::unordered_map<std::string, graphics::Shader*> shaders_;
183 std::unordered_map<std::uint64_t, const MeshVfxRendererCommand*> activeCommands_;
184 bool batchActive_ = false;
185};
186
187} // namespace eve::stylize
std::vector< BuildingInstanceSnapshot > instances
int priority
graphics::Texture * albedo
#define EVENGINE_API_WORLD
Definition Export.h:109
std::uint32_t key
glm::vec4 tint
MeshVfxBatchedDraw draw
std::unique_ptr< ParticleEffect > effect
Mesh * mesh
glm::mat4 model
Move-only, checked operation results for the common layer.
const UnitySourceAsset & source
std::vector< VegetationPresetCommand > commands
Move-only operation result carrying either a value or Status.
Definition Result.h:155
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:25
Custom GPU program.
Definition Shader.h:39
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Immediate graphics-backend contract for a mesh VFX render queue.
Runtime state for a shader effect attached to a renderable mesh.
Definition MeshEffect.h:40
Render-thread adapter from stylize runtime state to Graphics mesh draws.
MeshEffectRenderer & operator=(const MeshEffectRenderer &)=delete
graphics::Mesh * trailMesh() const noexcept
Return the backend-owned dynamic ribbon mesh, or nullptr before first upload.
MeshEffectRenderer(const MeshEffectRenderer &)=delete
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
eve::Result< TrailUploadData > prepareTrailUpload(const TrailMeshSnapshot &snapshot)
Validate and convert a ribbon snapshot into packed graphics arrays.
MeshVfxSubmitStatus
Result of one synchronous backend submission operation.
MeshEffectSubmitStatus
Observable result of one mesh-effect submission.
MeshParticleRenderInputs buildMeshParticleRenderInputs(std::span< const MeshParticleInstance > instances, MeshEffectInstance *effect, graphics::Mesh *mesh, graphics::Texture *albedo, const MeshVfxBatchKey &key, std::uint64_t emitterStableId, const glm::vec3 &cameraPosition, float projectionScalePixels, float maximumDistance, std::int32_t priority)
Convert stable particle snapshots into the shared LOD/batch/render pipeline.
Immediate borrowed inputs for drawing an effect over an existing mesh.
Borrowed mesh/material plus owning transform state for one mesh particle draw.
Render-facing immutable state of one live mesh particle.
Complete planner and renderer inputs generated from one particle snapshot.
std::vector< MeshVfxRendererCommand > commands
std::vector< MeshVfxLodCandidate > lodCandidates
std::vector< MeshVfxRenderItem > renderItems
Immutable GPU-state identity used to combine compatible draw items.
One ordered draw reference inside a render batch.
Complete deterministic queue consumed by a graphics backend.
Concrete draw payload resolved for one batched stable instance ID.
Owning CPU snapshot suitable for upload by a graphics adapter.
Definition TrailEffect.h:42
Packed owning arrays accepted by Graphics dynamic mesh upload APIs.
std::vector< std::uint32_t > indices