AS3 Raytracer

Hey everyone, just been working on writing a raytracer in AS3. I did initially have the idea of creating it to run in real time but it soon became clear that above about 100 by 100 pixels as soon as there were a significant number of objects on the screen it pretty much froze!

So far implemented are objects (planes, boxes and spheres), reflections, diffuse reflections, shadows and diffuse shadows. Rendering 400 x 400 pixels takes approximately 2 seconds for most renders and the code is completely unoptimized. For a 2880x2880 pixel version the time is a few minutes.

Here are some links to the ray tracer at various stages:

Initial screenshots:

Added planes:

Real-time flash example - low resolution 50x50

Current stage:

Let me know what you think about it. Once its finished I will post a summary/tutorial of what I’ve learnt during making it. Remember all the images are made using AS3 code.

Cheers

Sam