# Why does my blur shader implementation produce this strange result?

I tried to implement the blur shader shown here.

Instead of having a simple 2D texture I use Unity's GrabPass function to capture what's behind the plane to have a transparent effect. Then I apply this on a 3D plane:

struct v2f {
float4 pos : SV_POSITION;
float4 screenPos : TEXCOORD3;
float3 uv;
};

v2f vert(appdata_full v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.screenPos = ComputeScreenPos(o.pos);
o.uv = UNITY_PROJ_COORD(o.screenPos);
return o;
}

// In the frag part there is the shader blur computation but based on XYZ, with Z = 0


Then I apply the blur and this leads to this when I zoom in:

Is there a way to avoid this effect?

• The duplication effect is due to the samples in the blur kernel being spaced too far apart. You need to either decrease the radius of the blur, or add more samples so that you can blur such a large radius smoothly. (Or apply multiple blur passes, or downsample the image before blurring it.) Jun 9 '13 at 18:05
• A good blur is to use 1/width and 1/height for X, Y respectively. Jun 10 '13 at 4:08