summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-22 18:10:50 -0500
committerDave Parks <davep@lindenlab.com>2022-09-22 18:10:50 -0500
commit43822fa6e4ccb2e41a33cb39fff756572b0fde0b (patch)
treee8f77f7859e5b553f54f9958a0464ed9caf01850
parent0afc237de2b3c8286efda25f9ca72aa710bc81ef (diff)
SL-18190 Fix for texture animation not working on opaque PBR materials.
-rw-r--r--indra/newview/lldrawpoolpbropaque.cpp17
1 files changed, 17 insertions, 0 deletions
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);
+ }
}
}