views:

2203

answers:

9

I am interested in finding recommendations on books on writing a raytracer, simple and clear implementations of ray tracing that can be seen on the web, and online resources on introductory raytracing.

Ideally, the approach would be incremental and tutorial in style, and explain both the programming techniques and underyling mathematics, starting from the basics.

+1  A: 

This user has some interesting tutorials on ray tracing, these tutorials use C# I believe:

http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=3589667

I'm sure there will be some better tutorials, but this might be of interest.

BobbyShaftoe
A: 

Have you seen povray? IMHO it is a very good starting point to understand ray-tracing (http://www.povray.org/)

pglowack
+8  A: 

"Ray Tracing from the Ground Up" by Kevin Suffern for getting started.

"Physically Based Rendering" by Matt Pharr and Greg Humphreys for a more advanced take on it when you've gotten comfortable with the basics.

And if you get really into it, the Ray Tracing News archives are a good read. Also, a lot of ray tracing enthusiast hang out at the ompf.org forum.

Boojum
+2  A: 

As said above, the best book you can possibly get is Physically based Rendering by Matt Pharr (check out www.pbrt.org). Explains a lot of algorithms in great detail, including advanced stuff like photon mapping. Moreover, it includes a fully working ray-tracer, so you can take a look at it. It also covers the math basics, so if you don't want to buy many books, I'd definitely recommend to take a look at this one.

It's much better than the classic books on this subject, as they tend to explain only the theory, not so much how to really implement it. For basics, any math book will do it, or you could try "Realtime collision detection", which also explains lots of intersection routines (which you will need in ray-tracing).

If you really want to start at the basics, you should try "Computer Graphics: Principles and Practice", it's dated (some parts are really nonsense now), but it explains the basics pretty well. If you want a more recent book, try "Fundamentals of Computer Graphics", which contains the same, just not that detailed (should be good enough to get you started thou).

Last but not least, the wikipedia page on Raytracing is actually pretty good and should give you some starting points. Take a look at the external links section.

Anteru
+4  A: 

Ok, I haven't found any perfect answers myself, that step through from the very basics; I have found a lot of simple ray tracers, and pointers to voluminous textbooks and academic references however.

I haven't tried these ray tracers, but they look interesting and simple.

http://www.barakcohen.co.il/2008/10/ray-tracing-simple-java-open-source.html

http://blogs.msdn.com/lukeh/archive/2007/04/03/a-ray-tracer-in-c-3-0.aspx

http://www.ffconsultancy.com/languages/ray_tracer/

From the ACM Cross Roads student magazine

http://www.acm.org/crossroads/xrds3-4/raytracing.html

This one in C++ is at least short; simplicity was lost for speed

http://ompf.org/ray/sphereflake/

A PhD Thesis on some aspects of ray tracing is here

A series of articles on DevMaster is here

The OMPF forum must read series of posts can be found here

It sounds like the book "An Introduction to Ray Tracing" is what I need ;-), and the authors home page is here for more graphics related programming.

Ray tracing from the ground up includes downloadable ray tracer source code too.

MiniLight is a minimal global illumination renderer.

SmallPT is a global illumination renderer, in 99 lines of C++, with a variant using single precision float on CPU and GPU in OpenCL.

Thanks to the other posters for the pointers

grrussel
The Glassner book (intro to ray tracing) is the one I used.
Alnitak
+1  A: 

The advanced rendering class I took in college had the best designed projects I've ever seen. With the project helps and the lecture notes, all you need is on the website.

The basic idea is that it's really easy to make very subtle bugs in a raytracer, especially when you get into things like refraction. If you're just randomly creating a bunch of spheres in space, it's pretty hard to verify correctness or diagnose errors.

So, there's a parser that's easy to incorporate into your own code, and a bunch of diagnostic scene files. The first file is the easiest to get working (eye at origin, looking down one axis, a single sphere), and if you can render them all correctly, you are pretty much guaranteed to have a properly working raytracer.

Additionally, the parser uses the RIB format, which is Pixar's standard scene file format, and can be exported from pretty much any modeler.

It also explores distributed raytracing and path tracing, which can give you some really nice images.

tfinniga
+1  A: 

If you are looking for a single good book that brings you from nothing to working code that can produce images, I started with Andrew Glassner's An Introduction to Ray Tracing. I can't get to Amazon right now but here is the relevant link.

Coincidentally, this is actually the book and problem domain that introduced me to object-oriented design. Boy, that was a while ago....

From there, I would recommend moving on to Pete Shirley's book, as the Wikipedia bibliography seems to imply. Actually, an even better suggestion is to take his ray tracing class. It worked for me!

Bob Cross
+1  A: 

A few years ago someone challenged me to do a Delphi port of a tiny ray-tracer (less than 200 lines of C code).

i ported it to Delphi, perhaps one day i'll re-port to C#.

Ian Boyd
+1  A: 

The best one I have found is: http://www.devmaster.net/articles/raytracing_series/part1.php This tutorial does tend to move a bit fast, but it covers lots of aspects of raytracing.

a_m0d