

	varying vec3 normal;



	uniform sampler2D Texture0,Texture1,Texture2;
	
	void main()
	{


		vec4 color ;
		vec4 mask=texture2D(Texture2,gl_TexCoord[0].st) ;

color.rgba    = texture2D(Texture0,gl_TexCoord[0].st).rgba;
color.rgb    *= texture2D(Texture1,gl_TexCoord[1].st).rgb;


vec3 n = normalize(normal);
color.r -= n.x*0.1;
color.rgb += mask.rgb*pow(0.1+n.z,15.0)*0.3;



gl_FragColor = color;
	}