From 9de2af8b2dde7dc326f970d61950bebc565883f6 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 13 Nov 2017 14:26:15 +0200 Subject: MAINT-7847 Remake of 'white alpfa' fix --- indra/llprimitive/llmaterial.cpp | 14 ++++++++++++-- indra/llprimitive/llmaterial.h | 11 +++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 57ceb3e11b..e6d2790a5f 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -106,10 +106,16 @@ LLMaterial::LLMaterial() , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) , mAlphaMaskCutoff(0) + , mIsDiffuseAlphaInvalid(false) + , mIsNormalInvalid(false) + , mIsSpecularInvalid(false) { } LLMaterial::LLMaterial(const LLSD& material_data) + : mIsDiffuseAlphaInvalid(false) + , mIsNormalInvalid(false) + , mIsSpecularInvalid(false) { fromLLSD(material_data); } @@ -199,13 +205,17 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) { ret = getDiffuseAlphaMode(); } + if (mIsDiffuseAlphaInvalid && ret != DIFFUSE_ALPHA_MODE_DEFAULT) + { + ret = alpha_mode != DIFFUSE_ALPHA_MODE_NONE; + } llassert(ret < SHADER_COUNT); //next bit is whether or not specular map is present const U32 SPEC_BIT = 0x4; - if (getSpecularID().notNull()) + if (getSpecularID().notNull() && !mIsSpecularInvalid) { ret |= SPEC_BIT; } @@ -214,7 +224,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) //next bit is whether or not normal map is present const U32 NORM_BIT = 0x8; - if (getNormalID().notNull()) + if (getNormalID().notNull() && !mIsNormalInvalid) { ret |= NORM_BIT; } diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 9f52a3f6c1..2f23a50973 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -120,6 +120,13 @@ public: void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; } bool isNull() const; + bool isDiffuseAlphaInvalid() const { return mIsDiffuseAlphaInvalid; } + void setDiffuseAlphaInvalid(bool is_invalid) { mIsDiffuseAlphaInvalid = is_invalid; } + bool isNormalInvalid() const { return mIsNormalInvalid; } + void setNormalInvalid(bool is_invalid) { mIsNormalInvalid = is_invalid; } + bool isSpecularInvalid() const { return mIsSpecularInvalid; } + void setSpecularInvalid(bool is_invalid) { mIsSpecularInvalid = is_invalid; } + static const LLMaterial null; bool operator == (const LLMaterial& rhs) const; @@ -147,6 +154,10 @@ protected: U8 mEnvironmentIntensity; U8 mDiffuseAlphaMode; U8 mAlphaMaskCutoff; + + bool mIsDiffuseAlphaInvalid; + bool mIsNormalInvalid; + bool mIsSpecularInvalid; }; typedef LLPointer LLMaterialPtr; -- cgit v1.2.3 From 9fe126e7e5be64ff4251b285eb168ff9c45e76fb Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 20 Dec 2017 22:03:06 +0200 Subject: Backed out changeset: 761e890970b2 --- indra/llprimitive/llmaterial.cpp | 14 ++------------ indra/llprimitive/llmaterial.h | 11 ----------- 2 files changed, 2 insertions(+), 23 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index e6d2790a5f..57ceb3e11b 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -106,16 +106,10 @@ LLMaterial::LLMaterial() , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) , mAlphaMaskCutoff(0) - , mIsDiffuseAlphaInvalid(false) - , mIsNormalInvalid(false) - , mIsSpecularInvalid(false) { } LLMaterial::LLMaterial(const LLSD& material_data) - : mIsDiffuseAlphaInvalid(false) - , mIsNormalInvalid(false) - , mIsSpecularInvalid(false) { fromLLSD(material_data); } @@ -205,17 +199,13 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) { ret = getDiffuseAlphaMode(); } - if (mIsDiffuseAlphaInvalid && ret != DIFFUSE_ALPHA_MODE_DEFAULT) - { - ret = alpha_mode != DIFFUSE_ALPHA_MODE_NONE; - } llassert(ret < SHADER_COUNT); //next bit is whether or not specular map is present const U32 SPEC_BIT = 0x4; - if (getSpecularID().notNull() && !mIsSpecularInvalid) + if (getSpecularID().notNull()) { ret |= SPEC_BIT; } @@ -224,7 +214,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) //next bit is whether or not normal map is present const U32 NORM_BIT = 0x8; - if (getNormalID().notNull() && !mIsNormalInvalid) + if (getNormalID().notNull()) { ret |= NORM_BIT; } diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 2f23a50973..9f52a3f6c1 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -120,13 +120,6 @@ public: void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; } bool isNull() const; - bool isDiffuseAlphaInvalid() const { return mIsDiffuseAlphaInvalid; } - void setDiffuseAlphaInvalid(bool is_invalid) { mIsDiffuseAlphaInvalid = is_invalid; } - bool isNormalInvalid() const { return mIsNormalInvalid; } - void setNormalInvalid(bool is_invalid) { mIsNormalInvalid = is_invalid; } - bool isSpecularInvalid() const { return mIsSpecularInvalid; } - void setSpecularInvalid(bool is_invalid) { mIsSpecularInvalid = is_invalid; } - static const LLMaterial null; bool operator == (const LLMaterial& rhs) const; @@ -154,10 +147,6 @@ protected: U8 mEnvironmentIntensity; U8 mDiffuseAlphaMode; U8 mAlphaMaskCutoff; - - bool mIsDiffuseAlphaInvalid; - bool mIsNormalInvalid; - bool mIsSpecularInvalid; }; typedef LLPointer LLMaterialPtr; -- cgit v1.2.3 From c56298d4ba818aaa5b69a8c30e5b577f7e4596eb Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 3 Jan 2018 16:30:57 +0200 Subject: MAINT-8022 Make unzip silent yet include failure reason into output --- indra/llprimitive/llmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index db6d00bc2c..29af859cd0 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1354,7 +1354,7 @@ bool LLModel::loadSkinInfo(LLSD& header, std::istream &is) LLSD skin_data; - if (unzip_llsd(skin_data, is, size)) + if (LLUZipHelper::unzip_llsd(skin_data, is, size) == LLUZipHelper::ZR_OK) { mSkinInfo.fromLLSD(skin_data); return true; @@ -1375,7 +1375,7 @@ bool LLModel::loadDecomposition(LLSD& header, std::istream& is) LLSD data; - if (unzip_llsd(data, is, size)) + if (LLUZipHelper::unzip_llsd(data, is, size) == LLUZipHelper::ZR_OK) { mPhysics.fromLLSD(data); updateHullCenters(); -- cgit v1.2.3 From 750d90cf592d22b9c717fa138f17b2c1e32dd1c7 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 22 Jan 2018 18:11:12 +0200 Subject: MAINT-8208 [Mac] Viewer crashes when uploading certain mesh model after enabling "Include skin weight" --- indra/llprimitive/llmodel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 29af859cd0..8fbb4f6b96 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1034,8 +1034,11 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) { //no exact match found, get closest point const F32 epsilon = 1e-5f; weight_map::iterator iter_up = mSkinWeights.lower_bound(pos); - weight_map::iterator iter_down = ++iter_up; - + weight_map::iterator iter_down = iter_up; + if (iter_up != mSkinWeights.end()) + { + iter_down = ++iter_up; + } weight_map::iterator best = iter_up; F32 min_dist = (iter->first - pos).magVec(); -- cgit v1.2.3