Added some missing drawpool determination logic pertaining to face materials.

This commit is contained in:
Shyotl
2013-07-29 19:39:59 -05:00
parent 44909af372
commit 8e40d6b52c
2 changed files with 46 additions and 8 deletions

View File

@@ -1415,12 +1415,32 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
return 0;
}
bool alpha = te->getColor().mV[3] < 0.999f;
LLMaterial* mat = te->getMaterialParams().get();
bool color_alpha = te->getColor().mV[3] < 0.999f;
bool alpha = color_alpha;
if (imagep)
{
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
}
if (alpha && mat)
{
switch (mat->getDiffuseAlphaMode())
{
case 1:
alpha = true; // Material's alpha mode is set to blend. Toss it into the alpha draw pool.
break;
case 0: //alpha mode set to none, never go to alpha pool
case 3: //alpha mode set to emissive, never go to alpha pool
alpha = color_alpha;
break;
default: //alpha mode set to "mask", go to alpha pool if fullbright
alpha = color_alpha; // Material's alpha mode is set to none, mask, or emissive. Toss it into the opaque material draw pool.
break;
}
}
if (alpha)
{
return LLDrawPool::POOL_ALPHA;