In WPF OuterGlowBitmapEffect is no longer supported nor rendered by Net4.0. DropShadow has a little in common and not acceptable in my case. My initial goal is to make a white blurry background for black ClearType text upon AeroGlass window to make it more readable on a dark scenes. I started to play with fx and HLSL. It is quite interesting and powerful but I still can not get closer to OuterGlowBitmapEffect.
My current dummy version that reflects the idea:
sampler2D Sampler : register(S0);
#define PI 3.14f
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 px = tex2D(Sampler, uv);
/*
if (px.a > 0.9)
{
return px;
}
*/
const float d = 3;
int cnt = 0;
float a = 0;
for (float x = -0.1*d; x < 0.1*d; x += 0.05*d)
{
a += tex2D(Sampler, uv + float2(x, 0)).a;
a += tex2D(Sampler, uv + float2(0, x)).a;
a += tex2D(Sampler, uv + x).a;
cnt += 3;
}
a /= cnt;
float4 s = a;
float4 r = float4(px.rgb*px.a + s.rgb*(1-px.a), max(px.a, a));
return r;
}
BTW: can I get a HLSL source for DropShadowEffect to use it as a reference? Can someone point me to an OuterGlowEffect algorithm in any language?
NOTE: Windows 7 Aero Glass title bar have such effect to make title more readable! That exactly what I'd like to have for my text on other parts of window (DwmExtendFrameIntoClientArea applied)