Module ray_tracing

Source
Expand description

Ray tracing pipeline functionality for GPU-accelerated ray tracing.

§Overview

Ray tracing pipelines enable high-performance ray tracing by defining a set of shader stages that handle ray generation, intersection testing, and shading calculations. The pipeline consists of different shader stages organized into shader groups.

§Shader types

§Ray generation shader

  • Entry point for ray tracing.
  • Generates and traces primary rays.
  • Controls the overall ray tracing process.

§Intersection shaders

  • Built-in triangle intersection handles standard triangle geometry intersection.
  • Custom intersection implements custom geometry intersection testing.

§Hit shaders

  • Closest hit executes when a ray finds its closest intersection.
  • Any hit is an optional shader that runs on every potential intersection.

§Miss shader

  • Executes when a ray doesn’t intersect any geometry.
  • Typically handles environment mapping or background colors.

§Callable shader

  • Utility shader that can be called from other shader stages.
  • Enables code reuse across different shader stages.

§Pipeline organization

Shaders are organized into groups:

  • General groups contain ray generation, miss, or callable shaders.
  • Triangle hit groups contain closest-hit and optional any-hit shaders.
  • Procedural hit groups contain intersection, closest-hit, and optional any-hit shaders.

The ray tracing pipeline uses a Shader Binding Table (SBT) to organize and access these shader groups during execution.

Structs§

RayTracingPipeline
Defines how the implementation should perform ray tracing operations.
RayTracingPipelineCreateInfo
Parameters to create a new RayTracingPipeline.
ShaderBindingTable
An object that holds the shader binding table buffer and its addresses.
ShaderBindingTableAddresses
An object that holds the strided addresses of the shader groups in a shader binding table.
ShaderGroupHandlesData
Holds the data returned by RayTracingPipeline::group_handles.

Enums§

RayTracingShaderGroupCreateInfo
Enum representing different types of Ray Tracing Shader Groups.