summaryrefslogtreecommitdiff
path: root/src/gltf_render/basic.frag
blob: 73209ea3608518510b80b34237cc1606bd9ea8d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#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);
}