载入中...
搜索中...
未找到
MeshEffectRenderer.cpp
浏览该文件的文档.
74 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "trail snapshot index count is not triangular",
109MeshEffectRenderer::MeshEffectRenderer(graphics::Graphics& graphics) noexcept : graphics_(graphics) {}
146 eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation, "mesh effect has no bound target", {},
150 eve::DiagnosticCode::StaleHandle, "resolved mesh source does not match the effect target", {}, {},
154 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "resolved mesh source has no mesh", {}, {},
169 eve::DiagnosticCode::Failed, std::string("mesh overlay submission failed: ") + error.what(), {}, {},
196 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "graphics failed to create the trail mesh", {},
215 eve::Diagnostic::error(eve::DiagnosticCode::Failed, std::string("trail submission failed: ") + error.what(),
225 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "mesh particle source has no mesh", {}, {},
240 eve::DiagnosticCode::Failed, std::string("mesh particle submission failed: ") + error.what(), {}, {},
250 eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation, "mesh VFX queue submission is reentrant",
255 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "mesh VFX renderer command has no effect",
260 eve::DiagnosticCode::InvalidArgument, "mesh VFX renderer commands contain a duplicate stable ID", {},
Stable, structured diagnostics shared by engine modules.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
const T & value() const &
Borrow the value from a const lvalue after checking success.
Definition Result.h:308
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Definition Result.h:255
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Definition Graphics.h:125
virtual bool updateMeshVertices(Mesh *mesh, const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0
In-place update of a mesh's vertex/index data (CPU -> host-visible VBO). Mirrors bakeMeshMorph: the u...
virtual void setMesh3DSurface(SurfaceMode mode, BlendMode blend, bool depthWrite, bool doubleSided, float alphaCutoff, const std::string &alphaTechnique="cutoff")=0
Select pipeline state for subsequent mesh draws.
@ ExplicitOverride
virtual void drawMeshShader(Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint, Shader *shader)=0
Draw mesh with an explicit Mesh3D Shader (nullptr = default PBR pipeline).
virtual Mesh * newMeshFromArrays(const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0
Upload a triangle mesh from packed CPU arrays. Owned by Graphics. posXYZ required (vertexCount*3)....
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Runtime state for a shader effect attached to a renderable mesh.
Definition MeshEffect.h:40
MeshVfxSubmitStatus endBatch() override
End the active GPU-state batch.
Definition MeshEffectRenderer.cpp:304
eve::Result< MeshVfxSubmissionReport > submitQueue(const MeshVfxRenderQueue &queue, std::span< const MeshVfxRendererCommand > commands)
Resolve and submit a complete LOD-planned render queue.
Definition MeshEffectRenderer.cpp:246
eve::Result< MeshEffectSubmitStatus > submitTrail(MeshEffectInstance &effect, const TrailMeshSnapshot &snapshot, const glm::mat4 &model=glm::mat4(1.f), const graphics::Color &tint=graphics::Color(1.f))
Upload and draw one dynamic ribbon using an active mesh effect.
Definition MeshEffectRenderer.cpp:175
MeshVfxSubmitStatus submitDraw(const MeshVfxBatchedDraw &draw) override
Submit one resolved draw in the active batch.
Definition MeshEffectRenderer.cpp:285
MeshEffectRenderer(graphics::Graphics &graphics) noexcept
Bind this adapter to one Graphics owner for its entire lifetime.
Definition MeshEffectRenderer.cpp:109
eve::Result< MeshEffectSubmitStatus > submitParticle(MeshEffectInstance &effect, const MeshParticleDrawSource &source)
Draw one simulated mesh particle through an active mesh-effect style.
Definition MeshEffectRenderer.cpp:221
eve::Result< MeshEffectSubmitStatus > submitOverlay(MeshEffectInstance &effect, const MeshEffectDrawSource &source)
Draw a second-pass effect over a resolved source mesh.
Definition MeshEffectRenderer.cpp:142
MeshVfxSubmitStatus beginBatch(const MeshVfxBatchKey &key) override
Begin one GPU-state batch; intended for MeshVfxBatchExecutor.
Definition MeshEffectRenderer.cpp:271
Executes a planned render queue against one immediate backend sink.
Definition MeshVfxBatchSubmission.h:71
MeshVfxSubmissionReport submit(const MeshVfxRenderQueue &queue, IMeshVfxBatchSink &sink) const
Submits all batches in order until completion or device loss.
Definition MeshVfxBatchSubmission.cpp:14
@ Transparent
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
Definition MeshVfxPackage.h:10
eve::Result< TrailUploadData > prepareTrailUpload(const TrailMeshSnapshot &snapshot)
Validate and convert a ribbon snapshot into packed graphics arrays.
Definition MeshEffectRenderer.cpp:56
MeshVfxSubmitStatus
Result of one synchronous backend submission operation.
Definition MeshVfxBatchSubmission.h:12
@ SkippedEmpty
@ SkippedInactive
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.
Definition MeshEffectRenderer.cpp:24
@ InvalidArgument
@ PreconditionViolation
@ Unsupported
@ Failed
@ StaleHandle
Immediate borrowed inputs for drawing an effect over an existing mesh.
Definition MeshEffectRenderer.h:28
Borrowed mesh/material plus owning transform state for one mesh particle draw.
Definition MeshEffectRenderer.h:37
Complete planner and renderer inputs generated from one particle snapshot.
Definition MeshEffectRenderer.h:70
std::vector< MeshVfxRendererCommand > commands
Definition MeshEffectRenderer.h:73
std::vector< MeshVfxLodCandidate > lodCandidates
Definition MeshEffectRenderer.h:71
std::vector< MeshVfxRenderItem > renderItems
Definition MeshEffectRenderer.h:72
Immutable GPU-state identity used to combine compatible draw items.
Definition MeshVfxRenderBatch.h:20
One ordered draw reference inside a render batch.
Definition MeshVfxRenderBatch.h:45
Complete deterministic queue consumed by a graphics backend.
Definition MeshVfxRenderBatch.h:68
Concrete draw payload resolved for one batched stable instance ID.
Definition MeshEffectRenderer.h:55
MeshParticleDrawSource particle
Definition MeshEffectRenderer.h:66
std::uint64_t stableInstanceId
Definition MeshEffectRenderer.h:59
MeshEffectInstance * effect
Definition MeshEffectRenderer.h:61
Counters and terminal state produced by queue execution.
Definition MeshVfxBatchSubmission.h:28
Owning CPU snapshot suitable for upload by a graphics adapter.
Definition TrailEffect.h:42
std::vector< std::uint32_t > indices
Definition TrailEffect.h:44
std::vector< TrailVertex > vertices
Definition TrailEffect.h:43
Packed owning arrays accepted by Graphics dynamic mesh upload APIs.
Definition MeshEffectRenderer.h:44
std::vector< float > positions
Definition MeshEffectRenderer.h:45
std::vector< std::uint32_t > indices
Definition MeshEffectRenderer.h:48
std::vector< float > normals
Definition MeshEffectRenderer.h:46