wonderfl post – dripping, breeding

March 6th, 2010

While I’ve been stuck with Pixel Bender, since its functions available for flash player are too limited, I accidentally found out that DisplacementMapFilter can add interesting effects to my previous sample code.

wonderfl post – dripping, breeding

February 24th, 2010

After an absence of more than a month, I’ve posted a trivial code to wonderfl. This is actually a preparation to testify bitmap filters made with PixelBender. The challenge is to simulate breeding on different materials such as paper, silk, stone, etc and keep the codes as simple as possible.

Red and blue stereo skiing

January 10th, 2010

Commemorating Sony’s announcement of their dedication for 3D in winter CES

Pixel Bender – Chroma key filter

January 4th, 2010

As a study of Pixel Bender, I wrote a very rough chroma key filter that makes a specified range of colors transparent. This is my first time working on Pixel Bender, but it turned out to be quite simple as it didn’t take me more than half an hour to make this demo after downloading the reference.
The result may look clumsy, I admit, but the poor movie that I took with a mobile phone should be blamed rather than the filter itself.

<languageVersion : 1.0;>

kernel ChromaKey
<   namespace : "info.kynd";
    vendor : "kynd.info";
    version : 1;
    description : "makes specified range of colors transparent";
>
{
    input image4 src;
    output pixel4 dst;

    parameter float4 keyColor
    <
        minValue: float4(0.0, 0.0, 0.0, 0.0);
        maxValue: float4(1.0, 1.0, 1.0, 1.0);
        defaultValue: float4(0.0, 0.0, 0.0, 1.0);
        description: "color that is used for keying";
    >;
    parameter float range
    <
        minValue: 0.0;
        maxValue: 1.0;
        defaultValue: 0.0;
        description: "range of color that the filter is applied";
    >;

    void
    evaluatePixel()
    {
        float4 color = sampleNearest(src,outCoord());
        float dist = distance(color, keyColor);
        if (dist <= range) {
            dst = float4(0.0, 0.0, 0.0, 0.0);
        } else {
            dst = color;
        }
    }
}
Related Posts with Thumbnails