 
 uniform sampler2D textureColor;
 uniform sampler2D textureNormal;
+uniform sampler2D textureEffects;
 
 // Output: the fragment color
 out vec3 fragColor;

	n = normalize(n * 2.0 - 1.0);
	n = normalize(In.tbn * n);

	// Compute the direction from the point to the light
	vec3 d = normalize(light.position.xyz - In.position);

	// The ambient factor
	float ambient = 0.1;
	
	// Compute the diffuse factor
	float diffuse = max(0.0, dot(d,n));

		vec3 v = normalize(-In.position);
		vec3 r = reflect(-d,n);
		specular = pow(max(dot(r,v),0.0),light.shininess);
		specular *= effects.g;
	}
	

	vec3 shading =  ambient * light.Ia.rgb + diffuse * light.Id.rgb * diffuseColor + specular * light.Is.rgb * material.Ks.rgb ;
	fragColor = shading;
	

}
