aboutsummaryrefslogtreecommitdiff
path: root/shaders/skybox.vert
diff options
context:
space:
mode:
authorccolin2020-12-28 17:36:45 +0100
committerccolin2020-12-28 17:36:45 +0100
commitf3a34665978729ef65010ac2a4a9408e27d5bf3e (patch)
treee8f4d6f2402c9b7113e33684f64b82a98d990313 /shaders/skybox.vert
parentef37119f4e94c83a6357ebc0b94a39e4e53b20d7 (diff)
skybox
Diffstat (limited to 'shaders/skybox.vert')
-rw-r--r--shaders/skybox.vert28
1 files changed, 28 insertions, 0 deletions
diff --git a/shaders/skybox.vert b/shaders/skybox.vert
new file mode 100644
index 0000000..ac4ac5e
--- /dev/null
+++ b/shaders/skybox.vert
@@ -0,0 +1,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;
+}