summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditsky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneleditsky.cpp')
-rw-r--r--indra/newview/llpaneleditsky.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp
index 0d36fce90a..faba2b7ed1 100644
--- a/indra/newview/llpaneleditsky.cpp
+++ b/indra/newview/llpaneleditsky.cpp
@@ -92,6 +92,10 @@ namespace
const std::string FIELD_SKY_DENSITY_ABSORPTION_CONSTANT("absorption_constant");
const std::string FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE("absorption_max_altitude");
+ const std::string FIELD_SKY_DENSITY_MOISTURE_LEVEL("moisture_level");
+ const std::string FIELD_SKY_DENSITY_DROPLET_RADIUS("droplet_radius");
+ const std::string FIELD_SKY_DENSITY_ICE_LEVEL("ice_level");
+
const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f);
const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f);
const F32 SLIDER_SCALE_GLOW_R(20.0f);
@@ -536,6 +540,10 @@ BOOL LLPanelSettingsSkyDensityTab::postBuild()
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAbsorptionMaxAltitudeChanged(); });
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoistureLevelChanged(); });
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onDropletRadiusChanged(); });
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onIceLevelChanged(); });
+
refresh();
return TRUE;
}
@@ -562,6 +570,11 @@ void LLPanelSettingsSkyDensityTab::setEnabled(BOOL enabled)
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_LINEAR)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_CONSTANT)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->setEnabled(enabled);
+
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->setEnabled(enabled);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->setEnabled(enabled);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->setEnabled(enabled);
+
}
void LLPanelSettingsSkyDensityTab::refresh()
@@ -600,6 +613,10 @@ void LLPanelSettingsSkyDensityTab::refresh()
F32 absorption_constant_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
F32 absorption_max_alt = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+ F32 moisture_level = mSkySettings->getSkyMoistureLevel();
+ F32 droplet_radius = mSkySettings->getSkyDropletRadius();
+ F32 ice_level = mSkySettings->getSkyIceLevel();
+
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL)->setValue(rayleigh_exponential_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE)->setValue(rayleigh_exponential_scale);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_LINEAR)->setValue(rayleigh_linear_term);
@@ -618,6 +635,10 @@ void LLPanelSettingsSkyDensityTab::refresh()
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_LINEAR)->setValue(absorption_linear_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_CONSTANT)->setValue(absorption_constant_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->setValue(absorption_max_alt);
+
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->setValue(moisture_level);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->setValue(droplet_radius);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->setValue(ice_level);
}
void LLPanelSettingsSkyDensityTab::updateProfile()
@@ -645,6 +666,10 @@ void LLPanelSettingsSkyDensityTab::updateProfile()
LLSD mie_config = LLSettingsSky::createSingleLayerDensityProfile(mie_max_alt, mie_exponential_term, mie_exponential_scale, mie_linear_term, mie_constant_term, mie_aniso_factor);
LLSD absorption_layer = LLSettingsSky::createSingleLayerDensityProfile(absorption_max_alt, absorption_exponential_term, absorption_exponential_scale, absorption_linear_term, absorption_constant_term);
+ F32 moisture_level = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->getValueF32();
+ F32 droplet_radius = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->getValueF32();
+ F32 ice_level = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->getValueF32();
+
static LLSD absorption_layer_ozone = LLSettingsSky::createDensityProfileLayer(0.0f, 0.0f, 0.0f, -1.0f / 15000.0f, 8.0f / 3.0f);
LLSD absorption_config;
@@ -654,7 +679,9 @@ void LLPanelSettingsSkyDensityTab::updateProfile()
mSkySettings->setRayleighConfigs(rayleigh_config);
mSkySettings->setMieConfigs(mie_config);
mSkySettings->setAbsorptionConfigs(absorption_config);
-
+ mSkySettings->setSkyMoistureLevel(moisture_level);
+ mSkySettings->setSkyDropletRadius(droplet_radius);
+ mSkySettings->setSkyIceLevel(ice_level);
mSkySettings->update();
setIsDirty();
@@ -745,3 +772,18 @@ void LLPanelSettingsSkyDensityTab::onAbsorptionMaxAltitudeChanged()
{
updateProfile();
}
+
+void LLPanelSettingsSkyDensityTab::onMoistureLevelChanged()
+{
+ updateProfile();
+}
+
+void LLPanelSettingsSkyDensityTab::onDropletRadiusChanged()
+{
+ updateProfile();
+}
+
+void LLPanelSettingsSkyDensityTab::onIceLevelChanged()
+{
+ updateProfile();
+}