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.
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:
hlsl
Available in stages: raygen
, closesthit
, miss
.
Requires capability: hlsl_nvapi
.
glsl
Available in stages: raygen
, closesthit
, miss
.
spirv
Available in stages: raygen
, closesthit
, miss
.
Requires capabilities: spvRayTracingKHR
, spvShaderInvocationReorderNV
.