#version 330
#extension GL_ARB_explicit_uniform_location : enable

in vec4 coord;
in vec4 color;
in vec4 normal;
out vec4 fragcolor;

void main()
{	    
    vec4 n = normal;
    vec4 l = normalize(vec4(0,1,0,0));
    float alpha = 0.6-dot(n, l);
    if (alpha < 0) alpha = 0;
    alpha = pow(alpha, 3);
    fragcolor = vec4(color.xyz, alpha);    
    
}