summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-07-18 16:17:23 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-07-18 16:17:23 +1000
commit7ec62c58e9560fc961ec3522490e40ad1d259c72 (patch)
treee7d6c9bb9efc9871fe2a4bc7e5f51a02f7d901ef /assets
parentc43bee3ec89e0863b4195ca9298a007d3526a6d9 (diff)
wip skybox. make geometry owned and copied onto Mesh
Diffstat (limited to 'assets')
-rw-r--r--assets/shaders/skybox.frag11
-rw-r--r--assets/shaders/skybox.vert19
2 files changed, 24 insertions, 6 deletions
diff --git a/assets/shaders/skybox.frag b/assets/shaders/skybox.frag
new file mode 100644
index 0000000..242477d
--- /dev/null
+++ b/assets/shaders/skybox.frag
@@ -0,0 +1,11 @@
+#version 410 core
+
+out vec4 FragColor;
+
+in vec3 TexCoords;
+
+uniform samplerCube cubemap;
+
+void main() {
+ FragColor = texture(cubemap, TexCoords);
+}
diff --git a/assets/shaders/skybox.vert b/assets/shaders/skybox.vert
index e9149d8..57c6399 100644
--- a/assets/shaders/skybox.vert
+++ b/assets/shaders/skybox.vert
@@ -1,11 +1,18 @@
#version 410 core
-layout(location = 0) in vec3 inPos;
+layout(location = 0) in vec3 inPosition;
+layout(location = 1) in vec3 inNormal;
+layout(location = 2) in vec2 inTexCoords;
-uniform In {
- vec3 textureDir;
-} inc;
+uniform Camera {
+ mat4 view;
+ mat4 proj;
+ vec4 viewPos;
+} cam;
+
+out vec3 TexCoords;
void main() {
-
-} \ No newline at end of file
+ TexCoords = inPosition;
+ gl_Position = cam.proj * cam.view * vec4(inPosition, 1.0);
+}