From 6e32993c8787e7ba569d5a9ebcdb994c2ba03671 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 26 Sep 2023 13:59:31 +0300 Subject: SL-20338 FIXED Texture tab Material drop-down does not change if same numbered face is selected --- indra/newview/llpanelface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index e1f08915fa..1428f7fe23 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1056,6 +1056,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LLSelectedTEMaterial::getSpecularID(specmap_id, identical_spec); static S32 selected_te = -1; + static LLUUID prev_obj_id; if ((LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool()) && !LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { @@ -1070,7 +1071,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } } - if (new_selection != selected_te) + if ((new_selection != selected_te) + || (prev_obj_id != objectp->getID())) { bool te_has_media = objectp->getTE(new_selection) && objectp->getTE(new_selection)->hasMedia(); bool te_has_pbr = objectp->getRenderMaterialID(new_selection).notNull(); @@ -1088,6 +1090,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } selected_te = new_selection; + prev_obj_id = objectp->getID(); } } -- cgit v1.2.3 From b894570e9af5eafd5de06f401fdc782599c063a2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 Sep 2023 20:59:07 +0300 Subject: SL-19958 Fix default material not droping into texture ctrl --- indra/newview/lltexturectrl.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 7e399a6808..bbacec843b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -2101,8 +2101,16 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item) return mDropCallback(this, item); } - // no callback installed, so just set the image ids and carry on. - setImageAssetID( item->getAssetUUID() ); + // no callback installed, so just set the image ids and carry on. + LLUUID asset_id = item->getAssetUUID(); + + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL && asset_id.isNull()) + { + // If an inventory material has a null asset, consider it a valid blank material(gltf) + asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + } + + setImageAssetID(asset_id); mImageItemID = item->getUUID(); return TRUE; } -- cgit v1.2.3 From 1b493d56905a2d3875648196ac1bc39fc71e895a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 Sep 2023 21:11:01 +0300 Subject: SL-20343 Material floater was disconnected from object's face --- indra/newview/llmaterialeditor.cpp | 27 +-------------------------- indra/newview/llmaterialeditor.h | 1 - indra/newview/llpanelface.cpp | 1 + 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index a0c3fd9a28..0897ed14c6 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -412,9 +412,6 @@ BOOL LLMaterialEditor::postBuild() if (mIsOverride) { - // Material override change success callback - LLGLTFMaterialList::addSelectionUpdateCallback(&LLMaterialEditor::updateLive); - // Live editing needs a recovery mechanism on cancel mBaseColorTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_BASE_COLOR_TEX_DIRTY)); mMetallicTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_METALLIC_ROUGHTNESS_TEX_DIRTY)); @@ -542,12 +539,6 @@ void LLMaterialEditor::draw() { if (mIsOverride) { - bool selection_empty = LLSelectMgr::getInstance()->getSelection()->isEmpty(); - if (selection_empty && mHasSelection) - { - mSelectionNeedsUpdate = true; - } - if (mSelectionNeedsUpdate) { mSelectionNeedsUpdate = false; @@ -1790,22 +1781,6 @@ void LLMaterialEditor::updateLive() mOverrideInProgress = false; } -void LLMaterialEditor::updateLive(const LLUUID &object_id, S32 te) -{ - if (mOverrideObjectId != object_id - || mOverrideObjectTE != te) - { - // Ignore if waiting for override, - // if not waiting, mark selection dirty - mSelectionNeedsUpdate |= !mOverrideInProgress; - return; - } - - // update for currently displayed object and face - mSelectionNeedsUpdate = true; - mOverrideInProgress = false; -} - void LLMaterialEditor::loadLive() { LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("live_material_editor"); @@ -2816,7 +2791,7 @@ public: // something went wrong update selection LLMaterialEditor::updateLive(); } - // else we will get updateLive(obj, id) from applied overrides + // else we will get updateLive() from panel face } bool getResult() { return mSuccess; } diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h index b29db706f8..1c40fcc348 100644 --- a/indra/newview/llmaterialeditor.h +++ b/indra/newview/llmaterialeditor.h @@ -110,7 +110,6 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener void onSelectionChanged(); // live overrides selection changes static void updateLive(); - static void updateLive(const LLUUID &object_id, S32 te); static void loadLive(); static bool canModifyObjectsMaterial(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 1428f7fe23..cb28fb4770 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -515,6 +515,7 @@ void LLPanelFace::draw() if (sMaterialOverrideSelection.update()) { setMaterialOverridesFromSelection(); + LLMaterialEditor::updateLive(); } } -- cgit v1.2.3 From b49632f4278078b0d10129a8c6742e145946cfff Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 Sep 2023 22:49:36 +0300 Subject: SL-20343 Close material live editor if editor floater closes Closing tools floater disabled selection, material editor can't work without that --- indra/newview/llfloatertools.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index b6acba6558..5fb4fb9b07 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -925,6 +925,9 @@ void LLFloaterTools::onClose(bool app_quitting) // hide the advanced object weights floater LLFloaterReg::hideInstance("object_weights"); + // hide gltf material editor + LLFloaterReg::hideInstance("live_material_editor"); + // prepare content for next call mPanelContents->clearContents(); -- cgit v1.2.3 From a4c2eab969b1971389408de5a3927f87d74a6d6d Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Thu, 28 Sep 2023 16:05:37 -0400 Subject: Fix integer overflow when framebuffers are extremely high resolution resulting in INT_MAX texture bias (#393) --- indra/llrender/llimagegl.cpp | 24 ++++++++++++------------ indra/llrender/llimagegl.h | 8 ++++---- indra/newview/llviewertexture.cpp | 5 ++++- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index b77f98d65e..c6fd824c4e 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -58,7 +58,7 @@ U32 wpo2(U32 i); // texture memory accounting (for OS X) static LLMutex sTexMemMutex; -static std::unordered_map sTextureAllocs; +static std::unordered_map sTextureAllocs; static U64 sTextureBytes = 0; // track a texture alloc on the currently bound texture. @@ -67,7 +67,7 @@ static void alloc_tex_image(U32 width, U32 height, U32 pixformat) { U32 texUnit = gGL.getCurrentTexUnitIndex(); U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture(); - S32 size = LLImageGL::dataFormatBytes(pixformat, width, height); + U64 size = LLImageGL::dataFormatBytes(pixformat, width, height); llassert(size >= 0); @@ -296,7 +296,7 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) } //static -S32 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height) +S64 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height) { switch (dataformat) { @@ -312,8 +312,8 @@ S32 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height) default: break; } - S32 bytes ((width*height*dataFormatBits(dataformat)+7)>>3); - S32 aligned = (bytes+3)&~3; + S64 bytes (((S64)width * (S64)height * (S64)dataFormatBits(dataformat)+7)>>3); + S64 aligned = (bytes+3)&~3; return aligned; } @@ -518,7 +518,7 @@ void LLImageGL::init(BOOL usemipmaps) // so that it is obvious by visual inspection if we forgot to // init a field. - mTextureMemory = (S32Bytes)0; + mTextureMemory = S64Bytes(0); mLastBindTime = 0.f; mPickMask = NULL; @@ -1744,7 +1744,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ } - mTextureMemory = (S32Bytes)getMipBytes(mCurrentDiscardLevel); + mTextureMemory = (S64Bytes)getMipBytes(mCurrentDiscardLevel); mTexelsInGLTexture = getWidth() * getHeight(); // mark this as bound at this point, so we don't throw it out immediately @@ -1938,9 +1938,9 @@ void LLImageGL::destroyGLTexture() if (mTexName != 0) { - if(mTextureMemory != S32Bytes(0)) + if(mTextureMemory != S64Bytes(0)) { - mTextureMemory = (S32Bytes)0; + mTextureMemory = (S64Bytes)0; } LLImageGL::deleteTextures(1, &mTexName); @@ -2036,7 +2036,7 @@ S32 LLImageGL::getWidth(S32 discard_level) const return width; } -S32 LLImageGL::getBytes(S32 discard_level) const +S64 LLImageGL::getBytes(S32 discard_level) const { if (discard_level < 0) { @@ -2049,7 +2049,7 @@ S32 LLImageGL::getBytes(S32 discard_level) const return dataFormatBytes(mFormatPrimary, w, h); } -S32 LLImageGL::getMipBytes(S32 discard_level) const +S64 LLImageGL::getMipBytes(S32 discard_level) const { if (discard_level < 0) { @@ -2057,7 +2057,7 @@ S32 LLImageGL::getMipBytes(S32 discard_level) const } S32 w = mWidth>>discard_level; S32 h = mHeight>>discard_level; - S32 res = dataFormatBytes(mFormatPrimary, w, h); + S64 res = dataFormatBytes(mFormatPrimary, w, h); if (mUseMipMaps) { while (w > 1 && h > 1) diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 243aeaea25..a9a6b93cb3 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -65,7 +65,7 @@ public: // Size calculation static S32 dataFormatBits(S32 dataformat); - static S32 dataFormatBytes(S32 dataformat, S32 width, S32 height); + static S64 dataFormatBytes(S32 dataformat, S32 width, S32 height); static S32 dataFormatComponents(S32 dataformat); BOOL updateBindStats() const ; @@ -145,8 +145,8 @@ public: S32 getWidth(S32 discard_level = -1) const; S32 getHeight(S32 discard_level = -1) const; U8 getComponents() const { return mComponents; } - S32 getBytes(S32 discard_level = -1) const; - S32 getMipBytes(S32 discard_level = -1) const; + S64 getBytes(S32 discard_level = -1) const; + S64 getMipBytes(S32 discard_level = -1) const; BOOL getBoundRecently() const; BOOL isJustBound() const; BOOL getHasExplicitFormat() const { return mHasExplicitFormat; } @@ -208,7 +208,7 @@ public: public: // Various GL/Rendering options - S32Bytes mTextureMemory; + S64Bytes mTextureMemory; mutable F32 mLastBindTime; // last time this was bound, by discard level private: diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9fc092d4b9..9336d99555 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -534,9 +534,12 @@ void LLViewerTexture::updateClass() static LLCachedControl max_vram_budget(gSavedSettings, "RenderMaxVRAMBudget", 0); + F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 512.0; + F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 512.0; + // get an estimate of how much video memory we're using // NOTE: our metrics miss about half the vram we use, so this biases high but turns out to typically be within 5% of the real number - F32 used = (LLImageGL::getTextureBytesAllocated() + LLVertexBuffer::getBytesAllocated()) / 1024 / 512; + F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc); F32 budget = max_vram_budget == 0 ? gGLManager.mVRAM : max_vram_budget; -- cgit v1.2.3 From a95ad7aac7248c5b81e5d9dd9e606b5ecb61e301 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 28 Sep 2023 23:35:09 +0300 Subject: SL-20337 Add tooltips for HDR Scale and Reflection Probe Ambience environment sliders --- indra/newview/llfloaterenvironmentadjust.cpp | 2 ++ indra/newview/llpaneleditsky.cpp | 2 ++ indra/newview/skins/default/xui/en/floater_adjust_environment.xml | 2 ++ indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 18be4fffda..f3133ecb37 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -495,10 +495,12 @@ void LLFloaterEnvironmentAdjust::updateGammaLabel() if (ambiance != 0.f) { childSetValue("scene_gamma_label", getString("hdr_string")); + getChild(FIELD_SKY_SCENE_GAMMA)->setToolTip(getString("hdr_tooltip")); } else { childSetValue("scene_gamma_label", getString("brightness_string")); + getChild(FIELD_SKY_SCENE_GAMMA)->setToolTip(std::string()); } } diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 0a7a4763be..839f25761a 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -342,10 +342,12 @@ void LLPanelSettingsSkyAtmosTab::updateGammaLabel(bool auto_adjust) if (ambiance != 0.f) { childSetValue("scene_gamma_label", getString("hdr_string")); + getChild(FIELD_SKY_SCENE_GAMMA)->setToolTip(getString("hdr_tooltip")); } else { childSetValue("scene_gamma_label", getString("brightness_string")); + getChild(FIELD_SKY_SCENE_GAMMA)->setToolTip(std::string()); } } diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index 518a83f846..91a1dffcb5 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -12,6 +12,7 @@ can_resize="false"> HDR Scale: Brightness: + Intensity of lightning effects such as realistically bright skies and dynamic exposure. 1.0 is the default, 0 is off, values between 0 and 1 are mixing Ambient with HDR. diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml index 2d79bc74ab..da82c95c83 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml @@ -9,6 +9,7 @@ top="0"> HDR Scale: Brightness: + Intensity of lightning effects such as realistically bright skies and dynamic exposure. 1.0 is the default, 0 is off, values between 0 and 1 are mixing Ambient with HDR. -- cgit v1.2.3