aboutsummaryrefslogtreecommitdiff
path: root/shaders/skybox.vert
blob: ac4ac5ea6a0c9946f25c686d1756c782719c7c1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#version 330 core

// layout(location = 0) in vec3 in_pos;

// out vec3 tex_coords;

// uniform mat4 proj;
// uniform mat4 view;

// void main() {
// 	// vec4 pos = proj * view * vec4(in_pos, 1.0);
// 	// gl_Position = pos.xyww;
// 	gl_Position = proj * vec4(in_pos, 1.0);
// 	tex_coords = in_pos;
// }

layout(location = 0) in vec3 in_pos;

out vec3 tex_coords;

uniform mat4 proj;
uniform mat4 view;

void main() {
	tex_coords = in_pos;
	vec4 pos = proj * mat4(mat3(view)) * vec4(in_pos, 1.0);
	gl_Position = pos.xyww;
}