summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/basicShader.vs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-01 19:12:04 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-01 19:12:04 +0000
commit3b791f79bf53e481d053ea4516eedce8be3423bf (patch)
tree39817b0996eaa867c7f7abbc5dbd5cb706ecbaa5 /gfx/gl/shaders/basicShader.vs
parentSomewhat dirty but functional helper to save a texture (diff)
downloadilt-3b791f79bf53e481d053ea4516eedce8be3423bf.tar.bz2
ilt-3b791f79bf53e481d053ea4516eedce8be3423bf.tar.xz
ilt-3b791f79bf53e481d053ea4516eedce8be3423bf.zip
Switch to a deferred lighting based render pipeline
Tidy-up required.
Diffstat (limited to 'gfx/gl/shaders/basicShader.vs')
-rw-r--r--gfx/gl/shaders/basicShader.vs18
1 files changed, 12 insertions, 6 deletions
diff --git a/gfx/gl/shaders/basicShader.vs b/gfx/gl/shaders/basicShader.vs
index 8f2ab3e..bc7ea5d 100644
--- a/gfx/gl/shaders/basicShader.vs
+++ b/gfx/gl/shaders/basicShader.vs
@@ -4,15 +4,21 @@ in vec3 position;
in vec2 texCoord;
in vec3 normal;
-out vec2 texCoord0;
-out vec3 normal0;
+out vec3 FragPos;
+out vec2 TexCoords;
+out vec3 Normal;
uniform mat4 viewProjection;
uniform mat4 model;
-void main()
+void
+main()
{
- gl_Position = viewProjection * model * vec4(position, 1.0);
- texCoord0 = texCoord;
- normal0 = (model * vec4(normal, 0.0)).xyz;
+ vec4 worldPos = model * vec4(position, 1.0);
+
+ FragPos = worldPos.xyz;
+ TexCoords = texCoord;
+ Normal = (model * vec4(normal, 0.0)).xyz;
+
+ gl_Position = viewProjection * worldPos;
}