Lattice - an pure Alchemy brewage. May 7, 2010 at 3:20 pm
My last weeks were strongly characterized by scripting ideas in C that might make new things possible in Flash. By doing so I´m reading a lot of research-docs and such and among lots other things I came across this little piece of code called the Lattice Effect. “Phew,” quite a lot of loops-, iterations-, and calculations in there so it might not work in Flash only, but I thought I should give it a try by using Alchemy. And look mom - it´s running!
Well, in my case the Lattice Effect is completely calculated in C (which isn´t the most performant way at all) and Flash is not used for more than displaying the ongoing results… but hey, calculating ~33600 pixels from the scratch in realtime building this lattice is pretty worth doing this way. For now you can switch the ‘display-mode’ between fisheye- and normal lens by simply clicking on the stage.
And here goes the pure Alchemy brewage…
And due to the fact that this is just an actual byproduct from what I´m working on, I´m pretty looking forward optimizing and speeding things up. Want to optimize and speed up this effect yourself? Download the full sourcecode here.




Cool!
I’m back on the Alchemy bandwagon myself, calculating with massive amounts of particles/pixels.
One thing I encountered, is that somehow Alchemy tends to overtake the runtime layer which listens to UI responses from the user.
For example, I can have code running at 60 FPS with no visual stutter at all, yet input commands tend to lag behind up to many a second after a while.
My current workaround is to have Alchemy code execute on every second/third frame, which seems to open up the UI layer again.
Encountered anything similar? Or perhaps you call the Alchemy code in a different matter?
Very nice. I also remember being blown away when I first saw the Puls demo. Good find with the link explaining how it was done :)
@Frank Pepermans: Didn´t run into the same probs yet. I call my Alchemy code every frame too. looking for speed optimizating my whole script in the moment - let´s see if and when your problem pops up in my case. ;)
@Tom:An pure PixelBender-Lattice approach would be worth while… counting on you! ;)