Monday, October 01, 2007

Astro & Hydra - about the next flashplayer

Flash is a proprietary technology, often associated with "Skip Intro" and annoying ads. And for web applications most developers prefer AJAX. But for video and graphics effects there is nothing which can beat flash. And Adobe keeps making the player better and faster. They have yesterday updated their current flashplayer beta with some h264 video playback improvements and today revealed some of the capabilities of their next flashplayer codenamed Astro:

Advanced Text Layout
As long as the text is outside the Browser DOM, I am not really interested in that kind of stuff, sorry Adobe ...

3D Effects
There are today quite impressive 3D engines written in Actionscript such as Sandy and Papervision, but a native implementation will bring obviously a huge performance boost.

Custom Filters, Blend Modes and other Bitmap Effects
That seems to be something completely new. They provide a downloadable application called AIF Toolkit, (for Mac and Windows) where one can define graphical effects in a new scripting language called Hydra (syntax looks like a mixture between actionscript and c). I installed the tool on my Mac and loaded one of the provided code samples. The tool is a simple application with a text editor, an image preview area and a button labeled Run. If you press it, and the syntax of the code snippet is correct, the snippet gets compiled. The tool also contains a pdf document with the hydra language specification.
I couldn't figure out how to test such a compiled filter or effect. And I don't see how this can be integrated into an existing tool chain. But I guess this is not a problem for the average flash developer who is used to work with proprietary tools.

Update: Tried again and everything magically worked. After compilation you see immediately the result of the script in the image preview area and if the script has parameters, you can interactively change them. For example with the simple script below you can set the opacity of a bitmap:

// opacity: A simple example to demonstrate the use of the hydra to change
// the opacity of an image based on an input parameter
kernel opacity
// An input parameter used to specify the opacity of the image.
// The parameter comes directly from the user by way of the UI that gets
// created for the filter.
parameter float alpha;

// evaluatePixel(): The function of the filter that actually does the
// processing of the image. This function is called once
// for each pixel of the output image.
evaluatePixel(in image4 myImage, out float4 dst)
// Acquire the pixel value from the image at the current location
float4 myPixel = sampleNearest(myImage, outCoord());

// Calculate the output the pixel value:
dst = myPixel * alpha;

No comments: