Skip to content
Snippets Groups Projects
Commit b98a17c8 authored by David Parks's avatar David Parks
Browse files

SH-1443 Fix for fullbright alpha objects not appearing for some combinations...

SH-1443 Fix for fullbright alpha objects not appearing for some combinations of deferred rendering and non deferred automatic alpha mask toggling.
parent deba003d
No related branches found
No related tags found
No related merge requests found
...@@ -210,7 +210,7 @@ void LLDrawPoolAlpha::render(S32 pass) ...@@ -210,7 +210,7 @@ void LLDrawPoolAlpha::render(S32 pass)
gGL.setColorMask(true, true); gGL.setColorMask(true, true);
} }
if (LLPipeline::sAutoMaskAlphaNonDeferred && !deferred_render) if (LLPipeline::sAutoMaskAlphaNonDeferred)
{ {
mColorSFactor = LLRender::BF_ONE; // } mColorSFactor = LLRender::BF_ONE; // }
mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow
...@@ -226,7 +226,10 @@ void LLDrawPoolAlpha::render(S32 pass) ...@@ -226,7 +226,10 @@ void LLDrawPoolAlpha::render(S32 pass)
simple_shader->bind(); simple_shader->bind();
pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask()); pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask());
} }
fullbright_shader->bind(); if (fullbright_shader)
{
fullbright_shader->bind();
}
pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask()); pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask());
LLGLSLShader::bindNoShader(); LLGLSLShader::bindNoShader();
} }
...@@ -273,6 +276,7 @@ void LLDrawPoolAlpha::render(S32 pass) ...@@ -273,6 +276,7 @@ void LLDrawPoolAlpha::render(S32 pass)
if (deferred_render && pass == 1) if (deferred_render && pass == 1)
{ {
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
} }
if (deferred_render && current_shader != NULL) if (deferred_render && current_shader != NULL)
......
...@@ -979,19 +979,29 @@ bool LLFace::canRenderAsMask() ...@@ -979,19 +979,29 @@ bool LLFace::canRenderAsMask()
} }
const LLTextureEntry* te = getTextureEntry(); const LLTextureEntry* te = getTextureEntry();
return (
( if ((te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha
(LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaDeferred) ||
(!LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaNonDeferred)
) // do we want masks at all?
&&
(te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha
!(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid
(te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask
getTexture()->getIsAlphaMask()) // texture actually qualifies for masking (lazily recalculated but expensive)
{
if (LLPipeline::sRenderDeferred)
{
if (getViewerObject()->isHUDAttachment() || te->getFullbright())
{ //hud attachments and fullbright objects are NOT subject to the deferred rendering pipe
return LLPipeline::sAutoMaskAlphaNonDeferred;
}
else
{
return LLPipeline::sAutoMaskAlphaDeferred;
}
}
else
{
return LLPipeline::sAutoMaskAlphaNonDeferred;
}
}
getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily recalculated but expensive) return false;
);
} }
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment