载入中...
搜索中...
未找到
eve::graphics::IRayTracing类 参考abstract

Optional hardware ray-tracing backend (Vulkan KHR RT). 更多...

#include <IRayTracing.h>

类 eve::graphics::IRayTracing 继承关系图:
eve::graphics::raytracing::VulkanRayTracing

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< 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.
 
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< 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 images and sampled textures; no caller storage is retained. @thread Render thread, outside frame recording; no callbacks. @cost Allocates images proportional to pixels on resize; equal extents reuse the current output token.
 
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. @ownership Returned texture is borrowed from the provider until output invalidation; use it in this frame only. @thread Render thread; once per present frame, no callbacks or reentrancy. @cost Records pixel/sample/bounce-proportional GPU work; does not submit or wait for this batch.
 
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 第 28 行定义.

构造及析构函数说明

◆ ~IRayTracing()

virtual eve::graphics::IRayTracing::~IRayTracing ( )
virtualdefault

I ray tracing.

成员函数说明

◆ addMesh()

virtual Result< uint32_t > eve::graphics::IRayTracing::addMesh ( Mesh *  mesh,
const glm::mat4 &  transform 
)
pure virtual

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.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ addTriangleMesh()

virtual Result< uint32_t > eve::graphics::IRayTracing::addTriangleMesh ( const float *  positionsXYZ,
int  vertexCount,
const uint32_t *  indices,
int  indexCount,
const glm::mat4 &  transform 
)
pure virtual

Register a triangle mesh instance for ray tracing.

参数
positionsXYZPacked xyz positions (vertexCount * 3).
indicesTriangle indices (indexCount, multiple of 3).
transformObject-to-world transform for the TLAS instance.
返回
Instance id on success, or Unsupported / InvalidArgument. @ownership Input spans are borrowed only during this call.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ applyReflections()

virtual Result< void > eve::graphics::IRayTracing::applyReflections ( Graphics *  gfx,
Texture *  sceneColor,
Texture *  hwDepth,
Texture *  worldNormal,
Canvas *  dest,
const glm::mat4 &  invViewProj,
const glm::mat4 &  viewProj,
const glm::vec3 &  eyeWorld 
)
pure virtual

Trace mirror-style reflections into dest (RGBA16F, A = hit mask).

参数
gfxActive Graphics backend (Vulkan).
sceneColorLit scene color to sample on a hit when no material is bound.
hwDepthHardware depth (D32) matching the scene projection.
worldNormalWorld-space normals (RGB).
destOutput canvas; size drives the launch dimensions.
invViewProjInverse view-projection (RH + ZO) for primary rays.
viewProjView-projection used to reproject hit points into scene color.
eyeWorldCamera 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.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ caps()

virtual RayTracingCaps eve::graphics::IRayTracing::caps ( ) const
pure virtual

Borrowed device caps; valid while Graphics remains initialized.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ clearScene()

virtual void eve::graphics::IRayTracing::clearScene ( )
pure virtual

Drop every registered mesh and acceleration structure.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ detachFromGraphics()

virtual void eve::graphics::IRayTracing::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 第 150 行定义.

◆ isAvailable()

virtual bool eve::graphics::IRayTracing::isAvailable ( ) const
pure virtual

True when the active Graphics device enabled the KHR RT path.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ preparePathFrame()

virtual Result< PathFrameToken > eve::graphics::IRayTracing::preparePathFrame ( PathSceneToken  scene,
uint32_t  width,
uint32_t  height 
)
pure virtual

Prepare provider-owned output images for normal-frame path tracing. @ownership Provider owns output images and sampled textures; no caller storage is retained. @thread Render thread, outside frame recording; no callbacks. @cost Allocates images proportional to pixels on resize; equal extents reuse the current output token.

返回
Output identity, invalidated by resize, full scene replacement or device detach.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ preparePathScene()

virtual Result< PathSceneToken > eve::graphics::IRayTracing::preparePathScene ( Graphics *  gfx,
const PathSceneDescription &  scene 
)
pure virtual

Prepare an independently owned path-tracing scene and publish it atomically.

参数
gfxInitialized graphics device; borrowed until device detachment.
sceneBorrowed geometry, materials, textures, instances and lights; copied during preparation.
返回
Current token for identical values, new token for changed values, or a failure preserving the prior scene. @cost CPU validation/comparison proportional to input; unchanged values reuse GPU resources. Geometry/material/light/texture changes upload/build; native textures copy GPU bytes proportional to texels. Source content identities amortize unchanged native captures; instance-only changes reuse BLAS and update TLAS. @thread Render thread, outside frame recording; no callbacks or reentrancy. @lifetime Successful preparation of changed inputs invalidates prior tokens/history. Source edits/releases alone leave an existing snapshot intact. Device detachment releases the owned scene.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ rebuildScene()

virtual Result< void > eve::graphics::IRayTracing::rebuildScene ( )
pure virtual

Rebuild the TLAS from meshes previously registered with the scene.

返回
Unsupported when RT is unavailable; Failed on build errors.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ recordPathFrame()

virtual Result< Texture * > eve::graphics::IRayTracing::recordPathFrame ( PathSceneToken  scene,
PathFrameToken  output,
const PathTraceView &  view 
)
pure virtual

End the scene pass and record one path batch as this normal frame's HDR resolve source. @ownership Returned texture is borrowed from the provider until output invalidation; use it in this frame only. @thread Render thread; once per present frame, no callbacks or reentrancy. @cost Records pixel/sample/bounce-proportional GPU work; does not submit or wait for this batch.

返回
Sampleable output for same-frame composition, or a structured failure. Success is recording, not completion.

The caller submits the normal frame. Reset history if a previous recording was not submitted. Subsequent 3D raster draws are not permitted; 2D UI overlays remain supported.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ renderPaths()

virtual Result< void > eve::graphics::IRayTracing::renderPaths ( PathSceneToken  token,
Canvas *  dest,
const PathTraceView &  view 
)
pure virtual

Render a prepared path-tracing sample batch into an HDR canvas.

参数
tokenToken returned by this provider's latest successful preparation.
destBorrowed RGBA16F output canvas; must outlive the call.
viewCamera, environment and deterministic sampling/accumulation settings.
返回
InvalidArgument for stale tokens or invalid inputs; Failed for GPU errors. @cost GPU work scales with pixels, samples and bounces; currently waits for GPU completion per batch. @thread Render thread, outside frame recording; no callbacks or reentrancy. @ownership Provider owns accumulation; destination remains caller-owned.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

◆ updatePathInstances()

virtual Result< PathSceneToken > eve::graphics::IRayTracing::updatePathInstances ( PathSceneToken  token,
std::span< const PathInstance >  instances 
)
pure virtual

Replace instances of a prepared geometry set without rebuilding its BLAS.

参数
tokenCurrent prepared-scene token.
instancesComplete replacement instance list; geometry indices refer to the prepared geometry set.
返回
New scene token on success; failure preserves the prior token and scene. @ownership Input is borrowed for this call; geometry/material buffers remain provider-owned. @lifetime Success invalidates the old token and accumulation. Detachment invalidates all tokens. @thread Render thread, outside frame recording; no callbacks or reentrancy. @cost TLAS build and emissive-instance upload proportional to instances/emissive triangles; amortize across frames with unchanged instances. Geometry/material/light replacement requires preparation.

在 eve::graphics::raytracing::VulkanRayTracing 内被实现.

类成员变量说明

◆ capabilityName

constexpr const char* eve::graphics::IRayTracing::capabilityName = "IRayTracing"
staticconstexpr

在文件 IRayTracing.h 第 30 行定义.


该类的文档由以下文件生成: