2022-01-27 23:56:43 +01:00
|
|
|
#version 410 core
|
|
|
|
|
|
|
|
uniform vec3 objectColor;
|
|
|
|
uniform vec3 lightDir;
|
|
|
|
|
2022-02-02 00:25:38 +01:00
|
|
|
//vec4(0.0175,0.4716,0.5109,1.0)
|
|
|
|
|
2022-01-27 23:56:43 +01:00
|
|
|
in vec3 interpNormal;
|
2022-02-02 00:25:38 +01:00
|
|
|
in float visibility;
|
2022-01-27 23:56:43 +01:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec3 normal = normalize(interpNormal);
|
|
|
|
float ambient = 0.2;
|
|
|
|
float diffuse = max(dot(normal, -lightDir), 0.0);
|
2022-02-02 00:25:38 +01:00
|
|
|
|
2022-01-27 23:56:43 +01:00
|
|
|
gl_FragColor = vec4(objectColor * (ambient + (1-ambient) * diffuse), 1.0);
|
2022-02-02 00:25:38 +01:00
|
|
|
|
|
|
|
|
2022-02-13 01:51:44 +01:00
|
|
|
gl_FragColor = mix(vec4(0.0175,0.4716,0.5109,1), gl_FragColor, visibility);
|
2022-01-27 23:56:43 +01:00
|
|
|
}
|