From 05d3d1b4815e4bd683b4362b57942563e6902262 Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Tue, 2 Oct 2018 17:00:17 +0100
Subject: Add LUT textures and optional settings for moisture/ice level to sky
 settings.

---
 indra/llinventory/llsettingssky.cpp                |  57 +++++++++++++++++++++
 indra/llinventory/llsettingssky.h                  |  14 +++++
 .../newview/app_settings/windlight/corona_lut.png  | Bin 0 -> 6129 bytes
 .../newview/app_settings/windlight/rainbow_lut.png | Bin 0 -> 200088 bytes
 4 files changed, 71 insertions(+)
 create mode 100644 indra/newview/app_settings/windlight/corona_lut.png
 create mode 100644 indra/newview/app_settings/windlight/rainbow_lut.png

(limited to 'indra')

diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 4543f00454..f298a9cbc7 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -126,6 +126,9 @@ const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR("exp_s
 const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM("linear_term");
 const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM("constant_term");
 
+const std::string LLSettingsSky::SETTING_SKY_MOISTURE_LEVEL("moisture_level");
+const std::string LLSettingsSky::SETTING_SKY_ICE_LEVEL("ice_level");
+
 const LLUUID LLSettingsSky::DEFAULT_ASSET_ID("ff64f04e-097f-40bc-9063-d8d48c308739");
 
 static const LLUUID DEFAULT_SUN_ID("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver
@@ -559,6 +562,12 @@ LLSettingsSky::validation_list_t LLSettingsSky::validationList()
         validation.push_back(Validator(SETTING_SUN_ARC_RADIANS,      true,  LLSD::TypeReal,  
             boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(0.1f)))));
 
+        validation.push_back(Validator(SETTING_SKY_MOISTURE_LEVEL,      false,  LLSD::TypeReal,  
+            boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f)))));
+
+        validation.push_back(Validator(SETTING_SKY_ICE_LEVEL,      false,  LLSD::TypeReal,  
+            boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f)))));
+
         validation.push_back(Validator(SETTING_RAYLEIGH_CONFIG, true, LLSD::TypeArray, &validateRayleighLayers));
         validation.push_back(Validator(SETTING_ABSORPTION_CONFIG, true, LLSD::TypeArray, &validateAbsorptionLayers));
         validation.push_back(Validator(SETTING_MIE_CONFIG, true, LLSD::TypeArray, &validateMieLayers));
@@ -675,6 +684,9 @@ LLSD LLSettingsSky::defaults(const LLSettingsBase::TrackPosition& position)
         dfltsetting[SETTING_SKY_TOP_RADIUS]     = 6420.0f;
         dfltsetting[SETTING_SUN_ARC_RADIANS]    = 0.00045f;
 
+        dfltsetting[SETTING_SKY_MOISTURE_LEVEL] = 0.0f;
+        dfltsetting[SETTING_SKY_ICE_LEVEL]      = 0.0f;
+
         dfltsetting[SETTING_RAYLEIGH_CONFIG]    = rayleighConfigDefault();
         dfltsetting[SETTING_MIE_CONFIG]         = mieConfigDefault();
         dfltsetting[SETTING_ABSORPTION_CONFIG]  = absorptionConfigDefault();
@@ -953,6 +965,41 @@ F32 LLSettingsSky::getDistanceMultiplier() const
     return 0.8f;
 }
 
+void LLSettingsSky::setPlanetRadius(F32 radius)
+{
+    mSettings[SETTING_PLANET_RADIUS] = radius;
+}
+
+void LLSettingsSky::setSkyBottomRadius(F32 radius)
+{
+    mSettings[SETTING_SKY_BOTTOM_RADIUS] = radius;
+}
+
+void LLSettingsSky::setSkyTopRadius(F32 radius)
+{
+    mSettings[SETTING_SKY_TOP_RADIUS] = radius;
+}
+
+void LLSettingsSky::setSunArcRadians(F32 radians)
+{
+    mSettings[SETTING_SUN_ARC_RADIANS] = radians;
+}
+
+void LLSettingsSky::setMieAnisotropy(F32 aniso_factor)
+{
+    getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR] = aniso_factor;
+}
+
+void LLSettingsSky::setSkyMoistureLevel(F32 moisture_level)
+{
+    mSettings[SETTING_SKY_MOISTURE_LEVEL] = moisture_level;
+}
+
+void LLSettingsSky::setSkyIceLevel(F32 ice_level)
+{
+    mSettings[SETTING_SKY_ICE_LEVEL] = ice_level;
+}
+
 void LLSettingsSky::setBlueDensity(const LLColor3 &val)
 {
     mSettings[SETTING_LEGACY_HAZE][SETTING_BLUE_DENSITY] = val.getValue();
@@ -1148,6 +1195,16 @@ F32 LLSettingsSky::getPlanetRadius() const
     return mSettings[SETTING_PLANET_RADIUS].asReal();
 }
 
+F32 LLSettingsSky::getSkyMoistureLevel() const
+{
+    return mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal();
+}
+
+F32 LLSettingsSky::getSkyIceLevel() const
+{
+    return mSettings[SETTING_SKY_ICE_LEVEL].asReal();
+}
+
 F32 LLSettingsSky::getSkyBottomRadius() const
 {
     return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index a4ea8c98f4..2052908bd3 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -87,6 +87,8 @@ public:
         static const std::string SETTING_DENSITY_PROFILE_LINEAR_TERM;
         static const std::string SETTING_DENSITY_PROFILE_CONSTANT_TERM;
         
+    static const std::string SETTING_SKY_MOISTURE_LEVEL;
+    static const std::string SETTING_SKY_ICE_LEVEL;
 
     static const std::string SETTING_LEGACY_HAZE;
 
@@ -117,6 +119,9 @@ public:
     F32 getSunArcRadians() const;
     F32 getMieAnisotropy() const;   
 
+    F32 getSkyMoistureLevel() const;
+    F32 getSkyIceLevel() const;
+
     // Return first (only) profile layer represented in LLSD
     LLSD getRayleighConfig() const;
     LLSD getMieConfig() const;
@@ -133,6 +138,15 @@ public:
     void setMieConfigs(const LLSD& mieConfig);
     void setAbsorptionConfigs(const LLSD& absorptionConfig);
 
+    void setPlanetRadius(F32 radius);
+    void setSkyBottomRadius(F32 radius);
+    void setSkyTopRadius(F32 radius);
+    void setSunArcRadians(F32 radians);
+    void setMieAnisotropy(F32 aniso_factor);
+
+    void setSkyMoistureLevel(F32 moisture_level);
+    void setSkyIceLevel(F32 ice_level);
+
     //---------------------------------------------------------------------
     LLColor3 getAmbientColor() const;
     void setAmbientColor(const LLColor3 &val);
diff --git a/indra/newview/app_settings/windlight/corona_lut.png b/indra/newview/app_settings/windlight/corona_lut.png
new file mode 100644
index 0000000000..c4843667d9
Binary files /dev/null and b/indra/newview/app_settings/windlight/corona_lut.png differ
diff --git a/indra/newview/app_settings/windlight/rainbow_lut.png b/indra/newview/app_settings/windlight/rainbow_lut.png
new file mode 100644
index 0000000000..4bede25649
Binary files /dev/null and b/indra/newview/app_settings/windlight/rainbow_lut.png differ
-- 
cgit v1.2.3


From 4f9d8f555efe04924a7730d3c91faaae3ea56825 Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Fri, 5 Oct 2018 00:16:44 +0100
Subject: SL-9809

Cap glow size at 1.99 to match FS range and fix issue with NaNs when going above that value.
---
 indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra')

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 fd9933f69f..6d12f6bb94 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
@@ -148,7 +148,7 @@
                     layout="topleft"
                     left_delta="5"
                     min_val="0"
-                    max_val="2"
+                    max_val="1.99"
                     name="glow_size"
                     top_delta="15"
                     width="250"
-- 
cgit v1.2.3