diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-08-06 23:15:55 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-08-06 23:15:55 +0000 |
commit | 1b9804535732c9f7469b3765d31e4853af0a2d9b (patch) | |
tree | 2d6b2ad8886b39e47fd3cf95b7a5cc60686cda14 /data/shaders/lighting.frag | |
parent | 22f17f52f8d8f08f2546a1552e5075d4895d6937 (diff) |
Squeeze everything into 19 varying components
Add texture for pipework
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@227 84d2e878-0bd5-11dd-ad15-13eda11d74c5
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)); |