summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-11 18:54:41 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-11 18:54:41 +0100
commit43d8fdb3f6aeb88762c68179d7bb1dc58507bb60 (patch)
tree5d0cf299cfe9a4688cc5df54984780a49566bcb1
parentSupport m4 includes as a Jam scanner (diff)
downloadilt-43d8fdb3f6aeb88762c68179d7bb1dc58507bb60.tar.bz2
ilt-43d8fdb3f6aeb88762c68179d7bb1dc58507bb60.tar.xz
ilt-43d8fdb3f6aeb88762c68179d7bb1dc58507bb60.zip
Move lots of common glsl interface to include files
-rw-r--r--gfx/gl/shaders/basicShader.fs5
-rw-r--r--gfx/gl/shaders/basicShader.vs6
-rw-r--r--gfx/gl/shaders/geometryOut.glsl3
-rw-r--r--gfx/gl/shaders/landmassShader.fs5
-rw-r--r--gfx/gl/shaders/landmassShader.vs6
-rw-r--r--gfx/gl/shaders/meshIn.glsl4
-rw-r--r--gfx/gl/shaders/shadowDynamicPoint.vs2
-rw-r--r--gfx/gl/shaders/shadowFixedPoint.vs2
-rw-r--r--gfx/gl/shaders/waterShader.fs5
-rw-r--r--gfx/gl/shaders/waterShader.vs5
10 files changed, 15 insertions, 28 deletions
diff --git a/gfx/gl/shaders/basicShader.fs b/gfx/gl/shaders/basicShader.fs
index 24b2791..0d0b904 100644
--- a/gfx/gl/shaders/basicShader.fs
+++ b/gfx/gl/shaders/basicShader.fs
@@ -4,10 +4,7 @@ in vec3 FragPos;
in vec2 TexCoords;
in vec3 Normal;
in vec4 Colour;
-
-out vec4 gPosition;
-out vec4 gNormal;
-out vec4 gAlbedoSpec;
+include(`geometryOut.glsl')
uniform sampler2D texture0;
diff --git a/gfx/gl/shaders/basicShader.vs b/gfx/gl/shaders/basicShader.vs
index ff9a401..a96d478 100644
--- a/gfx/gl/shaders/basicShader.vs
+++ b/gfx/gl/shaders/basicShader.vs
@@ -1,10 +1,6 @@
#version 330 core
-in vec3 position;
-in vec2 texCoord;
-in vec3 normal;
-in vec4 colour;
-
+include(`meshIn.glsl')
out vec3 FragPos;
out vec2 TexCoords;
out vec3 Normal;
diff --git a/gfx/gl/shaders/geometryOut.glsl b/gfx/gl/shaders/geometryOut.glsl
new file mode 100644
index 0000000..dc5f8e8
--- /dev/null
+++ b/gfx/gl/shaders/geometryOut.glsl
@@ -0,0 +1,3 @@
+layout(location = 0) out vec4 gPosition;
+layout(location = 1) out vec4 gNormal;
+layout(location = 2) out vec4 gAlbedoSpec;
diff --git a/gfx/gl/shaders/landmassShader.fs b/gfx/gl/shaders/landmassShader.fs
index 7c08e8e..5daeeb6 100644
--- a/gfx/gl/shaders/landmassShader.fs
+++ b/gfx/gl/shaders/landmassShader.fs
@@ -3,10 +3,7 @@
in vec3 FragPos;
in vec2 TexCoords;
in vec3 Normal;
-
-layout(location = 0) out vec4 gPosition;
-layout(location = 1) out vec4 gNormal;
-layout(location = 2) out vec4 gAlbedoSpec;
+include(`geometryOut.glsl')
uniform sampler2D texture0;
diff --git a/gfx/gl/shaders/landmassShader.vs b/gfx/gl/shaders/landmassShader.vs
index 30c4ef4..3eb9aa3 100644
--- a/gfx/gl/shaders/landmassShader.vs
+++ b/gfx/gl/shaders/landmassShader.vs
@@ -1,10 +1,6 @@
#version 330 core
-in vec3 position;
-in vec2 texCoord;
-in vec3 normal;
-in vec4 colour;
-
+include(`meshIn.glsl')
out vec3 FragPos;
out vec2 TexCoords;
out vec3 Normal;
diff --git a/gfx/gl/shaders/meshIn.glsl b/gfx/gl/shaders/meshIn.glsl
new file mode 100644
index 0000000..2b244c1
--- /dev/null
+++ b/gfx/gl/shaders/meshIn.glsl
@@ -0,0 +1,4 @@
+layout(location = 0) in vec3 position;
+layout(location = 1) in vec2 texCoord;
+layout(location = 2) in vec3 normal;
+layout(location = 3) in vec4 colour;
diff --git a/gfx/gl/shaders/shadowDynamicPoint.vs b/gfx/gl/shaders/shadowDynamicPoint.vs
index 6ea352f..531d8de 100644
--- a/gfx/gl/shaders/shadowDynamicPoint.vs
+++ b/gfx/gl/shaders/shadowDynamicPoint.vs
@@ -1,6 +1,6 @@
#version 330 core
-in vec3 position;
+include(`meshIn.glsl')
uniform mat4 viewProjection;
uniform mat4 model;
diff --git a/gfx/gl/shaders/shadowFixedPoint.vs b/gfx/gl/shaders/shadowFixedPoint.vs
index 246890c..c9fa19b 100644
--- a/gfx/gl/shaders/shadowFixedPoint.vs
+++ b/gfx/gl/shaders/shadowFixedPoint.vs
@@ -1,6 +1,6 @@
#version 330 core
-layout(location = 0) in vec3 position;
+include(`meshIn.glsl')
uniform mat4 viewProjection;
diff --git a/gfx/gl/shaders/waterShader.fs b/gfx/gl/shaders/waterShader.fs
index d242566..d457f27 100644
--- a/gfx/gl/shaders/waterShader.fs
+++ b/gfx/gl/shaders/waterShader.fs
@@ -4,10 +4,7 @@
in vec3 FragPos;
in vec2 TexCoords;
in vec3 Normal;
-
-out vec4 gPosition;
-out vec4 gNormal;
-out vec4 gAlbedoSpec;
+include(`geometryOut.glsl')
uniform sampler2D texture0;
uniform vec3 waves;
diff --git a/gfx/gl/shaders/waterShader.vs b/gfx/gl/shaders/waterShader.vs
index fe9206f..6f96c19 100644
--- a/gfx/gl/shaders/waterShader.vs
+++ b/gfx/gl/shaders/waterShader.vs
@@ -1,9 +1,6 @@
#version 330 core
-in vec3 position;
-in vec2 texCoord;
-in vec3 normal;
-
+include(`meshIn.glsl')
out vec3 FragPos;
out vec2 TexCoords;
out vec3 Normal;