My new ray tracer is starting to look good, even though there’s still quite a lot of work to do before its first public release.
Anyway, I was bored today, so I thought I’d upload a video of an early test. It’s a test of the keyframe animation system, and of the motion blur effect produced through monte carlo (distribution) ray tracing, when a non-zero shutter speed is selected.

Here’s a link to the video on youtube.
June 13, 2009 at 2:41 am
Nuclear is an achiever.
June 14, 2009 at 1:22 am
Gianni poly entypwsiako !!!
Mporeis na postareis kapoio link gia tutorials pou aforoun raytraces klp ???
June 14, 2009 at 6:40 am
smathegreek: I’m not sure about any tutorials, but I could suggest a book: “An Introduction to Ray Tracing” ( http://www.amazon.com/Introduction-tracing-Kaufmann-Computer-Graphics/dp/0122861604 ). Unfortunately I just noticed it’s quite expensive, but no matter, actually I can explain how to write a simple ray tracer in a few sentences. The algorithm is extremely simple and elegant.
For each pixel of the image, you start by generating a ray that starts from the view point, and passes through that pixel. Then you have to test that ray with all objects in the scene and find the closest intersection point (start by supporting only spheres and infinite planes which are the simplest objects to test for intersections). If there is no intersection, just assign black, or whatever you consider the “background” color to that pixel. Otherwise, at the closest intersection, calculate the color using the standard phong reflectance model and assign that to the pixel.
Adding reflections is trivial. At the intersection point, recursively call the ray tracing routine with a new ray which has that point as its origin, and direction equal to the reflected vector of the original ray by the normal, and just add the color it returns to the calculated direct color, multiplied by the “reflectivity” of the object. Refraction and shadows are equally trivial if you think about it.
Have fun, and let me know if you give it a try, and ask if you have any problems :)
June 20, 2009 at 9:48 pm
It looks good John ;)
Is SRay going to be an educational tool of yours, or are you heading for a production ray-tracer?
June 21, 2009 at 3:27 am
For the moment I’m just having fun with it, plus it’s my MSc dissertation project.
I will definitely release it when it’s close to usable, but whether I’ll carry on development and make it into something considered “production quality” in terms of features and performance, remains to be seen :)
June 21, 2009 at 6:56 pm
Ok, good to know – please keep us updated with your work! :)