Experiments in Ray-Tracing, Part 1

This is a very old article, included for historical interest only!

I was bored the other evening, so I decided to knock together a little ray-tracing application in C#. I’ve always wondered a couple of things about ray-tracing:

  • How fast can you make a ray-tracer?
  • How easy is it to code a tracer that produces realistic images?

(You might think it’s a little odd to be trying to write a fast ray-tracer in C# - but realistically, a C++/assembler implementation would only be a few times faster – so I can get an idea of how fast it could potentially be, while keeping the fast development environment of .NET).

I’m going to write a series of articles about how I’ve coded it so far, but to answer those two questions first:

  • I can render approximately 200,000 anti-aliased, ray-traced pixels per second in pure C#, and,
  • Writing a ‘standard’ ray-tracer really is easy… writing an optimized one is trickier… and writing a photo-realistic one is going to take me more time.

Here’s where I’ll be going in the first set of articles:

Example ray-traced image

(I’ve doubled the size of the pixels so you can get a better idea of what’s being produced).

Yes – it’s shiny balls on a chessboard. There’s a reason that’s the first image everyone produces in a ray-tracer – but I’ll get onto that later.

Published: Friday, July 11, 2008

Pinterest
Reddit
Hacker News

You may be interested in...

Hackification.io is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. I may earn a small commission for my endorsement, recommendation, testimonial, and/or link to any products or services from this website.

Comments? Questions?