summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-11-12 15:54:53 -0800
committerGraham Linden <graham@lindenlab.com>2018-11-12 15:54:53 -0800
commita49e2b604e6b505e083e24b10e39053196d917c1 (patch)
tree931c403bcc66f9831b595b1aeb54534e5a5eff4a /indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
parentbdf4442e216273bb32eeb607857efdad2336ee81 (diff)
SL-10044 SL-10045
Fix class 1 and 2 transport/gamma funcs and made usage consistent across all shaders. Fix class1\environment\waterV reverting to old d1/d2 names for wave directions.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl32
1 files changed, 5 insertions, 27 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index c92dbda185..308a85d2d9 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -49,6 +49,7 @@ uniform vec4 morphFactor;
uniform vec3 camPosLocal;
//uniform vec4 camPosWorld;
uniform vec4 gamma;
+uniform vec4 lightnorm;
uniform vec4 sunlight_color;
uniform vec4 ambient;
uniform vec4 blue_horizon;
@@ -83,32 +84,9 @@ 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 == 1)
- {
- return light;
- }
- return (light + additive) * atten.r * 2.0;
-}
-
-vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) {
- if (no_atmo == 1)
- {
- return light;
- }
- float brightness = dot(light.rgb, vec3(0.33333));
- return mix(atmosTransportFrag(light.rgb, additive, atten), light.rgb + additive.rgb, brightness * brightness);
-}
-
-vec3 fullbrightShinyAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) {
- if (no_atmo == 1)
- {
- return light;
- }
- float brightness = dot(light.rgb, vec3(0.33333));
- return mix(atmosTransportFrag(light.rgb, additive, atten), (light.rgb + additive.rgb) * (2.0 - brightness), brightness * brightness);
-}
+vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
+vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
+vec3 fullbrightShinyAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
vec4 getPosition_d(vec2 pos_screen, float depth)
{
@@ -175,7 +153,7 @@ void main()
ambient *= ambient;
ambient = (1.0-ambient);
- col.rgb = ambient * amblit;
+ col.rgb = ambient * ((col * 0.5) + amblit);
col += sunlit * max(min(da, scol), 0.0);