From ab0c38612f5d055b41fdf08efa9ab8f2c30ec6b8 Mon Sep 17 00:00:00 2001 From: Nyx Linden <nyx@lindenlab.com> Date: Tue, 24 Sep 2013 20:22:19 +0000 Subject: [PATCH] SH-2728 SH-4010 FIX pants flare issues When wearing multiple layers of pants, the morph masks for all layers would be composited, resulting in the smallest intersection of all layers. Instead we should only be applying the top layer. This change will affect all consumers of the llappearance library. --- indra/llappearance/lltexlayer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 59765b38337..510d8ce879a 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1776,13 +1776,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const /*virtual*/ void LLTexLayerTemplate::gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height) { U32 num_wearables = updateWearableCache(); - for (U32 i = 0; i < num_wearables; i++) + U32 i = num_wearables - 1; // For rendering morph masks, we only want to use the top wearable + LLTexLayer *layer = getLayer(i); + if (layer) { - LLTexLayer *layer = getLayer(i); - if (layer) - { - layer->addAlphaMask(data, originX, originY, width, height); - } + layer->addAlphaMask(data, originX, originY, width, height); } } -- GitLab