aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-07-30 17:39:46 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-07-30 17:39:46 +0000
commitec734c362ca2f79683bd876406e8a3c1fa09b443 (patch)
treebc8ee3908607812ae3d02938f5de848e89e54c03
parent0ee0bb54725cf2d950d8514a105247ce882fd8f5 (diff)
Calculate specular highlights correctly
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@194 84d2e878-0bd5-11dd-ad15-13eda11d74c5
-rw-r--r--data/shaders/lighting.vert4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/shaders/lighting.vert b/data/shaders/lighting.vert
index ddbe8ab..3647999 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 = normalize(gl_LightSource[0].halfVector.xyz);
+ light0hvc = vec3(gl_LightSource[0].halfVector - vert.xyz);
/* 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(gl_LightSource[2].halfVector.xyz);
+ light2hvc = normalize(vec3(gl_LightSource[2].halfVector));
/* Material properties */
normal = gl_NormalMatrix * gl_Normal;