Submitted by Trenkwalder Markus, posted on 11 March 2005



Image Description, by Trenkwalder Markus


Lately I was interested in raytracing. I started writing my own raytracer with C++ in December 2004, utilizing my own 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 for antialiasing I created some simple test scenes which you can see in the images.

Most of the scenes feature perfect spheres with different materials applied to them. The checkerboard texture in the images is a procedural texture. In bottom two images there is also a procedural bumpmap applied to it.

The top image and the left image in the second row feature High Dynamic Range (HDR) rendering. All the light in these scenes comes from a HDR cubemap.

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

Source code can be downloaded at http://trenki.gippsbiz.com/raytracer/



[prev]
Image of the Day Gallery
www.flipcode.com

[next]


 


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.