17 lines
445 B
GLSL
17 lines
445 B
GLSL
#version 460
|
|
layout(location = 0) in vec4 v_color;
|
|
layout(location = 1) in float depth;
|
|
layout(location = 2) in vec3 v_normal_vs;
|
|
|
|
layout(location = 0) out vec4 out_color;
|
|
|
|
void main() {
|
|
vec3 light_dir = normalize(vec3(0.5, 1.0, 0.8));
|
|
|
|
float ambient = 0.2;
|
|
float diffuse = max(dot(v_normal_vs, light_dir), 0.0);
|
|
float lighting = ambient + (1.0 - ambient) * diffuse;
|
|
|
|
out_color = vec4(v_color.rgb * lighting, v_color.a);
|
|
}
|