summaryrefslogtreecommitdiff
path: root/indra/newview/llenvironment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r--indra/newview/llenvironment.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 4ef14c20f7..efe4ad2af2 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -1728,8 +1728,19 @@ void LLEnvironment::updateGLVariablesForSettings(LLShaderUniforms* uniforms, con
//_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << value << LL_ENDL;
break;
case LLSD::TypeReal:
- shader->uniform1f(it.second.getShaderKey(), value.asReal());
+ {
+ F32 v = value.asReal();
+ switch (it.second.getShaderKey())
+ { // convert to linear color space if this is a color parameter
+ case LLShaderMgr::HAZE_HORIZON:
+ case LLShaderMgr::HAZE_DENSITY:
+ case LLShaderMgr::CLOUD_SHADOW:
+ //v = sRGBtoLinear(v);
+ break;
+ }
+ shader->uniform1f(it.second.getShaderKey(), v);
//_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << value << LL_ENDL;
+ }
break;
case LLSD::TypeBoolean:
@@ -1740,8 +1751,16 @@ void LLEnvironment::updateGLVariablesForSettings(LLShaderUniforms* uniforms, con
case LLSD::TypeArray:
{
LLVector4 vect4(value);
+
+ switch (it.second.getShaderKey())
+ { // convert to linear color space if this is a color parameter
+ case LLShaderMgr::BLUE_HORIZON:
+ case LLShaderMgr::BLUE_DENSITY:
+ //vect4 = LLVector4(linearColor4(LLColor4(vect4.mV)).mV);
+ break;
+ }
//_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << vect4 << LL_ENDL;
- shader->uniform4fv(it.second.getShaderKey(), vect4 );
+ shader->uniform3fv(it.second.getShaderKey(), LLVector3(vect4.mV) );
break;
}