From 1b5af4be298198cedc407b6b294b2d71129d7731 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 13 May 2016 18:47:23 +0300 Subject: Add invert texture coordinates for media textures. --- indra/newview/lldrawpool.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'indra/newview/lldrawpool.cpp') diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index f74164aea6..a6cf917cbd 100755 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -473,6 +473,10 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba if (params.mTextureList[i].notNull()) { gGL.getTexUnit(i)->bind(params.mTextureList[i], TRUE); + if (LLViewerTexture::MEDIA_TEXTURE == params.mTextureList[i]->getType()) + { + gGL.setInverseTexCoordByY(true); + } } } } @@ -482,13 +486,54 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba { params.mTexture->addTextureStats(params.mVSize); gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ; + + if (!gPipeline.mVertexShadersEnabled) + { + if (LLViewerTexture::MEDIA_TEXTURE == params.mTexture->getType() && !params.mTextureMatrix) + { + static const float fIdntInvY[] = { + 1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + }; + + gGL.getTexUnit(0)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*)fIdntInvY); + gPipeline.mTextureMatrixOps++; + + tex_setup = true; + } + } + else + { + gGL.setInverseTexCoordByY(LLViewerTexture::MEDIA_TEXTURE == params.mTexture->getType()); + } + if (params.mTextureMatrix) { tex_setup = true; gGL.getTexUnit(0)->activate(); gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix); + + if (LLViewerTexture::MEDIA_TEXTURE == params.mTexture->getType() && !gPipeline.mVertexShadersEnabled) + { + static const float fIdntInvY[] = { + 1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + }; + + gGL.multMatrix(fIdntInvY); + gPipeline.mMatrixOpCount++; + } + gPipeline.mTextureMatrixOps++; + + tex_setup = true; } } else -- cgit v1.2.3