summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRye <rye@lindenlab.com>2025-02-05 11:26:40 -0500
committerGitHub <noreply@github.com>2025-02-05 11:26:40 -0500
commitc0156eb1c77a81d7cc180e6f61683d46b67d0f2d (patch)
treef69fad850635af9ba1825e3ff19d90d923c82a86
parent265ebfb82f09f1c2c24578d4817ba389059e6da0 (diff)
parent81a2813bf50c7a75acaa48c7398ce926784300c6 (diff)
Merge pull request #3497 from secondlife/rye/forever-3445
Fix media failing to function on PBR materials (#3445)
-rw-r--r--indra/newview/llviewertexture.cpp13
-rw-r--r--indra/newview/llvovolume.cpp7
2 files changed, 7 insertions, 13 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 1084fb91da..609ad38e96 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -3548,18 +3548,7 @@ void LLViewerMediaTexture::setPlaying(bool playing)
for(std::list< LLFace* >::iterator iter = mMediaFaceList.begin(); iter!= mMediaFaceList.end(); ++iter)
{
LLFace* facep = *iter;
- const LLTextureEntry* te = facep->getTextureEntry();
- if (te && te->getGLTFMaterial())
- {
- // PBR material, switch emissive and basecolor
- switchTexture(LLRender::EMISSIVE_MAP, *iter);
- switchTexture(LLRender::BASECOLOR_MAP, *iter);
- }
- else
- {
- // blinn-phong material, switch diffuse map only
- switchTexture(LLRender::DIFFUSE_MAP, *iter);
- }
+ switchTexture(LLRender::DIFFUSE_MAP, facep);
}
}
else //stop playing this media
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c1079ba12b..4dba930ed5 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -5750,7 +5750,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if (is_pbr)
{
// tell texture streaming system to ignore blinn-phong textures
- facep->setTexture(LLRender::DIFFUSE_MAP, nullptr);
+ // except the special case of the diffuse map containing a
+ // media texture that will be reused for swapping on to the pbr face
+ if (!facep->hasMedia())
+ {
+ facep->setTexture(LLRender::DIFFUSE_MAP, nullptr);
+ }
facep->setTexture(LLRender::NORMAL_MAP, nullptr);
facep->setTexture(LLRender::SPECULAR_MAP, nullptr);