summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2017-09-27 09:36:26 -0700
committerRider Linden <rider@lindenlab.com>2017-09-27 09:36:26 -0700
commit52b0d4173cec0f643f37d426aef8f5ab1fdf3232 (patch)
tree5e2cb3e2ea12cabe81bb4a6b134968109e3414b4
parent0d414c1fb579dffc122c4d021a84cd126c612e54 (diff)
No longer 'goth windlight only', sky parameters passed from settings object.
-rw-r--r--indra/llmath/v3colorutil.h20
-rw-r--r--indra/newview/llappviewer.cpp1
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp9
-rw-r--r--indra/newview/llenvironment.cpp22
-rw-r--r--indra/newview/llenvironment.h9
-rw-r--r--indra/newview/llfloaterenvironmentsettings.cpp6
-rw-r--r--indra/newview/llsettingssky.cpp144
-rw-r--r--indra/newview/llsettingssky.h7
-rw-r--r--indra/newview/llviewerdisplay.cpp2
-rw-r--r--indra/newview/llviewershadermgr.cpp3
-rw-r--r--indra/newview/llvosky.cpp2
-rw-r--r--indra/newview/llvosky.h21
-rw-r--r--indra/newview/llvowlsky.cpp11
-rw-r--r--indra/newview/llwaterparammanager.cpp10
-rw-r--r--indra/newview/pipeline.cpp1
15 files changed, 153 insertions, 115 deletions
diff --git a/indra/llmath/v3colorutil.h b/indra/llmath/v3colorutil.h
index 00b36132d8..6d8cd9329b 100644
--- a/indra/llmath/v3colorutil.h
+++ b/indra/llmath/v3colorutil.h
@@ -91,5 +91,25 @@ inline LLColor3 smear(F32 val)
return LLColor3(val, val, val);
}
+inline F32 color_intens(const LLColor3 &col)
+{
+ return col.mV[0] + col.mV[1] + col.mV[2];
+}
+
+inline F32 color_max(const LLColor3 &col)
+{
+ return llmax(col.mV[0], col.mV[1], col.mV[2]);
+}
+
+inline F32 color_max(const LLColor4 &col)
+{
+ return llmax(col.mV[0], col.mV[1], col.mV[2]);
+}
+
+
+inline F32 color_min(const LLColor3 &col)
+{
+ return llmin(col.mV[0], col.mV[1], col.mV[2]);
+}
#endif
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9bab572b68..529bd429a4 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -170,7 +170,6 @@
#include "llviewerparcelmgr.h"
#include "llworldmapview.h"
#include "llpostprocess.h"
-#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "lldebugview.h"
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index e10bc10bc2..2ff4edabe3 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -33,7 +33,6 @@
#include "pipeline.h"
#include "llviewercamera.h"
#include "llimage.h"
-#include "llwlparammanager.h"
#include "llviewershadermgr.h"
#include "llglslshader.h"
#include "llsky.h"
@@ -83,7 +82,8 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
}
}
- LLWLParamManager::getInstance()->propagateParameters();
+ /* *LAPRAS */
+// LLWLParamManager::getInstance()->propagateParameters();
}
LLDrawPoolWLSky::~LLDrawPoolWLSky()
@@ -312,7 +312,8 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
}
LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY);
- const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
+
+ const F32 camHeightLocal = LLEnvironment::instance().getCamHeight();
LLGLSNoFog disableFog;
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
@@ -359,7 +360,7 @@ void LLDrawPoolWLSky::render(S32 pass)
}
LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY);
- const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
+ const F32 camHeightLocal = LLEnvironment::instance().getCamHeight();
LLGLSNoFog disableFog;
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 84a1f2c1ab..ceba7fda88 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -34,7 +34,6 @@
#include "llviewerregion.h"
#include "llwaterparammanager.h"
#include "llwlhandlers.h"
-#include "llwlparammanager.h"
#include "lltrans.h"
#include "lltrace.h"
#include "llfasttimer.h"
@@ -66,6 +65,12 @@ LLEnvironment::~LLEnvironment()
}
//-------------------------------------------------------------------------
+F32 LLEnvironment::getCamHeight() const
+{
+ return (mCurrentSky->getDomeOffset() * mCurrentSky->getDomeRadius());
+}
+
+//-------------------------------------------------------------------------
void LLEnvironment::update(const LLViewerCamera * cam)
{
LL_RECORD_BLOCK_TIME(FTM_ENVIRONMENT_UPDATE);
@@ -222,7 +227,7 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader)
stop_glerror();
}
- shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mCurrentSky->getSceneLightStrength());
+ shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, getSceneLightStrength());
// {
// LLVector4 cloud_scroll(mCloudScroll[0], mCloudScroll[1], 0.0, 0.0);
@@ -244,6 +249,8 @@ void LLEnvironment::addSky(const LLSettingsSky::ptr_t &sky)
{
std::string name = sky->getValue(LLSettingsSky::SETTING_NAME).asString();
+ LL_WARNS("RIDER") << "Adding sky as '" << name << "'" << LL_ENDL;
+
std::pair<NamedSkyMap_t::iterator, bool> result;
result = mSkysByName.insert(NamedSkyMap_t::value_type(name, sky));
@@ -280,3 +287,14 @@ void LLEnvironment::clearAllSkys()
mSkysById.clear();
}
+void LLEnvironment::selectSky(const std::string &name)
+{
+ NamedSkyMap_t::iterator it = mSkysByName.find(name);
+
+ if (it == mSkysByName.end())
+ return;
+
+ mCurrentSky = (*it).second;
+ mCurrentSky->setDirtyFlag(true);
+}
+
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 3a834963f3..0e8f39b4bf 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -54,9 +54,16 @@ public:
void updateShaderUniforms(LLGLSLShader *shader);
void addSky(const LLSettingsSky::ptr_t &sky);
+ void selectSky(const std::string &name);
inline LLVector2 getCloudScrollDelta() const { return mCloudScrollDelta; }
+ F32 getCamHeight() const;
+
+ inline F32 getSceneLightStrength() const { return mSceneLightStrength; }
+ inline void setSceneLightStrength(F32 light_strength) { mSceneLightStrength = light_strength; }
+
+
private:
static const F32 SUN_DELTA_YAW;
@@ -71,6 +78,8 @@ private:
NamedSkyMap_t mSkysByName;
AssetSkyMap_t mSkysById;
+ F32 mSceneLightStrength;
+
void addSky(const LLUUID &id, const LLSettingsSky::ptr_t &sky);
void removeSky(const std::string &name);
void removeSky(const LLUUID &id);
diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp
index 4dbc8cdee0..3a059e92dc 100644
--- a/indra/newview/llfloaterenvironmentsettings.cpp
+++ b/indra/newview/llfloaterenvironmentsettings.cpp
@@ -37,6 +37,8 @@
#include "llwlparamset.h"
#include "llwlparammanager.h"
+#include "llenvironment.h"
+
LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key)
: LLFloater(key)
,mRegionSettingsRadioGroup(NULL)
@@ -188,7 +190,9 @@ void LLFloaterEnvironmentSettings::apply()
{
if (use_fixed_sky)
{
- env_mgr.useSkyPreset(sky_preset);
+ /* LAPRAS */
+ //env_mgr.useSkyPreset(sky_preset);
+ LLEnvironment::instance().selectSky(sky_preset);
}
else
{
diff --git a/indra/newview/llsettingssky.cpp b/indra/newview/llsettingssky.cpp
index 1d71140430..191ca2d2ec 100644
--- a/indra/newview/llsettingssky.cpp
+++ b/indra/newview/llsettingssky.cpp
@@ -48,8 +48,11 @@ namespace
LLTrace::BlockTimerStatHandle FTM_BLEND_ENVIRONMENT("Blending Environment Params");
LLTrace::BlockTimerStatHandle FTM_UPDATE_ENVIRONMENT("Update Environment Params");
+ LLQuaternion body_position_from_angles(F32 azimuth, F32 altitude);
+
}
+
//=========================================================================
const std::string LLSettingsSky::SETTING_AMBIENT("ambient");
const std::string LLSettingsSky::SETTING_BLOOM_TEXTUREID("bloom_id");
@@ -112,38 +115,27 @@ LLSettingsSky::stringset_t LLSettingsSky::getSlerpKeys() const
LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &name, const LLSD &oldsettings)
{
- LLSD newsettings(LLSD::emptyMap());
+ LLSD newsettings(defaults());
newsettings[SETTING_NAME] = name;
+
if (oldsettings.has(SETTING_AMBIENT))
{
newsettings[SETTING_AMBIENT] = LLColor4(oldsettings[SETTING_AMBIENT]).getValue();
}
-
if (oldsettings.has(SETTING_BLUE_DENSITY))
{
newsettings[SETTING_BLUE_DENSITY] = LLColor4(oldsettings[SETTING_BLUE_DENSITY]).getValue();
}
-
if (oldsettings.has(SETTING_BLUE_HORIZON))
{
newsettings[SETTING_BLUE_HORIZON] = LLColor4(oldsettings[SETTING_BLUE_HORIZON]).getValue();
}
-
if (oldsettings.has(SETTING_CLOUD_COLOR))
{
newsettings[SETTING_CLOUD_COLOR] = LLColor4(oldsettings[SETTING_CLOUD_COLOR]).getValue();
}
- if (oldsettings.has(SETTING_SUNLIGHT_COLOR))
- {
- newsettings[SETTING_SUNLIGHT_COLOR] = LLColor4(oldsettings[SETTING_SUNLIGHT_COLOR]).getValue();
- }
- if (oldsettings.has(SETTING_CLOUD_SHADOW))
- {
- newsettings[SETTING_CLOUD_SHADOW] = LLSD::Real(oldsettings[SETTING_CLOUD_SHADOW][0].asReal());
- }
-
if (oldsettings.has(SETTING_CLOUD_POS_DENSITY1))
{
newsettings[SETTING_CLOUD_POS_DENSITY1] = LLColor4(oldsettings[SETTING_CLOUD_POS_DENSITY1]).getValue();
@@ -152,16 +144,29 @@ LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &nam
{
newsettings[SETTING_CLOUD_POS_DENSITY2] = LLColor4(oldsettings[SETTING_CLOUD_POS_DENSITY2]).getValue();
}
- if (oldsettings.has(SETTING_LIGHT_NORMAL))
- {
- newsettings[SETTING_LIGHT_NORMAL] = LLVector4(oldsettings[SETTING_LIGHT_NORMAL]).getValue();
- }
-
if (oldsettings.has(SETTING_CLOUD_SCALE))
{
newsettings[SETTING_CLOUD_SCALE] = LLSD::Real(oldsettings[SETTING_CLOUD_SCALE][0].asReal());
}
+ if (oldsettings.has(SETTING_CLOUD_SCROLL_RATE))
+ {
+ LLVector2 cloud_scroll(oldsettings[SETTING_CLOUD_SCROLL_RATE]);
+ if (oldsettings.has(SETTING_LEGACY_ENABLE_CLOUD_SCROLL))
+ {
+ LLSD enabled = oldsettings[SETTING_LEGACY_ENABLE_CLOUD_SCROLL];
+ if (!enabled[0].asBoolean())
+ cloud_scroll.mV[0] = 0.0f;
+ if (!enabled[1].asBoolean())
+ cloud_scroll.mV[1] = 0.0f;
+ }
+
+ newsettings[SETTING_CLOUD_SCROLL_RATE] = cloud_scroll.getValue();
+ }
+ if (oldsettings.has(SETTING_CLOUD_SHADOW))
+ {
+ newsettings[SETTING_CLOUD_SHADOW] = LLSD::Real(oldsettings[SETTING_CLOUD_SHADOW][0].asReal());
+ }
if (oldsettings.has(SETTING_DENSITY_MULTIPLIER))
{
newsettings[SETTING_DENSITY_MULTIPLIER] = LLSD::Real(oldsettings[SETTING_DENSITY_MULTIPLIER][0].asReal());
@@ -170,6 +175,14 @@ LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &nam
{
newsettings[SETTING_DISTANCE_MULTIPLIER] = LLSD::Real(oldsettings[SETTING_DISTANCE_MULTIPLIER][0].asReal());
}
+ if (oldsettings.has(SETTING_GAMMA))
+ {
+ newsettings[SETTING_GAMMA] = LLVector4(oldsettings[SETTING_GAMMA]).getValue();
+ }
+ if (oldsettings.has(SETTING_GLOW))
+ {
+ newsettings[SETTING_GLOW] = LLColor4(oldsettings[SETTING_GLOW]).getValue();
+ }
if (oldsettings.has(SETTING_HAZE_DENSITY))
{
newsettings[SETTING_HAZE_DENSITY] = LLSD::Real(oldsettings[SETTING_HAZE_DENSITY][0].asReal());
@@ -178,6 +191,10 @@ LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &nam
{
newsettings[SETTING_HAZE_HORIZON] = LLSD::Real(oldsettings[SETTING_HAZE_HORIZON][0].asReal());
}
+ if (oldsettings.has(SETTING_LIGHT_NORMAL))
+ {
+ newsettings[SETTING_LIGHT_NORMAL] = LLVector4(oldsettings[SETTING_LIGHT_NORMAL]).getValue();
+ }
if (oldsettings.has(SETTING_MAX_Y))
{
newsettings[SETTING_MAX_Y] = LLSD::Real(oldsettings[SETTING_MAX_Y][0].asReal());
@@ -186,55 +203,29 @@ LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &nam
{
newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(oldsettings[SETTING_STAR_BRIGHTNESS].asReal());
}
-
- if (oldsettings.has(SETTING_GLOW))
- {
- newsettings[SETTING_GLOW] = LLColor4(oldsettings[SETTING_GLOW]).getValue();
- }
-
- if (oldsettings.has(SETTING_GAMMA))
+ if (oldsettings.has(SETTING_SUNLIGHT_COLOR))
{
- newsettings[SETTING_GAMMA] = LLVector4(oldsettings[SETTING_GAMMA]).getValue();
+ newsettings[SETTING_SUNLIGHT_COLOR] = LLColor4(oldsettings[SETTING_SUNLIGHT_COLOR]).getValue();
}
- if (oldsettings.has(SETTING_CLOUD_SCROLL_RATE))
- {
- LLVector2 cloud_scroll(oldsettings[SETTING_CLOUD_SCROLL_RATE]);
-
- if (oldsettings.has(SETTING_LEGACY_ENABLE_CLOUD_SCROLL))
- {
- LLSD enabled = oldsettings[SETTING_LEGACY_ENABLE_CLOUD_SCROLL];
- if (!enabled[0].asBoolean())
- cloud_scroll.mV[0] = 0.0f;
- if (!enabled[1].asBoolean())
- cloud_scroll.mV[1] = 0.0f;
- }
-
- newsettings[SETTING_CLOUD_SCROLL_RATE] = cloud_scroll.getValue();
- }
+// dfltsetting[SETTING_DOME_OFFSET] = LLSD::Real(0.96f);
+// dfltsetting[SETTING_DOME_RADIUS] = LLSD::Real(15000.f);
+//
+// dfltsetting[SETTING_MOON_ROTATION] = moonquat.getValue();
+// dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue();
+//
+// dfltsetting[SETTING_BLOOM_TEXTUREID] = LLUUID::null;
+// dfltsetting[SETTING_CLOUD_TEXTUREID] = LLUUID::null;
+// dfltsetting[SETTING_MOON_TEXTUREID] = IMG_SUN; // gMoonTextureID; // These two are returned by the login... wow!
+// dfltsetting[SETTING_SUN_TEXUTUREID] = IMG_MOON; // gSunTextureID;
if (oldsettings.has(SETTING_LEGACY_EAST_ANGLE) && oldsettings.has(SETTING_LEGACY_SUN_ANGLE))
{ // convert the east and sun angles into a quaternion.
- F32 east = oldsettings[SETTING_LEGACY_EAST_ANGLE].asReal();
- F32 azimuth = oldsettings[SETTING_LEGACY_SUN_ANGLE].asReal();
-
- LLQuaternion sunquat;
- sunquat.setEulerAngles(azimuth, 0.0, east);
-// // set the sun direction from SunAngle and EastAngle
-// F32 sinTheta = sin(east);
-// F32 cosTheta = cos(east);
-//
-// F32 sinPhi = sin(azimuth);
-// F32 cosPhi = cos(azimuth);
-//
-// LLVector4 sunDir;
-// sunDir.mV[0] = -sinTheta * cosPhi;
-// sunDir.mV[1] = sinPhi;
-// sunDir.mV[2] = cosTheta * cosPhi;
-// sunDir.mV[3] = 0;
-//
-// LLQuaternion sunquat = LLQuaternion(0.1, sunDir); // small rotation around axis
+ F32 azimuth = oldsettings[SETTING_LEGACY_EAST_ANGLE].asReal();
+ F32 altitude = oldsettings[SETTING_LEGACY_SUN_ANGLE].asReal();
+
+ LLQuaternion sunquat = ::body_position_from_angles(azimuth, altitude);
LLQuaternion moonquat = ~sunquat;
newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
@@ -252,7 +243,7 @@ LLSettingsSky::ptr_t LLSettingsSky::buildDefaultSky()
LLSD settings = LLSettingsSky::defaults();
LLSettingsSky::ptr_t skyp = boost::make_shared<LLSettingsSky>(settings);
- skyp->update();
+ //skyp->update();
return skyp;
}
@@ -458,7 +449,7 @@ void LLSettingsSky::calculateLightSettings()
// between sunlight and point lights in windlight to normalize point lights.
F32 sun_dynamic_range = std::max(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f);
- mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp);
+ LLEnvironment::instance().setSceneLightStrength(2.0f * (1.0f + sun_dynamic_range * dp));
mSunDiffuse = vary_SunlightColor;
mSunAmbient = vary_AmbientColor;
@@ -506,8 +497,6 @@ void LLSettingsSky::applySpecial(void *ptarget)
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mLightDirectionClamped.mV);
- shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mSceneLightStrength);
-
shader->uniform4f(LLShaderMgr::GAMMA, getGama(), 0.0, 0.0, 1.0);
{
@@ -534,3 +523,30 @@ void LLSettingsSky::applySpecial(void *ptarget)
//param_map[SETTING_CLOUD_POS_DENSITY1] = LLShaderMgr::CLOUD_POS_DENSITY1;
}
+
+//=========================================================================
+namespace
+{
+ LLQuaternion body_position_from_angles(F32 azimuth, F32 altitude)
+ {
+ static const LLVector3 VECT_ZENITH(0.f, 0.f, 1.f);
+ static const LLVector3 VECT_NORTHSOUTH(0.f, 1.f, 0.f);
+
+ // Azimuth is traditionally calculated from North, we are going from East.
+ LLQuaternion rot_azi;
+ LLQuaternion rot_alt;
+
+ rot_azi.setAngleAxis(azimuth, VECT_ZENITH);
+ rot_alt.setAngleAxis(-altitude, VECT_NORTHSOUTH);
+
+ LLQuaternion body_quat = rot_alt * rot_azi;
+ body_quat.normalize();
+
+ LLVector3 sun_vector = (DUE_EAST * body_quat);
+
+
+ LL_WARNS("RIDER") << "Azimuth=" << azimuth << " Altitude=" << altitude << " Body Vector=" << sun_vector.getValue() << LL_ENDL;
+
+ return body_quat;
+ }
+}
diff --git a/indra/newview/llsettingssky.h b/indra/newview/llsettingssky.h
index 4e333f0584..b3ac3c2ac9 100644
--- a/indra/newview/llsettingssky.h
+++ b/indra/newview/llsettingssky.h
@@ -233,12 +233,6 @@ public:
return mLightDirectionClamped;
};
- F32 getSceneLightStrength() const
- {
- update();
- return mSceneLightStrength;
- }
-
LLVector3 getSunDirection() const
{
update();
@@ -304,7 +298,6 @@ private:
LLVector3 mSunDirection;
LLVector3 mMoonDirection;
- F32 mSceneLightStrength;
LLVector3 mLightDirection;
LLVector3 mLightDirectionClamped;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index d810d7077b..dcf42a201b 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -202,8 +202,6 @@ void display_update_camera()
gViewerWindow->setup3DRender();
// update all the sky/atmospheric/water settings
- // *LAPRAS
- //LLWLParamManager::getInstance()->update(LLViewerCamera::getInstance());
LLEnvironment::instance().update(LLViewerCamera::getInstance());
LLWaterParamManager::getInstance()->update(LLViewerCamera::getInstance());
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 313cdaa500..683ff7558a 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -38,7 +38,6 @@
#include "llviewercontrol.h"
#include "pipeline.h"
#include "llworld.h"
-#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llsky.h"
#include "llvosky.h"
@@ -3430,9 +3429,7 @@ std::string LLViewerShaderMgr::getShaderDirPrefix(void)
void LLViewerShaderMgr::updateShaderUniforms(LLGLSLShader * shader)
{
- //*LAPRAS*/
LLEnvironment::instance().updateShaderUniforms(shader);
- //LLWLParamManager::getInstance()->updateShaderUniforms(shader);
LLWaterParamManager::getInstance()->updateShaderUniforms(shader);
}
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index ce956b7fda..dc6e6e9e45 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -962,7 +962,7 @@ void LLVOSky::calcAtmospherics(void)
// Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio
// between sunlight and point lights in windlight to normalize point lights.
F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f);
- LLWLParamManager::getInstance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp);
+ LLEnvironment::instance().setSceneLightStrength(2.0f * (1.0f + sun_dynamic_range * dp));
mSunDiffuse = vary_SunlightColor;
mSunAmbient = vary_AmbientColor;
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index 9cfb9773bd..c865e8701c 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -33,6 +33,7 @@
#include "llviewertexture.h"
#include "llviewerobject.h"
#include "llframetimer.h"
+#include "v3colorutil.h"
//////////////////////////////////
@@ -85,26 +86,6 @@ BOOL clip_quad_to_horizon(F32& t_left, F32& t_right, LLVector3 v_clipped[4],
const LLVector3 v_corner[4], const F32 cos_max_angle);
F32 clip_side_to_horizon(const LLVector3& v0, const LLVector3& v1, const F32 cos_max_angle);
-inline F32 color_intens ( const LLColor3 &col )
-{
- return col.mV[0] + col.mV[1] + col.mV[2];
-}
-
-inline F32 color_max(const LLColor3 &col)
-{
- return llmax(col.mV[0], col.mV[1], col.mV[2]);
-}
-
-inline F32 color_max(const LLColor4 &col)
-{
- return llmax(col.mV[0], col.mV[1], col.mV[2]);
-}
-
-
-inline F32 color_min(const LLColor3 &col)
-{
- return llmin(col.mV[0], col.mV[1], col.mV[2]);
-}
class LLFace;
class LLHaze;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index 16130b5ca7..aff155637e 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -32,8 +32,9 @@
#include "llsky.h"
#include "lldrawpoolwlsky.h"
#include "llface.h"
-#include "llwlparammanager.h"
#include "llviewercontrol.h"
+#include "llenvironment.h"
+#include "llsettingssky.h"
#define DOME_SLICES 1
const F32 LLVOWLSky::DISTANCE_TO_STARS = (HORIZON_DIST - 10.f)*0.25f;
@@ -232,7 +233,7 @@ void subdivide(LLVertexBuffer& in, LLVertexBuffer* ret)
void chop(LLVertexBuffer& in, LLVertexBuffer* out)
{
//chop off all triangles below horizon
- F32 d = LLWLParamManager::sParamMgr->getDomeOffset() * LLWLParamManager::sParamMgr->getDomeRadius();
+ F32 d = LLEnvironment::instance().getCamHeight();
std::vector<LLVector3> vert;
@@ -399,7 +400,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
#else
mStripsVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
- const F32 RADIUS = LLWLParamManager::sParamMgr->getDomeRadius();
+ const F32 RADIUS = LLEnvironment::getCurrentSky()->getDomeRadius();
LLPointer<LLVertexBuffer> temp = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, 0);
temp->allocateBuffer(12, 60, TRUE);
@@ -574,7 +575,7 @@ void LLVOWLSky::buildFanBuffer(LLStrider<LLVector3> & vertices,
LLStrider<LLVector2> & texCoords,
LLStrider<U16> & indices)
{
- const F32 RADIUS = LLWLParamManager::getInstance()->getDomeRadius();
+ const F32 RADIUS = LLEnvironment::instance().getCurrentSky()->getDomeRadius();
U32 i, num_slices;
F32 phi0, theta, x0, y0, z0;
@@ -635,7 +636,7 @@ void LLVOWLSky::buildStripsBuffer(U32 begin_stack, U32 end_stack,
LLStrider<LLVector2> & texCoords,
LLStrider<U16> & indices)
{
- const F32 RADIUS = LLWLParamManager::getInstance()->getDomeRadius();
+ const F32 RADIUS = LLEnvironment::instance().getCurrentSky()->getDomeRadius();
U32 i, j, num_slices, num_stacks;
F32 phi0, theta, x0, y0, z0;
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index b484b6d709..689296a53a 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -52,7 +52,7 @@
#include "llagentcamera.h"
#include "llviewerregion.h"
-#include "llwlparammanager.h"
+#include "llenvironment.h"
#include "llwaterparamset.h"
#include "curl/curl.h"
@@ -187,8 +187,8 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
{
if (shader->mShaderGroup == LLGLSLShader::SG_WATER)
{
- shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV);
-shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV);
+ shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLEnvironment::instance().getRotatedLightDir().mV);
+ shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV);
shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, LLDrawPoolWater::sWaterFogColor.mV);
shader->uniform4fv(LLShaderMgr::WATER_WATERPLANE, 1, mWaterPlane.mV);
shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, getFogDensity());
@@ -207,7 +207,9 @@ void LLWaterParamManager::applyParams(const LLSD& params, bool interpolate)
if (interpolate)
{
- LLWLParamManager::getInstance()->mAnimator.startInterpolation(params);
+ // *LAPRAS
+
+ //LLWLParamManager::getInstance()->mAnimator.startInterpolation(params);
}
else
{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c38dafee53..fb2e27d492 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -100,7 +100,6 @@
#include "llviewerstats.h"
#include "llviewerjoystick.h"
#include "llviewerdisplay.h"
-#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llspatialpartition.h"
#include "llmutelist.h"