diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp index 977fc748a36c0ccca60b18c143ec2c536d2949f4..52f7bcbd88697f7c0ca02c3cc37d14578ecf9dad 100644 --- a/indra/llprimitive/llgltfmaterial.cpp +++ b/indra/llprimitive/llgltfmaterial.cpp @@ -839,7 +839,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data) } const LLSD& ds = data["ds"]; - if (data.isBoolean()) + if (ds.isBoolean()) { mDoubleSided = ds.asBoolean(); mOverrideDoubleSided = true; diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index c7cbe9b62c0c621a59f2c569d84553e3d1c06d07..eb2e565417850d529bb5ea0fff7c67b647505daf 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1783,7 +1783,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ } - mTextureMemory = S64Bytes(getMipBytes(mCurrentDiscardLevel)); + mTextureMemory = (S64Bytes)getMipBytes(mCurrentDiscardLevel); mTexelsInGLTexture = getWidth() * getHeight(); // mark this as bound at this point, so we don't throw it out immediately diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 45203f48cfb7dba63824349f93079bc55337773e..7bc45ffc46f6454eaa2000e1571264b22f1c9919 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2921,12 +2921,20 @@ void LLEnvironment::DayTransition::animate() setWater(mNextInstance->getWater()); }); + + // pause probe updates and reset reflection maps on sky change + gPipeline.mReflectionMapManager.pause(); + gPipeline.mReflectionMapManager.reset(); + mSky = mStartSky->buildClone(); mBlenderSky = std::make_shared<LLSettingsBlenderTimeDelta>(mSky, mStartSky, mNextInstance->getSky(), mTransitionTime); mBlenderSky->setOnFinished( [this](LLSettingsBlender::ptr_t blender) { mBlenderSky.reset(); + // resume reflection probe updates + gPipeline.mReflectionMapManager.resume(); + if (!mBlenderSky && !mBlenderWater) LLEnvironment::instance().mCurrentEnvironment = mNextInstance; else @@ -3517,12 +3525,19 @@ namespace LLSettingsSky::ptr_t target_sky(start_sky->buildClone()); mInjectedSky->setSource(target_sky); + // clear reflection probes and pause updates during sky change + gPipeline.mReflectionMapManager.pause(); + gPipeline.mReflectionMapManager.reset(); + mBlenderSky = std::make_shared<LLSettingsBlenderTimeDelta>(target_sky, start_sky, psky, transition); mBlenderSky->setOnFinished( [this, psky](LLSettingsBlender::ptr_t blender) { mBlenderSky.reset(); mInjectedSky->setSource(psky); + + // resume updating reflection probes when done animating sky + gPipeline.mReflectionMapManager.resume(); setSky(mInjectedSky); if (!mBlenderWater && (countExperiencesActive() == 0)) { diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 18be4fffda105fa9efdaad71601fabfe83cfcadd..f3133ecb37baf9ca2ebde536b501dfd0e3d0c960 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<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(getString("hdr_tooltip")); } else { childSetValue("scene_gamma_label", getString("brightness_string")); + getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(std::string()); } } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index fab1135106c753d842c824980ab6d194e7aeac2f..002bea5a728d959ed0777da5d4105b3db1d86b94 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1040,6 +1040,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(); diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 9c8a97eed1b52390fbf74795aac8f0766096e765..a94c658f54327dde5dbdf1da035abcc5a40ffa15 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -419,9 +419,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)); @@ -549,12 +546,6 @@ void LLMaterialEditor::draw() { if (mIsOverride) { - bool selection_empty = LLSelectMgr::getInstance()->getSelection()->isEmpty(); - if (selection_empty && mHasSelection) - { - mSelectionNeedsUpdate = true; - } - if (mSelectionNeedsUpdate) { mSelectionNeedsUpdate = false; @@ -1797,22 +1788,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"); @@ -2823,7 +2798,7 @@ class LLRenderMaterialOverrideFunctor : public LLSelectedNodeFunctor // 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 b29db706f819c93a01f3d59582c0471b3f8a4256..1c40fcc348f29c1a8c60cf05f4ff95be09337a80 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/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index ed55ff988abb5c8847962baf6cc32962d5f4c6c8..bfa570c8e37a6e66f6cb8570ba5647c93de26908 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -341,10 +341,12 @@ void LLPanelSettingsSkyAtmosTab::updateGammaLabel(bool auto_adjust) if (ambiance != 0.f) { childSetValue("scene_gamma_label", getString("hdr_string")); + getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(getString("hdr_tooltip")); } else { childSetValue("scene_gamma_label", getString("brightness_string")); + getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(std::string()); } } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 8bb44c863184068d247d6fe9ef9a76488c2279a6..9ea8afb45dd85959a97136189108860fbf98198a 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -501,6 +501,7 @@ void LLPanelFace::draw() if (sMaterialOverrideSelection.update()) { setMaterialOverridesFromSelection(); + LLMaterialEditor::updateLive(); } } @@ -1020,6 +1021,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()) { @@ -1034,7 +1036,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(); @@ -1052,6 +1055,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } selected_te = new_selection; + prev_obj_id = objectp->getID(); } } diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index edf093261c959bce3ebf1793fb1586b9a19e1dcb..d4e1d22f35d722b3db3a253eaa322044b243f691 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -224,11 +224,14 @@ void LLReflectionMapManager::update() continue; } - if (probe != mDefaultProbe && !probe->isRelevant()) - { + if (probe != mDefaultProbe && + (!probe->isRelevant() || mPaused)) + { // skip irrelevant probes (or all non-default probes if paused) continue; } + + LLVector4a d; if (probe != mDefaultProbe) @@ -786,6 +789,16 @@ void LLReflectionMapManager::reset() mReset = true; } +void LLReflectionMapManager::pause() +{ + mPaused = true; +} + +void LLReflectionMapManager::resume() +{ + mPaused = false; +} + void LLReflectionMapManager::shift(const LLVector4a& offset) { for (auto& probe : mProbes) diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 5a3901cae9f29aca4886af3afda31a01bc455da2..b77a33da898b2759598c5452fd31990215b5d4b2 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -84,6 +84,12 @@ class alignas(16) LLReflectionMapManager // reset all state on the next update void reset(); + // pause all updates other than the default probe + void pause(); + + // unpause (see pause) + void resume(); + // called on region crossing to "shift" probes into new coordinate frame void shift(const LLVector4a& offset); @@ -191,5 +197,8 @@ class alignas(16) LLReflectionMapManager // if true, reset all probe render state on the next update (for teleports and sky changes) bool mReset = false; + + // if true, only update the default probe + bool mPaused = false; }; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 2a06f3a670cac7301a06dd809a10ae91a17c651e..8d0cbe01cd4c9170fe02f395528a413ab7fbef11 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -2098,8 +2098,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; } 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 518a83f846a393ffeb6e0b8af59c69948293fbb2..91a1dffcb5facdcb5d2d041447534cdf180b9683 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"> <string name="hdr_string">HDR Scale:</string> <string name="brightness_string">Brightness:</string> + <string name="hdr_tooltip">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.</string> <layout_stack name="outer_stack" width="845" height="275" @@ -263,6 +264,7 @@ min_val="0" max_val="10" name="probe_ambiance" + tool_tip="Intensity of environment based indirect lighting. At zero HDR scale becomes Brightness" top_pad="5" width="185" can_edit_text="true"/> 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 2d79bc74ab8a963f2ac22f5166d694ba6e70de4b..da82c95c8384fbddb98c8df85c734b9dbe98a3c5 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"> <string name="hdr_string">HDR Scale:</string> <string name="brightness_string">Brightness:</string> + <string name="hdr_tooltip">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.</string> <layout_stack name="main_ls" follows="all" @@ -332,6 +333,7 @@ min_val="0" max_val="10" name="probe_ambiance" + tool_tip="Intensity of environment based indirect lighting. At zero HDR scale becomes Brightness" top_delta="20" width="219" can_edit_text="true"/>