diff options
Diffstat (limited to 'data/shaders')
-rw-r--r-- | data/shaders/lighting.vert | 4 |
1 files changed, 2 insertions, 2 deletions
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; |