Flash 使用像素弯曲器对图像边缘进行加法混合

Flash 使用像素弯曲器对图像边缘进行加法混合,flash,adobe,shader,pixel-bender,Flash,Adobe,Shader,Pixel Bender,我正在尝试使用像素弯曲着色器添加图像的边缘,但我不太清楚如何检测边缘本身。我试过这个,但不起作用: { input image4 src; output pixel4 dst; void evaluatePixel() { if(outCoord().x == 0.0) { dst = sampleNearest(src, outCoord()); dst.rgb = float3(255.0, 255.0, 255.0); // just a

我正在尝试使用像素弯曲着色器添加图像的边缘,但我不太清楚如何检测边缘本身。我试过这个,但不起作用:

{
input image4 src;
output pixel4 dst;

void
evaluatePixel()
{
    if(outCoord().x == 0.0)
    {
        dst = sampleNearest(src, outCoord());
        dst.rgb = float3(255.0, 255.0, 255.0); // just a test to see if the left side will turn white
    }
    else
    {
        dst = sampleNearest(src, outCoord());
    }
}
}
我也不知道如何检测图像的宽度和高度

我试图通过将前几个像素混合在一起,使图像在边缘周围发光。x:0是1-4混合型,2是2-4混合型,3是3-4混合型


一些指导?

我认为从as3传递宽度和高度作为着色器参数的唯一方法