diff options
author | Dave Parks <davep@lindenlab.com> | 2022-10-05 08:12:00 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-10-05 08:12:00 -0500 |
commit | 46009c19e9aadbd74c49a2ecdf28c290409226e2 (patch) | |
tree | 4b6db0481a0c5f383512af5f72b59bfd9ce81fe0 /indra/newview/llviewerobject.cpp | |
parent | 30bcc7d6d5fa4ceedfec28cc0973c253364c555e (diff) | |
parent | 1a437cbedf94de90d749f426dde09f2466693de2 (diff) |
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b4fad16dba..a256b770b1 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4930,13 +4930,21 @@ void LLViewerObject::updateTEMaterialTextures(U8 te) mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); } - auto fetch_texture = [](const LLUUID& id) + auto fetch_texture = [](const LLUUID& id, LLViewerObject *obj) { LLViewerFetchedTexture* img = nullptr; if (id.notNull()) { - img = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); - img->addTextureStats(64.f * 64.f, TRUE); + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + { + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(id); + img = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : nullptr; + } + else + { + img = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); + img->addTextureStats(64.f * 64.f, TRUE); + } } return img; @@ -4957,10 +4965,10 @@ void LLViewerObject::updateTEMaterialTextures(U8 te) if (mat != nullptr) { - mGLTFBaseColorMaps[te] = fetch_texture(mat->mBaseColorId); - mGLTFNormalMaps[te] = fetch_texture(mat->mNormalId); - mGLTFMetallicRoughnessMaps[te] = fetch_texture(mat->mMetallicRoughnessId); - mGLTFEmissiveMaps[te] = fetch_texture(mat->mEmissiveId); + mGLTFBaseColorMaps[te] = fetch_texture(mat->mBaseColorId, this); + mGLTFNormalMaps[te] = fetch_texture(mat->mNormalId, this); + mGLTFMetallicRoughnessMaps[te] = fetch_texture(mat->mMetallicRoughnessId, this); + mGLTFEmissiveMaps[te] = fetch_texture(mat->mEmissiveId, this); } else { |