summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autobuild.xml16
-rw-r--r--indra/llinventory/llsettingssky.cpp2
-rw-r--r--indra/llrender/llatmosphere.cpp8
-rw-r--r--indra/newview/app_settings/settings.xml4
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/skyF.glsl2
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp6
-rw-r--r--indra/newview/llenvironment.cpp3
-rw-r--r--indra/newview/llpaneleditsky.cpp69
-rw-r--r--indra/newview/llpaneleditsky.h5
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_sky_density.xml54
10 files changed, 121 insertions, 48 deletions
diff --git a/autobuild.xml b/autobuild.xml
index 1c328ddb3e..b5e336948a 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -64,9 +64,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>2679e9960e5a1c14e8c6a4e8baf70040</string>
+ <string>722693009586e18aa4d611218c26c5e3</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21515/158137/libatmosphere-1.0.0.100-darwin-517661.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/23969/184338/libatmosphere-1.0.0.100-darwin-519274.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -76,9 +76,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>3b509a8b85a05c53fa19f5f06f0e546b</string>
+ <string>9ecdbb77a18a5dea905ebd3d7faf1f8f</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21514/158129/libatmosphere-1.0.0.100-darwin64-517661.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/23968/184333/libatmosphere-1.0.0.100-darwin64-519274.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
@@ -88,9 +88,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>b0f7b131d0a7d8d6a6404f27f2697872</string>
+ <string>05e113c2988bf77dcde7df0216c26481</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21517/158147/libatmosphere-1.0.0.100-windows-517661.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/23971/184350/libatmosphere-1.0.0.100-windows-519274.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -100,9 +100,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>a50d05abaca0ae167640171ab814a3db</string>
+ <string>1b5fcfbc0123263d68843ac4570c8204</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21516/158140/libatmosphere-1.0.0.100-windows64-517661.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/23970/184345/libatmosphere-1.0.0.100-windows64-519274.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 5f55018387..cd6dfad71d 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -32,6 +32,8 @@
#include "llfasttimer.h"
#include "v3colorutil.h"
+#pragma optimize("", off)
+
//=========================================================================
static const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees
static const F32 NIGHTTIME_ELEVATION_SIN = (F32)sinf(NIGHTTIME_ELEVATION * DEG_TO_RAD);
diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp
index 4edfd9efe9..4fd9764e07 100644
--- a/indra/llrender/llatmosphere.cpp
+++ b/indra/llrender/llatmosphere.cpp
@@ -34,6 +34,8 @@
#include "llshadermgr.h"
#include "llglslshader.h"
+#pragma optimize("", off)
+
LLAtmosphere* gAtmosphere = nullptr;
// Values from "Reference Solar Spectral Irradiance: ASTM G-173", ETR column
@@ -78,6 +80,8 @@ const double kMieScaleHeight = 1200.0;
const double kMieAngstromAlpha = 0.0;
const double kMieAngstromBeta = 5.328e-3;
const double kMieSingleScatteringAlbedo = 0.9;
+const double kGroundAlbedo = 0.1;
+
const double max_sun_zenith_angle = F_PI * 2.0 / 3.0;
AtmosphericModelSettings::AtmosphericModelSettings()
@@ -201,7 +205,7 @@ LLAtmosphere::LLAtmosphere()
m_mie_scattering.push_back(mie * kMieSingleScatteringAlbedo);
m_mie_extinction.push_back(mie);
m_absorption_extinction.push_back(kMaxOzoneNumberDensity * kOzoneCrossSection[(l - kLambdaMin) / 10]);
- m_ground_albedo.push_back(0.6f);
+ m_ground_albedo.push_back(kGroundAlbedo);
}
AtmosphericModelSettings defaults;
@@ -268,7 +272,7 @@ bool LLAtmosphere::configureAtmosphericModel(AtmosphericModelSettings& settings)
m_ground_albedo,
max_sun_zenith_angle,
1000.0,
- 15,
+ 3,
false,
true);
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 214b1a1965..e32eeb4779 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8664,7 +8664,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>RenderLocalLights</key>
<map>
@@ -10165,7 +10165,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>RenderUseTriStrips</key>
<map>
diff --git a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
index 47fa0efe06..01c873584f 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
@@ -1,5 +1,5 @@
/**
- * @file advancedAtmoF.glsl
+ * @file class3/skyF.glsl
*
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 4bf47f4fd6..04f358ba79 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -44,6 +44,8 @@
#include "llenvironment.h"
#include "llatmosphere.h"
+#pragma optimize("", off)
+
static LLStaticHashedString sCamPosLocal("camPosLocal");
static LLStaticHashedString sCustomAlpha("custom_alpha");
@@ -180,12 +182,12 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
sky_shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m);
- // clouds are rendered along with sky in adv atmo
+ /* clouds are rendered along with sky in adv atmo
if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp->getCloudNoiseTex())
{
sky_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, gSky.mVOSkyp->getCloudNoiseTex());
sky_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP_NEXT, gSky.mVOSkyp->getCloudNoiseTexNext());
- }
+ }*/
sky_shader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 6e19df0a94..ed25120241 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -1628,13 +1628,14 @@ void LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky)
mSky->mReplaced |= different_sky;
mSky->update();
mBlenderSky.reset();
-
+/*
if (gAtmosphere)
{
AtmosphericModelSettings settings;
LLEnvironment::getAtmosphericModelSettings(settings, psky);
gAtmosphere->configureAtmosphericModel(settings);
}
+*/
}
void LLEnvironment::DayInstance::setWater(const LLSettingsWater::ptr_t &pwater)
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp
index a9cf9a00d6..451e15c73d 100644
--- a/indra/newview/llpaneleditsky.cpp
+++ b/indra/newview/llpaneleditsky.cpp
@@ -34,6 +34,10 @@
#include "llcolorswatch.h"
#include "llvirtualtrackball.h"
#include "llsettingssky.h"
+#include "llenvironment.h"
+#include "llatmosphere.h"
+
+#pragma optimize("", off)
namespace
{
@@ -75,18 +79,20 @@ namespace
const std::string FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE("rayleigh_exponential_scale");
const std::string FIELD_SKY_DENSITY_RAYLEIGH_LINEAR("rayleigh_linear");
const std::string FIELD_SKY_DENSITY_RAYLEIGH_CONSTANT("rayleigh_constant");
+ const std::string FIELD_SKY_DENSITY_RAYLEIGH_MAX_ALTITUDE("rayleigh_max_altitude");
const std::string FIELD_SKY_DENSITY_MIE_EXPONENTIAL("mie_exponential");
const std::string FIELD_SKY_DENSITY_MIE_EXPONENTIAL_SCALE("mie_exponential_scale");
const std::string FIELD_SKY_DENSITY_MIE_LINEAR("mie_linear");
const std::string FIELD_SKY_DENSITY_MIE_CONSTANT("mie_constant");
const std::string FIELD_SKY_DENSITY_MIE_ANISO("mie_aniso_factor");
+ const std::string FIELD_SKY_DENSITY_MIE_MAX_ALTITUDE("mie_max_altitude");
const std::string FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL("absorption_exponential");
const std::string FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL_SCALE("absorption_exponential_scale");
const std::string FIELD_SKY_DENSITY_ABSORPTION_LINEAR("absorption_linear");
const std::string FIELD_SKY_DENSITY_ABSORPTION_CONSTANT("absorption_constant");
- const std::string FIELD_SKY_DENSITY_MAX_ALTITUDE("max_altitude");
+ const std::string FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE("absorption_max_altitude");
const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f);
const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f);
@@ -520,19 +526,21 @@ BOOL LLPanelSettingsSkyDensityTab::postBuild()
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onRayleighExponentialScaleChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_LINEAR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onRayleighLinearChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_CONSTANT)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onRayleighConstantChanged(); });
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_MAX_ALTITUDE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onRayleighMaxAltitudeChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMieExponentialChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMieExponentialScaleChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_LINEAR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMieLinearChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_CONSTANT)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMieConstantChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_ANISO)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMieAnisoFactorChanged(); });
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_MAX_ALTITUDE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMieMaxAltitudeChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAbsorptionExponentialChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAbsorptionExponentialScaleChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_LINEAR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAbsorptionLinearChanged(); });
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_CONSTANT)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAbsorptionConstantChanged(); });
- getChild<LLUICtrl>(FIELD_SKY_DENSITY_MAX_ALTITUDE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMaxAltitudeChanged(); });
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAbsorptionMaxAltitudeChanged(); });
refresh();
return TRUE;
@@ -546,19 +554,20 @@ void LLPanelSettingsSkyDensityTab::setEnabled(BOOL enabled)
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_LINEAR)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_CONSTANT)->setEnabled(enabled);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_MAX_ALTITUDE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL_SCALE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_LINEAR)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_CONSTANT)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_ANISO)->setEnabled(enabled);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_MAX_ALTITUDE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL_SCALE)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_LINEAR)->setEnabled(enabled);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_CONSTANT)->setEnabled(enabled);
-
- getChild<LLUICtrl>(FIELD_SKY_DENSITY_MAX_ALTITUDE)->setEnabled(enabled);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->setEnabled(enabled);
}
void LLPanelSettingsSkyDensityTab::refresh()
@@ -582,34 +591,39 @@ void LLPanelSettingsSkyDensityTab::refresh()
F32 rayleigh_exponential_scale = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
F32 rayleigh_linear_term = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
F32 rayleigh_constant_term = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal();
+ F32 rayleigh_max_alt = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+
F32 mie_exponential_term = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
F32 mie_exponential_scale = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
F32 mie_linear_term = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
F32 mie_constant_term = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal();
F32 mie_aniso_factor = mie_config[LLSettingsSky::SETTING_MIE_ANISOTROPY_FACTOR].asReal();
+ F32 mie_max_alt = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+
F32 absorption_exponential_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
F32 absorption_exponential_scale = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
F32 absorption_linear_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
F32 absorption_constant_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
- F32 max_alt = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+ F32 absorption_max_alt = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
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);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_CONSTANT)->setValue(rayleigh_constant_term);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_MAX_ALTITUDE)->setValue(rayleigh_max_alt);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL)->setValue(mie_exponential_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL_SCALE)->setValue(mie_exponential_scale);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_LINEAR)->setValue(mie_linear_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_CONSTANT)->setValue(mie_constant_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_ANISO)->setValue(mie_aniso_factor);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_MIE_MAX_ALTITUDE)->setValue(mie_max_alt);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL)->setValue(absorption_exponential_term);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL_SCALE)->setValue(absorption_exponential_scale);
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_MAX_ALTITUDE)->setValue(max_alt);
+ getChild<LLUICtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->setValue(absorption_max_alt);
}
void LLPanelSettingsSkyDensityTab::updateProfile()
@@ -618,26 +632,47 @@ void LLPanelSettingsSkyDensityTab::updateProfile()
F32 rayleigh_exponential_scale = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE)->getValueF32();
F32 rayleigh_linear_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_RAYLEIGH_LINEAR)->getValueF32();
F32 rayleigh_constant_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_RAYLEIGH_CONSTANT)->getValueF32();
+ F32 rayleigh_max_alt = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_RAYLEIGH_MAX_ALTITUDE)->getValueF32();
+
F32 mie_exponential_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL)->getValueF32();
F32 mie_exponential_scale = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MIE_EXPONENTIAL_SCALE)->getValueF32();
F32 mie_linear_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MIE_LINEAR)->getValueF32();
F32 mie_constant_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MIE_CONSTANT)->getValueF32();
F32 mie_aniso_factor = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MIE_ANISO)->getValueF32();
+ F32 mie_max_alt = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MIE_MAX_ALTITUDE)->getValueF32();
+
F32 absorption_exponential_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL)->getValueF32();
F32 absorption_exponential_scale = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_ABSORPTION_EXPONENTIAL_SCALE)->getValueF32();
F32 absorption_linear_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_ABSORPTION_LINEAR)->getValueF32();
F32 absorption_constant_term = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_ABSORPTION_CONSTANT)->getValueF32();
- F32 max_alt = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_MAX_ALTITUDE)->getValueF32();
+ F32 absorption_max_alt = getChild<LLSliderCtrl>(FIELD_SKY_DENSITY_ABSORPTION_MAX_ALTITUDE)->getValueF32();
+
+ LLSD rayleigh_config = LLSettingsSky::createSingleLayerDensityProfile(rayleigh_max_alt, rayleigh_exponential_term, rayleigh_exponential_scale, rayleigh_linear_term, rayleigh_constant_term);
+ 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);
+
+ static LLSD absorption_layer_ozone = LLSettingsSky::createDensityProfileLayer(0.0f, 0.0f, 0.0f, -1.0f / 15000.0f, 8.0f / 3.0f);
- LLSD rayleigh_config = LLSettingsSky::createSingleLayerDensityProfile(max_alt, rayleigh_exponential_term, rayleigh_exponential_scale, rayleigh_linear_term, rayleigh_constant_term);
- LLSD mie_config = LLSettingsSky::createSingleLayerDensityProfile(max_alt, mie_exponential_term, mie_exponential_scale, mie_linear_term, mie_constant_term, mie_aniso_factor);
- LLSD absorption_config = LLSettingsSky::createSingleLayerDensityProfile(max_alt, absorption_exponential_term, absorption_exponential_scale, absorption_linear_term, absorption_constant_term);
+ LLSD absorption_config;
+ absorption_config.append(absorption_layer);
+ absorption_config.append(absorption_layer_ozone);
mSkySettings->setRayleighConfigs(rayleigh_config);
mSkySettings->setMieConfigs(mie_config);
mSkySettings->setAbsorptionConfigs(absorption_config);
mSkySettings->update();
+ setIsDirty();
+
+/*
+ if (gAtmosphere)
+ {
+ AtmosphericModelSettings atmospheric_settings;
+ LLEnvironment::getAtmosphericModelSettings(atmospheric_settings, mSkySettings);
+ gAtmosphere->configureAtmosphericModel(atmospheric_settings);
+ }
+*/
+
}
void LLPanelSettingsSkyDensityTab::onRayleighExponentialChanged()
@@ -660,6 +695,11 @@ void LLPanelSettingsSkyDensityTab::onRayleighConstantChanged()
updateProfile();
}
+void LLPanelSettingsSkyDensityTab::onRayleighMaxAltitudeChanged()
+{
+ updateProfile();
+}
+
void LLPanelSettingsSkyDensityTab::onMieExponentialChanged()
{
updateProfile();
@@ -685,6 +725,11 @@ void LLPanelSettingsSkyDensityTab::onMieAnisoFactorChanged()
updateProfile();
}
+void LLPanelSettingsSkyDensityTab::onMieMaxAltitudeChanged()
+{
+ updateProfile();
+}
+
void LLPanelSettingsSkyDensityTab::onAbsorptionExponentialChanged()
{
updateProfile();
@@ -705,7 +750,7 @@ void LLPanelSettingsSkyDensityTab::onAbsorptionConstantChanged()
updateProfile();
}
-void LLPanelSettingsSkyDensityTab::onMaxAltitudeChanged()
+void LLPanelSettingsSkyDensityTab::onAbsorptionMaxAltitudeChanged()
{
updateProfile();
}
diff --git a/indra/newview/llpaneleditsky.h b/indra/newview/llpaneleditsky.h
index a9022ec86b..b34271f610 100644
--- a/indra/newview/llpaneleditsky.h
+++ b/indra/newview/llpaneleditsky.h
@@ -144,19 +144,20 @@ protected:
void onRayleighExponentialScaleChanged();
void onRayleighLinearChanged();
void onRayleighConstantChanged();
+ void onRayleighMaxAltitudeChanged();
void onMieExponentialChanged();
void onMieExponentialScaleChanged();
void onMieLinearChanged();
void onMieConstantChanged();
void onMieAnisoFactorChanged();
+ void onMieMaxAltitudeChanged();
void onAbsorptionExponentialChanged();
void onAbsorptionExponentialScaleChanged();
void onAbsorptionLinearChanged();
void onAbsorptionConstantChanged();
-
- void onMaxAltitudeChanged();
+ void onAbsorptionMaxAltitudeChanged();
// update the settings for our profile type
void updateProfile();
diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_density.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_density.xml
index 5159a2714e..50663e94f6 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_sky_density.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_sky_density.xml
@@ -22,7 +22,7 @@
auto_resize="true"
user_resize="true"
visible="true"
- height="16">
+ height="14">
<slider
decimal_digits="2"
follows="left|top"
@@ -35,7 +35,7 @@
max_val="1"
name="rayleigh_exponential"
label="Rayleigh Exponential Term:"
- top_pad="8"
+ top_pad="12"
width="400"
label_width="160"
can_edit_text="true"/>
@@ -81,6 +81,20 @@
width="400"
label_width="160"
can_edit_text="true"/>
+ <slider
+ decimal_digits="2"
+ follows="left|top"
+ height="14"
+ increment="1"
+ initial_value="0"
+ layout="topleft"
+ min_val="1000"
+ max_val="40000"
+ name="rayleigh_max_altitude"
+ label="Rayleigh Max Altitude:"
+ width="400"
+ label_width="160"
+ can_edit_text="true"/>
</layout_panel>
<layout_panel
border="true"
@@ -88,7 +102,7 @@
auto_resize="true"
user_resize="true"
visible="true"
- height="18">
+ height="16">
<slider
decimal_digits="2"
follows="left|top"
@@ -101,7 +115,7 @@
max_val="3.0"
name="mie_exponential"
label="Mie Exponential Term:"
- top_pad="8"
+ top_pad="12"
width="400"
label_width="160"
can_edit_text="true"/>
@@ -161,6 +175,20 @@
width="400"
label_width="160"
can_edit_text="true"/>
+ <slider
+ decimal_digits="2"
+ follows="left|top"
+ height="14"
+ increment="1"
+ initial_value="0"
+ layout="topleft"
+ min_val="1000"
+ max_val="30000"
+ name="mie_max_altitude"
+ label="Mie Max Altitude:"
+ width="400"
+ label_width="160"
+ can_edit_text="true"/>
</layout_panel>
<layout_panel
border="true"
@@ -168,7 +196,7 @@
auto_resize="true"
user_resize="true"
visible="true"
- height="16">
+ height="14">
<slider
decimal_digits="2"
follows="left|top"
@@ -227,14 +255,6 @@
width="400"
label_width="160"
can_edit_text="true"/>
- </layout_panel>
- <layout_panel
- border="true"
- bevel_style="in"
- auto_resize="true"
- user_resize="true"
- visible="true"
- height="10">
<slider
decimal_digits="2"
follows="left|top"
@@ -242,12 +262,10 @@
increment="1"
initial_value="0"
layout="topleft"
- left_delta="5"
min_val="1000"
- max_val="40000"
- name="max_altitude"
- label="Max Altitude:"
- top_pad="8"
+ max_val="25000"
+ name="absorption_max_altitude"
+ label="Absorption Max Altitude:"
width="400"
label_width="160"
can_edit_text="true"/>