I have simple blur shader which I calculate offsets in:
Piece of vertex shader:
output.texCoord1 = input.tex + float2( texelSize * -4.0f, 0.0f ); output.texCoord12 = input.tex + float2( texelSize * -3.0f, 0.0f ); output.texCoord13 = input.tex + float2( texelSize * -2.0f, 0.0f ); output.texCoord14 = input.tex + float2( -texelSize, 0.0f ); output.texCoord15 = input.tex + float2( 0.0f, 0.0f ); output.texCoord16 = input.tex + float2( texelSize, 0.0f ); output.texCoord17 = input.tex + float2( texelSize * 2.0f, 0.0f ); output.texCoord18 = input.tex + float2( texelSize * 3.0f, 0.0f ); output.texCoord19 = input.tex + float2( texelSize * 4.0f, 0.0f );
However with this manner I have artifacts on the sides of the screen: http://img822.imageshack.us/img822/9868/blurartifacts.png
I know that it occurs because when the offset goes out from the right it takes pixels from the left appropriately.
So my question is: how is the "standard" way to deal with this? I was trying to saturate() all of the values assigned to output.texCoordX, it removes the artifacts in 95%, but it makes my blur much weaker and with strange sharper edges ("roll my log and I will roll yours"?).