summaryrefslogtreecommitdiff
path: root/indra/newview/llfetchedgltfmaterial.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-11-02 00:33:39 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-11-06 18:29:42 +0200
commit52c60ab3fdb8617471eccd9df52cc126e0243e76 (patch)
tree7496136c8551ef61fd306f119c7cc6a77ca16a47 /indra/newview/llfetchedgltfmaterial.cpp
parent3a5b678eba5d86acccb1a1f233f862d292258fac (diff)
SL-20523 Local textures not updating on PBR Materials #4
Diffstat (limited to 'indra/newview/llfetchedgltfmaterial.cpp')
-rw-r--r--indra/newview/llfetchedgltfmaterial.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp
index 71a961ce49..c61b25f0a2 100644
--- a/indra/newview/llfetchedgltfmaterial.cpp
+++ b/indra/newview/llfetchedgltfmaterial.cpp
@@ -155,7 +155,14 @@ LLViewerFetchedTexture* fetch_texture(const LLUUID& id)
return img;
};
-bool LLFetchedGLTFMaterial::replaceLocalTexture(const LLUUID& old_id, const LLUUID& new_id)
+void LLFetchedGLTFMaterial::applyOverride(const LLGLTFMaterial& override_mat)
+{
+ LLGLTFMaterial::applyOverride(override_mat);
+
+ updateTextureTracking();
+}
+
+bool LLFetchedGLTFMaterial::replaceLocalTexture(const LLUUID& tracking_id, const LLUUID& old_id, const LLUUID& new_id)
{
bool res = false;
if (mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR] == old_id)
@@ -182,14 +189,24 @@ bool LLFetchedGLTFMaterial::replaceLocalTexture(const LLUUID& old_id, const LLUU
mEmissiveTexture = fetch_texture(new_id);
res = true;
}
+
+ if (res)
+ {
+ mTrackingIdToLocalTexture[tracking_id] = new_id;
+ }
+ else
+ {
+ mTrackingIdToLocalTexture.erase(tracking_id);
+ }
+
return res;
}
void LLFetchedGLTFMaterial::updateTextureTracking()
{
- for (const LLUUID& id : mLocalTextureTrackingIds)
+ for (local_tex_map_t::value_type val : mTrackingIdToLocalTexture)
{
- LLLocalBitmapMgr::getInstance()->associateGLTFMaterial(id, this);
+ LLLocalBitmapMgr::getInstance()->associateGLTFMaterial(val.first, this);
}
}