Currently I prepare my “Diplomarbeit” (German Master’s thesis equivalent) about interactive global illumination on the GPU (Graphics Processing Unit). The exact topic of the thesis is not fixed yet. I use the paper
An Efficient GPU-based Approach for Interactive Global Illumination
Rui Wang, Rui Wang, Kun Zhou, Minghao Pan, Hujun Bao
ACM Transactions on Graphics, Vol. 28, No. 3, August 2009
as a starting point. Since I’m very interested in writing and testing my own sample application, I decided to explore NVIDIA’s CUDA (Compute Unified Device Architecture) development kit. Based on my experiments with CUDA I want to define the exact topic of the thesis.
As CUDA is just an extension of the well known C programming language, it wasn’t too challenging to get started. After some time I chose to implement a simple CUDA-based ray tracer to start my application. I began with porting parts of my Java-based ray tracer I had written while working on courses about computer graphics. To import scene models I currently use the Open Asset Import Library. It met my requirements as I currently want triangle data (vertices, normals and colors) only.
The latest version of the application performs the following tasks directly on the GPU:
- Generation of rays (both primary and secondary rays)
- Ray-triangle-intersection test
- Shadow ray generation and intersection
- Phong shading at found intersection points
It has to be noted that there is no acceleration data structure (to speed up intersection search) yet. Therefore a bruteforce approach is taken which tests each ray against all triangles. Because of this I only work with very small scenes consisting of less than 100 triangles. One prominent example for such scenes is the Cornell Box scene. I use a simplified variant of that scene as I only need some basic scene information.
The following screenshot shows this Cornell Box variant rendered with my CUDA-based ray tracer at 512×512 resolution. To improve quality it was generated using simple 2×2-supersampling. I deactivated secondary rays since the model had no reflection or transmission material properties.
On my NVIDIA GeForce GTS 250 I get about 12 fps. Before I optimize the raytracer or add other features such as photon mapping I want to implement an acceleration data structure, specifically the kd-tree as described in
Real-Time KD-Tree Construction on Graphics Hardware
Kun Zhou, Qiming Hou, Rui Wang, Baining Guo
ACM Transactions on Graphics, Vol. 27, No. 5, December 2008
For now I will not upload any files or source code. I plan to do that when everything is a little more stable and optimized.