From a22dfc28a132c0cf888a7ee6e47b29f50b6193af Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 26 Jul 2023 17:53:45 +0200 Subject: SL-18619 Eyes not rendering in Shape floater thumbnails --- indra/llappearance/llavatarappearance.cpp | 1 - indra/newview/lldrawpoolavatar.cpp | 12 ++++++------ indra/newview/llvoavatar.cpp | 5 ----- 3 files changed, 6 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 7946a3e705..18b03c1f89 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1050,7 +1050,6 @@ BOOL LLAvatarAppearance::loadSkeletonNode () mRoot->addChild(mMeshLOD[MESH_ID_UPPER_BODY]); mRoot->addChild(mMeshLOD[MESH_ID_LOWER_BODY]); mRoot->addChild(mMeshLOD[MESH_ID_SKIRT]); - mRoot->addChild(mMeshLOD[MESH_ID_HEAD]); LLAvatarJoint *skull = (LLAvatarJoint*)mRoot->findJoint("mSkull"); if (skull) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index f3a6c4a3a7..342b76d93b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -171,8 +171,8 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) is_deferred_render = true; if (LLPipeline::sImpostorRender) - { //impostor pass does not have rigid or impostor rendering - pass += 2; + { //impostor pass does not have impostor rendering + ++pass; } switch (pass) @@ -198,7 +198,7 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) if (LLPipeline::sImpostorRender) { - pass += 2; + ++pass; } switch (pass) @@ -418,7 +418,7 @@ void LLDrawPoolAvatar::render(S32 pass) LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (LLPipeline::sImpostorRender) { - renderAvatars(NULL, pass+2); + renderAvatars(NULL, ++pass); return; } @@ -433,7 +433,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) if (LLPipeline::sImpostorRender) { //impostor render does not have impostors or rigid rendering - pass += 2; + ++pass; } switch (pass) @@ -461,7 +461,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) if (LLPipeline::sImpostorRender) { - pass += 2; + ++pass; } switch (pass) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 22cd9f71b3..10a257fbb5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5232,11 +5232,6 @@ U32 LLVOAvatar::renderRigid() { return 0; } - - if (!mIsBuilt) - { - return 0; - } if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { -- cgit v1.2.3 From d8872d5273b5cc952f692d970f19db90588a1508 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Jul 2023 21:30:24 +0300 Subject: SL-18720 getDataBegin() and stateSort() crashes No repro, but likely cause is in mOctreeNode being NULL. Marked octree group as dead when destroyed and added isDead verification --- indra/newview/llvieweroctree.cpp | 6 +++++- indra/newview/pipeline.cpp | 32 +++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index a2d8d30fb2..9d63241300 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -627,13 +627,17 @@ void LLViewerOctreeGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntr //virtual void LLViewerOctreeGroup::handleDestruction(const TreeNode* node) { + if (isDead()) + { + return; + } + setState(DEAD); for (OctreeNode::element_iter i = mOctreeNode->getDataBegin(); i != mOctreeNode->getDataEnd(); ++i) { LLViewerOctreeEntry* obj = *i; if (obj && obj->getGroup() == this) { obj->nullGroup(); - //obj->setGroup(NULL); } } mOctreeNode = NULL; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1b4c8f65a6..1620b1ff4c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2466,8 +2466,11 @@ void LLPipeline::doOcclusion(LLCamera& camera) for (LLCullResult::sg_iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter) { LLSpatialGroup* group = *iter; - group->doOcclusion(&camera); - group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION); + if (!group->isDead()) + { + group->doOcclusion(&camera); + group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION); + } } //apply occlusion culling to object cache tree @@ -2912,6 +2915,10 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter) { LLSpatialGroup* group = *iter; + if (group->isDead()) + { + continue; + } group->checkOcclusion(); if (sUseOcclusion > 1 && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { @@ -2971,6 +2978,10 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter) { LLSpatialGroup* group = *iter; + if (group->isDead()) + { + continue; + } group->checkOcclusion(); if (sUseOcclusion > 1 && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { @@ -3130,7 +3141,12 @@ void forAllDrawables(LLCullResult::sg_iterator begin, { for (LLCullResult::sg_iterator i = begin; i != end; ++i) { - for (LLSpatialGroup::element_iter j = (*i)->getDataBegin(); j != (*i)->getDataEnd(); ++j) + LLSpatialGroup* group = *i; + if (group->isDead()) + { + continue; + } + for (LLSpatialGroup::element_iter j = group->getDataBegin(); j != group->getDataEnd(); ++j) { if((*j)->hasDrawable()) { @@ -3339,6 +3355,10 @@ void LLPipeline::postSort(LLCamera &camera) for (LLCullResult::sg_iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i) { LLSpatialGroup *group = *i; + if (group->isDead()) + { + continue; + } if (!sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { group->rebuildGeom(); @@ -3357,6 +3377,12 @@ void LLPipeline::postSort(LLCamera &camera) for (LLCullResult::sg_iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i) { LLSpatialGroup *group = *i; + + if (group->isDead()) + { + continue; + } + if ((sUseOcclusion && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) || (RenderAutoHideSurfaceAreaLimit > 0.f && group->mSurfaceArea > RenderAutoHideSurfaceAreaLimit * llmax(group->mObjectBoxSize, 10.f))) -- cgit v1.2.3 From 119b02937ed42502549ba3dab2db48c6edef9425 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 27 Jul 2023 23:20:17 +0300 Subject: SL-19958 An inventory material without asset should default to a blank material #2 --- indra/newview/lltexturectrl.cpp | 18 +++++++++++++----- indra/newview/lltexturectrl.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 0dd1ff5483..b3310a1f9a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -232,12 +232,20 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); } } - - - } } +void LLFloaterTexturePicker::setImageIDFromItem(const LLInventoryItem* itemp, bool set_selection) +{ + LLUUID asset_id = itemp->getAssetUUID(); + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL && asset_id.isNull()) + { + // If an inventory item has a null asset, consider it a valid blank material(gltf) + asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + } + setImageID(asset_id, set_selection); +} + void LLFloaterTexturePicker::setActive( BOOL active ) { if (!active && getChild("Pipette")->getValue().asBoolean()) @@ -388,7 +396,7 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( { if (drop) { - setImageID( item->getAssetUUID() ); + setImageIDFromItem(item); commitIfImmediateSet(); } @@ -860,7 +868,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequegetAssetUUID(),false); + setImageIDFromItem(itemp, false); mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? if(!mPreviewSettingChanged) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index c66e618782..ba310dd9a6 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -357,6 +357,7 @@ public: protected: void refreshLocalList(); void refreshInventoryFilter(); + void setImageIDFromItem(const LLInventoryItem* itemp, bool set_selection = true); LLPointer mTexturep; LLPointer mGLTFMaterial; -- cgit v1.2.3 From 5e344813dc9bb4e5ecb8187642f97377c157955f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 27 Jul 2023 23:06:26 +0300 Subject: SL-18396 PBR and blinn phong should not be allowed to be edited together --- indra/newview/llpanelface.cpp | 39 ++++++++++++++++++++++++++++----------- indra/newview/llpanelface.h | 4 ++-- indra/newview/llviewermenu.cpp | 14 ++++++++++++-- 3 files changed, 42 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index ff21438085..83a330af37 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1000,7 +1000,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced(); bool has_pbr_material; - updateUIGLTF(objectp, has_pbr_material, force_set_values); + bool has_faces_without_pbr; + updateUIGLTF(objectp, has_pbr_material, has_faces_without_pbr, force_set_values); const bool has_material = !has_pbr_material; @@ -1536,7 +1537,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChild("checkbox fullbright")->setValue((S32)(fullbright_flag != 0)); getChildView("checkbox fullbright")->setEnabled(editable && !has_pbr_material); getChild("checkbox fullbright")->setTentative(!identical_fullbright); - getChild("combobox matmedia")->setEnabledByValue("Materials", !has_pbr_material); + mComboMatMedia->setEnabledByValue("Materials", !has_pbr_material); } // Repeats per meter @@ -1800,7 +1801,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } } -void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool force_set_values) +void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool& has_faces_without_pbr, bool force_set_values) { has_pbr_material = false; @@ -1813,9 +1814,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, { LLUUID pbr_id; bool identical_pbr; - LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr); - - has_pbr_material = pbr_id.notNull(); + LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr, has_pbr_material, has_faces_without_pbr); pbr_ctrl->setTentative(identical_pbr ? FALSE : TRUE); pbr_ctrl->setEnabled(editable && has_pbr_capabilities); @@ -1823,13 +1822,13 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, } getChildView("pbr_from_inventory")->setEnabled(editable && has_pbr_capabilities); - getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material && has_pbr_capabilities); - getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material && has_pbr_capabilities); + getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material && !has_faces_without_pbr && has_pbr_capabilities); + getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material && !has_faces_without_pbr && has_pbr_capabilities); const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled(); if (show_pbr) { - const bool new_state = has_pbr_capabilities && has_pbr_material; + const bool new_state = has_pbr_capabilities && has_pbr_material && !has_faces_without_pbr; LLUICtrl* gltfCtrlTextureScaleU = getChild("gltfTextureScaleU"); LLUICtrl* gltfCtrlTextureScaleV = getChild("gltfTextureScaleV"); @@ -5057,16 +5056,34 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id ); } -void LLPanelFace::LLSelectedTE::getPbrMaterialId(LLUUID& id, bool& identical) +void LLPanelFace::LLSelectedTE::getPbrMaterialId(LLUUID& id, bool& identical, bool& has_faces_with_pbr, bool& has_faces_without_pbr) { struct LLSelectedTEGetmatId : public LLSelectedTEGetFunctor { + LLSelectedTEGetmatId() + : mHasFacesWithoutPBR(false) + , mHasFacesWithPBR(false) + { + } LLUUID get(LLViewerObject* object, S32 te_index) { - return object->getRenderMaterialID(te_index); + LLUUID pbr_id = object->getRenderMaterialID(te_index); + if (pbr_id.isNull()) + { + mHasFacesWithoutPBR = true; + } + else + { + mHasFacesWithPBR = true; + } + return pbr_id; } + bool mHasFacesWithoutPBR; + bool mHasFacesWithPBR; } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&func, id); + has_faces_with_pbr = func.mHasFacesWithPBR; + has_faces_without_pbr = func.mHasFacesWithoutPBR; } void LLPanelFace::LLSelectedTEMaterial::getCurrent(LLMaterialPtr& material_ptr, bool& identical_material) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 4dfef5d9bc..7d567c7ce8 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -452,7 +452,7 @@ private: void onTextureSelectionChanged(LLInventoryItem* itemp); void onPbrSelectionChanged(LLInventoryItem* itemp); - void updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool force_set_values); + void updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool& has_faces_without_pbr, bool force_set_values); void updateVisibilityGLTF(); void updateSelectedGLTFMaterials(std::function func); @@ -595,7 +595,7 @@ public: static void getFace(class LLFace*& face_to_return, bool& identical_face); static void getImageFormat(LLGLenum& image_format_to_return, bool& identical_face); static void getTexId(LLUUID& id, bool& identical); - static void getPbrMaterialId(LLUUID& id, bool& identical); + static void getPbrMaterialId(LLUUID& id, bool& identical, bool& has_pbr, bool& has_faces_without_pbr); static void getObjectScaleS(F32& scale_s, bool& identical); static void getObjectScaleT(F32& scale_t, bool& identical); static void getMaxDiffuseRepeats(F32& repeats, bool& identical); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6e5c268c00..ae04d536f1 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2800,7 +2800,12 @@ bool enable_object_inspect() struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor { - LLSelectedTEGetmatIdAndPermissions() : mCanCopy(true), mCanModify(true), mCanTransfer(true) {} + LLSelectedTEGetmatIdAndPermissions() + : mCanCopy(true) + , mCanModify(true) + , mCanTransfer(true) + , mHasNonPbrFaces(false) + {} bool apply(LLViewerObject* objectp, S32 te_index) { mCanCopy &= (bool)objectp->permCopy(); @@ -2811,11 +2816,16 @@ struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor { mMaterialId = mat_id; } + else + { + mHasNonPbrFaces = true; + } return true; } bool mCanCopy; bool mCanModify; bool mCanTransfer; + bool mHasNonPbrFaces; LLUUID mMaterialId; }; @@ -2828,7 +2838,7 @@ bool enable_object_edit_gltf_material() LLSelectedTEGetmatIdAndPermissions func; LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); - return func.mCanModify && func.mMaterialId.notNull(); + return func.mCanModify && !func.mHasNonPbrFaces; } bool enable_object_open() -- cgit v1.2.3 From 5a706086fefa6058389dc35707fc6b0c8ccece2d Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 21 Jul 2023 17:32:08 -0700 Subject: SL-20053: Fix sometimes unable to unset a PBR material on a prim. Caused by inventory item asset IDs being null. Seems suspicious. But working around it for now seems best. --- indra/newview/lltexturectrl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index b3310a1f9a..c13376d0a6 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -693,6 +693,11 @@ void LLFloaterTexturePicker::draw() const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library) { + if (asset_id.isNull()) + { + return LLUUID::null; + } + LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; LLAssetIDMatches asset_id_matches(asset_id); -- cgit v1.2.3