uniform sampler2D tex0; //image
uniform sampler2D tex1; //depth buffer

uniform vec2 size;
uniform float zo;
uniform float blur;

uniform float dp;

uniform vec3 color;

void main(void)
{
  float velocityScale = blur;

	vec2 texCoord = gl_FragCoord.xy/size;
  //float depth = clamp((1.0-texture2D(tex1, texCoord).r) * 100.0, 0.0, 1.0);
  
  float depth = texture2D(tex1, texCoord).r;
  
  depth = 1.0 - smoothstep(dp, 1.0, depth);
  
  
	vec4 texel = texture2D(tex0, texCoord);
  
   gl_FragColor = vec4(mix(color, texel.rgb, depth), texel.a);
   //gl_FragColor = vec4(depth, 0,0,1);

}