summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/basicShader.vs
diff options
context:
space:
mode:
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;
}