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?