From 43822fa6e4ccb2e41a33cb39fff756572b0fde0b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 22 Sep 2022 18:10:50 -0500 Subject: SL-18190 Fix for texture animation not working on opaque PBR materials. --- indra/newview/lldrawpoolpbropaque.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/indra/newview/lldrawpoolpbropaque.cpp b/indra/newview/lldrawpoolpbropaque.cpp index e1614904b4..71f648a714 100644 --- a/indra/newview/lldrawpoolpbropaque.cpp +++ b/indra/newview/lldrawpoolpbropaque.cpp @@ -148,6 +148,16 @@ void LLDrawPoolPBROpaque::renderDeferred(S32 pass) LLGLDisable cull_face(mat->mDoubleSided ? GL_CULL_FACE : 0); + bool tex_setup = false; + if (pparams->mTextureMatrix) + { //special case implementation of texture animation here because of special handling of textures for PBR batches + tex_setup = true; + gGL.getTexUnit(0)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*)pparams->mTextureMatrix->mMatrix); + gPipeline.mTextureMatrixOps++; + } + if (rigged) { if (pparams->mAvatar.notNull() && (lastAvatar != pparams->mAvatar || lastMeshId != pparams->mSkinInfo->mHash)) @@ -163,6 +173,13 @@ void LLDrawPoolPBROpaque::renderDeferred(S32 pass) { pushBatch(*pparams, vertex_data_mask, FALSE, FALSE); } + + if (tex_setup) + { + gGL.matrixMode(LLRender::MM_TEXTURE0); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + } } } -- cgit v1.2.3