From 759525040ac11a2edee541c944ad0c6e9cc04d0f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 8 Apr 2019 13:07:44 -0700 Subject: SL-10912 Fix conversion of star brightness, density mult, and distance mult to legacy ranges. Make settings look in both legacyhaze and top-level settings for haze params. --- indra/newview/llsettingsvo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 6556380f28..60f4cd3f5a 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -568,9 +568,11 @@ void LLSettingsVOSky::convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings) F32 density_multiplier = legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal(); density_multiplier = (density_multiplier < 0.0001f) ? 0.0001f : density_multiplier; + density_multiplier *= 0.9f / 2.0f; // take 0 - 2.0 range to 0 - 0.9 range legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(density_multiplier)(0.0f)(0.0f)(1.0f); F32 distance_multiplier = legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal(); + distance_multiplier *= 0.1f; // take 0 - 1000 range to 0 - 100 range legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(distance_multiplier)(0.0f)(0.0f)(1.0f); legacy[SETTING_HAZE_DENSITY] = LLSDArray(legacyhaze[SETTING_HAZE_DENSITY])(0.0f)(0.0f)(1.0f); @@ -597,7 +599,7 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA legacy[SETTING_GLOW] = ensure_array_4(settings[SETTING_GLOW], 1.0); legacy[SETTING_LIGHT_NORMAL] = ensure_array_4(psky->getLightDirection().getValue(), 0.0f); legacy[SETTING_MAX_Y] = LLSDArray(settings[SETTING_MAX_Y])(0.0f)(0.0f)(1.0f); - legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS]; + legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS].asReal() / 250.0f; // convert from 0-500 -> 0-2 ala pre-FS-compat changes legacy[SETTING_SUNLIGHT_COLOR] = ensure_array_4(settings[SETTING_SUNLIGHT_COLOR], 1.0f); LLVector3 dir = psky->getLightDirection(); -- cgit v1.2.3