vox/assets/shaders/teapot/teapot.frag

14 lines
313 B
GLSL
Raw Permalink Normal View History

2022-03-29 07:07:56 -05:00
#version 140
2022-03-29 07:22:03 -05:00
in vec3 v_normal;
2022-03-29 07:07:56 -05:00
out vec4 color;
2022-03-29 07:22:03 -05:00
uniform vec3 u_light;
2022-03-29 07:07:56 -05:00
void main() {
2022-03-29 07:22:03 -05:00
float brightness = dot(normalize(v_normal), normalize(u_light));
vec3 dark_color = vec3(0.6, 0.0, 0.0);
vec3 regular_color = vec3(1.0, 0.0, 0.0);
color = vec4(mix(dark_color, regular_color, brightness), 1.0);
2022-03-29 07:07:56 -05:00
}