blob: eca50d9967b3b43cc0f619fbc1ad66fd96f2d1d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#version 330 core
uniform sampler2D tex;
uniform vec3 sun_direction;
in vec3 surface_normal;
in vec2 frag_tex_coord;
out vec4 color;
void main() {
float brightness = dot(normalize(surface_normal), normalize(-sun_direction));
vec3 diffuse = vec3(max(brightness, 0.3));
color = vec4(diffuse, 1.0) * texture(tex, frag_tex_coord);
// color = texture(tex, frag_tex_coord);
}
|