HitObject.MakeHit
Description
Creates a HitObject representing a hit based on values explicitly passed as arguments, without tracing a ray. The primitive specified by AccelerationStructure, InstanceIndex, GeometryIndex, and PrimitiveIndex must exist. The shader table index is computed using the formula used with TraceRay. The computed index must reference a valid hit group record in the shader table. The Attributes parameter must either be an attribute struct, such as BuiltInTriangleIntersectionAttributes, or another HitObject to copy the attributes from. On CUDA/OptiX, GeometryIndex is an SBT GAS index (see GeometryIndex()), and with OptiX 9.0 and later the hit-identifying arguments are not used (see “Geometry index” in the CUDA target documentation).
Signature
static HitObject HitObject.MakeHit<attr_t>( RaytracingAccelerationStructure AccelerationStructure, uint InstanceIndex, uint GeometryIndex, uint PrimitiveIndex, uint HitKind, uint RayContributionToHitGroupIndex, uint MultiplierForGeometryContributionToHitGroupIndex, RayDesc Ray, attr_t attributes); static HitObject HitObject.MakeHit<attr_t>( uint HitGroupRecordIndex, RaytracingAccelerationStructure AccelerationStructure, uint InstanceIndex, uint GeometryIndex, uint PrimitiveIndex, uint HitKind, RayDesc Ray, attr_t attributes);
Generic Parameters
attr_t
Parameters
AccelerationStructure : RaytracingAccelerationStructure
InstanceIndex : uint
GeometryIndex : uint
PrimitiveIndex : uint
HitKind : uint
RayContributionToHitGroupIndex : uint
MultiplierForGeometryContributionToHitGroupIndex : uint
Ray : RayDesc
attributes : attr_t
HitGroupRecordIndex : uint
Availability and Requirements
Defined for the following targets:
cuda
Available in stages: raygen, closesthit, miss.
glsl
Available in stages: raygen, closesthit, miss.
spirv
Available in stages: raygen, closesthit, miss.
Requires capabilities: spvRayTracingKHR, spvShaderInvocationReorderNV.
hlsl
Available in stages: raygen, closesthit, miss.
Requires capabilities: hlsl_nvapi, ser_hlsl_native.