Hydra

Okay, i hopped around when i read about Adobe Image Foundation’s Toolkit for Flash announced at MAX…
Fast custom blend modes and filters on the pixel level in Flash! Yay!

Only a subset of the Hydra language will be available for Flash. Most notably, the flow control statements will not be available (if, for, while…). However… i can imagine creative combinations of the ActionScript pixel manipulation instructions and Hydra to make up for this…

I cooked up this example for image blending that should work in Astro (Flash 10) according to the compiler.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
kernel BlendModeKPTExtrapolate
{
    parameter float mix
    <
        minValue: 0.0;
        maxValue: 1.0;
        defaultValue: 1.0;
    >;
 
    void evaluatePixel(in image3 srcA, in image3 srcB, out pixel3 dst)
    {
        pixel3 a = sampleLinear(srcA, outCoord());
        pixel3 b = sampleLinear(srcB, outCoord());
        pixel3 f = a * 2.0 - b;
        dst = a - mix * a + mix * f;
    }
}

(It’s the KPT Extrapolate blend mode…)

Hydra KPT Extrapolate

(Joa Ebert also has some more examples already…)


About this entry