#version 330 core

layout(location=0) out vec4 fragColor;

in vec3 worldNormal;
in vec3 Normal;
in vec3 FragPos;
in vec2 texCoord;

uniform sampler2D color_texture;
uniform vec3 lightPos;


void main()
{
	vec3 lightColor = vec3(1.0f,1.0f,1.0f).rgb;

	vec3 norm = normalize(Normal);
	vec3 lightDir = normalize(lightPos - FragPos);

	float diff = max(dot(norm,lightDir),0.0);
	vec3 diffuse = diff*lightColor;

	float ambient = 0.3f;
	vec3 objectColor=  texture(color_texture, texCoord).rgb;
	vec3 result =objectColor*(ambient+diffuse);
	fragColor = vec4(result, 1.0f);
}