summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-10-02 17:00:17 +0100
committerGraham Linden <graham@lindenlab.com>2018-10-02 17:00:17 +0100
commit05d3d1b4815e4bd683b4362b57942563e6902262 (patch)
tree3cbf0b7fc82585e0fcf8c5d5eb91d6b48b693fd2 /indra/llinventory
parent17ce10ccd98d4795784466bb217e877ca2d8bad2 (diff)
Add LUT textures and optional settings for moisture/ice level to sky settings.
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingssky.cpp57
-rw-r--r--indra/llinventory/llsettingssky.h14
2 files changed, 71 insertions, 0 deletions
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);