载入中...
搜索中...
未找到
IRayTracing.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Result.h"
6
7#include <glm/mat4x4.hpp>
8
9namespace eve::graphics {
10
11class Canvas;
12class Graphics;
13class Mesh;
14class Texture;
15
27public:
28 static constexpr const char* capabilityName = "IRayTracing";
29
31 virtual ~IRayTracing() = default;
32
34 virtual bool isAvailable() const = 0;
35
37 virtual RayTracingCaps caps() const = 0;
38
53 [[nodiscard]] virtual Result<void> applyReflections(Graphics* gfx, Texture* sceneColor, Texture* hwDepth,
54 Texture* worldNormal, Canvas* dest,
55 const glm::mat4& invViewProj, const glm::mat4& viewProj,
56 const glm::vec3& eyeWorld) = 0;
57
62 [[nodiscard]] virtual Result<void> rebuildScene() = 0;
63
72 [[nodiscard]] virtual Result<uint32_t> addTriangleMesh(const float* positionsXYZ, int vertexCount,
73 const uint32_t* indices, int indexCount,
74 const glm::mat4& transform) = 0;
75
81 [[nodiscard]] virtual Result<uint32_t> addMesh(Mesh* mesh, const glm::mat4& transform) = 0;
82
84 virtual void clearScene() = 0;
85
90 virtual void detachFromGraphics() {}
91};
92
93} // namespace eve::graphics
#define EVENGINE_API_BACKENDS_INLINE
Definition Export.h:172
std::uint32_t vertexCount
std::uint32_t indexCount
std::vector< std::uint32_t > indices
Mesh * mesh
glm::mat4 viewProj
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Canvas public API.
Definition Canvas.h:17
Optional hardware ray-tracing backend (Vulkan KHR RT).
Definition IRayTracing.h:26
virtual ~IRayTracing()=default
I ray tracing.
virtual Result< void > applyReflections(Graphics *gfx, Texture *sceneColor, Texture *hwDepth, Texture *worldNormal, Canvas *dest, const glm::mat4 &invViewProj, const glm::mat4 &viewProj, const glm::vec3 &eyeWorld)=0
Trace mirror-style reflections into dest (RGBA16F, A = hit mask).
virtual void detachFromGraphics()
Release device-owned RT resources before Graphics destroys the device. @thread Render thread only; sa...
Definition IRayTracing.h:90
virtual bool isAvailable() const =0
True when the active Graphics device enabled the KHR RT path.
virtual Result< uint32_t > addTriangleMesh(const float *positionsXYZ, int vertexCount, const uint32_t *indices, int indexCount, const glm::mat4 &transform)=0
Register a triangle mesh instance for ray tracing.
virtual Result< void > rebuildScene()=0
Rebuild the TLAS from meshes previously registered with the scene.
virtual RayTracingCaps caps() const =0
Borrowed device caps; valid while Graphics remains initialized.
virtual void clearScene()=0
Drop every registered mesh and acceleration structure.
virtual Result< uint32_t > addMesh(Mesh *mesh, const glm::mat4 &transform)=0
Register a GPU Mesh already uploaded by Graphics. @ownership mesh is borrowed for the call; vertex/in...
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:25
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Hardware ray-tracing capabilities probed once at Vulkan device creation.
glm::mat4 invViewProj