//treshold fbTEX1 masked to fbTEX2
varying vec2 texCoord;
uniform sampler2D colorMap;
uniform sampler2D maskMap;
uniform float maskx;
uniform float masky;
void main (void)
{
vec4 pixelcolor;
	pixelcolor = texture2D(colorMap, texCoord);
	if (pixelcolor.r+pixelcolor.g+pixelcolor.b>3.3f) {
		pixelcolor=texture2D(maskMap, vec2(texCoord.x+maskx,texCoord.y+masky));
	} else {
		pixelcolor=vec4(0.0f,0.0f,0.0f,1.0f);
	}
	gl_FragColor = pixelcolor;
}
