#version 400 core

in vec2 pass_textureCoords;
in vec3 surfaceNormal;
in vec3 toLightVector;

out vec4 out_Color;

uniform sampler2D textureSampler;
uniform vec3 lightColor;
uniform vec3 terrainColor;

void main(void) {
    vec3 unitNormal = normalize(surfaceNormal);
    vec3 unitToLightVector = normalize(toLightVector);

    float nDotl = dot(unitNormal, unitToLightVector);
    float brightness = max(nDotl, 0.2);
    vec3 diffusde = brightness * lightColor;

    out_Color =  /*vec4(diffusde, 1.0) **/ vec4(terrainColor, 1);
}