uniform sampler2DShadow shadowMap;
uniform sampler2D Texture0;
uniform sampler2D Texture1;

varying vec3 normal;
varying vec4 projCoord;

	
const vec3 Xunitvec = vec3 (1.0, 0.0, 0.0);
const vec3 Yunitvec = vec3 (0.0, 1.0, 0.0);

	void main()
	{


vec4 color ;
color.rgba    = texture2D(Texture0,gl_TexCoord[0].st).rgba*gl_Color;

vec3 shadowUV = projCoord.xyz / projCoord.q;






	if(shadowUV.x >= 0.0 && shadowUV.y >= 0.0 && shadowUV.x <= 1.0 && shadowUV.y <= 1.0 )
   	{
	float shadowColor = shadow2D(shadowMap, shadowUV).r;	shadowUV.y -=0.004;

	shadowColor 	+= shadow2D(shadowMap, shadowUV).r;	shadowUV.y +=0.008;
	shadowColor 	+= shadow2D(shadowMap, shadowUV).r;	shadowUV.y -=0.004; shadowUV.x -=0.004;
	shadowColor 	+= shadow2D(shadowMap, shadowUV).r;	shadowUV.x +=0.008;
	shadowColor 	+= shadow2D(shadowMap, shadowUV).r;	shadowUV.x +=0.004;


	shadowColor	*=0.2;
	shadowColor = clamp(shadowColor, 0.2, 1.0);
	color.rgb *= shadowColor;
	}

color.rgb += texture2D(Texture1,gl_TexCoord[2].st).rgb;


gl_FragColor = color;



}