summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-05-22 11:43:32 -0400
committerOz Linden <oz@lindenlab.com>2013-05-22 11:43:32 -0400
commit2b517892ad571d935645f46eee5b0c1182d9c5c9 (patch)
treeedbf93d7c3105927ece4ac9f179a71e8e307aff3 /indra/newview/llvovolume.cpp
parent5758b9e304c182db93aa642358140d9464331208 (diff)
parentd4f2a2df5308ba1527e6f000582f75b73e5ea597 (diff)
merge latest project repo
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-xindra/newview/llvovolume.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index d8f1896654..ca7849fdad 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1980,7 +1980,7 @@ void LLVOVolume::setTEMaterialParamsCallbackTE(const LLMaterialID &pMaterialID,
return;
LLTextureEntry* texture_entry = getTE(te);
- if (texture_entry)
+ if (texture_entry && (texture_entry->getMaterialID() == pMaterialID))
{
setTEMaterialParams(te, pMaterialParams);
}
@@ -2009,7 +2009,7 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
if (res)
{
#if USE_TE_SPECIFIC_REGISTRATION
- LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3));
+ LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallbackTE, this, _1, _2, _3));
#else
LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2));
#endif
@@ -4531,7 +4531,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_GLOW);
}
- LLMaterial* mat = LLPipeline::sRenderDeferred ? te->getMaterialParams().get() : NULL;
+ LLMaterial* mat = te->getMaterialParams().get();
if (mat)
{
@@ -4550,6 +4550,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT);
}
}
+ else if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
+ {
+ // This feels unclean, but is the only way to get alpha masked rigged stuff to show up
+ // with masking correctly in both deferred and non-deferred paths. NORSPEC-191
+ //
+ pool->addRiggedFace(facep, LLPipeline::sRenderDeferred ? LLDrawPoolAvatar::RIGGED_MATERIAL_ALPHA_MASK : LLDrawPoolAvatar::RIGGED_ALPHA);
+ }
else
{
U32 mask = mat->getShaderMask();
@@ -5361,6 +5368,28 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
registerFace(group, facep, pass[mask]);
}
}
+ else if (mat)
+ {
+ if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
+ {
+ registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK : LLRenderPass::PASS_ALPHA_MASK);
+ }
+ else if (is_alpha || (te->getColor().mV[3] < 0.999f))
+ {
+ registerFace(group, facep, LLRenderPass::PASS_ALPHA);
+ }
+ else if (gPipeline.canUseVertexShaders()
+ && LLPipeline::sRenderBump
+ && te->getShiny()
+ && can_be_shiny)
+ {
+ registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT_SHINY : LLRenderPass::PASS_SHINY);
+ }
+ else
+ {
+ registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT : LLRenderPass::PASS_SIMPLE);
+ }
+ }
else if (is_alpha)
{
// can we safely treat this as an alpha mask?