diff options
| author | Graham Linden <graham@lindenlab.com> | 2019-05-21 16:00:45 -0700 | 
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2019-05-21 16:00:45 -0700 | 
| commit | e9dbee00262a437e4b3f971b37ea636e92032133 (patch) | |
| tree | 57f79641ee532f3f80b0fbd89d3a1f42de398829 /indra/newview/app_settings/shaders/class2/deferred | |
| parent | 78e62fe0f16d95a2afb6c4205b121db189c297b9 (diff) | |
SL-11238
Fix ambient light inputs to the renderer.
Fix 3rd sky shader w/ mistaken density mod conversion.
Make ambient clamp apply to all modes.
Tune ALM ambient clamp to match non-ALM.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
| -rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/skyF.glsl | 7 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 19 | 
2 files changed, 15 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl index eb95890e08..dca2862b5a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl @@ -88,6 +88,7 @@ vec3 halo22(float d)  /// Soft clips the light with a gamma correction  vec3 scaleSoftClip(vec3 light); +vec3 srgb_to_linear(vec3 c);  void main()  { @@ -194,10 +195,12 @@ void main()      color.rgb += halo_22; -    color *= 2.; +    color.rgb *= 2.; +    color.rgb = scaleSoftClip(color.rgb); +    color.rgb = srgb_to_linear(color.rgb);      /// Gamma correct for WL (soft clip effect). -    frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0); +    frag_data[0] = vec4(color.rgb, 1.0);      frag_data[1] = vec4(0.0,0.0,0.0,0.0);      frag_data[2] = vec4(0.5,0.5,0.0,1.0); //1.0 in norm.w masks off fog  } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 1b2b835ad1..94abcf08ed 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -24,6 +24,7 @@   */  #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable  /*[EXTRA_CODE_HERE]*/ @@ -87,14 +88,11 @@ void main()      float da = dot(normalize(norm.xyz), light_dir.xyz);            da = clamp(da, -1.0, 1.0); -     -      float final_da = da;            final_da = clamp(final_da, 0.0, 1.0); -    vec4 diffuse_srgb   = texture2DRect(diffuseRect, tc); -    vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); -  +    vec4 diffuse_linear = texture2DRect(diffuseRect, tc); +    vec4 diffuse_srgb   = vec4(linear_to_srgb(diffuse_linear.rgb), diffuse_linear.a);      // clamping to alpha value kills underwater shadows...      //scol = max(scol_ambocc.r, diffuse_linear.a); @@ -116,7 +114,10 @@ void main()          float ambient = da;          ambient *= 0.5;          ambient *= ambient; -        ambient = min(getAmbientClamp(), 1.0 - ambient); + +        float ambient_clamp = getAmbientClamp() + 0.1; +        ambient = (1.0 - ambient); +        ambient *= ambient_clamp;          vec3 sun_contrib = min(scol, final_da) * sunlit; @@ -129,7 +130,7 @@ vec3 post_ambient = color.rgb;  vec3 post_sunlight = color.rgb; -        color.rgb *= diffuse_srgb.rgb; +        color.rgb *= diffuse_linear.rgb;  vec3 post_diffuse = color.rgb; @@ -155,7 +156,7 @@ vec3 post_diffuse = color.rgb;                  float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);                  vec3 sp = sun_contrib*scontrib / 16.0;                  sp = clamp(sp, vec3(0), vec3(1)); -                bloom += dot (sp, sp) / 6.0; +                bloom += dot(sp, sp) / 6.0;                  color += sp * spec.rgb;              }          } @@ -163,7 +164,7 @@ vec3 post_diffuse = color.rgb;   vec3 post_spec = color.rgb;  #ifndef WATER_FOG -        color.rgb += diffuse_srgb.a * diffuse_srgb.rgb; +        color.rgb = mix(color.rgb, diffuse_srgb.rgb, diffuse_srgb.a);  #endif          if (envIntensity > 0.0)  | 
