diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-01-08 23:15:00 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-01-08 23:15:00 +0200 |
commit | fe796dac711c7ecdc7d6d17e0b692abf468b754a (patch) | |
tree | 32750c8e5be3b21c2c8d6bf3cbc43eb012dba72a /indra/llprimitive | |
parent | 1cc91fac587ae0edf86d2dec42e2846e57bfafd0 (diff) | |
parent | 77395eddc911e0801e50fd693f7bbaee8046aa95 (diff) |
Merge branch 'main' into DRTVWR-588-maint-W
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 3 | ||||
-rw-r--r-- | indra/llprimitive/llgltfmaterial.cpp | 25 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 3 |
3 files changed, 29 insertions, 2 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 46e1cb4922..2e4b013b77 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -2584,7 +2584,8 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& mo next->mLabel = model_name + (char)((int)'a' + next->mSubmodelID) + lod_suffix[mLod]; next->getVolumeFaces() = remainder; next->mNormalizedScale = ret->mNormalizedScale; - + next->mNormalizedTranslation = ret->mNormalizedTranslation; + if ( ret->mMaterialList.size() > LL_SCULPT_MESH_MAX_FACES) { next->mMaterialList.assign(ret->mMaterialList.begin() + LL_SCULPT_MESH_MAX_FACES, ret->mMaterialList.end()); 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"]; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 84de69d189..d56ffdc317 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -52,7 +52,8 @@ const int MODEL_NAMES_LENGTH = sizeof(model_names) / sizeof(std::string); LLModel::LLModel(LLVolumeParams& params, F32 detail) : LLVolume(params, detail), - mNormalizedScale(1,1,1), + mNormalizedScale(1,1,1), + mNormalizedTranslation(0, 0, 0), mPelvisOffset( 0.0f ), mStatus(NO_ERRORS), mSubmodelID(0) |