Ocean rendering OptiX 7.x Example(s)

Good Morning,

I noticed that there is an advanced OptiX example to render an ocean but it is in older OptiX. Is there a version of this particular example created with OptiX 7.x ?

Thank you in advance for any assist.

Hey, I poked around but there is no example of this that I can find, not even internally or in the advanced samples repo. Sorry about that. It might be a great exercise to port it from OptiX 6 to OptiX 7! ;)


Thanks for the reply @dhart

You might be correct that it would be a great exercise. Time permitting I will give it a try.

Quick question.

Is ray tracing via OptiX 7 able to achieve actual real-time rendering or is it near real-time?


Edit: Scratch that question, it appears that OptiX 7 does indeed execute in real time. Do you happen to know range of fps OptiX 7 can optimally run?

OptiX 7 can definitely do real-time, many many times over if your GPU workload is setup for it.

It’s a good idea to think in terms of rays per second rather than frames per second. Without more information, the answer to your question is that the range of framerates possible can be anything from 0 to 10,000 fps or even more depending on how you define what a frame is and what you need to do other than trace rays.

Remember that if you use the optimal performance of the hardware, with Turing RTX you can get as high as 10 gigarays per second. With Ampere, the budget is even higher. Getting that performance requires using the built-in triangles, using highly coherent rays, avoiding any-hit shaders, using very simple shading, etc… But it’s straightforward to calculate your max framerate by starting from the performance your app is getting in rays per second, and then divide by the total number of rays you’re casting per frame, which is often something like resolution * samples per pixel * ray depth.

So for example, suppose you are rendering 1080p frames, and getting a decent 5 billion rays per second. Pretend your application is tracing 16 rays per pixel, maybe 4 primary rays, 4 bounce rays, and 8 shadow rays. So your maximum possible framerate would be 5e9 / 1920 / 1080 / 16 = 150 frames per second. Now this is a theoretical frame rate that doesn’t have room for BVH builds or framebuffer copies or anything else, so in practice you might assume that doing a BVH build could cut your framerate significantly. If instead you’re doing progressive rendering, not building a BVH every frame, but accumulating your results, you’ll probably see a framerate that is closer to 150 fps.

On my linux machine with the --no-gl-interop flag, the optixPathTracer sample runs at slightly over 100 fps. The sample resolution is 768x768, it casts 16 primary rays per pixel, allows a depth of 4, and casts a shadow ray for every hit. So it casts a maximum of 16 * 4 * 2 = 128 rays per pixel. On average the number is quite a bit lower because paths terminate early. IIRC the sample gets around 5 gigarays per second.

If you cast only one ray per pixel, and your frames are small resolution, then your framerate will be in the many thousands but you’ll run into the overheads of just trying to call functions quickly and launch kernels in microseconds. In that case you can improve the framerate by rendering multiple frames in a single launch.


1 Like

Thanks @dhart

Great information as per usual.

1 Like