载入中...
搜索中...
未找到
IRayTracing.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Result.h"
7
8// Incomplete glm types are enough for const-reference parameters.
9#include <glm/fwd.hpp>
10
11namespace eve::graphics {
12
13class Canvas;
14class Graphics;
15class Mesh;
16class Texture;
17
29public:
30 static constexpr const char* capabilityName = "IRayTracing";
31
33 virtual ~IRayTracing() = default;
34
36 virtual bool isAvailable() const = 0;
37
39 virtual RayTracingCaps caps() const = 0;
40
54
66 std::span<const PathInstance> instances) = 0;
67
77 [[nodiscard]] virtual Result<void> renderPaths(PathSceneToken token, Canvas* dest, const PathTraceView& view) = 0;
78
86 uint32_t height) = 0;
97 const PathTraceView& view) = 0;
98
113 [[nodiscard]] virtual Result<void> applyReflections(Graphics* gfx, Texture* sceneColor, Texture* hwDepth,
114 Texture* worldNormal, Canvas* dest,
115 const glm::mat4& invViewProj, const glm::mat4& viewProj,
116 const glm::vec3& eyeWorld) = 0;
117
122 [[nodiscard]] virtual Result<void> rebuildScene() = 0;
123
132 [[nodiscard]] virtual Result<uint32_t> addTriangleMesh(const float* positionsXYZ, int vertexCount,
133 const uint32_t* indices, int indexCount,
134 const glm::mat4& transform) = 0;
135
141 [[nodiscard]] virtual Result<uint32_t> addMesh(Mesh* mesh, const glm::mat4& transform) = 0;
142
144 virtual void clearScene() = 0;
145
150 virtual void detachFromGraphics() {}
151};
152
153} // namespace eve::graphics
std::string output
#define EVENGINE_API_BACKENDS_INLINE
Definition Export.h:172
std::uint32_t vertexCount
std::uint32_t indexCount
std::vector< std::uint32_t > indices
std::uint32_t height
std::uint32_t width
OceanGpuFrameToken token
OceanMeshSettings mesh
OceanSprayView view
std::weak_ptr< PrimitiveScene > scene
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:176
Canvas public API.
Definition Canvas.h:17
Optional hardware ray-tracing backend (Vulkan KHR RT).
Definition IRayTracing.h:28
virtual ~IRayTracing()=default
I ray tracing.
virtual Result< PathFrameToken > preparePathFrame(PathSceneToken scene, uint32_t width, uint32_t height)=0
Prepare provider-owned output images for normal-frame path tracing. @ownership Provider owns output i...
virtual Result< void > renderPaths(PathSceneToken token, Canvas *dest, const PathTraceView &view)=0
Render a prepared path-tracing sample batch into an HDR canvas.
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...
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...
virtual Result< Texture * > recordPathFrame(PathSceneToken scene, PathFrameToken output, const PathTraceView &view)=0
End the scene pass and record one path batch as this normal frame's HDR resolve source....
virtual Result< PathSceneToken > preparePathScene(Graphics *gfx, const PathSceneDescription &scene)=0
Prepare an independently owned path-tracing scene and publish it atomically.
virtual Result< PathSceneToken > updatePathInstances(PathSceneToken token, std::span< const PathInstance > instances)=0
Replace instances of a prepared geometry set without rebuilding its BLAS.
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:26
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Provider-owned frame output identity; invalidated by resize, scene replacement or device detach.
Borrowed scene snapshot; preparation copies all inputs into provider-owned resources....
Opaque prepared-scene identity; invalid after replacement or device detachment. @ownership Does not o...
Deterministic path sample batch. Zero history starts a new accumulation.
Hardware ray-tracing capabilities probed once at Vulkan device creation.
glm::mat4 invViewProj