After the overwhelming response of posting the sources of 300.000 pixels with Alchemy and Pixelbender, I thought it would be nice to post some more from my session at FITC Amsterdam.
First let’s take a look at what people have done in response of the previous sources.
All the work in that list is incredible, but for this post, I’m most interested in the last 2. Joa’s work on getting AS3 up to speed with my Alchemy demo (Joa’s demo is actually faster then the Alchemy version on my machine) is incredible. And it also proves the one thing I tried to convey in my blog post Adobe Alchemy, is it ActionScript Heresy ?.
Joa’s optimization relies mostly on a linked list implementation to iterate over the particles, and using the Flash 10 Vector type to allow for faster access to write to screen. Another speed improvement over the Alchemy version is not using Pixelbender, but having both rotation and projection done in the same loop as drawing to screen. All in all, his result on this is pretty awesome.
Again, writing highly optimized ActionScript should enable you to do the same speedwise as Alchemy compiled code. There’s at least one definitive advantage which Alchemy has in that case. The first advantage in Alchemy lies is the fast ByteArray access (which currently only Alchemy and Haxe can use).
The second advantage is why I think we should have a better AS3 compiler. It is the use of a more advanced compiler. This reduces the need to *highly* optimize your code, although I’d always recommend doing that in any case. My demo’s here are meant of examples on how to use Alchemy, rather then to get the last bit of performance out. That, we’ll leave to PapervisionX work.
Now, as I said, for this post we would be looking at two of the responses on my earlier Alchemy demo, the second one being Dennis Ippel’s Fast Plasma effects. Plasma effects and Lookup Table efffects aren’t too different. Ricardo Cabello did some experiments with them earlier, using Pixelbender. I worked on taking this type of effect and implementing it using Alchemy. Since that I had already done some experiments with them earlier, I thought it would be nice to release the sources, and see what you guys do with them. Maybe Joa feels like another shot of doing the same with ActionScript ?
Play around, let me know what you do with it, and make sure you check out Mr. Quilez his webpage, specifically, the article on Plane Deformations, where part of this code is derived from. If you want to optimize more, you *could* read Kebby’s article F***ing learn to code again.
One more observation : the difference between running this on Firefox on a Mac and just running it in the FlashPlayer is huge, even bigger then normal. Could someone from Adobe finally explain this ?