summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolavatar.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-06-03 18:06:45 -0400
committerOz Linden <oz@lindenlab.com>2013-06-03 18:06:45 -0400
commit9acabccdde5cff91cac3bae0502c8ff5b26cada6 (patch)
treeb6fc95044fc41cdc43969195f9c1939e8ecb0158 /indra/newview/lldrawpoolavatar.cpp
parentdd2ede9991a9a31821fbe43a7fa17a5aafa19542 (diff)
parent7fa8c2313b47959ba8c0a40d92461f6892e0d0d3 (diff)
merge changes for 3.6.0-materials-beta1
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp71
1 files changed, 60 insertions, 11 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index b4ebee064e..7e8bdfba2c 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -894,7 +894,14 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
}
else
{
- sVertexProgram = &gSkinnedObjectFullbrightProgram;
+ if (LLPipeline::sRenderDeferred)
+ {
+ sVertexProgram = &gDeferredSkinnedFullbrightProgram;
+ }
+ else
+ {
+ sVertexProgram = &gSkinnedObjectFullbrightProgram;
+ }
}
}
else
@@ -913,6 +920,15 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
{
sDiffuseChannel = 0;
sVertexProgram->bind();
+
+ if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred)
+ {
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ }
+ else
+ {
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ }
}
}
@@ -979,7 +995,14 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
}
else
{
- sVertexProgram = &gSkinnedObjectFullbrightShinyProgram;
+ if (LLPipeline::sRenderDeferred)
+ {
+ sVertexProgram = &gDeferredSkinnedFullbrightShinyProgram;
+ }
+ else
+ {
+ sVertexProgram = &gSkinnedObjectFullbrightShinyProgram;
+ }
}
}
else
@@ -994,11 +1017,19 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
}
}
-
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
sVertexProgram->bind();
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
+
+ if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred)
+ {
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
+ }
+ else
+ {
+ sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
+ }
}
}
@@ -1625,7 +1656,8 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow());
}*/
- LLMaterial* mat = face->getTextureEntry()->getMaterialParams().get();
+ const LLTextureEntry* te = face->getTextureEntry();
+ LLMaterial* mat = te->getMaterialParams().get();
if (mat)
{
@@ -1633,16 +1665,32 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
gGL.getTexUnit(normal_channel)->bind(face->getTexture(LLRender::NORMAL_MAP));
gGL.getTexUnit(specular_channel)->bind(face->getTexture(LLRender::SPECULAR_MAP));
- LLColor4U col = mat->getSpecularLightColor();
- U8 spec = mat->getSpecularLightExponent();
-
- U8 env = mat->getEnvironmentIntensity();
+ LLColor4 col = mat->getSpecularLightColor();
+ F32 spec = mat->getSpecularLightExponent()/255.f;
- sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0]/255.f, col.mV[1]/255.f, col.mV[2]/255.f, spec/255.f);
+ F32 env = mat->getEnvironmentIntensity()/255.f;
- sVertexProgram->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env/255.f);
+ if (mat->getSpecularID().isNull())
+ {
+ env = te->getShiny()*0.25f;
+ col.set(env,env,env,0);
+ spec = env;
+ }
- sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f);
+ BOOL fullbright = te->getFullbright();
+
+ sVertexProgram->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, fullbright ? 1.f : 0.f);
+ sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec);
+ sVertexProgram->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env);
+
+ if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
+ {
+ sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f);
+ }
+ else
+ {
+ sVertexProgram->setMinimumAlpha(0.f);
+ }
for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
{
@@ -1656,6 +1704,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
else
{
gGL.getTexUnit(sDiffuseChannel)->bind(face->getTexture());
+ sVertexProgram->setMinimumAlpha(0.f);
if (normal_channel > -1)
{
LLDrawPoolBump::bindBumpMap(face, normal_channel);