pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Ray Tracer

Ray Tracer - 4.0.0

Ian Mallett (geometrian)

Tags:

Description

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!

Links

Home Page: http://geometrian.com/programming/index.php
Source: http://www.geometrian.com/data/programming/projects/Ray-Tracer/4.0.0/Ray%20Tracer%204.zip

Screenshot


click to view original size

Releases

Ray Tracer - 4.0.0 - Jun 24, 2008

Pygame.org account Comments

If you wish to leave a comment with your pygame.org 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).
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Aug 2, 2014

Jul 28, 2014

Jul 22, 2014

Jul 21, 2014

Jul 20, 2014

Jul 19, 2014

Jul 15, 2014

Jul 10, 2014

Jul 9, 2014

Jun 27, 2014



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