summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-05-06 15:44:44 -0500
committerDave Parks <davep@lindenlab.com>2013-05-06 15:44:44 -0500
commit18e3985120d53acdf07d43dce79312b78629e57a (patch)
treec4cf4cc69decbb3beeb910f8038d2d321e7f2d18 /indra/newview/llvovolume.cpp
parentdf6bb7ace2f2ca26f5fabf8305e190e7d0066cf1 (diff)
NORSPEC-162 Fix for objects with materials set ignoring "tranparency %" value.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 9b940300f5..637d40c5b5 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4088,6 +4088,21 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
bool batchable = false;
+ U32 shader_mask = 0xFFFFFFFF; //no shader
+
+ if (mat)
+ {
+ if (type == LLRenderPass::PASS_ALPHA)
+ {
+ shader_mask = mat->getShaderMask(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND);
+ }
+ else
+ {
+ shader_mask = mat->getShaderMask();
+ }
+ }
+
+
if (index < 255 && idx >= 0)
{
if (mat || draw_vec[idx]->mMaterial)
@@ -4124,7 +4139,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
draw_vec[idx]->mBump == bump &&
draw_vec[idx]->mTextureMatrix == tex_mat &&
draw_vec[idx]->mModelMatrix == model_mat &&
- draw_vec[idx]->mMaterial == mat)
+ draw_vec[idx]->mMaterial == mat &&
+ draw_vec[idx]->mShaderMask == shader_mask)
{
draw_vec[idx]->mCount += facep->getIndicesCount();
draw_vec[idx]->mEnd += facep->getGeomCount();
@@ -4152,10 +4168,11 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
draw_vec.push_back(draw_info);
draw_info->mTextureMatrix = tex_mat;
draw_info->mModelMatrix = model_mat;
- if (mat && LLPipeline::sRenderBump && LLPipeline::sRenderDeferred)
+ if (mat)
{
// We have a material. Update our draw info accordingly.
draw_info->mMaterial = mat;
+ draw_info->mShaderMask = shader_mask;
LLVector4 specColor;
specColor.mV[0] = mat->getSpecularLightColor().mV[0] * (1.f / 255.f);
specColor.mV[1] = mat->getSpecularLightColor().mV[1] * (1.f / 255.f);
@@ -5280,6 +5297,10 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
{
registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
}
+ else if (te->getColor().mV[3] < 0.999f)
+ {
+ registerFace(group, facep, LLRenderPass::PASS_ALPHA);
+ }
else
{
U32 pass[] =