From 0a78e9271c524c92cb8b1965e9a6081d4f700437 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 4 Sep 2018 23:39:21 +0100 Subject: Make legacy star brightness setting convert to 0-512 range of new settings. Make brightness scale in shader more linear and fix twinkling. --- indra/llinventory/llsettingssky.cpp | 4 ++-- indra/newview/app_settings/shaders/class1/deferred/starsF.glsl | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 0203e5067a..3b60ee2000 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -646,7 +646,7 @@ LLSD LLSettingsSky::defaults(const LLSettingsBase::TrackPosition& position) dfltsetting[SETTING_MAX_Y] = LLSD::Real(1605); dfltsetting[SETTING_MOON_ROTATION] = moonquat.getValue(); - dfltsetting[SETTING_STAR_BRIGHTNESS] = LLSD::Real(0.0000); + dfltsetting[SETTING_STAR_BRIGHTNESS] = LLSD::Real(256.0000); dfltsetting[SETTING_SUNLIGHT_COLOR] = LLColor4(0.7342, 0.7815, 0.8999, 0.0).getValue(); dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue(); @@ -775,7 +775,7 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy) } if (legacy.has(SETTING_STAR_BRIGHTNESS)) { - newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(legacy[SETTING_STAR_BRIGHTNESS].asReal()); + newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(legacy[SETTING_STAR_BRIGHTNESS].asReal()) * 256.0f; } if (legacy.has(SETTING_SUNLIGHT_COLOR)) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index 6c616db442..4ae3f7b76f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -53,9 +53,11 @@ void main() vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy); vec4 col = mix(col_b, col_a, blend_factor); col.rgb *= vertex_color.rgb; - col.a = (col.a * custom_alpha) * 8.0f; - col.a += twinkle() * 2.0f; - col.a = max(0.0f, col.a); + + float factor = smoothstep(0.0f, 0.9f, custom_alpha); + + col.a = (col.a * factor) * 32.0f; + col.a *= twinkle(); frag_data[0] = col; frag_data[1] = vec4(0.0f); -- cgit v1.2.3