diff options
Diffstat (limited to 'data/shaders/lighting.frag')
-rw-r--r-- | data/shaders/lighting.frag | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/data/shaders/lighting.frag b/data/shaders/lighting.frag index bf03dbb..b95397d 100644 --- a/data/shaders/lighting.frag +++ b/data/shaders/lighting.frag @@ -15,16 +15,17 @@ varying vec3 normal; varying vec3 light0vc; varying vec3 light1vc; +varying vec3 col_ambi_diff; +varying vec3 col_emit; +varying float col_spec; + uniform sampler2D texture; uniform sampler2D normalmap; uniform bool has_normals; uniform bool texture_emits; uniform float alpha; - -varying vec3 col_ambi_diff; -varying vec3 col_emit; -varying float shininess; +uniform float shininess; void main() { @@ -68,7 +69,7 @@ void main() { R = normalize(-reflect(L, norm)); spec_fac = max(0.0, dot(R, E)); spec_fac = pow(spec_fac, shininess); - spec += vec3(1.0, 1.0, 1.0) * gl_LightSource[0].specular.rgb * spot * falloff * spec_fac; + spec += col_spec * gl_LightSource[0].specular.rgb * spot * falloff * spec_fac; /* Light 1: Diffuse background glow */ diff += col_ambi_diff * gl_LightSource[1].diffuse.rgb * max(0.0, dot(vec3(light1vc), norm)); |