Ray contact points for objects

Hello.
Currently, we are looking for a way to get all the points that a ray can touch when penetrating, without any reflection or refraction of one object.
I’m sorry for the rudimentary question, what kind of method is there?

Are you saying you want to gather all intersections along a straight ray?

Please follow the links in my answer to this thread for possible implementation methods and caveats to consider:
[url]distinguish objects when closest hit program occured - OptiX - NVIDIA Developer Forums

Thank you for your reply. I will read the thread.
That’s right about the question.
For example, suppose you have a sphere with a center (1,1,1) radius of 0.5 and a ray fired from (0,0,0) to (1,1,1). I want to get two intersections where the line meets the sphere.

Your sphere example is not quite what I explained. I thought you wanted to capture all intersections along a ray inside a full scene where all intersection programs exist already.

Your sphere example would be a custom geometric primitive intersection routine. It’s your responsibility to calculate the primitive intersection points inside an intersection program for any custom geometric primitive, like parametric spheres. Only triangles have built-in intersection routines in OptiX 6 and 7.

The OptiX SDK contains example code for a ray-sphere intersection routine. Search the SDK sources for *.cu files with “sphere” in the name and you’ll find that intersection calculation.

I misread your question because my English reading ability was insufficient.

I saw a sample of .
In this sample, is it correct that the registered process (intersect this time) is called when the light beam emitted by <pinhole_camera> hits an object?
Also, when it is called, is it correct that the ray information that was struck is passed in the ray of rtDeclareVariable (optix :: Ray, ray, rtCurrentRay,);

I ’m sorry to ask you some basic questions.

Yes, that intersection program is called whenever a ray hits a bounding box for a geometry with that custom intersection program assigned.
Also see this thread:
https://devtalk.nvidia.com/default/topic/1050973/optix/when-the-rtpotentialintersection-t-return-true-is-t-the-any-hit-or-must-closest-hit/post/5334456
https://raytracing-docs.nvidia.com/optix6/guide_6_0/index.html#programs#intersection

Yes, the semantic variable of type rtCurrentRay is accessible inside the intersection program.
Note that the coordinate space in that intersection program domain is object space, also in the anyhit program, but it’s in world space inside the raygeneration and closest hit program domain. See Table 5 and 7 here:
https://raytracing-docs.nvidia.com/optix6/guide_6_0/index.html#programs#internally-provided-semantics

If you’re new to OptiX, I would recommend to watch my GTC 2018 OptiX Introduction presentation.
Links to that and the examples’ source code here:
https://devtalk.nvidia.com/default/topic/998546/optix/optix-advanced-samples-on-github/
GTC 2018 S8518 - An Introduction to NVIDIA OptiX http://on-demand-gtc.gputechconf.com/gtc-quicklink/4JAjAp

Then watch the GTC 2019 presentation from David Hart about new features in OptiX 6.0.0.
GTC 2019 S9768 - New Features in OptiX 6.0 http://on-demand-gtc.gputechconf.com/gtc-quicklink/4FB3l

If you’re starting a new development, there is also the newest OptiX 7 API.
The device side programs behave mostly the same, but the host side API is very different:
https://devtalk.nvidia.com/default/topic/1058310/optix/optix-7-0-release/
https://devtalk.nvidia.com/default/topic/1058577/optix/porting-to-optix-7/post/5368038

The landing page for all NVIDIA raytracing docs is here: https://raytracing-docs.nvidia.com

Thank you for your polite explanation. I was saved.
I will study for a while.
I might ask again.