From 57d89c80945ee0944f745b812487b6e3c16631d2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 17 Sep 2018 19:40:21 +0100 Subject: SL-1491 take two: fix non-ALM/class2 atmospherics additive artifacts Modulate class1 softenLight atmospheric additive by specular.a (same fix as for class2). Clamp additive color to <= vec3(0.2) to avoid similar artifacts in non-deferred render path. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- .../app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 4e11a7e2f5..7a1968efee 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -174,7 +174,8 @@ void main() if (norm.w < 0.5) { - col = mix(atmosFragLighting(col, additive, atten), fullbrightFragAtmosTransport(col, atten, additive), diffuse.a); + vec3 add = additive * spec.a; + col = mix(atmosFragLighting(col, add, atten), fullbrightFragAtmosTransport(col, atten, add), diffuse.a); col = mix(scaleFragSoftClip(col), fullbrightScaleSoftClipFrag(col, atten), diffuse.a); } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 99dbee15ee..3b87c70932 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -73,6 +73,9 @@ void setAmblitColor(vec3 v) void setAdditiveColor(vec3 v) { + // SL-1491 clamp additive term to something reasonable to prevent + // lens flares over non-reflective surfaces + v = clamp(v, vec3(0), vec3(0.2)); additive_color = v; vary_AdditiveColor = v; } -- cgit v1.2.3 From 9581a197aceba7647ab9153513089570f11c4f9a Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 17 Sep 2018 19:48:58 +0100 Subject: SL-1873 Make range of star brightness in code and in UI 0-500 (not 512). --- indra/newview/lldrawpoolwlsky.cpp | 2 +- indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index def2c5263d..76c0bd5abf 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -293,7 +293,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const LLGLEnable blend(GL_BLEND); gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); - F32 star_alpha = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / 512.0f; + F32 star_alpha = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / 500.0f; // If start_brightness is not set, exit if(star_alpha < 0.001f) diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml index 0ec3528718..841a8c3199 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml @@ -171,7 +171,7 @@ layout="topleft" left_delta="5" min_val="0" - max_val="512" + max_val="500" name="star_brightness" top_delta="15" width="250" -- cgit v1.2.3 From eb5038fe755fd90b927359cd9fccd9ef2e951ca5 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 17 Sep 2018 20:09:58 +0100 Subject: SL-9618 Remove extraneous linear to sRGB conversion causing underwater refracted screen tex to be brighter than it should be. --- indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl index 3a8565ee38..db1eab23fb 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl @@ -115,7 +115,7 @@ void main() vec4 fb = texture2D(screenTex, distort); - frag_data[0] = vec4(linear_to_srgb(fb.rgb), 1.0); // diffuse + frag_data[0] = vec4(fb.rgb, 1.0); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace } -- cgit v1.2.3