summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-13 15:33:48 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-13 15:33:48 -0700
commitb143aa96fcd6d16558464c98bcfd9984f7d29750 (patch)
tree72645408a6a4f8f179a1c668f530d3844d6558dd /indra/newview/app_settings
parent4e9111bbd49e9c5f84be5dc82949dd0ec1f6a03b (diff)
SL-10856
Modify calc of sunlight to avoid clipping in gamma correct on values outside 0-1 range. Modify shaders to put back ambient clamp tuned to be close to ambient contrib in low/mid lighting.
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class3/lighting/lightV.glsl2
6 files changed, 8 insertions, 12 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index dbd7abd7e5..b439fbbff6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -223,8 +223,7 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
- //ambient = max(getAmbientClamp(), ambient); // keeps shadows dark
- ambient = 1.0 - ambient;
+ ambient = min(getAmbientClamp(), 1.0 - ambient);
vec3 sun_contrib = min(final_da, shadow) * sunlit;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 7533762a96..274d1818f0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -320,8 +320,7 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
- //ambient = max(getAmbientClamp(), ambient);
- ambient = 1.0 - ambient;
+ ambient = min(getAmbientClamp(), 1.0 - ambient);
vec3 sun_contrib = min(final_da, shadow) * sunlit;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index b6e3951ee3..2a24915ade 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -106,8 +106,7 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
- //ambient = max(getAmbientClamp(), ambient);
- ambient = 1.0 - ambient;
+ ambient = min(getAmbientClamp(), 1.0 - ambient);
vec3 sun_contrib = final_da * sunlit;
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index 6788cc1f63..7f5ac00963 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -44,7 +44,7 @@ uniform float sun_moon_glow_factor;
float getAmbientClamp()
{
- return 0.66f;
+ return 0.2f;
}
void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten) {
@@ -137,7 +137,7 @@ void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, o
+ tmpAmbient));
//brightness of surface both sunlight and ambient
- sunlit = sunlight.rgb * 0.5;
- amblit = tmpAmbient.rgb * .25;
+ sunlit = sunlight.rgb;
+ amblit = tmpAmbient.rgb;
additive *= vec3(1.0 - temp1);
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index e41b4b99a3..39b13b46cc 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -116,8 +116,7 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
- //ambient = max(getAmbientClamp(), ambient);
- ambient = 1.0 - ambient;
+ ambient = min(getAmbientClamp(), 1.0 - ambient);
vec3 sun_contrib = min(scol, final_da) * sunlit;
diff --git a/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl
index 48c883d98a..2f64ab25cb 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl
@@ -32,7 +32,7 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color);
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color)
{
vec4 c = sumLights(pos, norm, color);
- c.rgb += atmosAmbient() * color.rgb;
+ c.rgb += atmosAmbient() * color.rgb * 0.25;
return c;
}