pygame is
Simple DirectMedia Layer is
Site Swing
Ray Tracer

Ray Tracer - 4.0.0

Ian Mallett (geometrian)



OK, you knew this was coming. From circular refraction and spheres comes the first actual ray-tracing thingie. Weeeeeeee!

At present, it is pretty slow--the screenshot took several minutes to render, but note the subtle reflections and the crisp shadows! (Incidentally, the artifacts around the edges of the wheel are not due to the program, but due to my inferior skill at modeling).

There are more pictures on my ray-tracing gallery, and I'll soon add some way for you to post yours.

Have fun!


Home Page:


click to view original size


Ray Tracer - 4.0.0 - Jun 24, 2008 account Comments

If you wish to leave a comment with your account, please sign in first.

May 16, 2009 7:28pm - Ian Mallett - nickname: (geometrian)
Hey, yea I was thinking of doing this with NumPy as well. If there's interest, I may do so. The problem is optimizations (to the ray intersections) are REALLY annoying.
December 3, 2008 9:37pm - Clark Van Oyen - nickname: (echo85) - 5/5
Very nice work! It might be interesting to try compiling this with pyrex. Doing this gave my raytracer a 10 fold speed boost, but yours is almost as fast without compiling!
August 14, 2008 3:40pm - Ian Mallett - nickname: (geometrian)
The optimisations are coming along well. A 512x512 render takes ~13 seconds, start to finish; though no shadows, reflections, etc. have been implemented.
June 25, 2008 3:15pm - Ian Mallett - nickname: (geometrian)
Took me about 3 min.

But yes. Very slow. I'll try to get a cube tree optimization or something.
June 25, 2008 12:31pm - patrick mullen - nickname: (saluk) - 4/5
This is impressive, but as mentioned is excruciatingly slow. Took me 16 minutes to render the test scene!
June 25, 2008 10:43am - Ian Mallett - nickname: (geometrian)
Unfortunately, yes. Currently, the structure is organized into bounding spheres--so if a ray hits the bounding sphere of this wheel, say, the ray is also tested against all the polygons, which can take a while. In this case, there are several hundred, so it it not too bad, but with thousands or even the millions that are common in modern graphics, it becomes impractical.

This ray-tracer does support reflections and shadows right now, though, so it will work like other ray-tracers (with the exception of caustics). For now, this is useful if you want a nice render of something simple.
June 24, 2008 4:49pm - pymike - nickname: (pymike)
Very cool! Very slow though...
June 24, 2008 3:57pm - Ian Mallett - nickname: (geometrian)
Version 4.0.0 released! (Versions 1.0.0-3.0.0 were pre-release work).

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Nov 17, 2015

Nov 12, 2015

Nov 11, 2015

Nov 8, 2015

Oct 16, 2015

Oct 9, 2015

Sep 11, 2015

Sep 6, 2015

Aug 26, 2015

Aug 25, 2015

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)