Optix 7 any hit point

I’m trying to get all hits along a ray. I need to store all hits info for further use after a ray traversal is done, which info like barycentric and distance. I mean add all hit into an array or other containers in any-hit function and handle them after the function optixTrace().

Is there any solution for that? thanks!

Yes, possible algorithms have been explained on this forum before.

Please look into this post and follow all links:
https://devtalk.nvidia.com/default/topic/1051105/optix/distinguish-objects-when-closest-hit-program-occured/post/5335113/#5335113

Thanks for your help! I know any-hit can get all hit without sorted, and I can use payload send hits info from AH back to RG(handle all hits info after optixTrace()). but may many hits along a ray, therefore the size of all hits may larger than 8 payload size. I read OptiX 7 programming guide this:

There is a limited number of payload values, but one or more of these values can also be a pointer to stack-based local memory or application-managed global memory.

so, How to make payload value to be a pointer? (the code demo is best).
thanks!

Please have a look into the OptiX SDK 7.0.0 example sources and search for the device functions packPointer and unpackPointer.
Those already show one way to split and merge a 64-bit pointer to and and from two 32-bit unsigned int values to allow bigger per ray payloads.

Thanks!