diff options
Diffstat (limited to 'src/gltf_render/basic.frag')
| -rw-r--r-- | src/gltf_render/basic.frag | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gltf_render/basic.frag b/src/gltf_render/basic.frag new file mode 100644 index 0000000..73209ea --- /dev/null +++ b/src/gltf_render/basic.frag @@ -0,0 +1,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); +} |
