diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-29 00:31:39 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-29 00:31:39 -0800 |
commit | 35ed9dd2986aac6471a9c089bad6ff6062e34177 (patch) | |
tree | 7f1529c883b5a92242711fd4d12cddb04b11ed39 /indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | |
parent | 0fcdf05366c604c66e11cf0b6cc26c5fdbe3265f (diff) |
Don't scale windlight lights up just to scale them down again later. avoid this with rearrangement.
not tested.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 91793a29d3..cb0d7b797b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -41,12 +41,7 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); @@ -58,6 +53,9 @@ void main() col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; |