I'm performing gaussian blur with a 9 taps filter and I use bilinear filtering in turn to reduce the number of taps (i.e. getting two sample at once thanks to hw filtering..., so using just half of the taps [9/2]+1).
If I iterate over the previous blurred result to get more blur on the resulting image, the image itself gets darker and darker as the number of iterations raise ... until it gets completely black ...
Why this behaviour ?
Note: I've calculated my weights from the pascal triangle and normalized them, also the tex coords offset will reflect the border of the pixel to account for the fact that I'm using bilinear filtering to read more sample at once.
I show just the horizontal pass pixel shader source:
static const float weight[3] = {0.2270270270,0.3162162162,0.0702702703};
static const float offsets[3] = {0.0,1.3846153846,3.2307692308};
//perform horizontal blur
static const float2 invImageSize = float2(1.f/1000.f,1.f/800.f);
static const float downsampledLevel = 0.f;
float4 PSBlurH(VS_OUTPUT Input) : SV_Target{
float3 color = colorTexture.SampleLevel(textureSampler,Input.tc*invImageSize,downsampledLevel).xyz*weight[0];
[unroll]
for(int i=1;i<3;++i){
color += colorTexture.SampleLevel(textureSampler,Input.tc+float2(offsets[i]*invImageSize.x,0.f),downsampledLevel).xyz*weight[i];
color += colorTexture.SampleLevel(textureSampler,Input.tc-float2(offsets[i]*invImageSize.x,0.f),downsampledLevel).xyz*weight[i];
}
return float4(color,1.f);
}
It seems that the background color is influencing the cube ... :/

Thanks in advance for any reply













