summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-11-06 16:38:06 +0000
committerGraham Linden <graham@lindenlab.com>2018-11-06 16:38:06 +0000
commit8c1aefc17c710b55ed7a72bd9de14cbed58ccd31 (patch)
treefe13d4e2fca64318b8019906aa7525195c5ce159 /indra
parente0a1b46e6129a0e6ca62efe18882889db96c572f (diff)
Remove scaleDownLight funcs and eliminate unused copy-pasted funcs in lighting shaders.
Also fix terrain response to atmospherics shaders (was failing to apply ambient on low end even when atmospherics was on).
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/transportF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/windlight/transportF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/shader_hierarchy.txt5
22 files changed, 26 insertions, 95 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 1cfc19267c..3ec2ea12da 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -94,13 +94,6 @@ vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
vec3 atmosFragAffectDirectionalLight(float light, vec3 sunlit);
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
-vec3 calcDirectionalLight(vec3 n, vec3 l)
-{
- float a = max(dot(n,l),0.0);
- a = pow(a, 1.0/1.3);
- return vec3(a,a,a);
-}
-
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
{
//get light vector
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl
index f2d2300766..e68b082d43 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl
@@ -34,7 +34,6 @@ mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye);
float calcDirectionalLight(vec3 n, vec3 l);
-float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
@@ -57,12 +56,6 @@ uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
-float calcDirectionalLight(vec3 n, vec3 l)
-{
- float a = max(dot(n,l),0.0);
- return a;
-}
-
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
{
//get light vector
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index c001ff9ac8..c1c17532b8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -110,13 +110,6 @@ uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
-vec3 calcDirectionalLight(vec3 n, vec3 l)
-{
- float a = max(dot(n,l),0.0);
- return vec3(a,a,a);
-}
-
-
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare)
{
//get light vector
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index 46bde7f308..668a710c04 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -59,10 +59,8 @@ void main()
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
/// Add WL Components
- //outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
+ outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
- outColor.rgb = atmosLighting(outColor.rgb);
-
frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index 5ffe464172..4d6f0c67a5 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -71,7 +71,7 @@ void main()
/// Potentially better without it for water.
pos /= pos.w;
- vec4 color = calcLighting(pos.xyz, norm, vec4(0), vec4(1));
+ vec4 color = calcLighting(pos.xyz, norm, vec4(1), vec4(0));
vertex_color = color;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl
index 85cddc647d..20e44d74d5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl
@@ -23,14 +23,6 @@
* $/LicenseInfo$
*/
-
-
-float calcDirectionalLight(vec3 n, vec3 l)
-{
- float a = max(dot(n,l),0.0);
- return a;
-}
-
float calcDirectionalSpecular(vec3 view, vec3 n, vec3 l)
{
return pow(max(dot(reflect(view, n),l), 0.0),8.0);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
index 7059ff31ae..10958025ac 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl
@@ -29,7 +29,6 @@ float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 atmosGetDiffuseSunlightColor();
-vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
uniform vec3 light_diffuse[8];
@@ -44,7 +43,6 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor
vec4 specularSum = vec4(0.0);
col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0);
- col.rgb = scaleDownLight(col.rgb);
col.rgb += atmosAmbient(baseCol.rgb);
col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0));
diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
index 41288c21c1..569b629ef8 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
@@ -30,7 +30,6 @@ float calcDirectionalLight(vec3 n, vec3 l);
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
-vec3 scaleDownLight(vec3 light);
vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
{
@@ -38,7 +37,6 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
col.a = color.a;
col.rgb = light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
- col.rgb = scaleDownLight(col.rgb);
col.rgb += atmosAmbient(baseLight.rgb);
col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl
index bf0a9048f0..c1cc3679a7 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl
@@ -25,13 +25,14 @@
vec3 atmosFragAmbient(vec3 light, vec3 sunlit)
{
- return light;
+ /* stub function for fallback compatibility on class1 hardware */
+ return light;
}
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
{
- /* stub function for fallback compatibility on class1 hardware */
- return light;
+ /* stub function for fallback compatibility on class1 hardware */
+ return light;
}
vec3 atmosFragAffectDirectionalLight(float light, vec3 sunlit)
@@ -41,7 +42,8 @@ vec3 atmosFragAffectDirectionalLight(float light, vec3 sunlit)
vec3 atmosLighting(vec3 light)
{
- return atmosFragLighting(light, vec3(0), vec3(1.0));
+ /* stub function for fallback compatibility on class1 hardware */
+ return light;
}
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive)
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl
index c16e3d50a2..9e5893d32a 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl
@@ -41,9 +41,3 @@ vec3 atmosGetDiffuseSunlightColor()
return sunlight_color.rgb;
}
-vec3 scaleDownLight(vec3 light)
-{
- /* stub function for fallback compatibility on class1 hardware */
- return light;
-}
-
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index 9f68ca3dfa..01f19087ff 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -41,9 +41,3 @@ vec3 atmosGetDiffuseSunlightColor()
return sunlight_color.rgb;
}
-vec3 scaleDownLight(vec3 light)
-{
- /* stub function for fallback compatibility on class1 hardware */
- return light;
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index fa81317f3f..c92dbda185 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -83,13 +83,13 @@ vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten);
vec3 fullbrightScaleSoftClipFrag(vec3 l);
vec3 scaleSoftClipFrag(vec3 l);
-vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten) {
- if (no_atmo == 0)
+vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten)
+{
+ if (no_atmo == 1)
{
- light *= atten.r;
- light += additive * 2.0;
+ return light;
}
- return light;
+ return (light + additive) * atten.r * 2.0;
}
vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) {
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
index 3acf9fe883..eef259349f 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
@@ -31,7 +31,6 @@ vec3 calcPointLightSpecular(inout vec4 specular, vec3 view, vec3 v, vec3 n, vec3
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 atmosGetDiffuseSunlightColor();
-vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
uniform vec3 light_attenuation[8];
@@ -50,7 +49,6 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor
col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0);
col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[2].xyz, light_attenuation[2].x, light_attenuation[2].y, light_diffuse[2].rgb);
col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[3].xyz, light_attenuation[3].x, light_attenuation[3].y, light_diffuse[3].rgb);
- col.rgb = scaleDownLight(col.rgb);
// Add windlight lights
col.rgb += atmosAmbient(baseCol.rgb);
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
index c9987ef3b9..b42506dd40 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
@@ -28,7 +28,6 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
-vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
@@ -45,8 +44,6 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z);
col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
- col.rgb = scaleDownLight(col.rgb);
-
// Add windlight lights
col.rgb += atmosAmbient(baseLight.rgb);
col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index 89bdbfc0e6..229f8073b0 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -47,12 +47,13 @@ vec3 scaleSoftClipFrag(vec3 light);
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
{
- if (no_atmo == 0)
+ if (no_atmo == 1)
{
- light *= atten.r;
- light += additive;
+ return light;
}
- return (2.0 * light);
+ light *= atten.r;
+ light += additive;
+ return light;
}
vec3 atmosLighting(vec3 light)
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl
index 63c683c99e..8648c38501 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl
@@ -37,8 +37,3 @@ vec3 atmosFragAffectDirectionalLight(float lightIntensity, vec3 sunlit)
return sunlit * lightIntensity;
}
-vec3 scaleDownLightFrag(vec3 light)
-{
- return (light / scene_light_strength );
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl
index 617704ff67..a83aa95f95 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl
@@ -49,8 +49,3 @@ vec3 atmosGetDiffuseSunlightColor()
return getSunlitColor();
}
-vec3 scaleDownLight(vec3 light)
-{
- return (light / scene_light_strength );
-}
-
diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
index 976e5066dc..bf64605014 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
@@ -32,13 +32,13 @@ vec3 getAtmosAttenuation();
uniform int no_atmo;
-vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) {
- if (no_atmo == 0)
+vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive)
+{
+ if (no_atmo == 1)
{
- light *= atten.r;
- light += additive * 2.0;
+ return light;
}
- return light;
+ return (light + additive) * atten * 2.0;
}
vec3 fullbrightFragAtmosTransport(vec3 light, vec3 atten, vec3 additive) {
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
index e043ac873e..7870d0516f 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
@@ -29,7 +29,6 @@ vec3 calcPointLightSpecular(inout vec4 specular, vec3 view, vec3 v, vec3 n, vec3
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 atmosGetDiffuseSunlightColor();
-vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
uniform vec3 light_attenuation[8];
@@ -52,7 +51,6 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor
col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[5].xyz, light_attenuation[5].x, light_attenuation[5].y, light_diffuse[5].rgb);
col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[6].xyz, light_attenuation[6].x, light_attenuation[6].y, light_diffuse[6].rgb);
col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[7].xyz, light_attenuation[7].x, light_attenuation[7].y, light_diffuse[7].rgb);
- col.rgb = scaleDownLight(col.rgb);
// Add windlight lights
col.rgb += atmosAmbient(baseCol.rgb);
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
index b5dcd2eba2..9842d9ba93 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
@@ -29,7 +29,6 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
-vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
@@ -50,7 +49,6 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].z);
col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].z);
col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz);
- col.rgb = scaleDownLight(col.rgb);
// Add windlight lights
col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
diff --git a/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl
index 5c93af386b..8195801be6 100644
--- a/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl
+++ b/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl
@@ -32,14 +32,13 @@ vec3 getAtmosAttenuation();
uniform int no_atmo;
-vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten) {
+vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten)
+{
if (no_atmo == 1)
{
return light;
}
- light *= atten.r;
- light += additive * 2.0;
- return light;
+ return (light + additive) * atten * 2.0;
}
vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) {
diff --git a/indra/newview/app_settings/shaders/shader_hierarchy.txt b/indra/newview/app_settings/shaders/shader_hierarchy.txt
index d8bbf69b38..ebccaddd55 100644
--- a/indra/newview/app_settings/shaders/shader_hierarchy.txt
+++ b/indra/newview/app_settings/shaders/shader_hierarchy.txt
@@ -7,7 +7,6 @@ avatar/avatarV.glsl - gAvatarProgram, gAvatarWaterProgram
sumLights() - lighting/sumLightsV.glsl
calcDirectionalLight() - lighting/lightFuncV.glsl
calcPointLight() - lighting/lightFuncV.glsl
- scaleDownLight() - windlight/atmosphericsHelpersV.glsl
atmosAmbient() - windlight/atmosphericsHelpersV.glsl
atmosAffectDirectionalLight() - windlight/atmosphericsHelpersV.glsl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -28,7 +27,6 @@ avatar/eyeballV.glsl - gAvatarEyeballProgram
atmosAmbient() - windlight/atmosphericsHelpersV.glsl
atmosAffectDirectionalLight() - windlight/atmosphericsHelpersV.glsl
atmosGetDiffuseSunlightColor() - windlight/atmosphericsHelpersV.glsl
- scaleDownLight() - windlight/atmosphericsHelpersV.glsl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
avatar/eyeballF.glsl - gAvatarEyeballProgram
main() - avatar/eyeballF.glsl
@@ -53,7 +51,6 @@ environment/terrainV.glsl - gTerrainProgram, gTerrainWaterProgram
sumLights() - lighting/sumLightsV.glsl
calcDirectionalLight() - lighting/lightFuncV.glsl
calcPointLight() - lighting/lightFuncV.glsl
- scaleDownLight() - windlight/atmosphericsHelpersV.glsl
atmosAmbient() - windlight/atmosphericsHelpersV.glsl
atmosAffectDirectionalLight() - windlight/atmosphericsHelpersV.glsl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -120,7 +117,6 @@ objects/shinyV.glsl - gObjectShinyProgram, gObjectShinyWaterProgram
sumLights() - lighting/sumLightsV.glsl
calcDirectionalLight() - lighting/lightFuncV.glsl
calcPointLight() - lighting/lightFuncV.glsl
- scaleDownLight() - windlight/atmosphericsHelpersV.glsl
atmosAmbient() - windlight/atmosphericsHelpersV.glsl
atmosAffectDirectionalLight() - windlight/atmosphericsHelpersV.glsl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -143,7 +139,6 @@ objects/simpleV.glsl - gObjectSimpleProgram, gObjectSimpleWaterProgram
sumLights() - lighting/sumLightsV.glsl
calcDirectionalLight() - lighting/lightFuncV.glsl
calcPointLight() - lighting/lightFuncV.glsl
- scaleDownLight() - windlight/atmosphericsHelpersV.glsl
atmosAmbient() - windlight/atmosphericsHelpersV.glsl
atmosAffectDirectionalLight() - windlight/atmosphericsHelpersV.glsl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~