From fff4e698f0d414d00cec8791447cb42412b95181 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 4 Jun 2020 11:16:22 +0200 Subject: [PATCH] Fix for broken local avatar texture bakes by Rye Mutt (Alchemy Viewer) --- indra/newview/llviewerjointmesh.cpp | 26 +++++++++++++++----------- indra/newview/llviewertexlayer.cpp | 5 ++++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 1a12236d8a..6183eba22d 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -253,7 +253,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) //---------------------------------------------------------------- llassert( !(mTexture.notNull() && mLayerSet) ); // mutually exclusive - LLTexUnit::eTextureAddressMode old_mode = LLTexUnit::TAM_WRAP; + // LLTexUnit::eTextureAddressMode old_mode = LLTexUnit::TAM_WRAP; // Rye Mutt's broken local texture rendering fix LLViewerTexLayerSet *layerset = dynamic_cast(mLayerSet); if (mTestImageName) { @@ -283,12 +283,14 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) else if ( !is_dummy && mTexture.notNull() ) { - if(mTexture->hasGLTexture()) - { - old_mode = mTexture->getAddressMode(); - } + // Rye Mutt's broken local texture rendering fix + //if(mTexture->hasGLTexture()) + //{ + // old_mode = mTexture->getAddressMode(); + //} + // gGL.getTexUnit(diffuse_channel)->bind(mTexture); - gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + //gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); // Rye Mutt's broken local texture rendering fix } else { @@ -341,11 +343,13 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) gGL.getTexUnit(diffuse_channel)->setTextureBlendType(LLTexUnit::TB_MULT); } - if (mTexture.notNull() && !is_dummy) - { - gGL.getTexUnit(diffuse_channel)->bind(mTexture); - gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(old_mode); - } + // Rye Mutt's broken local texture rendering fix + //if (mTexture.notNull() && !is_dummy) + //{ + // gGL.getTexUnit(diffuse_channel)->bind(mTexture); + // gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(old_mode); + //} + // return triangle_count; } diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 405103843d..3277acd3ec 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -60,7 +60,10 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height) : // ORDER_LAST => must render these after the hints are created. LLTexLayerSetBuffer(owner), - LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ), + // Rye Mutt's broken local texture rendering fix + //LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ), + LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, FALSE ), + // // [Legacy Bake] mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates mNeedsUpload(FALSE),