From b5a7874ba522089cf942fb9ad6fcd35383f69a88 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 5 Feb 2019 15:30:06 +0200 Subject: SL-10279 Use stored environment instead of region one --- indra/newview/llpanelenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index d20cc096de..2cfd0c8fc9 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -262,7 +262,7 @@ void LLPanelEnvironmentInfo::refresh() updateEditFloater(mCurrentEnvironment, canEdit()); - LLEnvironment::altitude_list_t altitudes = LLEnvironment::instance().getRegionAltitudes(); + LLEnvironment::altitude_list_t altitudes = mCurrentEnvironment->mAltitudes; if (altitudes.size() > 0) { -- cgit v1.2.3 From a19d7c92b51fa0272e1387d916a7fa4cfad61a26 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 5 Feb 2019 22:14:35 +0200 Subject: temp fog --- indra/newview/lldrawpoolwater.cpp | 71 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 23749d7adb..66d8306f97 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -59,6 +59,65 @@ BOOL LLDrawPoolWater::sNeedsReflectionUpdate = TRUE; BOOL LLDrawPoolWater::sNeedsDistortionUpdate = TRUE; F32 LLDrawPoolWater::sWaterFogEnd = 0.f; + +class LLFastLn +{ +public: + LLFastLn() + { + mTable[0] = 0; + for (S32 i = 1; i < 257; i++) + { + mTable[i] = log((F32)i); + } + } + + F32 ln(F32 x) + { + const F32 OO_255 = 0.003921568627450980392156862745098f; + const F32 LN_255 = 5.5412635451584261462455391880218f; + + if (x < OO_255) + { + return log(x); + } + else + if (x < 1) + { + x *= 255.f; + S32 index = llfloor(x); + F32 t = x - index; + F32 low = mTable[index]; + F32 high = mTable[index + 1]; + return low + t * (high - low) - LN_255; + } + else + if (x <= 255) + { + S32 index = llfloor(x); + F32 t = x - index; + F32 low = mTable[index]; + F32 high = mTable[index + 1]; + return low + t * (high - low); + } + else + { + return log(x); + } + } + + F32 pow(F32 x, F32 y) + { + return (F32)LL_FAST_EXP(y * ln(x)); + } + + +private: + F32 mTable[257]; // index 0 is unused +}; + +static LLFastLn gFastLn; + LLDrawPoolWater::LLDrawPoolWater() : LLFacePool(POOL_WATER) { } @@ -536,17 +595,23 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); + F32 density = pwater->getWaterFogDensity(); + F32 density_2 = gFastLn.pow(2.f, density); shader->uniform3fv(LLShaderMgr::WATER_FOGCOLOR, 1, pwater->getWaterFogColor().mV); - shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, pwater->getWaterFogDensity()); + shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, density_2); // bind reflection texture from RenderTarget S32 screentex = shader->enableTexture(LLShaderMgr::WATER_SCREENTEX); gGL.getTexUnit(screentex)->bind(&gPipeline.mWaterDis); if (mShaderLevel == 1) - { + { + density = llclamp(density, 0.f, 10.f); + density /= 10.0f; + density = 1.0f - density; + density *= density * density; LLColor4 fog_color(pwater->getWaterFogColor(), 0.f); - fog_color[3] = pwater->getWaterFogDensity(); + fog_color[3] = density; shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, fog_color.mV); } -- cgit v1.2.3 From ce40f88ecb09c91061f7a18ad2b52dcaa3df7ca3 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 5 Feb 2019 15:09:32 -0800 Subject: Better calculation of time remaining in span for track animator (from SL-10465) --- indra/newview/llenvironment.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index bf8cf4b552..fa583bdc9c 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -170,6 +170,20 @@ namespace return llclamp(position, 0.0f, 1.0f); } + inline LLSettingsBase::BlendFactor convert_time_to_blend_factor(const LLSettingsBase::Seconds& time, const LLSettingsBase::Seconds& len, LLSettingsDay::CycleTrack_t &track) + { + LLSettingsBase::TrackPosition position = convert_time_to_position(time, len); + LLSettingsDay::TrackBound_t bounds(get_bounding_entries(track, position)); + + LLSettingsBase::TrackPosition spanlength(get_wrapping_distance((*bounds.first).first, (*bounds.second).first)); + if (position < (*bounds.first).first) + position += 1.0; + + LLSettingsBase::TrackPosition start = position - (*bounds.first).first; + + return static_cast(start / spanlength); + } + //--------------------------------------------------------------------- class LLTrackBlenderLoopingTime : public LLSettingsBlenderTimeDelta { @@ -186,12 +200,14 @@ namespace // must happen prior to getBoundingEntries call... mTrackNo = selectTrackNumber(trackno); - LLSettingsDay::TrackBound_t initial = getBoundingEntries(getAdjustedNow()); + LLSettingsBase::Seconds now(getAdjustedNow()); + LLSettingsDay::TrackBound_t initial = getBoundingEntries(now); mInitial = (*initial.first).second; mFinal = (*initial.second).second; mBlendSpan = getSpanTime(initial); + initializeTarget(now); setOnFinished([this](const LLSettingsBlender::ptr_t &){ onFinishedSpan(); }); } @@ -248,6 +264,16 @@ namespace return bounds; } + void initializeTarget(LLSettingsBase::Seconds time) + { + LLSettingsBase::BlendFactor blendf(convert_time_to_blend_factor(time, mCycleLength, mDay->getCycleTrack(mTrackNo))); + + blendf = llclamp(blendf, 0.0, 0.999); + setTimeSpent(LLSettingsBase::Seconds(blendf * mBlendSpan)); + + setBlendFactor(blendf); + } + LLSettingsBase::Seconds getAdjustedNow() const { LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch()); -- cgit v1.2.3 From 702946a3b3672e54ad652d184f4eee9b86c07170 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 6 Feb 2019 19:43:02 +0200 Subject: SL-10485 Double-click should check visibility and open folders --- indra/newview/llsettingspicker.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp index e2d6d43ae3..fcc615db6e 100644 --- a/indra/newview/llsettingspicker.cpp +++ b/indra/newview/llsettingspicker.cpp @@ -356,9 +356,9 @@ BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask) S32 inventory_y = y - mInventoryPanel->getRect().mBottom; if (mInventoryPanel->parentPointInView(inventory_x, inventory_y)) { - // make sure item (not folder) is selected + // make sure item is selected and visible LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(mSettingItemID); - if (item_viewp && item_viewp->getIsCurSelection()) + if (item_viewp && item_viewp->getIsCurSelection() && item_viewp->getVisible()) { LLRect target_rect; item_viewp->localRectToOtherView(item_viewp->getLocalRect(), &target_rect, this); @@ -373,10 +373,10 @@ BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask) (*mCommitSignal)(this, res); } closeFloater(); + // hit inside panel on selected item, double click should do nothing + result = TRUE; } } - // hit inside panel on free place or (de)unselected item, double click should do nothing - result = TRUE; } } @@ -392,7 +392,7 @@ BOOL LLFloaterSettingsPicker::handleKeyHere(KEY key, MASK mask) if ((key == KEY_RETURN) && (mask == MASK_NONE)) { LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(mSettingItemID); - if (item_viewp && item_viewp->getIsCurSelection()) + if (item_viewp && item_viewp->getIsCurSelection() && item_viewp->getVisible()) { // Quick-apply if (mCommitSignal) -- cgit v1.2.3 From dfc80120ccb01a011eba1c686e7803bd7d88398d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 6 Feb 2019 19:44:24 +0200 Subject: Backed out changeset: 43f8558c602b --- indra/newview/lldrawpoolwater.cpp | 71 ++------------------------------------- 1 file changed, 3 insertions(+), 68 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 66d8306f97..23749d7adb 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -59,65 +59,6 @@ BOOL LLDrawPoolWater::sNeedsReflectionUpdate = TRUE; BOOL LLDrawPoolWater::sNeedsDistortionUpdate = TRUE; F32 LLDrawPoolWater::sWaterFogEnd = 0.f; - -class LLFastLn -{ -public: - LLFastLn() - { - mTable[0] = 0; - for (S32 i = 1; i < 257; i++) - { - mTable[i] = log((F32)i); - } - } - - F32 ln(F32 x) - { - const F32 OO_255 = 0.003921568627450980392156862745098f; - const F32 LN_255 = 5.5412635451584261462455391880218f; - - if (x < OO_255) - { - return log(x); - } - else - if (x < 1) - { - x *= 255.f; - S32 index = llfloor(x); - F32 t = x - index; - F32 low = mTable[index]; - F32 high = mTable[index + 1]; - return low + t * (high - low) - LN_255; - } - else - if (x <= 255) - { - S32 index = llfloor(x); - F32 t = x - index; - F32 low = mTable[index]; - F32 high = mTable[index + 1]; - return low + t * (high - low); - } - else - { - return log(x); - } - } - - F32 pow(F32 x, F32 y) - { - return (F32)LL_FAST_EXP(y * ln(x)); - } - - -private: - F32 mTable[257]; // index 0 is unused -}; - -static LLFastLn gFastLn; - LLDrawPoolWater::LLDrawPoolWater() : LLFacePool(POOL_WATER) { } @@ -595,23 +536,17 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); - F32 density = pwater->getWaterFogDensity(); - F32 density_2 = gFastLn.pow(2.f, density); shader->uniform3fv(LLShaderMgr::WATER_FOGCOLOR, 1, pwater->getWaterFogColor().mV); - shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, density_2); + shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, pwater->getWaterFogDensity()); // bind reflection texture from RenderTarget S32 screentex = shader->enableTexture(LLShaderMgr::WATER_SCREENTEX); gGL.getTexUnit(screentex)->bind(&gPipeline.mWaterDis); if (mShaderLevel == 1) - { - density = llclamp(density, 0.f, 10.f); - density /= 10.0f; - density = 1.0f - density; - density *= density * density; + { LLColor4 fog_color(pwater->getWaterFogColor(), 0.f); - fog_color[3] = density; + fog_color[3] = pwater->getWaterFogDensity(); shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, fog_color.mV); } -- cgit v1.2.3