RayTCurrent

A float representing the current parametric ending point for the ray.

Syntax

float RayTCurrent();

Remarks

RayTCurrent defines the current ending point of the ray according to the following formula: Origin + (Direction * RayTCurrent). Origin and Direction may be in either world or object space, which results in either a world or an object space ending point.

RayTCurrent is initialized in the call TraceRay call with the RayDesc::TMax value and then is updated during the trace query as intersections are reported (in the any hit), and accepted.

In the intersection shader, it represents the distance to the closest intersection found so far. It will be updated after () to the THit value provided if the hit was accepted.

In the any hit shader, it represents the distance to the current intersection being reported.

In the closest hit shader, it represents the distance to the closest intersection accepted.

In the miss shader, it is equal to TMax passed to the TraceRay call.

This function can be called from the following raytracing shader types:

See also

Direct3D 12 Raytracing HLSL Reference