summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
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/class1/deferred
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/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl13
2 files changed, 11 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 3ec2ea12da..f79fc012d1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -88,7 +88,7 @@ vec3 linear_to_srgb(vec3 cl);
vec2 encode_normal (vec3 n);
vec3 decode_normal (vec2 enc);
-vec3 scaleSoftClipFrag(vec3 l);
+vec3 scaleSoftClip(vec3 l);
vec3 atmosFragAmbient(vec3 light, vec3 sunlit);
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
vec3 atmosFragAffectDirectionalLight(float light, vec3 sunlit);
@@ -305,7 +305,7 @@ void main()
//color.rgb = mix(diff.rgb, color.rgb, final_alpha);
color.rgb = atmosFragLighting(color.rgb, additive, atten);
- color.rgb = scaleSoftClipFrag(color.rgb);
+ color.rgb = scaleSoftClip(color.rgb);
vec4 light = vec4(0,0,0,0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 5627275df6..18259ed9ed 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -70,8 +70,12 @@ vec3 linear_to_srgb(vec3 cl);
vec3 decode_normal (vec2 enc);
vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten);
+vec3 fullbrightAtmosTransportFrag(vec3 l, vec3 additive, vec3 atten);
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
+vec3 scaleSoftClip(vec3 l);
+vec3 fullbrightScaleSoftClip(vec3 l);
+
vec4 getPosition_d(vec2 pos_screen, float depth)
{
vec2 sc = pos_screen.xy*2.0;
@@ -129,8 +133,8 @@ void main()
ambient = (1.0 - ambient);
col = amblit;
- col += (final_da * sunlit);
col *= ambient;
+ col += (final_da * sunlit);
col *= diffuse.rgb;
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
@@ -141,7 +145,6 @@ void main()
//
float sa = dot(refnormpersp, sun_dir.xyz);
-
vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r);
// add the two types of shiny together
@@ -166,17 +169,19 @@ void main()
if (norm.w < 0.5)
{
- col = atmosFragLighting(col, additive, atten);
+ col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a);
+ col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a);
}
#ifdef WATER_FOG
- vec4 fogged = applyWaterFogView(pos,vec4(col, bloom));
+ vec4 fogged = applyWaterFogView(pos.xyz,vec4(col, bloom));
col = fogged.rgb;
bloom = fogged.a;
#endif
col = srgb_to_linear(col);
+ //col = vec3(1,0,1);
//col.g = envIntensity;
}