diff options
author | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2016-05-13 18:47:23 +0300 |
---|---|---|
committer | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2016-05-13 18:47:23 +0300 |
commit | 1b5af4be298198cedc407b6b294b2d71129d7731 (patch) | |
tree | 0fdc088875470a70c684da2ef7fea1055775b203 /indra/newview/lldrawpool.cpp | |
parent | bceafa5062db394048312aa7fe0a7706fb9524b7 (diff) |
Add invert texture coordinates for media textures.
Diffstat (limited to 'indra/newview/lldrawpool.cpp')
-rwxr-xr-x | indra/newview/lldrawpool.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
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 |