XNA 3.0 Hybrid Ray Tracer

May 16, 2008

Last week while going through my personal software graveyard, I "dug up" a ray tracer I started a few years ago. I had written it using C#, and it was rendered using GDI+. I decided to bring it up to date - and you can't get newer than the XNA 3.0 CTP, released last week. At this stage there's hardly any new features related to Windows development, apart from audio, but I like being able to use Visual Studio 2008 and LINQ.

Anyway, one thing that annoyed me about my previous implementation was how difficult it was to move the camera around. So, I decided to write a hybrid ray tracer:


The current version is fairly basic, both in terms of ray tracing and rasterization. The two render methods are also not very similar - about the only thing they are the same at is object position. However, I know it's usually better for me to upload something, however basic, just to get the ball rolling. So here it is. Feel free to use the code in any way you like. Hopefully you'll find it logically structured.

The camera has two modes:

My todo list:


comments powered by Disqus