summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index f299518474..cfe8b4c9a4 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -862,6 +862,26 @@ void LLFace::updateRebuildFlags()
}
}
+
+bool LLFace::canRenderAsMask()
+{
+ const LLTextureEntry* te = getTextureEntry();
+ return (
+ (
+ (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
+
+ getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily recalculated but expensive)
+ );
+}
+
+
static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom");
BOOL LLFace::getGeometryVolume(const LLVolume& volume,