Quote:


Color = tex2D( postTex, Tex.xy);
// the entire screen get's rendered at it's normal position once
Color += tex2D( postTex, Tex.xy+0.001);
// the entire screen get's rendered again, but this time it's moved a little bit,
which causes a blur if done 2 or 3 or more times.

Color += tex2D( postTex, Tex.xy+0.003);
Color += tex2D( postTex, Tex.xy+0.005);
Color = Color / 3.5; // as you can count, the entire screen get's rendered 4 times,
if you divide it to 4, colors will be normal. However if you divide it through less than 4,
the multiplication of colors will be visible. Which causes the "some sort of bloom" effect.






If you don't want a blur at all, do as Slin suggests. However because you may want a tiny blur for a more 'bloom-like' result and because it gives a nice 'anti-aliasing' too, you could play with the values 0.001 , 0.003 and 0.005.

Code:
  
texture postTex1;

sampler postTex = sampler_state
{
texture = (postTex1);
MinFilter = linear;
MagFilter = linear;
MipFilter = linear;
AddressU = Clamp;
AddressV = Clamp;
};

float4 MyShader( float2 Tex : TEXCOORD0 ) : COLOR0 {

float4 Color;Color = tex2D( g_samSrcColor, Tex.xy);
Color += tex2D( g_samSrcColor, Tex.xy+0.001);
Color += tex2D( g_samSrcColor, Tex.xy+0.0011);
Color += tex2D( g_samSrcColor, Tex.xy+0.0012);
Color = Color / 2.5;
return Color;
}

technique PostProcess {
pass p1 {
VertexShader = null;
PixelShader = compile ps_2_0 MyShader();
}
}



This one for example has less blur, but higher overexposured 'gloominess'. The lower the 0.001 to 0.005 values, the less blur, it's the amount the entire screen get's shifted and rendered on top of the other rendered screens.

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software