From d7dd10b88bc3fda88f6528ecc5936e4889f019f3 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 30 Nov 2017 11:32:22 -0800 Subject: Split for viewer/simhost sync LLSD with simhost. --- indra/llinventory/llsettingswater.cpp | 215 ++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 indra/llinventory/llsettingswater.cpp (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp new file mode 100644 index 0000000000..1b960746d5 --- /dev/null +++ b/indra/llinventory/llsettingswater.cpp @@ -0,0 +1,215 @@ +/** +* @file llsettingswater.h +* @author optional +* @brief A base class for asset based settings groups. +* +* $LicenseInfo:2011&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2017, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llsettingswater.h" +#include +#include +#include "lltrace.h" +#include "llfasttimer.h" +#include "v3colorutil.h" +#include "indra_constants.h" + +//========================================================================= +namespace +{ + LLTrace::BlockTimerStatHandle FTM_BLEND_WATERVALUES("Blending Water Environment"); + LLTrace::BlockTimerStatHandle FTM_UPDATE_WATERVALUES("Update Water Environment"); +} + +//========================================================================= +const std::string LLSettingsWater::SETTING_BLUR_MULTIPILER("blur_multiplier"); +const std::string LLSettingsWater::SETTING_FOG_COLOR("water_fog_color"); +const std::string LLSettingsWater::SETTING_FOG_DENSITY("water_fog_density"); +const std::string LLSettingsWater::SETTING_FOG_MOD("underwater_fog_mod"); +const std::string LLSettingsWater::SETTING_FRESNEL_OFFSET("fresnel_offset"); +const std::string LLSettingsWater::SETTING_FRESNEL_SCALE("fresnel_scale"); +const std::string LLSettingsWater::SETTING_NORMAL_MAP("normal_map"); +const std::string LLSettingsWater::SETTING_NORMAL_SCALE("normal_scale"); +const std::string LLSettingsWater::SETTING_SCALE_ABOVE("scale_above"); +const std::string LLSettingsWater::SETTING_SCALE_BELOW("scale_below"); +const std::string LLSettingsWater::SETTING_WAVE1_DIR("wave1_direction"); +const std::string LLSettingsWater::SETTING_WAVE2_DIR("wave2_direction"); + +const std::string LLSettingsWater::SETTING_LEGACY_BLUR_MULTIPILER("blurMultiplier"); +const std::string LLSettingsWater::SETTING_LEGACY_FOG_COLOR("waterFogColor"); +const std::string LLSettingsWater::SETTING_LEGACY_FOG_DENSITY("waterFogDensity"); +const std::string LLSettingsWater::SETTING_LEGACY_FOG_MOD("underWaterFogMod"); +const std::string LLSettingsWater::SETTING_LEGACY_FRESNEL_OFFSET("fresnelOffset"); +const std::string LLSettingsWater::SETTING_LEGACY_FRESNEL_SCALE("fresnelScale"); +const std::string LLSettingsWater::SETTING_LEGACY_NORMAL_MAP("normalMap"); +const std::string LLSettingsWater::SETTING_LEGACY_NORMAL_SCALE("normScale"); +const std::string LLSettingsWater::SETTING_LEGACY_SCALE_ABOVE("scaleAbove"); +const std::string LLSettingsWater::SETTING_LEGACY_SCALE_BELOW("scaleBelow"); +const std::string LLSettingsWater::SETTING_LEGACY_WAVE1_DIR("wave1Dir"); +const std::string LLSettingsWater::SETTING_LEGACY_WAVE2_DIR("wave2Dir"); + +const LLUUID LLSettingsWater::DEFAULT_WATER_NORMAL_ID(DEFAULT_WATER_NORMAL); + + +//========================================================================= +LLSettingsWater::LLSettingsWater(const LLSD &data) : + LLSettingsBase(data) +{ +} + +LLSettingsWater::LLSettingsWater() : + LLSettingsBase() +{ +} + +//========================================================================= +LLSD LLSettingsWater::defaults() +{ + LLSD dfltsetting; + + // Magic constants copied form defaults.xml + dfltsetting[SETTING_BLUR_MULTIPILER] = LLSD::Real(0.04000f); + dfltsetting[SETTING_FOG_COLOR] = LLColor3(0.0156f, 0.1490f, 0.2509f).getValue(); + dfltsetting[SETTING_FOG_DENSITY] = LLSD::Real(2.0f); + dfltsetting[SETTING_FOG_MOD] = LLSD::Real(0.25f); + dfltsetting[SETTING_FRESNEL_OFFSET] = LLSD::Real(0.5f); + dfltsetting[SETTING_FRESNEL_SCALE] = LLSD::Real(0.3999); + dfltsetting[SETTING_NORMAL_MAP] = LLSD::UUID(DEFAULT_WATER_NORMAL_ID); + dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f, 2.0f, 2.0f).getValue(); + dfltsetting[SETTING_SCALE_ABOVE] = LLSD::Real(0.0299f); + dfltsetting[SETTING_SCALE_BELOW] = LLSD::Real(0.2000f); + dfltsetting[SETTING_WAVE1_DIR] = LLVector2(1.04999f, -0.42000f).getValue(); + dfltsetting[SETTING_WAVE2_DIR] = LLVector2(1.10999f, -1.16000f).getValue(); + + return dfltsetting; +} + +LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) +{ + LLSD newsettings(defaults()); + + if (legacy.has(SETTING_LEGACY_BLUR_MULTIPILER)) + { + newsettings[SETTING_BLUR_MULTIPILER] = LLSD::Real(legacy[SETTING_LEGACY_BLUR_MULTIPILER].asReal()); + } + if (legacy.has(SETTING_LEGACY_FOG_COLOR)) + { + newsettings[SETTING_FOG_COLOR] = LLColor3(legacy[SETTING_LEGACY_FOG_COLOR]).getValue(); + } + if (legacy.has(SETTING_LEGACY_FOG_DENSITY)) + { + newsettings[SETTING_FOG_DENSITY] = LLSD::Real(legacy[SETTING_LEGACY_FOG_DENSITY]); + } + if (legacy.has(SETTING_LEGACY_FOG_MOD)) + { + newsettings[SETTING_FOG_MOD] = LLSD::Real(legacy[SETTING_LEGACY_FOG_MOD].asReal()); + } + if (legacy.has(SETTING_LEGACY_FRESNEL_OFFSET)) + { + newsettings[SETTING_FRESNEL_OFFSET] = LLSD::Real(legacy[SETTING_LEGACY_FRESNEL_OFFSET].asReal()); + } + if (legacy.has(SETTING_LEGACY_FRESNEL_SCALE)) + { + newsettings[SETTING_FRESNEL_SCALE] = LLSD::Real(legacy[SETTING_LEGACY_FRESNEL_SCALE].asReal()); + } + if (legacy.has(SETTING_LEGACY_NORMAL_MAP)) + { + newsettings[SETTING_NORMAL_MAP] = LLSD::UUID(legacy[SETTING_LEGACY_NORMAL_MAP].asUUID()); + } + if (legacy.has(SETTING_LEGACY_NORMAL_SCALE)) + { + newsettings[SETTING_NORMAL_SCALE] = LLVector3(legacy[SETTING_LEGACY_NORMAL_SCALE]).getValue(); + } + if (legacy.has(SETTING_LEGACY_SCALE_ABOVE)) + { + newsettings[SETTING_SCALE_ABOVE] = LLSD::Real(legacy[SETTING_LEGACY_SCALE_ABOVE].asReal()); + } + if (legacy.has(SETTING_LEGACY_SCALE_BELOW)) + { + newsettings[SETTING_SCALE_BELOW] = LLSD::Real(legacy[SETTING_LEGACY_SCALE_BELOW].asReal()); + } + if (legacy.has(SETTING_LEGACY_WAVE1_DIR)) + { + newsettings[SETTING_WAVE1_DIR] = LLVector2(legacy[SETTING_LEGACY_WAVE1_DIR]).getValue(); + } + if (legacy.has(SETTING_LEGACY_WAVE2_DIR)) + { + newsettings[SETTING_WAVE2_DIR] = LLVector2(legacy[SETTING_LEGACY_WAVE2_DIR]).getValue(); + } + + return newsettings; +} + +void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F32 blendf) +{ + LLSettingsWater::ptr_t other = boost::static_pointer_cast(end); + LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); + + replaceSettings(blenddata); +} + +LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const +{ + static validation_list_t validation; + + if (validation.empty()) + { // Note the use of LLSD(LLSDArray()()()...) This is due to an issue with the + // copy constructor for LLSDArray. Directly binding the LLSDArray as + // a parameter without first wrapping it in a pure LLSD object will result + // in deeply nested arrays like this [[[[[[[[[[v1,v2,v3]]]]]]]]]] + + validation.push_back(Validator(SETTING_BLUR_MULTIPILER, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(0.16f))))); + validation.push_back(Validator(SETTING_FOG_COLOR, true, LLSD::TypeArray, + boost::bind(&Validator::verifyVectorMinMax, _1, + LLSD(LLSDArray(0.0f)(0.0f)(0.0f)(1.0f)), + LLSD(LLSDArray(1.0f)(1.0f)(1.0f)(1.0f))))); + validation.push_back(Validator(SETTING_FOG_DENSITY, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(1.0f)(1024.0f))))); + validation.push_back(Validator(SETTING_FOG_MOD, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(1.0f)(1024.0f))))); + validation.push_back(Validator(SETTING_FRESNEL_OFFSET, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + validation.push_back(Validator(SETTING_FRESNEL_SCALE, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + validation.push_back(Validator(SETTING_NORMAL_MAP, true, LLSD::TypeUUID)); + validation.push_back(Validator(SETTING_NORMAL_SCALE, true, LLSD::TypeArray, + boost::bind(&Validator::verifyVectorMinMax, _1, + LLSD(LLSDArray(0.0f)(0.0f)(0.0f)), + LLSD(LLSDArray(10.0f)(10.0f)(10.0f))))); + validation.push_back(Validator(SETTING_SCALE_ABOVE, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + validation.push_back(Validator(SETTING_SCALE_BELOW, true, LLSD::TypeReal, + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + validation.push_back(Validator(SETTING_WAVE1_DIR, true, LLSD::TypeArray, + boost::bind(&Validator::verifyVectorMinMax, _1, + LLSD(LLSDArray(-4.0f)(-4.0f)), + LLSD(LLSDArray(4.0f)(4.0f))))); + validation.push_back(Validator(SETTING_WAVE2_DIR, true, LLSD::TypeArray, + boost::bind(&Validator::verifyVectorMinMax, _1, + LLSD(LLSDArray(-4.0f)(-4.0f)), + LLSD(LLSDArray(4.0f)(4.0f))))); + } + + return validation; +} + -- cgit v1.2.3 From 8211f57205f0008d8ffb9bfcd465ca26d906e19c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 8 Jan 2018 15:10:25 -0800 Subject: MAINT-7699: Deliver new settings to viewer via cap --- indra/llinventory/llsettingswater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 1b960746d5..00f870bbb0 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -159,7 +159,7 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) return newsettings; } -void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F32 blendf) +void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) { LLSettingsWater::ptr_t other = boost::static_pointer_cast(end); LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); -- cgit v1.2.3 From 1b8c2b5ebbe0d42f147730bc9b6528fa8c6796ce Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 23 Jan 2018 08:54:34 -0800 Subject: MAINT-8052: Initial support for new EEP cap --- indra/llinventory/llsettingswater.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 00f870bbb0..67a9cd39cb 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -168,6 +168,11 @@ void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) } LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const +{ + return LLSettingsWater::validationList(); +} + +LLSettingsWater::validation_list_t LLSettingsWater::validationList() { static validation_list_t validation; -- cgit v1.2.3 From 536aeb54a6130f3d1e20405c8f6cbd29201de26d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 23 Jan 2018 17:34:25 -0800 Subject: MAINT-8052: One more step towards parcel environments. --- indra/llinventory/llsettingswater.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 67a9cd39cb..0fe3de44d3 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -100,6 +100,8 @@ LLSD LLSettingsWater::defaults() dfltsetting[SETTING_WAVE1_DIR] = LLVector2(1.04999f, -0.42000f).getValue(); dfltsetting[SETTING_WAVE2_DIR] = LLVector2(1.10999f, -1.16000f).getValue(); + dfltsetting[SETTING_TYPE] = "water"; + return dfltsetting; } -- cgit v1.2.3 From 7838189843ff3b9c800e458b2452943edbc202ea Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 6 Feb 2018 17:27:56 -0800 Subject: boost->std & same level interp --- indra/llinventory/llsettingswater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 0fe3de44d3..a72cbc4136 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -163,7 +163,7 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) { - LLSettingsWater::ptr_t other = boost::static_pointer_cast(end); + LLSettingsWater::ptr_t other = std::static_pointer_cast(end); LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); replaceSettings(blenddata); -- cgit v1.2.3 From 3925e37532476c526375fd76143b2b5e1dcce9b9 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 15 May 2018 17:17:51 -0700 Subject: Fix the blend code to record the amount of the blend and to store what is being blended towards. --- indra/llinventory/llsettingswater.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index a72cbc4136..c6798945a3 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -72,12 +72,14 @@ const LLUUID LLSettingsWater::DEFAULT_WATER_NORMAL_ID(DEFAULT_WATER_NORMAL); //========================================================================= LLSettingsWater::LLSettingsWater(const LLSD &data) : - LLSettingsBase(data) + LLSettingsBase(data), + mNextNormalMapID() { } LLSettingsWater::LLSettingsWater() : - LLSettingsBase() + LLSettingsBase(), + mNextNormalMapID() { } @@ -167,6 +169,8 @@ void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); replaceSettings(blenddata); + setBlendFactor(blendf); + mNextNormalMapID = other->getNormalMapID(); } LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const -- cgit v1.2.3 From 2a613d7363c4e91a7258d4f0ea3971db1569e788 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 1 Jun 2018 16:24:36 -0700 Subject: Rework preset loading and context menu from inventory. --- indra/llinventory/llsettingswater.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index c6798945a3..aa1f0f1935 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -69,6 +69,9 @@ const std::string LLSettingsWater::SETTING_LEGACY_WAVE2_DIR("wave2Dir"); const LLUUID LLSettingsWater::DEFAULT_WATER_NORMAL_ID(DEFAULT_WATER_NORMAL); +// *LAPRAS* Change when Agni +const LLUUID LLSettingsWater::DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); + //========================================================================= LLSettingsWater::LLSettingsWater(const LLSD &data) : -- cgit v1.2.3 From 7136956b90614bbd236be0e30231781c04346220 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 2 Jun 2018 23:28:48 +0100 Subject: Use more typedefs to simplify sync between viewer and sim env settings code. --- indra/llinventory/llsettingswater.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index aa1f0f1935..03e174b454 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -67,11 +67,8 @@ const std::string LLSettingsWater::SETTING_LEGACY_SCALE_BELOW("scaleBelow"); const std::string LLSettingsWater::SETTING_LEGACY_WAVE1_DIR("wave1Dir"); const std::string LLSettingsWater::SETTING_LEGACY_WAVE2_DIR("wave2Dir"); -const LLUUID LLSettingsWater::DEFAULT_WATER_NORMAL_ID(DEFAULT_WATER_NORMAL); - // *LAPRAS* Change when Agni -const LLUUID LLSettingsWater::DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); - +static const LLUUID DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); //========================================================================= LLSettingsWater::LLSettingsWater(const LLSD &data) : @@ -98,7 +95,7 @@ LLSD LLSettingsWater::defaults() dfltsetting[SETTING_FOG_MOD] = LLSD::Real(0.25f); dfltsetting[SETTING_FRESNEL_OFFSET] = LLSD::Real(0.5f); dfltsetting[SETTING_FRESNEL_SCALE] = LLSD::Real(0.3999); - dfltsetting[SETTING_NORMAL_MAP] = LLSD::UUID(DEFAULT_WATER_NORMAL_ID); + dfltsetting[SETTING_NORMAL_MAP] = LLSD::UUID(DEFAULT_WATER_NORMAL); dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f, 2.0f, 2.0f).getValue(); dfltsetting[SETTING_SCALE_ABOVE] = LLSD::Real(0.0299f); dfltsetting[SETTING_SCALE_BELOW] = LLSD::Real(0.2000f); @@ -168,7 +165,7 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) { - LLSettingsWater::ptr_t other = std::static_pointer_cast(end); + LLSettingsWater::ptr_t other((LLSettingsWater*)end.get()); LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); replaceSettings(blenddata); @@ -227,3 +224,13 @@ LLSettingsWater::validation_list_t LLSettingsWater::validationList() return validation; } +LLUUID LLSettingsWater::GetDefaultAssetId() +{ + return DEFAULT_ASSET_ID; +} + +LLUUID LLSettingsWater::GetDefaultWaterNormalAssetId() +{ + return DEFAULT_WATER_NORMAL; +} + -- cgit v1.2.3 From cd8f0da2d187df69a99a665ea11faaa4e13b7a12 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 4 Jun 2018 23:12:21 +0100 Subject: Fix use of new typedefs in inventory settings code in llenvironment. --- indra/llinventory/llsettingswater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 03e174b454..ba147baed7 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -165,7 +165,7 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) { - LLSettingsWater::ptr_t other((LLSettingsWater*)end.get()); + LLSettingsWater::ptr_t other = PTR_NAMESPACE::static_pointer_cast(end); LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); replaceSettings(blenddata); -- cgit v1.2.3 From 34865c4bb5cd12219606f44748159fe7cbeea264 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Jun 2018 00:51:39 +0100 Subject: Mods to hook up water settings to water normals for rendering with support for current to next blending. Modify LLSettingsFoo::buildDefaultFoo to use a static and avoid re-validation of default sky/water/daycycle settings. Remove all references to gSun/MoonTextureId globals (they should come from sky settings now). --- indra/llinventory/llsettingswater.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index ba147baed7..16281e23cc 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -47,6 +47,7 @@ const std::string LLSettingsWater::SETTING_FOG_DENSITY("water_fog_density"); const std::string LLSettingsWater::SETTING_FOG_MOD("underwater_fog_mod"); const std::string LLSettingsWater::SETTING_FRESNEL_OFFSET("fresnel_offset"); const std::string LLSettingsWater::SETTING_FRESNEL_SCALE("fresnel_scale"); +const std::string LLSettingsWater::SETTING_TRANSPARENT_TEXTURE("transparent_texture"); const std::string LLSettingsWater::SETTING_NORMAL_MAP("normal_map"); const std::string LLSettingsWater::SETTING_NORMAL_SCALE("normal_scale"); const std::string LLSettingsWater::SETTING_SCALE_ABOVE("scale_above"); @@ -69,6 +70,8 @@ const std::string LLSettingsWater::SETTING_LEGACY_WAVE2_DIR("wave2Dir"); // *LAPRAS* Change when Agni static const LLUUID DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); +static const LLUUID DEFAULT_TRANSPARENT_WATER_TEXTURE("2bfd3884-7e27-69b9-ba3a-3e673f680004"); +static const LLUUID DEFAULT_OPAQUE_WATER_TEXTURE("43c32285-d658-1793-c123-bf86315de055"); //========================================================================= LLSettingsWater::LLSettingsWater(const LLSD &data) : @@ -95,7 +98,8 @@ LLSD LLSettingsWater::defaults() dfltsetting[SETTING_FOG_MOD] = LLSD::Real(0.25f); dfltsetting[SETTING_FRESNEL_OFFSET] = LLSD::Real(0.5f); dfltsetting[SETTING_FRESNEL_SCALE] = LLSD::Real(0.3999); - dfltsetting[SETTING_NORMAL_MAP] = LLSD::UUID(DEFAULT_WATER_NORMAL); + dfltsetting[SETTING_TRANSPARENT_TEXTURE] = GetDefaultTransparentTextureAssetId(); + dfltsetting[SETTING_NORMAL_MAP] = GetDefaultWaterNormalAssetId(); dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f, 2.0f, 2.0f).getValue(); dfltsetting[SETTING_SCALE_ABOVE] = LLSD::Real(0.0299f); dfltsetting[SETTING_SCALE_BELOW] = LLSD::Real(0.2000f); @@ -171,6 +175,7 @@ void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) replaceSettings(blenddata); setBlendFactor(blendf); mNextNormalMapID = other->getNormalMapID(); + mNextTransparentTextureID = other->getTransparentTextureID(); } LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const @@ -234,3 +239,12 @@ LLUUID LLSettingsWater::GetDefaultWaterNormalAssetId() return DEFAULT_WATER_NORMAL; } +LLUUID LLSettingsWater::GetDefaultTransparentTextureAssetId() +{ + return DEFAULT_TRANSPARENT_WATER_TEXTURE; +} + +LLUUID LLSettingsWater::GetDefaultOpaqueTextureAssetId() +{ + return DEFAULT_OPAQUE_WATER_TEXTURE; +} -- cgit v1.2.3 From 66d78ce1c73d5da3bc5bc39fe0196a9f82040105 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 15 Jun 2018 21:15:02 +0100 Subject: Make water and sky defaults take a position value to allow for default daycycle w/ multiple frames. Make default daycycle add 8 frames at 0, 0.125, 0.25 etc Merge over server-side bugfixes. Eliminate extraneous dirty bits in sky settings. --- indra/llinventory/llsettingswater.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 16281e23cc..a1e4929055 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -87,10 +87,13 @@ LLSettingsWater::LLSettingsWater() : } //========================================================================= -LLSD LLSettingsWater::defaults() +LLSD LLSettingsWater::defaults(const LLSettingsBase::TrackPosition& position) { LLSD dfltsetting; + // give the normal scale offset some variability over track time... + F32 normal_scale_offset = (position * 0.5f) - 0.25f; + // Magic constants copied form defaults.xml dfltsetting[SETTING_BLUR_MULTIPILER] = LLSD::Real(0.04000f); dfltsetting[SETTING_FOG_COLOR] = LLColor3(0.0156f, 0.1490f, 0.2509f).getValue(); @@ -100,7 +103,7 @@ LLSD LLSettingsWater::defaults() dfltsetting[SETTING_FRESNEL_SCALE] = LLSD::Real(0.3999); dfltsetting[SETTING_TRANSPARENT_TEXTURE] = GetDefaultTransparentTextureAssetId(); dfltsetting[SETTING_NORMAL_MAP] = GetDefaultWaterNormalAssetId(); - dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f, 2.0f, 2.0f).getValue(); + dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f + normal_scale_offset, 2.0f + normal_scale_offset, 2.0f + normal_scale_offset).getValue(); dfltsetting[SETTING_SCALE_ABOVE] = LLSD::Real(0.0299f); dfltsetting[SETTING_SCALE_BELOW] = LLSD::Real(0.2000f); dfltsetting[SETTING_WAVE1_DIR] = LLVector2(1.04999f, -0.42000f).getValue(); -- cgit v1.2.3 From 91121d113d25af570ec64564dd10c21f0d5fcb69 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 21 Jun 2018 18:37:00 +0100 Subject: Merge server side bugfixes over. --- indra/llinventory/llsettingswater.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index a1e4929055..8eb65331ad 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -173,12 +173,19 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) { LLSettingsWater::ptr_t other = PTR_NAMESPACE::static_pointer_cast(end); - LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); - - replaceSettings(blenddata); + if (other) + { + LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); + replaceSettings(blenddata); + mNextNormalMapID = other->getNormalMapID(); + mNextTransparentTextureID = other->getTransparentTextureID(); + } + else + { + LL_WARNS("SETTINGS") << "Cound not cast end settings to water. No blend performed." << LL_ENDL; + } setBlendFactor(blendf); mNextNormalMapID = other->getNormalMapID(); - mNextTransparentTextureID = other->getTransparentTextureID(); } LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const -- cgit v1.2.3 From a02b3500b9979c10336eb13674279b3c07367445 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 22 Jun 2018 00:41:19 +0100 Subject: Make LLSettingsFoo::defaults() funcs only calculate the invariant values once (use static trick ala the validations). Fix conversion of legacy settings w/ non-zero east angles to account for those values being CW radian angles. --- indra/llinventory/llsettingswater.cpp | 39 +++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 8eb65331ad..3e0c6dcb82 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -89,27 +89,30 @@ LLSettingsWater::LLSettingsWater() : //========================================================================= LLSD LLSettingsWater::defaults(const LLSettingsBase::TrackPosition& position) { - LLSD dfltsetting; + static LLSD dfltsetting; - // give the normal scale offset some variability over track time... - F32 normal_scale_offset = (position * 0.5f) - 0.25f; + if (dfltsetting.size() == 0) + { + // give the normal scale offset some variability over track time... + F32 normal_scale_offset = (position * 0.5f) - 0.25f; - // Magic constants copied form defaults.xml - dfltsetting[SETTING_BLUR_MULTIPILER] = LLSD::Real(0.04000f); - dfltsetting[SETTING_FOG_COLOR] = LLColor3(0.0156f, 0.1490f, 0.2509f).getValue(); - dfltsetting[SETTING_FOG_DENSITY] = LLSD::Real(2.0f); - dfltsetting[SETTING_FOG_MOD] = LLSD::Real(0.25f); - dfltsetting[SETTING_FRESNEL_OFFSET] = LLSD::Real(0.5f); - dfltsetting[SETTING_FRESNEL_SCALE] = LLSD::Real(0.3999); - dfltsetting[SETTING_TRANSPARENT_TEXTURE] = GetDefaultTransparentTextureAssetId(); - dfltsetting[SETTING_NORMAL_MAP] = GetDefaultWaterNormalAssetId(); - dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f + normal_scale_offset, 2.0f + normal_scale_offset, 2.0f + normal_scale_offset).getValue(); - dfltsetting[SETTING_SCALE_ABOVE] = LLSD::Real(0.0299f); - dfltsetting[SETTING_SCALE_BELOW] = LLSD::Real(0.2000f); - dfltsetting[SETTING_WAVE1_DIR] = LLVector2(1.04999f, -0.42000f).getValue(); - dfltsetting[SETTING_WAVE2_DIR] = LLVector2(1.10999f, -1.16000f).getValue(); + // Magic constants copied form defaults.xml + dfltsetting[SETTING_BLUR_MULTIPILER] = LLSD::Real(0.04000f); + dfltsetting[SETTING_FOG_COLOR] = LLColor3(0.0156f, 0.1490f, 0.2509f).getValue(); + dfltsetting[SETTING_FOG_DENSITY] = LLSD::Real(2.0f); + dfltsetting[SETTING_FOG_MOD] = LLSD::Real(0.25f); + dfltsetting[SETTING_FRESNEL_OFFSET] = LLSD::Real(0.5f); + dfltsetting[SETTING_FRESNEL_SCALE] = LLSD::Real(0.3999); + dfltsetting[SETTING_TRANSPARENT_TEXTURE] = GetDefaultTransparentTextureAssetId(); + dfltsetting[SETTING_NORMAL_MAP] = GetDefaultWaterNormalAssetId(); + dfltsetting[SETTING_NORMAL_SCALE] = LLVector3(2.0f + normal_scale_offset, 2.0f + normal_scale_offset, 2.0f + normal_scale_offset).getValue(); + dfltsetting[SETTING_SCALE_ABOVE] = LLSD::Real(0.0299f); + dfltsetting[SETTING_SCALE_BELOW] = LLSD::Real(0.2000f); + dfltsetting[SETTING_WAVE1_DIR] = LLVector2(1.04999f, -0.42000f).getValue(); + dfltsetting[SETTING_WAVE2_DIR] = LLVector2(1.10999f, -1.16000f).getValue(); - dfltsetting[SETTING_TYPE] = "water"; + dfltsetting[SETTING_TYPE] = "water"; + } return dfltsetting; } -- cgit v1.2.3 From 939174416453a46a4a415f37ae642e5508c05787 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 16 Jul 2018 16:49:49 -0700 Subject: Add default and wellknown asset ids. --- indra/llinventory/llsettingswater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 3e0c6dcb82..f0d63bf033 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -68,8 +68,8 @@ const std::string LLSettingsWater::SETTING_LEGACY_SCALE_BELOW("scaleBelow"); const std::string LLSettingsWater::SETTING_LEGACY_WAVE1_DIR("wave1Dir"); const std::string LLSettingsWater::SETTING_LEGACY_WAVE2_DIR("wave2Dir"); -// *LAPRAS* Change when Agni -static const LLUUID DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); +const LLUUID LLSettingsWater::DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); + static const LLUUID DEFAULT_TRANSPARENT_WATER_TEXTURE("2bfd3884-7e27-69b9-ba3a-3e673f680004"); static const LLUUID DEFAULT_OPAQUE_WATER_TEXTURE("43c32285-d658-1793-c123-bf86315de055"); -- cgit v1.2.3 From 94c24b8713b72b6ce52637644ff18b234a3a400a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 23 Aug 2018 20:14:15 +0300 Subject: MAINT-8944 Fix frame transition's images --- indra/llinventory/llsettingswater.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index f0d63bf033..652e211ac4 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -185,10 +185,16 @@ void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) } else { - LL_WARNS("SETTINGS") << "Cound not cast end settings to water. No blend performed." << LL_ENDL; + LL_WARNS("SETTINGS") << "Could not cast end settings to water. No blend performed." << LL_ENDL; } setBlendFactor(blendf); - mNextNormalMapID = other->getNormalMapID(); +} + +void LLSettingsWater::replaceSettings(LLSD settings) +{ + LLSettingsBase::replaceSettings(settings); + mNextNormalMapID.setNull(); + mNextTransparentTextureID.setNull(); } LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const -- cgit v1.2.3 From ed2e333a544acc467df0f1d97b4fc5d2fd72b3b2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 24 Sep 2018 17:00:01 -0700 Subject: MAINT-9734: Change limits on settings values. --- indra/llinventory/llsettingswater.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 652e211ac4..33f824028b 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -213,7 +213,7 @@ LLSettingsWater::validation_list_t LLSettingsWater::validationList() // in deeply nested arrays like this [[[[[[[[[[v1,v2,v3]]]]]]]]]] validation.push_back(Validator(SETTING_BLUR_MULTIPILER, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(0.16f))))); + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(-0.5f)(0.5f))))); validation.push_back(Validator(SETTING_FOG_COLOR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, _1, LLSD(LLSDArray(0.0f)(0.0f)(0.0f)(1.0f)), @@ -232,17 +232,17 @@ LLSettingsWater::validation_list_t LLSettingsWater::validationList() LLSD(LLSDArray(0.0f)(0.0f)(0.0f)), LLSD(LLSDArray(10.0f)(10.0f)(10.0f))))); validation.push_back(Validator(SETTING_SCALE_ABOVE, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(3.0f))))); validation.push_back(Validator(SETTING_SCALE_BELOW, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(3.0f))))); validation.push_back(Validator(SETTING_WAVE1_DIR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, _1, - LLSD(LLSDArray(-4.0f)(-4.0f)), - LLSD(LLSDArray(4.0f)(4.0f))))); + LLSD(LLSDArray(-20.0f)(-20.0f)), + LLSD(LLSDArray(20.0f)(20.0f))))); validation.push_back(Validator(SETTING_WAVE2_DIR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, _1, - LLSD(LLSDArray(-4.0f)(-4.0f)), - LLSD(LLSDArray(4.0f)(4.0f))))); + LLSD(LLSDArray(-20.0f)(-20.0f)), + LLSD(LLSDArray(20.0f)(20.0f))))); } return validation; -- cgit v1.2.3 From 79d33f9d19a0c6e5ed34ffbd01a31cb2625e1ecc Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 10 Oct 2018 18:44:03 +0100 Subject: Fix names of WATER_BLUR_MULTIPILER. Give wave direction uniforms more meaningful names in shaders. Add comments on glow size/focus conversions for clarity. --- indra/llinventory/llsettingswater.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 33f824028b..61eb3d6fc0 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -41,7 +41,7 @@ namespace } //========================================================================= -const std::string LLSettingsWater::SETTING_BLUR_MULTIPILER("blur_multiplier"); +const std::string LLSettingsWater::SETTING_BLUR_MULTIPLIER("blur_multiplier"); const std::string LLSettingsWater::SETTING_FOG_COLOR("water_fog_color"); const std::string LLSettingsWater::SETTING_FOG_DENSITY("water_fog_density"); const std::string LLSettingsWater::SETTING_FOG_MOD("underwater_fog_mod"); @@ -55,7 +55,7 @@ const std::string LLSettingsWater::SETTING_SCALE_BELOW("scale_below"); const std::string LLSettingsWater::SETTING_WAVE1_DIR("wave1_direction"); const std::string LLSettingsWater::SETTING_WAVE2_DIR("wave2_direction"); -const std::string LLSettingsWater::SETTING_LEGACY_BLUR_MULTIPILER("blurMultiplier"); +const std::string LLSettingsWater::SETTING_LEGACY_BLUR_MULTIPLIER("blurMultiplier"); const std::string LLSettingsWater::SETTING_LEGACY_FOG_COLOR("waterFogColor"); const std::string LLSettingsWater::SETTING_LEGACY_FOG_DENSITY("waterFogDensity"); const std::string LLSettingsWater::SETTING_LEGACY_FOG_MOD("underWaterFogMod"); @@ -97,7 +97,7 @@ LLSD LLSettingsWater::defaults(const LLSettingsBase::TrackPosition& position) F32 normal_scale_offset = (position * 0.5f) - 0.25f; // Magic constants copied form defaults.xml - dfltsetting[SETTING_BLUR_MULTIPILER] = LLSD::Real(0.04000f); + dfltsetting[SETTING_BLUR_MULTIPLIER] = LLSD::Real(0.04000f); dfltsetting[SETTING_FOG_COLOR] = LLColor3(0.0156f, 0.1490f, 0.2509f).getValue(); dfltsetting[SETTING_FOG_DENSITY] = LLSD::Real(2.0f); dfltsetting[SETTING_FOG_MOD] = LLSD::Real(0.25f); @@ -121,9 +121,9 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) { LLSD newsettings(defaults()); - if (legacy.has(SETTING_LEGACY_BLUR_MULTIPILER)) + if (legacy.has(SETTING_LEGACY_BLUR_MULTIPLIER)) { - newsettings[SETTING_BLUR_MULTIPILER] = LLSD::Real(legacy[SETTING_LEGACY_BLUR_MULTIPILER].asReal()); + newsettings[SETTING_BLUR_MULTIPLIER] = LLSD::Real(legacy[SETTING_LEGACY_BLUR_MULTIPLIER].asReal()); } if (legacy.has(SETTING_LEGACY_FOG_COLOR)) { @@ -212,14 +212,14 @@ LLSettingsWater::validation_list_t LLSettingsWater::validationList() // a parameter without first wrapping it in a pure LLSD object will result // in deeply nested arrays like this [[[[[[[[[[v1,v2,v3]]]]]]]]]] - validation.push_back(Validator(SETTING_BLUR_MULTIPILER, true, LLSD::TypeReal, + validation.push_back(Validator(SETTING_BLUR_MULTIPLIER, true, LLSD::TypeReal, boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(-0.5f)(0.5f))))); validation.push_back(Validator(SETTING_FOG_COLOR, true, LLSD::TypeArray, boost::bind(&Validator::verifyVectorMinMax, _1, LLSD(LLSDArray(0.0f)(0.0f)(0.0f)(1.0f)), LLSD(LLSDArray(1.0f)(1.0f)(1.0f)(1.0f))))); validation.push_back(Validator(SETTING_FOG_DENSITY, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(1.0f)(1024.0f))))); + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(-10.0f)(10.0f))))); validation.push_back(Validator(SETTING_FOG_MOD, true, LLSD::TypeReal, boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(1.0f)(1024.0f))))); validation.push_back(Validator(SETTING_FRESNEL_OFFSET, true, LLSD::TypeReal, -- cgit v1.2.3 From 6cdcc7fe2edcb6c001f2dabf48c87e00d907a4db Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 17 Oct 2018 12:16:24 -0700 Subject: SL-9889: New reconverted default assets --- indra/llinventory/llsettingswater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 61eb3d6fc0..87744453ed 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -68,7 +68,7 @@ const std::string LLSettingsWater::SETTING_LEGACY_SCALE_BELOW("scaleBelow"); const std::string LLSettingsWater::SETTING_LEGACY_WAVE1_DIR("wave1Dir"); const std::string LLSettingsWater::SETTING_LEGACY_WAVE2_DIR("wave2Dir"); -const LLUUID LLSettingsWater::DEFAULT_ASSET_ID("ce4cfe94-700a-292c-7c22-a2d9201bd661"); +const LLUUID LLSettingsWater::DEFAULT_ASSET_ID("59d1a851-47e7-0e5f-1ed7-6b715154f41a"); static const LLUUID DEFAULT_TRANSPARENT_WATER_TEXTURE("2bfd3884-7e27-69b9-ba3a-3e673f680004"); static const LLUUID DEFAULT_OPAQUE_WATER_TEXTURE("43c32285-d658-1793-c123-bf86315de055"); -- cgit v1.2.3 From 659d14504f6ab4ad283efe4ecd950a4483e1498f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 29 Oct 2018 18:18:20 +0200 Subject: SL-1476 EEP Better shader resets and transitions --- indra/llinventory/llsettingswater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 87744453ed..7cfff954a0 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -178,7 +178,7 @@ void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf) LLSettingsWater::ptr_t other = PTR_NAMESPACE::static_pointer_cast(end); if (other) { - LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); + LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, other->getParameterMap(), blendf); replaceSettings(blenddata); mNextNormalMapID = other->getNormalMapID(); mNextTransparentTextureID = other->getTransparentTextureID(); -- cgit v1.2.3 From 70ac8d9fa7049891ed1b65f68f112127dfb5f5f7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 12 Dec 2018 14:07:23 -0800 Subject: SL-10238: Viewer spport for push notifications from the simulator contaiting partial groups of settings. Blend these settings into the current environment. --- indra/llinventory/llsettingswater.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 7cfff954a0..1780948f0a 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -197,6 +197,14 @@ void LLSettingsWater::replaceSettings(LLSD settings) mNextTransparentTextureID.setNull(); } +void LLSettingsWater::replaceWithWater(LLSettingsWater::ptr_t other) +{ + replaceWith(other); + + mNextNormalMapID = other->mNextNormalMapID; + mNextTransparentTextureID = other->mNextTransparentTextureID; +} + LLSettingsWater::validation_list_t LLSettingsWater::getValidationList() const { return LLSettingsWater::validationList(); -- cgit v1.2.3 From c7e02b0835cbb50777c677f618c4a957e69fabee Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 30 Jan 2019 14:36:46 -0800 Subject: SL-9925: Viewer now shows an error message if import from legacy windlight fails. --- indra/llinventory/llsettingswater.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 1780948f0a..d160a4ae0e 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -119,57 +119,72 @@ LLSD LLSettingsWater::defaults(const LLSettingsBase::TrackPosition& position) LLSD LLSettingsWater::translateLegacySettings(LLSD legacy) { + bool converted_something(false); LLSD newsettings(defaults()); if (legacy.has(SETTING_LEGACY_BLUR_MULTIPLIER)) { newsettings[SETTING_BLUR_MULTIPLIER] = LLSD::Real(legacy[SETTING_LEGACY_BLUR_MULTIPLIER].asReal()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_FOG_COLOR)) { newsettings[SETTING_FOG_COLOR] = LLColor3(legacy[SETTING_LEGACY_FOG_COLOR]).getValue(); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_FOG_DENSITY)) { newsettings[SETTING_FOG_DENSITY] = LLSD::Real(legacy[SETTING_LEGACY_FOG_DENSITY]); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_FOG_MOD)) { newsettings[SETTING_FOG_MOD] = LLSD::Real(legacy[SETTING_LEGACY_FOG_MOD].asReal()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_FRESNEL_OFFSET)) { newsettings[SETTING_FRESNEL_OFFSET] = LLSD::Real(legacy[SETTING_LEGACY_FRESNEL_OFFSET].asReal()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_FRESNEL_SCALE)) { newsettings[SETTING_FRESNEL_SCALE] = LLSD::Real(legacy[SETTING_LEGACY_FRESNEL_SCALE].asReal()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_NORMAL_MAP)) { newsettings[SETTING_NORMAL_MAP] = LLSD::UUID(legacy[SETTING_LEGACY_NORMAL_MAP].asUUID()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_NORMAL_SCALE)) { newsettings[SETTING_NORMAL_SCALE] = LLVector3(legacy[SETTING_LEGACY_NORMAL_SCALE]).getValue(); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_SCALE_ABOVE)) { newsettings[SETTING_SCALE_ABOVE] = LLSD::Real(legacy[SETTING_LEGACY_SCALE_ABOVE].asReal()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_SCALE_BELOW)) { newsettings[SETTING_SCALE_BELOW] = LLSD::Real(legacy[SETTING_LEGACY_SCALE_BELOW].asReal()); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_WAVE1_DIR)) { newsettings[SETTING_WAVE1_DIR] = LLVector2(legacy[SETTING_LEGACY_WAVE1_DIR]).getValue(); + converted_something |= true; } if (legacy.has(SETTING_LEGACY_WAVE2_DIR)) { newsettings[SETTING_WAVE2_DIR] = LLVector2(legacy[SETTING_LEGACY_WAVE2_DIR]).getValue(); + converted_something |= true; } + if (!converted_something) + return LLSD(); return newsettings; } -- cgit v1.2.3 From 65927e0a76aaf8ff4dc268acdb12007265ff3a14 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Feb 2019 13:09:14 -0800 Subject: SL-10181, SL-10546 Fix distortion map rendering in deferred mode not including underwater fog effects. Fix distortion map rendering not including post-deferred content at all. Fix distortion map rendering not including anything but sky when camera is underwater. Update sun_up_factor/sunmoon_glow_factor uniforms even when sun disc isn't in use. --- indra/llinventory/llsettingswater.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingswater.cpp') diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index d160a4ae0e..0eb95dcd89 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -244,7 +244,7 @@ LLSettingsWater::validation_list_t LLSettingsWater::validationList() validation.push_back(Validator(SETTING_FOG_DENSITY, true, LLSD::TypeReal, boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(-10.0f)(10.0f))))); validation.push_back(Validator(SETTING_FOG_MOD, true, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(1.0f)(1024.0f))))); + boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(20.0f))))); validation.push_back(Validator(SETTING_FRESNEL_OFFSET, true, LLSD::TypeReal, boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); validation.push_back(Validator(SETTING_FRESNEL_SCALE, true, LLSD::TypeReal, @@ -290,3 +290,15 @@ LLUUID LLSettingsWater::GetDefaultOpaqueTextureAssetId() { return DEFAULT_OPAQUE_WATER_TEXTURE; } + +F32 LLSettingsWater::getModifiedWaterFogDensity(bool underwater) const +{ + F32 fog_density = getWaterFogDensity(); + F32 underwater_fog_mod = getFogMod(); + if (underwater && underwater_fog_mod > 0.0f) + { + underwater_fog_mod = llclamp(underwater_fog_mod, 0.0f, 10.0f); + fog_density = pow(fog_density, underwater_fog_mod); + } + return fog_density; +} -- cgit v1.2.3