Хочу создать фильтр свечения ярких объектов (скажем если сфоткана яркая точка то вокруг нее появится мягкий свет) в pixelbender...
Я знаю как узнать координаты самых ярких пикселей, проблема как их потом "размыть" по соседним... Кто нить может помочь?
Проблема в том что циклы он не поддерживает, выходит при радиусе размытия скажем 20 пикселей мне придется вручную писать 2*(20^2)=800 if'ов?
вот что я уже написал:

Код:
<languageVersion: 1.0;>
kernel glowWhite
< namespace : "AIF";
vendor : "Adobe Systems, Inc.";
version : 1;
description : "Glows white"; >
{
input image4 src;
output float4 dst;
parameter float threshold
<
minValue:float(0.01);
maxValue:float(1.0);
defaultValue:float(0.5);
>;
parameter float multiplier
<
minValue:float(0.01);
maxValue:float(5.0);
defaultValue:float(2);
>;
// evaluatePixel(): The function of the filter that actually does the
// processing of the image. This function is called once
// for each pixel of the output image.
void
evaluatePixel()
{
// Obtain the input pixel color
float4 inputColor = sampleNearest(src, outCoord());
// Calculate (1 - channel) for each of the RGB channels
dst.rgb = inputColor.rgb;
float2 pos = outCoord();
float4 sampled1 = sampleNearest(src, float2(pos.x, pos.y+2.0));
if(sampled1.r>threshold && sampled1.g>threshold && sampled1.b>threshold){
dst.rgb *= multiplier;
}
// set the alpha value equal to the alpha of the input
dst.a = inputColor.a;
}
}
скриптик окрасит светлые пиксели в кардинально белый цвет
как теперь размыть это дело?