summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llgltfmaterial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/llgltfmaterial.cpp')
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index e9d3350ee9..12af568b7e 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -760,24 +760,44 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
if (bc.isDefined())
{
mBaseColor.setValue(bc);
+ if (mBaseColor == getDefaultBaseColor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mBaseColor.mV[3] -= FLT_EPSILON;
+ }
}
const LLSD& ec = data["ec"];
if (ec.isDefined())
{
mEmissiveColor.setValue(ec);
+ if (mEmissiveColor == getDefaultEmissiveColor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mEmissiveColor.mV[0] += FLT_EPSILON;
+ }
}
const LLSD& mf = data["mf"];
if (mf.isReal())
{
mMetallicFactor = mf.asReal();
+ if (mMetallicFactor == getDefaultMetallicFactor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mMetallicFactor -= FLT_EPSILON;
+ }
}
const LLSD& rf = data["rf"];
if (rf.isReal())
{
mRoughnessFactor = rf.asReal();
+ if (mRoughnessFactor == getDefaultRoughnessFactor())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mRoughnessFactor -= FLT_EPSILON;
+ }
}
const LLSD& am = data["am"];
@@ -791,6 +811,11 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
if (ac.isReal())
{
mAlphaCutoff = ac.asReal();
+ if (mAlphaCutoff == getDefaultAlphaCutoff())
+ {
+ // HACK -- nudge by epsilon if we receive a default value (indicates override to default)
+ mAlphaCutoff -= FLT_EPSILON;
+ }
}
const LLSD& ds = data["ds"];