#version 450 layout(location = 0) in vec3 world_normal; layout(location = 1) in vec4 color; layout(location = 0) out vec4 out_color; void main() { vec3 normal = normalize(world_normal); if (!gl_FrontFacing) normal = -normal; float light = 0.42 + 0.58 * max(dot(normal, normalize(vec3(-0.45, 0.85, 0.3))), 0.0); out_color = vec4(pow(max(color.rgb * light, vec3(0.0)), vec3(1.0 / 2.2)), 1.0); }