uniform sampler2D 	tex;
varying vec2	t1,t2,t3,t4;
varying vec2	t0;

void main()
{
	vec4 	color;
	
	color=texture2D(tex, t0);
	color=max(color,texture2D(tex, t1.xy));
	color=max(color,texture2D(tex, t2.xy));
	color=max(color,texture2D(tex, t3.xy));
	color=max(color,texture2D(tex, t4.xy));	
/*	color=max(color,texture2D(tex, t1.zw));
	color=max(color,texture2D(tex, t2.zw));
/*	color=max(color,texture2D(tex, t3.zw));
	color=max(color,texture2D(tex, t4.zw));	*/

	gl_FragColor =  color;
}

/*float BlurFunction(vec2 uv, float r, float center_c, float center_d, inout float w_total)
{
    float c = texture2D( tex, uv ).r;
    float d = -texture2D( depthTex, uv ).r;

    float ddiff = d - center_d;
    float w = exp(-r*r*g_BlurFalloff - ddiff*ddiff*g_Sharpness);
    w_total += w;

    return w*c;
}

void main()
{
	float b = 0;
	float w_total = 0;
	float center_c = texture2D(  tex, t0 ).r;
	float center_d =  -texture2D( depthTex,  t0 ).r;

	for (float r = -g_BlurRadius; r <= g_BlurRadius; ++r)
	{
		vec2 uv =  t0 + vec2(r*ofs,0.0);
		b += BlurFunction(uv, r, center_c, center_d, w_total);	
	}

	gl_FragColor = b/w_total;
}*/