GPU ray tracing

With Nvidia RTX out (oct 2018) everybody is all fired up about GPU ray tracing. But it’s not a new thing, even though the hardware integration of the Bvh/triangle intersection is mind blowing.

Over the years i have been working with a lot of different aspect of GPU programming and ray tracing. Since the early days where programmable shaders were introduced and light could be calculated pr pixel.

But ray tracing on the GPU was something that we started around 2008 as far as i recall. And just having an acceleration structure running where pretty crazy. And the acceleration structure is the core of making Ray tracing fast. Then running the rays in parallel on the graphics card was insanely fast compared to our naive single threaded CPU code.

I tried a lot of different techniques like Grid based, Kd trees and Bvh and something in between. Most of these where merely prototypes that never made it into any products, but the screenshots are still nice to  watch.

The first serious attempt was the Cyclops render, where the computer graphics team at Alexandra spent some time on a Cuda Based ray tracing engine with graphical user interface.

We supported the usual materials and importance sampled environment light.

 

We made a demo for a furniture company, where we had 5 seconds to render an image. But again this never made it into real life, but the chair was nice.
Sweet glossy reflections
With participating media.
Final gathering photon mapping. Such a cool name for a nice technique. I think there were some errors in my implementation.
Inspired by seeing the first Bunkspeed later Keyshot, i wrote “LightSky” that featured CPU simulated photons and GPU ray tracing and photon mapping.
LightSky in danish LysSky actually means shady business. Id had nice material previews and caustics.
Some more Light Sky
5 second render back in 2009, pretty fast

Later on i was really into fast gpu Kd and Bvh-tree  acceleration structure building. I struggled for quite some time with the HLBVH by Jacopo Pantaleoni. The idea was simple enough sort triangle centroids along their 3d morton curve values. This will sort them into a grid, where you only have to find the changes in the different bitplanes for locate the splits in the BVH.

Devils in the detail and without proper debugging tools it aged me a bit to do i right.

https://research.nvidia.com/publication/hlbvh-hierarchical-lbvh-construction-real-time-ray-tracing

Later there was a break through in photon mapping Toshiya Hachisuka developed Stochastic Progressive Photon Mapping (SPPM) which was simple to implement and totally awesome. Give that man a medal. A side node is that i know Toshiya from the time he was teaching in Aarhus, but i could not keep up with him, he was blazing warp speed and i just had some children.. But he is safe back in Japan. He once asked me about some guitar playing and i regret not helping him out.  If he could play like he did research..

Check out him out https://www.ci.i.u-tokyo.ac.jp/~hachisuka/

He had some secret gpu hashmap trick for storing the photons, but man i tried and could never make it work.. So i used the fast HLBVH to build a photon structure, that could be used for the photon density quiries. And it was kind of nice because no photons where rejected.

SPPM was excellent to simulate caustics and there has been some development to make it work efficiently on diffuse/glossy surfaces as well.

Here are some images from my SPPM render.

I think 5 billion photons where used for this converged image
This shows some rather complex caustic patterns
Full spectral simulation, it is Lee Lassen work primarily
Lots and lots of photons