From 48401b224d778b21e4d8ae08365718591907d14b Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 5 Jun 2019 08:58:28 -0700 Subject: SL-9989 Clamp fog distance multiplier to >= 0.05 and adjust min range on control as well. Make sky shaders use dist mul consistently. --- .../shaders/class1/windlight/atmosphericsFuncs.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/skyF.glsl | 10 +++++----- .../newview/app_settings/shaders/class2/windlight/cloudsV.glsl | 5 +++-- indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 4 ++-- .../newview/skins/default/xui/en/panel_settings_sky_atmos.xml | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 9116b86f39..291e160cdc 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -68,7 +68,7 @@ void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, o vec4 light_atten; float dens_mul = density_multiplier; - float dist_mul = distance_multiplier; + float dist_mul = max(0.05, distance_multiplier); //sunlight attenuation effect (hue and brightness) due to atmosphere //this is used later for sunlight modulation at various altitudes diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl index dcd639caff..921f87cf14 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl @@ -120,7 +120,7 @@ void main() vec4 light_atten; float dens_mul = density_multiplier; - float dist_mul = distance_multiplier; + float dist_mul = max(0.05, distance_multiplier); // Sunlight attenuation effect (hue and brightness) due to atmosphere // this is used later for sunlight modulation at various altitudes @@ -169,13 +169,13 @@ void main() // Increase ambient when there are more clouds vec4 tmpAmbient = ambient_color; - tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5; + tmpAmbient += max(vec4(0), (1. - ambient_color)) * cloud_shadow * 0.5; // Dim sunlight by cloud shadow percentage - sunlight *= (1. - cloud_shadow); + sunlight *= max(0.0, (1. - cloud_shadow)); // Haze color below cloud - vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient) + vec4 additiveColorBelowCloud = (blue_horizon * blue_weight * (sunlight + tmpAmbient) + (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient) ); @@ -192,7 +192,7 @@ void main() vec3 halo_22 = halo22(optic_d); - color.rgb += rainbow(optic_d); + color.rgb += rainbow(optic_d); color.rgb += halo_22; diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 97eeb302d9..372c782d74 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -106,7 +106,7 @@ void main() vec4 light_atten; float dens_mul = density_multiplier; - float dist_mul = distance_multiplier; + float dist_mul = max(0.05, distance_multiplier); // Sunlight attenuation effect (hue and brightness) due to atmosphere // this is used later for sunlight modulation at various altitudes @@ -128,7 +128,8 @@ void main() // Transparency (-> temp1) // ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati // compiler gets confused. - temp1 = exp(-temp1 * temp2.z * dist_mul); + //temp1 = exp(-temp1 * temp2.z * dist_mul); + temp1 = exp(-temp1 * dist_mul); // Compute haze glow temp2.x = dot(Pn, lightnorm.xyz); diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 74326f252e..eb5ab0f012 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -89,6 +89,7 @@ void main() vec4 light_atten; float dens_mul = density_multiplier; + float dist_mul = max(0.05, distance_multiplier); // Sunlight attenuation effect (hue and brightness) due to atmosphere // this is used later for sunlight modulation at various altitudes @@ -110,8 +111,7 @@ void main() // Transparency (-> temp1) // ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati // compiler gets confused. - temp1 = exp(-temp1 * temp2.z * distance_multiplier); - + temp1 = exp(-temp1 * dist_mul); // Compute haze glow temp2.x = dot(Pn, lightnorm.xyz); diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml index e6fdc76de1..bec793bbee 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml @@ -283,10 +283,10 @@ follows="left|top" height="16" increment="0.01" - initial_value="0" + initial_value="0.8" layout="topleft" left_delta="5" - min_val="0" + min_val="0.05" max_val="1000" name="distance_multip" top_delta="20" -- cgit v1.2.3