summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-09-14 21:52:52 +0100
committerGraham Linden <graham@lindenlab.com>2018-09-14 21:52:52 +0100
commit1df7760d315430766bba44d4d4c64480b4a6138f (patch)
treef84ded9bc43e43b2c2fc985ed7a95aa4f0add69c /indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
parenta167f8857fd242e007a6bcbcee80a54a953f29f3 (diff)
SL-9632 add uniform and code to supress atmospherics in all shaders that could be used by HUDs
Make sky and cloud shaders use common scaleSoftClip implementation in gammaF.glsl
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
index 2db633cd01..f2764b72c3 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
@@ -26,11 +26,16 @@
uniform vec4 gamma;
+uniform int no_atmo;
vec3 getAtmosAttenuation();
/// Soft clips the light with a gamma correction
vec3 scaleSoftClip(vec3 light) {
+ if (no_atmo == 1)
+ {
+ return light;
+ }
//soft clip effect:
light = 1. - clamp(light, vec3(0.), vec3(1.));
light = 1. - pow(light, gamma.xxx);
@@ -40,10 +45,10 @@ vec3 scaleSoftClip(vec3 light) {
vec3 fullbrightScaleSoftClipFrag(vec3 light, vec3 atten)
{
- return mix(scaleSoftClip(light.rgb), light.rgb, atten);
+ return (no_atmo == 1) ? light : mix(scaleSoftClip(light.rgb), light.rgb, atten);
}
vec3 fullbrightScaleSoftClip(vec3 light) {
- return fullbrightScaleSoftClipFrag(light.rgb, getAtmosAttenuation());
+ return (no_atmo == 1) ? light : fullbrightScaleSoftClipFrag(light.rgb, getAtmosAttenuation());
}