pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Sphere Ray Trace

Sphere Ray Trace - 6.0.0

Ian Mallett (geometrian)

Tags:

Description

Lately, I've realized that while PyOpenGL is fast and powerful, it may not be quite powerful enough to create the realism I want easily.

Ray-tracing is a way to create super-realistic lighting effects, among other things. In this screenshot, for instance, you can see refractions and reflections.

Anyway, this is more of a tech demo than anything--it only works with spheres, as they are mathematically simple. There are a few bugs here. The refraction code is based off of my circle refraction program: http://www.pygame.org/project/768/?release_id=1324. The circle program, which currently just ignores internal reflection produces artifacts in the image. They're errors, since the refraction method is not implemented. Any problems show up magenta here. I'll fix all this later in perhaps another release.

Changes

Added refraction. Still has a few bugs therein, though...

Links

Home Page: http://geometrian.com/programming/index.php
Source: http://www.geometrian.com/data/programming/projects/Sphere%20Ray-Tracer/6.0.0/Sphere%20Ray%20Trace%203.zip

Screenshot


click to view original size

Releases

Sphere Ray Trace - 6.0.0 - Jun 12, 2008
Sphere Ray Trace - 4.0.0 - Jun 5, 2008
Sphere Ray Trace - 2.0.0 - Jun 5, 2008

Pygame.org account Comments

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

June 22, 2008 4:34pm - Ian Mallett - nickname: (geometrian)
Sorry about that. It appears to be fixed now. It can now be found on my website.
June 13, 2008 12:44am - Ian Mallett - nickname: (geometrian)
Ooooo dear. Scratch that. The server of my site is having issues. You can download this latest release at this temporary download location:
http://www.mediafire.com/?nm2vgz9vtbg
June 12, 2008 11:23pm - Ian Mallett - nickname: (geometrian)
Version 6.0.0 released! (Version 5.0.0 was pre-release work).
June 8, 2008 2:19pm - Ian Mallett - nickname: (geometrian)
I have come upon a dark secret of ray-tracing. Refractions and shadows cannot be done together exactly. One or the other can be done, but together, they are imperfect.
June 7, 2008 5:44pm - Ian Mallett - nickname: (geometrian)
No. And I will use it forever.
June 6, 2008 10:10pm - Paul Davey - nickname: (technomancer)
ever heard of the string method strip() ?
June 6, 2008 12:58pm - Ian Mallett - nickname: (geometrian)
It is possible that certain operating systems might work differently. On mine, "\n" is one character. I think in this case, changing the indexes in the scene loader could solve the problem. [x:-1] -> [x:-2] or something.

I added a gallery of ray-racing images online: http://geometrian.com/Gallery.php
June 6, 2008 12:55am - RB[0] - nickname: (roebros)
It doesn't appear to run for me.
It seems you aren't stripping the values correctly, ie: it is trying to float("0)"), instead of "0".
Also I got a "\r" in there - instead of no value :(

Looking good regardless though :D
June 5, 2008 10:34pm - pymike - nickname: (pymike) - 5/5
Woah. Nice work. Looks pretty dang cool :D
June 5, 2008 10:28pm - Ian Mallett - nickname: (geometrian)
Version 4.0.0 released! (Version 3.0.0 was pre-release work).
June 5, 2008 7:05pm - Emanuel Berg - nickname: (metabaron)
Very cool.
June 5, 2008 10:54am - Ian Mallett - nickname: (geometrian)
Fixed.
June 5, 2008 10:53am - Ian Mallett - nickname: (geometrian)
Good idea. I was having trouble with pygame.org last night (see pygame_users) but the problem was my download link. I deleted it, and haven't put it back since.
June 5, 2008 10:46am - pymike - nickname: (pymike)
Cool. :) You might want to include a direct link to the download though. Took a while to find it on the projects page.
June 5, 2008 8:00am - Francesco Mastellone - nickname: (effeemme)
Very interesting =)
June 5, 2008 1:38am - Ian Mallett - nickname: (geometrian)
Version 2.0.0 released! (Version 1.0.0 was 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
Oct 21, 2014


Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

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