From c8ffb4adf132ba6cf4ed3ad08db9f9bfbe1d7280 Mon Sep 17 00:00:00 2001 From: taw27 Date: Wed, 30 Jul 2008 21:02:21 +0000 Subject: Small shader tweaks git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@195 84d2e878-0bd5-11dd-ad15-13eda11d74c5 --- data/shaders/lighting.vert | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/shaders/lighting.vert') diff --git a/data/shaders/lighting.vert b/data/shaders/lighting.vert index 3647999..914d6ac 100644 --- a/data/shaders/lighting.vert +++ b/data/shaders/lighting.vert @@ -25,7 +25,7 @@ void main() { /* Spotlight - positional light */ vec4 vert = gl_ModelViewMatrix * gl_Vertex; light0vc = gl_LightSource[0].position.xyz - vert.xyz; - light0hvc = vec3(gl_LightSource[0].halfVector - vert.xyz); + light0hvc = vec3(gl_LightSource[0].halfVector - vert); /* Diffuse "background glow" - this can be normalised only once, here, since 'position' * is really 'direction' and is the same for all vertices. */ @@ -33,7 +33,7 @@ void main() { /* Fill-in light */ light2vc = normalize(vec3(gl_LightSource[2].position)); - light2hvc = normalize(vec3(gl_LightSource[2].halfVector)); + light2hvc = normalize(vec3(gl_LightSource[2].halfVector - vert)); /* Material properties */ normal = gl_NormalMatrix * gl_Normal; -- cgit v1.2.3