Skip to content

Commit 5d62cdb

Browse files
committed
#2768: Partial fix for PBR texture animations stopping. May also fix some Blinn-Phong texture animations. (#2971)
1 parent 55732f7 commit 5d62cdb

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

indra/newview/llvovolume.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,24 @@ void LLVOVolume::updateTextureVirtualSize(bool forced)
784784
LLFace* face = mDrawable->getFace(i);
785785
if (!face) continue;
786786
const LLTextureEntry *te = face->getTextureEntry();
787-
LLViewerTexture *imagep = face->getTexture();
787+
LLViewerTexture *imagep = nullptr;
788+
U32 ch_min;
789+
U32 ch_max;
790+
if (!te->getGLTFRenderMaterial())
791+
{
792+
ch_min = LLRender::DIFFUSE_MAP;
793+
ch_max = LLRender::SPECULAR_MAP;
794+
}
795+
else
796+
{
797+
ch_min = LLRender::BASECOLOR_MAP;
798+
ch_max = LLRender::EMISSIVE_MAP;
799+
}
800+
for (U32 ch = ch_min; (!imagep && ch <= ch_max); ++ch)
801+
{
802+
// Get _a_ non-null texture if possible (usually diffuse/basecolor, but could be something else)
803+
imagep = face->getTexture(ch);
804+
}
788805
if (!imagep || !te ||
789806
face->mExtents[0].equals3(face->mExtents[1]))
790807
{

0 commit comments

Comments
 (0)