aboutsummaryrefslogtreecommitdiff
path: root/data/shaders/lighting.frag
diff options
context:
space:
mode:
Diffstat (limited to 'data/shaders/lighting.frag')
-rw-r--r--data/shaders/lighting.frag18
1 files changed, 7 insertions, 11 deletions
diff --git a/data/shaders/lighting.frag b/data/shaders/lighting.frag
index a9febe4..d4cb035 100644
--- a/data/shaders/lighting.frag
+++ b/data/shaders/lighting.frag
@@ -9,18 +9,17 @@
*
*/
-varying vec3 pos;
varying vec3 normal;
+varying vec3 col_ambi_diff;
+varying vec3 col_emit;
varying vec3 light0vc;
+varying vec3 light0half;
varying float light0dist;
varying vec3 light1vc;
varying vec3 light2vc;
-varying vec3 col_ambi_diff;
-varying vec3 col_emit;
-
uniform sampler2D texture;
uniform sampler2D normalmap;
@@ -63,7 +62,6 @@ void main() {
/* Light 0: Lander craft's spotlight */
float falloff, spot;
float diff_fac, spec_fac;
- vec3 E, R;
falloff = 1/ ( gl_LightSource[0].constantAttenuation
+ gl_LightSource[0].linearAttenuation * light0dist
@@ -75,14 +73,12 @@ void main() {
diff_fac = max(0.0, dot(norm, normalize(light0vc)));
diff += col_ambi_diff * gl_LightSource[0].diffuse.rgb * spot * falloff * diff_fac;
- E = normalize(-pos);
- R = normalize(-reflect(light0vc, norm));
- spec_fac = pow(max(0.0, dot(R, E)), 80.0);
- spec += vec3(1.0, 1.0, 1.0) * gl_LightSource[0].specular.rgb * spot * falloff * spec_fac;
+ //spec_fac = pow(max(0.0, dot(normalize(light0half), norm)), 80.0);
+ //spec += vec3(1.0, 1.0, 1.0) * gl_LightSource[0].specular.rgb * spot * falloff * spec_fac;
/* Light 1: Background glow */
- diff += col_ambi_diff * gl_LightSource[1].diffuse.rgb * max(0.0, dot(vec3(light1vc), norm));
-
+ diff += col_ambi_diff * gl_LightSource[1].diffuse.rgb * max(0.0, dot(light1vc, norm));
+
}
if ( texture_enabled ) {