summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-02-27 11:48:04 -0700
committerDave Houlton <euclid@lindenlab.com>2020-02-28 12:35:36 -0700
commit823d8bce6034eaa748b65dfec3618d1283f1ec9d (patch)
treeb906cc915d7486aad6d52840fab851ba91c0536b /indra/newview/app_settings/shaders/class1/deferred
parent44f0cadad8f51e33d6af49d7ef3b3e175bd5b8b2 (diff)
SL-12638, further tweaking of normal-map lighting, add some de-saturation
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 2df683a5fd..eebb0a5fe5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -164,6 +164,14 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
return max(col, vec3(0.0,0.0,0.0));
}
+// Q&D approximate RGB-space de-saturation, strength from 0 (no effect) to 1.0 (complete grey-scale)
+vec3 desat(vec3 color, float strength)
+{
+ float primary_value = max(color.r, max(color.g, color.b));
+ vec3 delta = strength * (vec3(primary_value)-color);
+ return color + delta;
+}
+
#else
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_data[3];
@@ -355,11 +363,15 @@ void main()
#endif
#if !defined(SUNLIGHT_KILL)
- color.rgb += eep_bump_gain * sun_contrib;
+ color.rgb += sun_contrib;
#endif
color.rgb *= diffuse_linear.rgb; // SL-12006
+ // ad-hoc brighten and de-saturate (normal-mapped only), to match windlight - SL-12638
+ color.rgb = desat(color.rgb, 0.33 * (eep_bump_gain - 1.0));
+ color.rgb *= eep_bump_gain;
+
float glare = 0.0;
if (spec.a > 0.0) // specular reflection