uniform sampler2D Texture0;
uniform sampler2D Texture1;

/*void addFresnel()
{
	vec4 white=vec4(1,1,1,1);
	
	float f = 1.0+ dot(vertToEye, vnormal);		//[-1..0/.1] -> [0..1/.2]
	f*=f;
	gl_FrontColor += white * f;
}*/

void main()
{
	vec4 texel0, texel1, resultColor;
	vec4 pink=vec4(1,0,1,1);
	//-------------------
	texel0 = texture2D(Texture0, gl_TexCoord[0].xy);
	texel1 = texture2D(Texture1, gl_TexCoord[1].xy);
	//-------------------
	if(texel0.a<0.5)	discard;
	else{
		gl_FragColor = texel0;						//base texture
		gl_FragColor+= texel1*texel0.a * gl_Color;	//specular texture
		gl_FragColor*= 0.2+ texel0.a * gl_Color;	//self shadowing (alpha as diffuse)
	}
}