aboutsummaryrefslogtreecommitdiff
path: root/shaders/main.frag
blob: 8eb47eca3815eff92c12de622b422c3b0e534ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 330 core

in vec3 norm;
in vec2 uv;
in vec3 frag_pos;

out vec4 final_col;

uniform sampler2D tex;

void main() {
	vec3 light_col = vec3(1, .964, .783);
	vec3 ambient = light_col * .2;

	vec3 light_dir = normalize(vec3(5, 10, -8));
	float diff = max(dot(normalize(norm), light_dir), 0.0);
	vec3 diffuse = diff * light_col;

	final_col = texture(tex, uv) * vec4(ambient + diffuse, 1);
}