diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-09 13:28:23 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-09 13:28:23 +0000 |
commit | 4c022455685598bfd3ab90c4611e053fad72345d (patch) | |
tree | 24cbdc7ba94e134bf5de87754096fa1f0bc7ef1b /indra | |
parent | 68991a2cce21932137a2d678f4258dad83ee27d6 (diff) |
Disable alpha-masking for glowing surfaces. It seems beyond my ability to get right.
Refactor some replicated and/or strangely-expressed logic.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llspatialpartition.h | 5 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 24 |
2 files changed, 17 insertions, 12 deletions
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 88fab01ea4..d74216de2d 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -614,14 +614,15 @@ public: //class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp) class LLVolumeGeometryManager: public LLGeometryManager { -public: + public: virtual ~LLVolumeGeometryManager() { } virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); - + private: + bool canRenderAsMask(LLFace* facep); // logic helper }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 91aa994eab..90a06a966d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3319,7 +3319,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { @@ -3414,6 +3414,16 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) +{ + const LLTextureEntry* te = facep->getTextureEntry(); + return (LLPipeline::sFastAlpha && + (te->getColor().mV[3] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + facep->getTexture()->getIsAlphaMask()); +} + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3539,10 +3549,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3891,15 +3898,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; + BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { if (te->getFullbright()) { |