The application MNRT implements several techniques to realize fast global illumination for dynamic scenes on Graphics Processing Units (GPUs). It was developed during the creation of my Diplomarbeit (German master thesis equivalent):
- Neumann, Mathias
"GPU-basierte globale Beleuchtung mit CUDA in Echtzeit"
Diplomarbeit, FernUniversität in Hagen, 2010
The basic ideas of the implementation are described within [Wang et al. 2009]. Right now MNRT is very experimental. Therefore it might contain several errors. Furthermore MNRT does not show all features of the system described in my thesis. For example, spherical harmonics are not used to handle glossy materials, yet. They might be added in the future.
I released MNRT (including source code) to the public as I believe that I might not be able to concentrate on improving the application in the next time. Hence I want to allow others to check what I've done so far. Maybe someone has some ideas on improving MNRT. I'd be glad to hear about them.
Currently neither an English nor a German version of my thesis are available online. Please check the documentation of MNRT for some background on MNRT. It's available in English.
MNRT is not a fully functional application for end users. This section shows features and problems of the current version of MNRT, specifically the source code of MNRT.
- Almost everything (except e.g. scene and image loading) is implemented on the GPU using CUDA.
- GPU-based kd-tree implementation, following [Zhou et al. 2008]. Currently both triangle and point kd-trees are supported (see KDTreeGPU).
- GPU-based ray tracing implementation, including kd-tree traversal algorithm for intersection search (see raytracing.cu).
- GPU-based photon Mapping including final gathering to compute indirect illumination. This includes algorithms for photon tracing and density estimation.
- Iterative, histogram-based kNN-search implementation, following [Zhou et al. 2008].
- Accelerated final gathering step by adaptively selecting samples and subsequent interpolation (for indirect illumination).
- Accelerated density estimation using an illumination cut through the kd-tree of the photon map. Gathering k nearest photons is replaced by a spatial interpolation using RBF.
- CUDA implementations of parallel reduction and parallel segmented reduction (see MNCudaUtil.h).
- CUDA API overhead elimination using custom GPU memory pool which allocates big chunks of memory and hands segments of memory out to requesters (see MNCudaMemPool).
- Random number generation using NVIDIA's Mersenne Twister SDK sample.
- MNRT does not yet perform at frame rates required for computer games. Even the rates [Wang et al. 2009] reported cannot be reached.
- Currently only diffuse materials (BRDFs) are allowed. I already added some support for specular BSDFs (reflection, transmission), but it is currently disabled.
- Missing support for spherical harmonics. Using irradiance values instead of radiance fields. Furthermore there is no support to read glossy materials from scene descriptions, yet.
- Input scenes may only consist of triangles.
- Dynamic geometry, lights and materials are not implemented. Camera position however can be varied. The former would require an animation system. To simulate dynamic geometry, there is an option to rebuild kd-trees for objects and photon maps every frame.
- MNRT does not benefit from multiple GPUs, yet.
- Right now, the CPU cores are left unemployed and all work is done on the GPU. Moving some work to CPU cores might be a possible way to increase performance.
- Source Code Quality
- As MNRT is my first GPU-based application, it might not be the state-of-the-art of GPU-based programming.
- In no case does MNRT represent a high quality software product of good stability and extensibility.
- Seeming limitations of the CUDA API reduced the coherency of some components, e.g. limited scope of CUDA texture references (see raytracing.cu).
- Due to limited optimization, one might reach significant improvement for some parts of MNRT.
I used Microsoft Visual Studio for the development of MNRT. Hence MNRT is currently only available for Windows. But as I used almost no Windows specific code, compiling MNRT for other operating systems should be possible, assumed that the target system has support for CUDA. Please check the Usage Hints page for more details.
Copyright and License
MNRT is copyrighted by Mathias Neumann and released under a 3-clause BSD license. Check the Copyright and License page for details. Thus reuse of my work in other projects is encouraged. I'd be happy if you'd tell me of such reuse. To cite my work, you can use my thesis reference, see section Introduction.
- [Jensen 2001]
- Jensen, H. W.
Realistic Image Synthesis Using Photon Mapping
A K Peters, 2001
- [Pharr and Humphreys 2004]
- Pharr, M. and Humphreys, G.
Physically Based Rendering: From Theory to Implementation
Morgan Kaufmann Publishers Inc., 2004
- [Veach 1997]
- Veach, E.
Robust Monte Carlo Methods for Light Transport Simulation
PhD thesis, Stanford University, 1997
- [Wang et al. 2009]
- Wang, R.; Zhou, K.; Pan, M. & Bao, H.
An efficient GPU-based approach for interactive global illumination
SIGGRAPH '09: ACM SIGGRAPH 2009 papers, ACM, 2009, 1-8
- [Ward et al. 1988]
- Ward, G. J.; Rubinstein, F. M. & Clear, R. D.
A Ray Tracing Solution for Diffuse Interreflection
SIGGRAPH '88: Proceedings of the 15th annual conference on Computer graphics and interactive techniques, ACM, 1988, 85-92
- [Zhou et al. 2008]
- Zhou, K.; Hou, Q.; Wang, R. & Guo, B.
Real-time KD-tree construction on graphics hardware
SIGGRAPH Asia '08: ACM SIGGRAPH Asia 2008 papers, ACM, 2008, 1-11