Submitted by , posted on 05 January 2005
Image Description, by
These are some images from my latest (yet unnamed) ray tracer. Everyone has
seen the bunny a thousand times now so I'm throwing in a real time demo as
well. :-) As you can see, so far I have been focussing on raw performance.
The ray tracer now fully implements Ingo Wald's packet tracing: Whenever
possible, four rays are cast simultaneously and traversed through a kd-tree.
By using packets, the ray tracer becomes very suitable for vectorization
using sse/sse2 instructions. Despite some overhead this approach doubles the
speed of a regular raytracer.
About the images: The top left image shows the famous Stanford Bunny model,
69k triangles. There are two (dynamic) light sources in this scene, and the
animation is rendered at 512x384 pixels. On my 1.7Ghz Pentium-M laptop this
runs at about 5 frames per second. To the right of this image a dump of the
matching kd-tree is shown.
The two lower images show the Happy Buddha model and the matching kd-tree,
which consists of no less than 1089k triangles. This model renders slightly
slower; on my system it runs at about 4 frames per second.
This brings up a very interesting characteristic of ray tracing: The
technology scales very well. Switching from 69k to 1089k triangles only
means that some extra levels are added to the kd-tree; the speed decrease is
therefore not linear at all. Besides that, ray tracing performance scales
virtually linearly with processing power and the number of available
processors. This means that, given a sufficiently complex scene, it's
possible to outperform high-end graphics cards using commodity hardware.
Also interesting is the fact that the ray tracing algorithm is very simple.
750 lines of code get me 'z-buffering' with virtually unlimited accuracy,
visibility determination, self-shadowing, recursive reflections and
refractions, hard and / or soft shadows, per-pixel lighting, HDR effects and
I'm currently working with Thierry Berger-Perrin to produce a more
interesting demo, perhaps similar to the famous RealStorm benchmark. In the
meantime, you can download the bunny demo (3.8MB).