diff options
author | Graham Linden <graham@lindenlab.com> | 2018-09-14 21:52:52 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-09-14 21:52:52 +0100 |
commit | 1df7760d315430766bba44d4d4c64480b4a6138f (patch) | |
tree | f84ded9bc43e43b2c2fc985ed7a95aa4f0add69c /indra/newview/app_settings/shaders/class3 | |
parent | a167f8857fd242e007a6bcbcee80a54a953f29f3 (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/class3')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/cloudsF.glsl | 8 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class3/windlight/transportF.glsl | 24 |
2 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class3/deferred/cloudsF.glsl index 44b41cc0b8..d9fcc0a9ea 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/cloudsF.glsl @@ -58,13 +58,7 @@ vec4 cloudNoise(vec2 uv) /// Soft clips the light with a gamma correction -vec3 scaleSoftClip(vec3 light) { - //soft clip effect: - light = 1. - clamp(light, vec3(0.), vec3(1.)); - light = 1. - pow(light, gamma.xxx); - - return light; -} +vec3 scaleSoftClip(vec3 light); void main() { diff --git a/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl index 82e1d7fe35..e8e9c53c38 100644 --- a/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class3/windlight/transportF.glsl @@ -32,31 +32,43 @@ vec3 getAtmosAttenuation(); uniform sampler2D cloudMap; uniform vec4 cloud_pos_density1; +uniform int no_atmo; vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) { - light *= atten.r; - light += additive * 2.0; + if (no_atmo == 0) + { + light *= atten.r; + light += additive * 2.0; + } return light; } vec3 fullbrightFragAtmosTransport(vec3 light, vec3 atten, vec3 additive) { - float brightness = dot(light.rgb, vec3(0.33333)); + if (no_atmo) + { + return light; + } + loat brightness = dot(light.rgb, vec3(0.33333)); return mix(atmosFragTransport(light.rgb, atten, additive), light.rgb + additive.rgb, brightness * brightness); } vec3 fullbrightFragShinyAtmosTransport(vec3 light, vec3 atten, vec3 additive) { + if (no_atmo) + { + return light; + } float brightness = dot(light.rgb, vec3(0.33333)); return mix(atmosFragTransport(light.rgb, atten, additive), (light.rgb + additive.rgb) * (2.0 - brightness), brightness * brightness); } vec3 atmosTransport(vec3 light) { - return atmosFragTransport(light, getAtmosAttenuation(), getAdditiveColor()); + return no_atmo ? light : atmosFragTransport(light, getAtmosAttenuation(), getAdditiveColor()); } vec3 fullbrightAtmosTransport(vec3 light) { - return fullbrightFragAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); + return no_atmo ? light : fullbrightFragAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); } vec3 fullbrightShinyAtmosTransport(vec3 light) { - return fullbrightFragShinyAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); + return no_atmo ? light : fullbrightFragShinyAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); } |