Added some missing drawpool determination logic pertaining to face materials.
This commit is contained in:
@@ -1252,8 +1252,27 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
LLColor4U color = (tep ? LLColor4U(tep->getColor()) : LLColor4U::white);
|
LLColor4U color = (tep ? LLColor4U(tep->getColor()) : LLColor4U::white);
|
||||||
|
|
||||||
if (rebuild_color) // FALSE if tep == NULL
|
if (rebuild_color) // FALSE if tep == NULL
|
||||||
|
{ //decide if shiny goes in alpha channel of color
|
||||||
|
if (tep &&
|
||||||
|
getPoolType() != LLDrawPool::POOL_ALPHA) // <--- alpha channel MUST contain transparency, not shiny
|
||||||
{
|
{
|
||||||
if (tep)
|
bool shiny_in_alpha = false;
|
||||||
|
|
||||||
|
if (LLPipeline::sRenderDeferred)
|
||||||
|
{ //store shiny in alpha if we don't have a specular map
|
||||||
|
//if (!mat || mat->getSpecularID().isNull())
|
||||||
|
{
|
||||||
|
shiny_in_alpha = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(LLPipeline::sRenderBump && tep->getShiny())
|
||||||
|
{
|
||||||
|
shiny_in_alpha = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(shiny_in_alpha)
|
||||||
{
|
{
|
||||||
GLfloat alpha[4] =
|
GLfloat alpha[4] =
|
||||||
{
|
{
|
||||||
@@ -1263,8 +1282,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
0.75f
|
0.75f
|
||||||
};
|
};
|
||||||
|
|
||||||
if (getPoolType() != LLDrawPool::POOL_ALPHA && (LLPipeline::sRenderDeferred || (LLPipeline::sRenderBump && tep->getShiny())))
|
llassert(tep->getShiny() <= 3);
|
||||||
{
|
|
||||||
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
|
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1415,12 +1415,32 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
|
|||||||
return 0;
|
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)
|
if (imagep)
|
||||||
{
|
{
|
||||||
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
|
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)
|
if (alpha)
|
||||||
{
|
{
|
||||||
return LLDrawPool::POOL_ALPHA;
|
return LLDrawPool::POOL_ALPHA;
|
||||||
|
|||||||
Reference in New Issue
Block a user