summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-29 00:31:39 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-29 00:31:39 -0800
commit71b35bd63daecfe6ca60560a13f72990afae81ac (patch)
tree302e0d0166342c6066b10f98485c71c6ac7999b6 /indra/newview/app_settings/shaders/class1/deferred
parentd0cf5b03f4fec29db367d8f1f387f2b0996f67e6 (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')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl10
2 files changed, 8 insertions, 12 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;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index e36564df10..e34f6ba552 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -47,12 +47,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);
@@ -64,6 +59,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_ambient = col.rgb*gl_Color.rgb;
vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));