//------------------------
//Fragment shader
#version 110
uniform sampler2D Texture0;  //Mask
uniform sampler2D Texture1;
uniform sampler2D Texture2;
//------------------------
varying vec2 TexCoord0;
//------------------------
void main()
{
	vec4 texel0 = texture2D(Texture0, TexCoord0);
	vec4 texel1 = texture2D(Texture1, TexCoord0);
	vec4 texel2 = texture2D(Texture2, TexCoord0);
	gl_FragColor = mix(texel1, texel2, texel0.a);
}