m2-ar-projet/shaders/skybox.vert

29 lines
523 B
GLSL
Raw Normal View History

2020-12-28 17:36:45 +01:00
#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;
}