[SOLVED] Where is optixIntersectionDistance in OptiX 7 ?

In OptiX < 7 there was a function called “rtIntersectionDistance” to get the current “t hit” value of the ray, which was very useful especially for volumes. But I found no “optixIntersectionDistance” function for that functionality in the OptiX 7.0.0 SDK.
Of course it would be possible to calculate that value again in the kernel, but that would create some time+memory overhead, since the t_hit value is already present internally. And it would need an expensive additional square-root instruction.

In the SDK examples for intersection programs I found optixGetRayTmin() and optixGetRayTmax(), but they are not returning the current “t_hit” value. Please tell me how obtaining “t hit” should be done in OptiX 7.
Thank you.


optixGetRayTmax() operates differently in CH and AH. So a “optixIntersectionDistance” function is not required.

from online docs of optixGetRayTmax():
[…]In intersection and CH returns the current smallest reported hitT or the tmax passed into rtTrace if no hit has been reported
In AH returns the hitT value as passed in to optixReportIntersection
In Miss returns the tmax passed into optixTrace
Only available in Intersection, AH, CH, Miss.[…]