diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 2b32f26c2e..148aa99095 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -136,7 +136,7 @@ const std::string LLSettingsSky::SETTING_SKY_MOISTURE_LEVEL("moisture_level");
const std::string LLSettingsSky::SETTING_SKY_DROPLET_RADIUS("droplet_radius");
const std::string LLSettingsSky::SETTING_SKY_ICE_LEVEL("ice_level");
-const LLUUID LLSettingsSky::DEFAULT_ASSET_ID("eb3a7080-831f-9f37-10f0-7b1f9ea4043c");
+const LLUUID LLSettingsSky::DEFAULT_ASSET_ID("3ae23978-ac82-bcf3-a9cb-ba6e52dcb9ad");
static const LLUUID DEFAULT_SUN_ID("32bfbcea-24b1-fb9d-1ef9-48a28a63730f"); // dataserver
static const LLUUID DEFAULT_MOON_ID("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
@@ -1176,7 +1176,7 @@ LLColor3 LLSettingsSky::getTotalDensity() const
// this is used later for sunlight modulation at various altitudes
LLColor3 LLSettingsSky::getLightAttenuation(F32 distance) const
{
- F32 density_multiplier = getDensityMultiplier() * 0.45f;
+ F32 density_multiplier = getDensityMultiplier();
LLColor3 blue_density = getBlueDensity();
F32 haze_density = getHazeDensity();
// Approximate line integral over requested distance
@@ -1187,7 +1187,7 @@ LLColor3 LLSettingsSky::getLightAttenuation(F32 distance) const
LLColor3 LLSettingsSky::getLightTransmittance() const
{
LLColor3 total_density = getTotalDensity();
- F32 density_multiplier = getDensityMultiplier() * 0.45f;
+ F32 density_multiplier = getDensityMultiplier();
// Transparency (-> density) from Beer's law
LLColor3 transmittance = componentExp(total_density * -density_multiplier);
return transmittance;
@@ -1246,6 +1246,25 @@ LLColor4 LLSettingsSky::getTotalAmbient() const
return mTotalAmbient;
}
+LLColor3 LLSettingsSky::getMoonlightColor() const
+{
+ F32 moon_brightness = getIsMoonUp() ? getMoonBrightness() : 0.001f;
+ LLColor3 moonlight_a(0.9, 0.9, 1.32);
+ LLColor3 moonlight_b(0.66, 0.66, 2.0);
+ LLColor3 moonlight = lerp(moonlight_b, moonlight_a, moon_brightness);
+ return moonlight;
+}
+
+void LLSettingsSky::clampColor(LLColor3& color) const
+{
+ F32 max_color = llmax(color.mV[0], color.mV[1], color.mV[2]);
+ if (max_color > 1.f)
+ {
+ color *= 1.f/max_color;
+ }
+ color.clamp();
+}
+
void LLSettingsSky::calculateLightSettings() const
{
// Initialize temp variables
@@ -1271,26 +1290,29 @@ void LLSettingsSky::calculateLightSettings() const
}
lighty = llmax(LIMIT, lighty);
componentMultBy(sunlight, componentExp((light_atten * -1.f) * lighty));
+ componentMultBy(sunlight, light_transmittance);
+ clampColor(sunlight);
//increase ambient when there are more clouds
- LLColor3 tmpAmbient = ambient + (smear(1.f) - ambient) * cloud_shadow;
+ LLColor3 tmpAmbient = ambient + (smear(1.f) - ambient) * cloud_shadow * 0.5;
+ componentMultBy(tmpAmbient, light_transmittance);
+ clampColor(tmpAmbient);
//brightness of surface both sunlight and ambient
- // reduce range to 0 - 1 before gamma correct to prevent clipping
- // then restore to full 0 - 3 range before storage
- mSunDiffuse = gammaCorrect(componentMult(sunlight * 0.33333f, light_transmittance)) * 3.0f;
- mSunAmbient = gammaCorrect(componentMult(tmpAmbient * 0.33333f, light_transmittance)) * 3.0f;
+ mSunDiffuse = gammaCorrect(sunlight);
+ mSunAmbient = gammaCorrect(tmpAmbient);
F32 moon_brightness = getIsMoonUp() ? getMoonBrightness() : 0.001f;
- LLColor3 moonlight_a(0.45f, 0.45f, 0.66f);
- LLColor3 moonlight_b(0.33f, 0.33f, 1.0f);
+ LLColor3 moonlight = getMoonlightColor();
+ LLColor3 moonlight_b(0.66f, 0.66f, 1.2f); // scotopic ambient value
- LLColor3 moonlight = lerp(moonlight_b, moonlight_a, moon_brightness);
componentMultBy(moonlight, componentExp((light_atten * -1.f) * lighty));
+ clampColor(moonlight);
mMoonDiffuse = gammaCorrect(componentMult(moonlight, light_transmittance) * moon_brightness);
mMoonAmbient = gammaCorrect(componentMult(moonlight_b, light_transmittance) * 0.0125f);
+
mTotalAmbient = mSunAmbient;
}
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index ef2a6740f0..d04209a1a1 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -282,6 +282,9 @@ public:
LLVector3 getSunDirection() const;
LLVector3 getMoonDirection() const;
+ // color based on brightness
+ LLColor3 getMoonlightColor() const;
+
LLColor4 getMoonAmbient() const;
LLColor3 getMoonDiffuse() const;
LLColor4 getSunAmbient() const;
@@ -343,6 +346,7 @@ private:
void calculateHeavenlyBodyPositions() const;
void calculateLightSettings() const;
+ void clampColor(LLColor3& color) const;
mutable LLVector3 mSunDirection;
mutable LLVector3 mMoonDirection;
diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp
index 1bf51ca0eb..b25fd948f5 100644
--- a/indra/llmath/llcoordframe.cpp
+++ b/indra/llmath/llcoordframe.cpp
@@ -34,6 +34,20 @@
#include "llquaternion.h"
#include "llcoordframe.h"
+#define CHECK_FINITE(var) \
+ if (!var.isFinite()) \
+ { \
+ LL_WARNS() << "Non Finite " << std::string(#var) << LL_ENDL; \
+ reset(); \
+ }
+
+#define CHECK_FINITE_OBJ() \
+ if (!isFinite()) \
+ { \
+ LL_WARNS() << "Non Finite in LLCoordFrame " << LL_ENDL; \
+ reset(); \
+ }
+
#ifndef X_AXIS
#define X_AXIS 1.0f,0.0f,0.0f
#define Y_AXIS 0.0f,1.0f,0.0f
@@ -56,11 +70,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin) :
mYAxis(Y_AXIS),
mZAxis(Z_AXIS)
{
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLVector3 &direction) :
@@ -68,11 +78,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLVector3 &direction)
{
lookDir(direction);
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
LLCoordFrame::LLCoordFrame(const LLVector3 &x_axis,
@@ -83,11 +89,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &x_axis,
mYAxis(y_axis),
mZAxis(z_axis)
{
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
LLCoordFrame::LLCoordFrame(const LLVector3 &origin,
@@ -99,11 +101,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin,
mYAxis(y_axis),
mZAxis(z_axis)
{
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -114,11 +112,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin,
mYAxis(rotation.mMatrix[VY]),
mZAxis(rotation.mMatrix[VZ])
{
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
LLCoordFrame::LLCoordFrame(const LLQuaternion &q) :
@@ -129,11 +123,7 @@ LLCoordFrame::LLCoordFrame(const LLQuaternion &q) :
mYAxis.setVec(rotation_matrix.mMatrix[VY]);
mZAxis.setVec(rotation_matrix.mMatrix[VZ]);
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLQuaternion &q) :
@@ -144,11 +134,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLQuaternion &q) :
mYAxis.setVec(rotation_matrix.mMatrix[VY]);
mZAxis.setVec(rotation_matrix.mMatrix[VZ]);
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
LLCoordFrame::LLCoordFrame(const LLMatrix4 &mat) :
@@ -157,11 +143,7 @@ LLCoordFrame::LLCoordFrame(const LLMatrix4 &mat) :
mYAxis(mat.mMatrix[VY]),
mZAxis(mat.mMatrix[VZ])
{
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -173,11 +155,7 @@ LLCoordFrame::LLCoordFrame(const F32 *origin, const F32 *rotation) :
mYAxis(rotation+3*VY),
mZAxis(rotation+3*VZ)
{
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
*/
@@ -188,11 +166,7 @@ LLCoordFrame::LLCoordFrame(const F32 *origin_and_rotation) :
mYAxis(origin_and_rotation + 3*(VY+1)),
mZAxis(origin_and_rotation + 3*(VZ+1))
{
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
*/
@@ -217,21 +191,13 @@ void LLCoordFrame::setOrigin(F32 x, F32 y, F32 z)
{
mOrigin.setVec(x, y, z);
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
void LLCoordFrame::setOrigin(const LLVector3 &new_origin)
{
mOrigin = new_origin;
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
void LLCoordFrame::setOrigin(const F32 *origin)
@@ -239,23 +205,13 @@ void LLCoordFrame::setOrigin(const F32 *origin)
mOrigin.mV[VX] = *(origin + VX);
mOrigin.mV[VY] = *(origin + VY);
mOrigin.mV[VZ] = *(origin + VZ);
-
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
void LLCoordFrame::setOrigin(const LLCoordFrame &frame)
{
mOrigin = frame.getOrigin();
-
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
// setAxes() member functions set the axes, and assume that
@@ -268,11 +224,7 @@ void LLCoordFrame::setAxes(const LLVector3 &x_axis,
mXAxis = x_axis;
mYAxis = y_axis;
mZAxis = z_axis;
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -281,11 +233,7 @@ void LLCoordFrame::setAxes(const LLMatrix3 &rotation_matrix)
mXAxis.setVec(rotation_matrix.mMatrix[VX]);
mYAxis.setVec(rotation_matrix.mMatrix[VY]);
mZAxis.setVec(rotation_matrix.mMatrix[VZ]);
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -293,11 +241,7 @@ void LLCoordFrame::setAxes(const LLQuaternion &q )
{
LLMatrix3 rotation_matrix(q);
setAxes(rotation_matrix);
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -313,11 +257,7 @@ void LLCoordFrame::setAxes( const F32 *rotation_matrix )
mZAxis.mV[VY] = *(rotation_matrix + 3*VZ + VY);
mZAxis.mV[VZ] = *(rotation_matrix + 3*VZ + VZ);
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -326,40 +266,22 @@ void LLCoordFrame::setAxes(const LLCoordFrame &frame)
mXAxis = frame.getXAxis();
mYAxis = frame.getYAxis();
mZAxis = frame.getZAxis();
-
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
-
// translate() member functions move mOrigin to a relative position
-
void LLCoordFrame::translate(F32 x, F32 y, F32 z)
{
mOrigin.mV[VX] += x;
mOrigin.mV[VY] += y;
mOrigin.mV[VZ] += z;
-
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
-
void LLCoordFrame::translate(const LLVector3 &v)
{
mOrigin += v;
-
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
@@ -368,12 +290,7 @@ void LLCoordFrame::translate(const F32 *origin)
mOrigin.mV[VX] += *(origin + VX);
mOrigin.mV[VY] += *(origin + VY);
mOrigin.mV[VZ] += *(origin + VZ);
-
- if( !mOrigin.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL;
- }
+ CHECK_FINITE(mOrigin);
}
@@ -383,6 +300,7 @@ void LLCoordFrame::rotate(F32 angle, F32 x, F32 y, F32 z)
{
LLQuaternion q(angle, LLVector3(x,y,z));
rotate(q);
+ CHECK_FINITE_OBJ();
}
@@ -390,6 +308,7 @@ void LLCoordFrame::rotate(F32 angle, const LLVector3 &rotation_axis)
{
LLQuaternion q(angle, rotation_axis);
rotate(q);
+ CHECK_FINITE_OBJ();
}
@@ -397,6 +316,7 @@ void LLCoordFrame::rotate(const LLQuaternion &q)
{
LLMatrix3 rotation_matrix(q);
rotate(rotation_matrix);
+ CHECK_FINITE_OBJ();
}
@@ -405,12 +325,7 @@ void LLCoordFrame::rotate(const LLMatrix3 &rotation_matrix)
mXAxis.rotVec(rotation_matrix);
mYAxis.rotVec(rotation_matrix);
orthonormalize();
-
- if( !isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::rotate()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
@@ -419,12 +334,7 @@ void LLCoordFrame::roll(F32 angle)
LLQuaternion q(angle, mXAxis);
LLMatrix3 rotation_matrix(q);
rotate(rotation_matrix);
-
- if( !mYAxis.isFinite() || !mZAxis.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::roll()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
void LLCoordFrame::pitch(F32 angle)
@@ -432,12 +342,7 @@ void LLCoordFrame::pitch(F32 angle)
LLQuaternion q(angle, mYAxis);
LLMatrix3 rotation_matrix(q);
rotate(rotation_matrix);
-
- if( !mXAxis.isFinite() || !mZAxis.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::pitch()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
void LLCoordFrame::yaw(F32 angle)
@@ -445,12 +350,7 @@ void LLCoordFrame::yaw(F32 angle)
LLQuaternion q(angle, mZAxis);
LLMatrix3 rotation_matrix(q);
rotate(rotation_matrix);
-
- if( !mXAxis.isFinite() || !mYAxis.isFinite() )
- {
- reset();
- LL_WARNS() << "Non Finite in LLCoordFrame::yaw()" << LL_ENDL;
- }
+ CHECK_FINITE_OBJ();
}
// get*() routines
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index adb43317ae..1cc86a1543 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1258,6 +1258,7 @@ void LLRender::syncLightState()
shader->uniform3fv(LLShaderMgr::LIGHT_DIFFUSE, 8, diffuse[0].mV);
shader->uniform4fv(LLShaderMgr::LIGHT_AMBIENT, 1, mAmbientLightColor.mV);
shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, sun_primary[0] ? 1 : 0);
+ shader->uniform4fv(LLShaderMgr::AMBIENT, 1, mAmbientLightColor.mV);
shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, diffuse[0].mV);
shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, diffuse_b[0].mV);
}
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 20d2ed3c73..49de31f0b7 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1209,7 +1209,7 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("fullbright");
mReservedUniforms.push_back("lightnorm");
mReservedUniforms.push_back("sunlight_color");
- mReservedUniforms.push_back("ambient");
+ mReservedUniforms.push_back("ambient_color");
mReservedUniforms.push_back("blue_horizon");
mReservedUniforms.push_back("blue_density");
mReservedUniforms.push_back("haze_horizon");
diff --git a/indra/llui/llxyvector.cpp b/indra/llui/llxyvector.cpp
index 0012462aa2..3d50992dbe 100644
--- a/indra/llui/llxyvector.cpp
+++ b/indra/llui/llxyvector.cpp
@@ -81,7 +81,9 @@ LLXYVector::LLXYVector(const LLXYVector::Params& p)
mMinValueY(p.min_val_y),
mMaxValueY(p.max_val_y),
mIncrementY(p.increment_y),
- mLogarithmic(p.logarithmic)
+ mLogarithmic(p.logarithmic),
+ mValueX(0),
+ mValueY(0)
{
mGhostColor = p.ghost_color.isProvided() ? p.ghost_color() % 0.3f : p.arrow_color() % 0.3f;
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index bee9433817..19b860c187 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-6.2.3
+6.4.0
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 4bbb424776..28a6480d54 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -625,4 +625,15 @@
is_running_function="Floater.IsOpen"
is_running_parameters="beacons"
/>
+
diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml
index a10c02b79f..f989fe7381 100644
--- a/indra/newview/app_settings/mid_graphics.xml
+++ b/indra/newview/app_settings/mid_graphics.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a43b7feb00..a0cdec4878 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -15350,6 +15350,39 @@ Change of this parameter will affect the layout of buttons in notification toast
Backup
0
+ AmbientDisable
+
+ SunlightDisable
+
+ LocalLightDisable
+
TextureDiscardLevel