Hydra

The keynote at Adobe MAX at Chicago just finished. Get your hands on Hydra now!

via Kevin Goldsmith

I am currently reading through the Hydra manual. Actually it is kinda sad again. It is cool BUT the cool stuff is not available in Flash. Anyways I thinkwe can squeeze a lot of nice effect out of this anways.

My very first Hydra filters:

kernel BlendModeADD
{
  parameter pixel4 intensity;

  void evaluatePixel(in image4 source, out pixel4 result)
  {
    pixel4 in_pixel = sampleLinear( source, outCoord() );
    result = in_pixel + intensity;
  }
}

Here is another one:

kernel ColorMatrixFilter
{
  parameter float4x4 matrix;

  void evaluatePixel(in image4 source, out pixel4 result)
  {
    pixel4 in_pixel = sampleLinear( source, outCoord() );
    result = in_pixel * matrix;
  }
}

I think pure AS3 developers will like this syntax ;)

Update: Here is a simple sharpen filter. Check out the two techinques. I think both are completly wrong but it works. Time will definitly tell how to use this proper.

kernel Sharpen
{
    parameter float strength;
    
    void evaluatePixel(in image4 source, out pixel4 result)
    {
        int i;
        int j;
        
        float2 coords = outCoord();
        pixel4 s = pixel4( -strength, -strength, -strength, -strength );
        pixel4 total = pixel4(0,0,0,0);
        float factor = 8.0 * strength + 1.0;
        pixel4 f = pixel4(factor,factor,factor,factor);
        
        for ( i = -1; i <= 1; i++ )
        {
            for ( j = -1; j <= 1; j++ )
            {
                pixel4 current = sampleLinear( source, coords + float2(i,j));
                
                if ( i == 0 && j == 0 )
                {
                    total += f * current;
                }
                else
                {
                    total += s * current;
                }
            }
        }
        
        result = total;
    }
    
    /*
    void evaluatePixel(in image4 source, out pixel4 result)
    {
        float2 coord = outCoord();
        pixel4 tL = sampleLinear(source, coord - float2(1,1));
        pixel4 tM = sampleLinear(source, coord - float2(0,1));
        pixel4 tR = sampleLinear(source, coord + float2(1,-1));
        pixel4 mL = sampleLinear(source, coord - float2(1,0));
        pixel4 mR = sampleLinear(source, coord + float2(1,0));
        pixel4 bL = sampleLinear(source, coord - float2(1,-1));
        pixel4 bM = sampleLinear(source, coord + float2(0,1));
        pixel4 bR = sampleLinear(source, coord - float2(-1,-1));
        pixel4 mM = sampleLinear( source, outCoord() );
        pixel4 s = pixel4( -strength, -strength, -strength, -strength );
        float ms = 8.0 * strength + 1.0;
        pixel4 up = pixel4(ms,ms,ms,ms);
        result = s * tL + s * tM + s * tR + s * mL + s * mR + s * bL + s * bM + s * bR + mM * up;
    }
    */
}

Update 2: More hydra examples.

4 Comments

  1. Posted Oct 1, 2007 at 10:59 pm | Permalink

    Wow! That was super fast! Find me at MAX. I’ll buy you a beer and we can talk about how you can do more than you think within the limitations of the Hydra subset for Flash.

  2. Austin
    Posted Oct 1, 2007 at 11:48 pm | Permalink

    What do you mean when you say:

    “Actually it is kinda sad again. It is cool BUT the cool stuff is not available in Flash.”

    I thought that the effects were able to be applied in the next flash player?

  3. Posted Oct 1, 2007 at 11:51 pm | Permalink

    Reading through the docs. You can see that a set of features is not available in the Flashplayer. But it is great. I want to get home to play around with it even more and tomorrow I will be able to post some more news about it.

  4. Posted Apr 22, 2008 at 8:01 pm | Permalink

    Wow realy nice Job. I will try it for my next Projekt.
    Adobe Hydra is coool.

8 Trackbacks

  1. […] Update: Here are first 2 examples of Joa’s Bitmap filters […]

  2. […] Link: Adobe Image Foundation (AIF) Link2: AIF Examples […]

  3. […] Exemplo de script Hydra aqui. […]

  4. […] Some Hydra filters by Joa Ebert. […]

  5. […] (Joa Elbert has more) […]

  6. By Manuel’s Coding Blog » Hydra is here! on Oct 2, 2007 at 5:12 pm

    […] Player for custom bitmap filters, blend modes and a bunch of exciting new stuff! Also, congrats to Joa as he wrote the first non-Adobe hydra filter! I had some difficulties installing the package since […]

  7. […] already has a load of examples here, here and here and Mario also has a few examples up here and […]

  8. By Extrajetzt® Blog on Oct 8, 2007 at 6:08 pm

    […] Links für ausführliche Infos: – Ralph Hauwert’s Blog – Kevin Goldsmith – Joa Ebert’s Hydra Experimente […]