# AS3 Raytracer

**URL:** <https://forum.kirupa.com/t/as3-raytracer/301915>\
**Category:** design\
**Created:** [December 17, 2009, 6:25pm UTC](https://forum.kirupa.com/t/as3-raytracer/301915 "2009-12-17T18:25:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slideth3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@slideth3](https://forum.kirupa.com/u/slideth3)\
**Post date:** [December 17, 2009, 6:25pm UTC](https://forum.kirupa.com/t/as3-raytracer/301915/1 "2009-12-17T18:25:00Z")

</div>

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:

> **[First Screenshots of my AS3 Raytracer](http://experimentalized.blogspot.com/2009/12/first-screenshots-of-my-as3-raytracer.html)**
>
> After writing a really simple ray tracer to render the Mandelbulb in my last post , I thought I'd write a slightly more advanced one, with m...

Added planes:

> **[Plane Intersections Added to Flash Raytracer](http://experimentalized.blogspot.com/2009/12/plane-intersections-added-to-flash.html)**
>
> I was working late on this last night when I should have been doing coursework. Anyway I managed to get plane intersections in the AS3. The ...

Real-time flash example - low resolution 50x50

> **[Quick example of real-time raytracing in flash](http://experimentalized.blogspot.com/2009/12/quick-example-of-real-time-raytracing.html)**
>
> Just a quick low res, and completely un-optimized example of an animated version of the ray tracer I've been working on. The light source mo...

Current stage:

> **[Flash Ray Tracer Reflections](http://experimentalized.blogspot.com/2009/12/flash-ray-tracer-reflections.html)**
>
> Finally managed to get reflections properly working in my actionscript raytracer. The mathematics behind reflections is very simple. Given a...

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
