Using OptiX to determine travel time for a ray travelling through a material


I am looking to apply the ray tracing in OptiX to accurately determine the travel time through different materials.

The field I am involved with is sound, so transmission speeds will need to be defined (in m/s) and refraction from one material to the next is the primary process affecting the passage of the ray between source and receiver.

Is this possible with OptiX? I looked through the documentation briefly and I couldn’t see any references to the transmission speed of the ray.



OptiX is a general purpose GPU ray-casting SDK. It’s not a renderer and has no notion of material properties at all. All behavior depending on some material data is implemented by you as the developer.
If you know how to implement some simulation by shooting rays, then it should also be possible to implement that with OptiX

Rays in OptiX are not traveling at any “speed”. Fundamentally they just determine which geometric primitive you intersect at what distance, or if you missed. Everything happening on such a hit or miss event is defined by your implementation of the respective GPU device programs called by OptiX for each case.

Since you can determine how far a ray traveled inside a medium with a ray tracer easily, you can also determine the time it would have taken to travel along that distance inside whatever material and track that information along each ray path. That is all yours to calculate.
The same is true for calculating the reflections on or refraction through geometric surfaces separating volumes with different properties.
You could also do ray marching and step in discrete time intervals and calculate the ray distance depending on the surrounding medium until you hit something. (Not recommended unless you’re dealing with heterogeneous mediums.)

Simulations of time it takes to travel from a transmitter to a receiver have been implemented with ray tracing in OptiX before
NVIDIA actually has a product based on that:

Here are two related posts explaining ideas how to go about that with some Monte Carlo integration.
(Maybe disregard my idea of tracking the cone angle. That should even work without, by considering the full hemisphere above a hit point.):
Related post:

Thank you for a prompt reply, Detlef.

Your post clarifies the extent that OptiX ray-traces. I am looking for a developed solution for which I can modify for my purposes.

I looked into NVIDIAs audio ray tracer yesterday and thought it would be viable for my situation. I tried to email ( to clarify the limitations of the current implementation but the email bounced with a “Your message can’t be delivered because delivery to this address is restricted” error. Any idea why this is happening?


Probably an e-mail address setup glitch. I’ve asked what’s up with that.

And you already found the devtalk forum for it, which would have been my next link.