Home arrow cmd940
 
Raytracing

I started writing my own raytracer for my Bachelor Thesis with C++ in December 2004, utilizing my own (now outdated) math3d++ library for the necessary vector math, and was able to get the first results within less than a week.

I continued development at a much lower pace and added documentation to the source code, so that others, reading my code, could understand what i intended.

To be able to test new materials and pixel sampling patterns I developed some realy simple test scenes. The renderings of them can be seen below:

Most of the scenes feature perfect spheres with different materials applied to hem. The checkerboard texture in the images is a procedural texture. In the second and third image there is also a procedural bumpmap applied to it. The last three images feature High Dynamic Range (HDR) rendering. All the light in these scenes comes from a HDR Cubemap. To the last images a glow effect was applied as a post process.

Appart from manually unrolling small loops in the math3d++ library (which speeded things up quite a lot) the raytracer does not use any optimizations! On my old computer (Athlon TB 1.2 GHz) it takes 1.19 seconds to render the first scene at a resolution of 640x480 pixels with 1 sample per pixel.

Sice I also had to write a second Bachelor Thesis i decided to extend my raytracer so that it also supported rendering of large 3D meshes. As an acceleration data structure I decided to use a KD-tree. The test models I took from the Stanford 3D Scanning Rendering Repository, which offers models with millions of polygons. The results you can see below:

The image shows the Thai statuette from the 3d model repository which has 10 million polygons. I was able to render this model in less than a second! The above image took a bit longer though because it features Monte Carlo and HDR rendering (therefore the noise in the image).

Below you can download both of my Bachelor Theses and also the source code for the raytracer.


Source code
 Raytracing 1 (German)
 Raytracing 2 (German)
 
< Prev   Next >


© 2008 Trenki's Programming Page
Joomla! is Free Software released under the GNU/GPL License.
Template Design by funky-visions.de