我试图用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 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混合类型的东西。
有什么建议吗?
发布于 2012-10-09 12:38:40
我认为从as3传递宽度和高度作为着色器参数的唯一方法是...
https://stackoverflow.com/questions/11838254
复制相似问题