summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2017-11-13 14:26:15 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2017-11-13 14:26:15 +0200
commit9de2af8b2dde7dc326f970d61950bebc565883f6 (patch)
tree87d799179a0fdb1ad6279f62a4f41747dedfce19 /indra/llprimitive
parent8da9e0ffd73e30a55734864e49a6ec917e3bee00 (diff)
MAINT-7847 Remake of 'white alpfa' fix
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmaterial.cpp14
-rw-r--r--indra/llprimitive/llmaterial.h11
2 files changed, 23 insertions, 2 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index 57ceb3e11b..e6d2790a5f 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -106,10 +106,16 @@ LLMaterial::LLMaterial()
, mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY)
, mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
, mAlphaMaskCutoff(0)
+ , mIsDiffuseAlphaInvalid(false)
+ , mIsNormalInvalid(false)
+ , mIsSpecularInvalid(false)
{
}
LLMaterial::LLMaterial(const LLSD& material_data)
+ : mIsDiffuseAlphaInvalid(false)
+ , mIsNormalInvalid(false)
+ , mIsSpecularInvalid(false)
{
fromLLSD(material_data);
}
@@ -199,13 +205,17 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
{
ret = getDiffuseAlphaMode();
}
+ if (mIsDiffuseAlphaInvalid && ret != DIFFUSE_ALPHA_MODE_DEFAULT)
+ {
+ ret = alpha_mode != DIFFUSE_ALPHA_MODE_NONE;
+ }
llassert(ret < SHADER_COUNT);
//next bit is whether or not specular map is present
const U32 SPEC_BIT = 0x4;
- if (getSpecularID().notNull())
+ if (getSpecularID().notNull() && !mIsSpecularInvalid)
{
ret |= SPEC_BIT;
}
@@ -214,7 +224,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
//next bit is whether or not normal map is present
const U32 NORM_BIT = 0x8;
- if (getNormalID().notNull())
+ if (getNormalID().notNull() && !mIsNormalInvalid)
{
ret |= NORM_BIT;
}
diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h
index 9f52a3f6c1..2f23a50973 100644
--- a/indra/llprimitive/llmaterial.h
+++ b/indra/llprimitive/llmaterial.h
@@ -120,6 +120,13 @@ public:
void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; }
bool isNull() const;
+ bool isDiffuseAlphaInvalid() const { return mIsDiffuseAlphaInvalid; }
+ void setDiffuseAlphaInvalid(bool is_invalid) { mIsDiffuseAlphaInvalid = is_invalid; }
+ bool isNormalInvalid() const { return mIsNormalInvalid; }
+ void setNormalInvalid(bool is_invalid) { mIsNormalInvalid = is_invalid; }
+ bool isSpecularInvalid() const { return mIsSpecularInvalid; }
+ void setSpecularInvalid(bool is_invalid) { mIsSpecularInvalid = is_invalid; }
+
static const LLMaterial null;
bool operator == (const LLMaterial& rhs) const;
@@ -147,6 +154,10 @@ protected:
U8 mEnvironmentIntensity;
U8 mDiffuseAlphaMode;
U8 mAlphaMaskCutoff;
+
+ bool mIsDiffuseAlphaInvalid;
+ bool mIsNormalInvalid;
+ bool mIsSpecularInvalid;
};
typedef LLPointer<LLMaterial> LLMaterialPtr;