#version 300 es

in vec3 vWorldPos;
in vec3 vWorldNormal;

uniform vec4 modelColor;

out highp vec4 outColor;

void main()
{
    vec3 Nn = normalize(vWorldNormal);
    vec3 LightPos = vec3(0.0, 0.0, 0.0);
    vec3 ToLight = normalize(LightPos.xyz - vWorldPos.xyz);
    float diffuse = clamp(dot(Nn, ToLight), 0.0, 1.0);
    outColor.xyz = diffuse * modelColor.xyz;
	outColor.w = modelColor.w;
}
