From 7ec62c58e9560fc961ec3522490e40ad1d259c72 Mon Sep 17 00:00:00 2001 From: omnisci3nce Date: Thu, 18 Jul 2024 16:17:23 +1000 Subject: wip skybox. make geometry owned and copied onto Mesh --- assets/shaders/skybox.frag | 11 +++++++++++ assets/shaders/skybox.vert | 19 +++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 assets/shaders/skybox.frag (limited to 'assets') 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); +} -- cgit v1.2.3-70-g09d2