Raytracer. July 15, 2010 at 2:24 pm
Ray tracing is one of many techniques to render images with a computer by tracing the path of light through pixels in an image plane and simulating the effects of its encounters with virtual objects (Reference: Wikipedia). Ray tracing has been used in production environment for off-line rendering for a few decades now, but in times of increasing computing speeds and due to the high quality of the visual effects it achieves, ray tracing is becoming more and more applicable for interactive and animated rendering. Yeah, real time ray tracing! Sounds good in the abstract - but of course mostly fails when it comes to Flash which has no hardware acceleration at all…
Ok, there have been attempts building real time raytracers with Flash in the past and probably Strille´s raytracer was worth mentioning in recent years, but a few days ago I took notice of Simo´s fantastic approach of real time ray tracing. In that case the entire calculations are done with Pixel Bender and Flash just draws the final result. Not forgetting Ralph´s raytracer at this moment, but his example doesn´t show all of its power by far because if you ever visited one of Ralphs sessions you´ll see that his raytracer took giant strides from then on!
Seeing all this great approaches recently I resolve upon writing my own little raytracer by not using Pixel Bender but Alchemy as my weapon of choice. I decided to stay close to Simo´s setup so we finally can compare framerates aso. So, after a few eves and nights of tweakings and optimizations I got my raytracer running ~32fps, so here we go…

Launch (click stage to switch movement)
It´s still a very basic raytracer, so no refractions, Fresnel, noisy bump or other procedural texture mapping, but it runs very smooth and that´s a good beginning so far. Lastly, believing in the Flash community and that open source helps on developing all that great stuff we can use with Flash today, feel free to catch the sources.
Enjoy!



[…] actionscript microcosmos » Raytracer. dasprinzip.com/prinzipiell/2010/07/15/raytracer/ – view page – cached Ray tracing is one of many techniques to render images with a computer by tracing the path of light through pixels in an image plane and simulating the effects of its encounters with virtual objects (Reference: Wikipedia). Tweets about this link […]
[…] Go here to see the original: actionscript microcosmos » Raytracer. […]
[…] Adres URL: actionscript microcosmos » Raytracer. […]
[…] - didn´t I just wrote about ‘Raytracer‘ and ray tracing lastly? ;) Btw., never seen demos done by TBC? You really should take a look […]
Hi there, great blog! I’ve been doing a load of work on raytracers as well in flash which you might be interested in!
http://experimentalized.blogspot.com/2009/12/flash-ray-tracer-reflections.html
Hi Sam,
interesting stuff but unfortunately ‘only’ images… I´m more interested in seeing your approach under real time conditions in flash. ;)
[…] raytracing in AS3, there are a few better ones than mine out there. Frank is using alchemy, David too (I think), and Simo is using pixel bender, and I’ve done another one, not in real […]