Optional hardware ray-tracing backend (Vulkan KHR RT). 更多...
#include <IRayTracing.h>
Public 成员函数 | |
| virtual | ~IRayTracing ()=default |
| I ray tracing. | |
| virtual bool | isAvailable () const =0 |
| True when the active Graphics device enabled the KHR RT path. | |
| virtual RayTracingCaps | caps () const =0 |
| Borrowed device caps; valid while Graphics remains initialized. | |
| 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 Result< void > | rebuildScene ()=0 |
| Rebuild the TLAS from meshes previously registered with the scene. | |
| 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< 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/index bytes are copied. @lifetime mesh and its gpuHandle must remain valid through this call. | |
| virtual void | clearScene ()=0 |
| Drop every registered mesh and acceleration structure. | |
| virtual void | detachFromGraphics () |
| Release device-owned RT resources before Graphics destroys the device. @thread Render thread only; safe when never attached. | |
静态 Public 属性 | |
| static constexpr const char * | capabilityName = "IRayTracing" |
详细描述
Optional hardware ray-tracing backend (Vulkan KHR RT).
Provided by the graphics_raytracing module when linked. Consumers must tolerate eve::cap::query<IRayTracing>() == nullptr (module trimmed) and isAvailable() == false (GPU lacks the extensions) as supported states.
@lifetime The provider is registered at static init and outlives modules. @thread Render thread only.
在文件 IRayTracing.h 第 26 行定义.
构造及析构函数说明
◆ ~IRayTracing()
|
virtualdefault |
I ray tracing.
成员函数说明
◆ addMesh()
|
pure virtual |
◆ addTriangleMesh()
|
pure virtual |
Register a triangle mesh instance for ray tracing.
- 参数
-
positionsXYZ Packed xyz positions (vertexCount * 3). indices Triangle indices (indexCount, multiple of 3). transform Object-to-world transform for the TLAS instance.
- 返回
- Instance id on success, or Unsupported / InvalidArgument. @ownership Input spans are borrowed only during this call.
◆ applyReflections()
|
pure virtual |
Trace mirror-style reflections into dest (RGBA16F, A = hit mask).
- 参数
-
gfx Active Graphics backend (Vulkan). sceneColor Lit scene color to sample on a hit when no material is bound. hwDepth Hardware depth (D32) matching the scene projection. worldNormal World-space normals (RGB). dest Output canvas; size drives the launch dimensions. invViewProj Inverse view-projection (RH + ZO) for primary rays. viewProj View-projection used to reproject hit points into scene color. eyeWorld Camera eye in world space.
- 返回
- Unsupported when RT is unavailable; NoOp when the TLAS is empty; Failed on GPU errors. Callers must treat NoOp as "no usable output". @ownership All pointers are borrowed for the call; none are retained.
◆ caps()
|
pure virtual |
Borrowed device caps; valid while Graphics remains initialized.
◆ clearScene()
|
pure virtual |
Drop every registered mesh and acceleration structure.
◆ detachFromGraphics()
|
inlinevirtual |
Release device-owned RT resources before Graphics destroys the device. @thread Render thread only; safe when never attached.
被 eve::graphics::raytracing::VulkanRayTracing 重载.
在文件 IRayTracing.h 第 90 行定义.
◆ isAvailable()
|
pure virtual |
True when the active Graphics device enabled the KHR RT path.
◆ rebuildScene()
|
pure virtual |
Rebuild the TLAS from meshes previously registered with the scene.
- 返回
- Unsupported when RT is unavailable; Failed on build errors.
类成员变量说明
◆ capabilityName
|
staticconstexpr |
在文件 IRayTracing.h 第 28 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/IRayTracing.h