 
     #define TAA_CLIP_HISTORY_SAMPLE 1
 
-    #define TAA_DEPTH_SAMPLE_PATTERN 0
     #define TAA_DEPTH_SAMPLE_SPREAD 1.
 
     #define TAA_SHARPEN_OUTPUT 1

    #endif

    #if TAA_CLIP_HISTORY_SAMPLE
        //# History clipping causes artifacts
        history = clipToAABB(history, average.w, minimum.xyz, maximum.xyz);
    #else
        history = clamp(history, minimum, maximum);

    {
        const float2 k = TAA_DEPTH_SAMPLE_SPREAD * _CameraDepthTexture_TexelSize.xy;

        const float4 neighborhood = float4(
            tex2D(_CameraDepthTexture, uv - k).r,
            tex2D(_CameraDepthTexture, uv + float2(k.x, -k.y)).r,
            tex2D(_CameraDepthTexture, uv + float2(-k.x, k.y)).r,
            tex2D(_CameraDepthTexture, uv + k).r);

        float3 result = float3(0., 0., tex2D(_CameraDepthTexture, uv).r);

        #if TAA_USE_EXPERIMENTAL_OPTIMIZATIONS
            result.z = min(min(min(neighborhood.x, neighborhood.y), neighborhood.z), neighborhood.w);

            if (result.z == neighborhood.x)
                result.xy = float2(-1., -1.);
            else if (result.z == neighborhood.y)
                result.xy = float2(1., -1.);
            else if (result.z == neighborhood.z)
                result.xy = float2(-1., 1.);
            else
                result.xy = float2(1., 1.);
        #else
            if (neighborhood.x < result.z)
                result = float3(-1., -1., neighborhood.x);

            if (neighborhood.y < result.z)
                result = float3(1., -1., neighborhood.y);

            if (neighborhood.z < result.z)
                result = float3(-1., 1., neighborhood.z);

            if (neighborhood.w < result.z)
                result = float3(1., 1., neighborhood.w);
        #endif

        return (uv + result.xy * k);
