Skip to content

LiteFX::Rendering::ITopLevelAccelerationStructure::Instance::HitGroupOffset

An offset added to the address of the shader-local data of the shader record that is invoked for the instance, after the IBottomLevelAccelerationStructure indexing rules have been applied.

Synopsis

Declared in <litefx/rendering_api.hpp>

UInt32 HitGroupOffset : [object Object] = 0;

Description

Shader-local data is a piece of constant data that is available to the shader during invocation. During a ray hit/miss event, the shader record is selected based on geometry (IBottomLevelAccelerationStructure), instance (ITopLevelAccelerationStructure and an implementation-specific offset. The selected record is then used to load the shader and pass the shader local data to it.

The first part of the address is determined from the geometry index within the TLAS and a user-defined multiplier and base index specified in the shader when calling TraceRay. After this index is calculated the value of this property is added to it. The result is an offset into the shader-local data for the selected shader record.

See Also

https://microsoft.github.io/DirectX-Specs/d3d/Raytracing.html#addressing-calculations-within-shader-tables

https://docs.vulkan.org/spec/latest/chapters/raytracing.html#shader-binding-table-indexing-rules