From 1df10d13fbd0105c77df21e375f27848c6a12589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 9 May 2012 01:21:18 +0200 Subject: [PATCH] Fixed some more fuckups in PhongShader. --- src/Shaders/PhongShader.vert | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Shaders/PhongShader.vert b/src/Shaders/PhongShader.vert index 6fb1097e1..2a8ef00a0 100644 --- a/src/Shaders/PhongShader.vert +++ b/src/Shaders/PhongShader.vert @@ -5,7 +5,7 @@ uniform mat4 projectionMatrix; uniform vec3 light; in vec4 vertex; -in vec4 normal; +in vec3 normal; out vec3 transformedNormal; out vec3 lightDirection; @@ -16,10 +16,10 @@ void main() { vec3 transformedVertex = transformedVertex4.xyz/transformedVertex4.w; /* Transformed normal vector */ - transformedNormal = normalize(mat3x3(transformationMatrix)*normal.xyz); + transformedNormal = normalize(mat3x3(transformationMatrix)*normal); /* Direction to the light */ - lightDirection = normalize(light.xyz - transformedVertex); + lightDirection = normalize(light - transformedVertex); /* Transform the vertex */ gl_Position = projectionMatrix*transformedVertex4;