From 900b522d13ec43bbc4844dc435445f3823c9dd31 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 21 Feb 2016 01:28:42 +0100 Subject: [PATCH] Rename viewPos to viewDirection --- files/shaders/lighting.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/shaders/lighting.glsl b/files/shaders/lighting.glsl index d706563ba..08b369b5b 100644 --- a/files/shaders/lighting.glsl +++ b/files/shaders/lighting.glsl @@ -42,12 +42,12 @@ vec4 doLighting(vec3 viewPos, vec3 viewNormal, vec4 vertexColor) } -vec3 getSpecular(vec3 viewNormal, vec3 viewPos, float shininess, vec3 matSpec) +vec3 getSpecular(vec3 viewNormal, vec3 viewDirection, float shininess, vec3 matSpec) { vec3 lightDir = normalize(gl_LightSource[0].position.xyz); float NdotL = max(dot(viewNormal, lightDir), 0.0); if (NdotL < 0) return vec3(0,0,0); - vec3 halfVec = normalize(lightDir - viewPos); + vec3 halfVec = normalize(lightDir - viewDirection); return pow(max(dot(viewNormal, halfVec), 0.0), 128) * gl_LightSource[0].specular.xyz * matSpec; }