summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp133
1 files changed, 122 insertions, 11 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index ef69990170..2651e3531b 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -670,6 +670,14 @@ void LLDrawPoolAvatar::beginRigid()
{ //eyeballs render with the specular shader
sVertexProgram->bind();
sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
}
else
@@ -720,6 +728,14 @@ void LLDrawPoolAvatar::beginDeferredRigid()
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
sVertexProgram->bind();
sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
void LLDrawPoolAvatar::endDeferredRigid()
@@ -763,6 +779,14 @@ void LLDrawPoolAvatar::beginSkinned()
sVertexProgram->bind();
sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP);
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
gGL.getTexUnit(0)->activate();
}
else
@@ -772,6 +796,14 @@ void LLDrawPoolAvatar::beginSkinned()
// software skinning, use a basic shader for windlight.
// TODO: find a better fallback method for software skinning.
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
}
@@ -834,6 +866,14 @@ void LLDrawPoolAvatar::beginRiggedSimple()
{
sDiffuseChannel = 0;
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
}
@@ -899,6 +939,16 @@ void LLDrawPoolAvatar::beginRiggedGlow()
sVertexProgram->bind();
sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, LLPipeline::sRenderDeferred ? 2.2f : 1.1f);
+
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f));
}
@@ -946,16 +996,22 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
sDiffuseChannel = 0;
sVertexProgram->bind();
- if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred)
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else if (LLPipeline::sRenderDeferred)
{
- sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma");
+ sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f));
}
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));
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
}
}
}
@@ -998,6 +1054,14 @@ void LLDrawPoolAvatar::beginRiggedShinySimple()
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
}
}
@@ -1048,17 +1112,32 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
- if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred)
+ if (LLPipeline::sRenderingHUDs)
{
sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
- }
- else
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else if (LLPipeline::sRenderDeferred)
{
- sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ 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));
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+ else
+ {
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
}
}
}
@@ -1080,6 +1159,14 @@ void LLDrawPoolAvatar::beginDeferredRiggedSimple()
sVertexProgram = &gDeferredSkinnedDiffuseProgram;
sDiffuseChannel = 0;
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
}
void LLDrawPoolAvatar::endDeferredRiggedSimple()
@@ -1093,6 +1180,14 @@ void LLDrawPoolAvatar::beginDeferredRiggedBump()
{
sVertexProgram = &gDeferredSkinnedBumpProgram;
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
}
@@ -1125,6 +1220,14 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass)
}
sVertexProgram->bind();
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP);
specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -1158,7 +1261,15 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
sVertexProgram->bind();
sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha);
-
+ if (LLPipeline::sRenderingHUDs)
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1);
+ }
+ else
+ {
+ sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0);
+ }
+
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
gGL.getTexUnit(0)->activate();
}