Sep 2, 2010
So… alchemy… yeah. Install a bunch of crap on your system, write C/C++ code, compile it to a swc with gcc/g++, wait for the compiler to finish it’s work, use that heavy as hell swc in your AS3 code… realise calling alchemy code often is a performance killer, minimise calls to alchemy functions/code, write more C/C++ code…
It’s a little redundant to say the least, and thank god I use a Makefile…
All in all alchemy is a pain in the ass, in my opinion.
Anyway, I tried it out and got a small real time raytracer working, with a couple lights, some spheres and reflections. There is no way that would be possible in pure AS3 (well, I’m incapable of doing it in pure AS3), so there is no doubt alchemy give a pretty neat performance boost to AS3. Now that’s cool, and people have been doing some cool stuff with it. But then I think, if alchemy code if the same thing as compiled AS3, why the hell is it faster ? I’ve not really gotten into the details of what happens to the nice C code after the llvm has it’s way with it, but when I think about it, it’s like someone is asking me the meaning of life.
Ah well, who cares in the end, the performance is there, let’s take advantage of it.
About 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 time and without alchemy, that I might finish one day if I get some time. It’s really cool to see where people are taking AS3, and pushing it to it’s limits.