// Fragment Shader for experiments – file "sandbox.frag"

#version 150 core

uniform sampler2D in_texture;
uniform vec3 light_position;

in  vec3 ex_normal;
in vec2 fragment_texcoord;

out vec4 out_color;

void main(void)
{
	vec3 light = normalize(light_position);

	float diffuse_intensity = clamp(max( dot(ex_normal, light), 0.0), 0.0, 1.0);
	vec4 texel_color = texture(in_texture, fragment_texcoord);
	out_color = texel_color * 0.05 + //ambient
				texel_color * diffuse_intensity * 0.95; //diffuse
}
