varying vec3 normal,vert; // rem in

varying vec2 texCoords;
uniform sampler2D tex0;
uniform float intensity;

void main(void)
{

	vec3 lp=gl_LightSource[0].position.xyz;
	vec3 ld=normalize(lp-vert);
	vec3 ed=normalize(-vert);
	vec3 r=normalize(-reflect(ld,normal));
	
	vec4 la=gl_FrontLightProduct[0].ambient;
	vec4 lf=gl_FrontLightProduct[0].diffuse*max(dot(normal,ld),0.0);
	vec4 ls=gl_FrontLightProduct[0].specular*pow(max(dot(r,ed),0.0),gl_FrontMaterial.shininess);
	
	vec4 pixel = texture2D(tex0, texCoords);
	vec4 light = gl_FrontLightModelProduct.sceneColor+pow(la+lf+ls,vec4(0.75)); // add vec4

	gl_FragColor=mix(vec4(0),light*intensity,pixel*intensity); // add vec4
	//gl_FragColor=light;
	
}