Merge pull request #3497 from secondlife/rye/forever-3445

Fix media failing to function on PBR materials (#3445)
master
Rye 2025-02-05 11:26:40 -05:00 committed by GitHub
commit c0156eb1c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 13 deletions

View File

@ -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

View File

@ -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);