diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2024-10-31 11:28:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 13:28:13 -0500 |
commit | 34e909b6bfbd99d3df481a2f6e566a0b58a15905 (patch) | |
tree | ae3999e5de60c41dc0e02dcf07d027cc070ff72f | |
parent | 559e2c1bb223e82f29a00a0cf1556e56073dde3a (diff) |
secondlife/viewer#2768: Partial fix for PBR texture animations stopping. May also fix some Blinn-Phong texture animations. (#2971)
-rw-r--r-- | indra/newview/llvovolume.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 31f1bbcc21..39728b6818 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -786,7 +786,24 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) LLFace* face = mDrawable->getFace(i); if (!face) continue; const LLTextureEntry *te = face->getTextureEntry(); - LLViewerTexture *imagep = face->getTexture(); + LLViewerTexture *imagep = nullptr; + U32 ch_min; + U32 ch_max; + if (!te->getGLTFRenderMaterial()) + { + ch_min = LLRender::DIFFUSE_MAP; + ch_max = LLRender::SPECULAR_MAP; + } + else + { + ch_min = LLRender::BASECOLOR_MAP; + ch_max = LLRender::EMISSIVE_MAP; + } + for (U32 ch = ch_min; (!imagep && ch <= ch_max); ++ch) + { + // Get _a_ non-null texture if possible (usually diffuse/basecolor, but could be something else) + imagep = face->getTexture(ch); + } if (!imagep || !te || face->mExtents[0].equals3(face->mExtents[1])) { |