diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-01-08 21:33:06 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-01-08 21:33:06 +0200 |
commit | afe91b7eb68da65687beef451bd094ff0091b717 (patch) | |
tree | 5bdb9e5b5a78a16a8c1362c33717a6931fb40458 /indra/llprimitive/llgltfmaterial.cpp | |
parent | 6e6df8c31e09e6ba69156150ecd37cc4ac4ea0e6 (diff) | |
parent | 77395eddc911e0801e50fd693f7bbaee8046aa95 (diff) |
Merge main (DRTVWR-596 GLTF Materials Maint) into DRTVWR-591-maint-X
# Conflicts:
# indra/newview/VIEWER_VERSION.txt
Diffstat (limited to 'indra/llprimitive/llgltfmaterial.cpp')
-rw-r--r-- | indra/llprimitive/llgltfmaterial.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp index ae165f7fa4..237636bd0b 100644 --- a/indra/llprimitive/llgltfmaterial.cpp +++ b/indra/llprimitive/llgltfmaterial.cpp @@ -699,24 +699,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"]; @@ -730,6 +750,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"]; |