summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-07-24 15:43:38 -0700
committerGraham Linden <graham@lindenlab.com>2013-07-24 15:43:38 -0700
commite21ab706b93229964e59fa1d4c221ead30983486 (patch)
treec154028f40baef78e3a6d08652b21fba644b3250
parente681d19ea678ae378807b2054d33b6b1abcb8b6b (diff)
NORSPEC-324 when using display_gamma, actually set display_gamma
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 87e9071c4d..b6eee124e1 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -49,6 +49,7 @@
#include "llappviewer.h"
#include "llrendersphere.h"
#include "llviewerpartsim.h"
+#include "llviewercontrol.h" // for gSavedSettings
static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK;
static U32 sBufferUsage = GL_STREAM_DRAW_ARB;
@@ -281,6 +282,11 @@ void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
{
sVertexProgram = &gDeferredSkinnedAlphaProgram;
gPipeline.bindDeferredShader(*sVertexProgram);
+
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
+ sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f));
+
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
gPipeline.enableLightsDynamic();
}
@@ -890,6 +896,8 @@ void LLDrawPoolAvatar::beginRiggedGlow()
sVertexProgram->bind();
sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, LLPipeline::sRenderDeferred ? 2.2f : 1.1f);
+ F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
+ sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f));
}
}
@@ -942,6 +950,9 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
else
{
sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+
+ F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
+ sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f));
}
}
}
@@ -1043,6 +1054,8 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
else
{
sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
+ sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f));
}
}
}