Invisible Rays

Is it possible to define a ray type that is invisible in the scene?

I currently have a light source that I can dynamically alter the color it’s emitting. However, I don’t want to see any color or light emit from this light source. I’m just trying to calculate the attenuation data from this ray type; I want to know how ‘strong’ the rays are after bouncing around the scene.

Can this be done by not putting this ray type in the output buffer? Or are there any ray type properties that can disable the color/ light?

Let’s clear that up a little.
Yes, you’re completely free to implement whatever calculations happen for the ray types and materials you implement using OptiX.
You do not need to generate any output results from rays. For example visibility tests between two points in the scene are done with a ray which only checks if there is something between these two points. It’s used to cast shadows and only needs an anyhit program for that task. It’s not calculating or writing colors for that.

So you say you want to calculate the attenuation along a ray path through the scene?
With what kind of attenuation along that path? Through transparent objects or volume absorbtion or volume scattering?
That’s effectively the throughput calculation along a path in a path tracer.
You can find example code doing that in my OptiX Introduction source for opaque and transparent surfaces and volume absorption.

Other than that, if you want to make objects invisible to some ray types, that is done via the material’s anyhit program for that ray type and just needs to ignore intersections.

I really recommend you watch my OptiX Introduction GTC presentation which explains many OptiX basics like that.

Link to Detlef’s An Introduction to NVIDIA OptiX GTC Presentation:

  • Search by: Detlef
  • I found the presentation at the bottom of the list.