From 03da2bc1a1c7674514c967b0e7408258dba25d77 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 2 May 2018 17:07:06 -0700 Subject: Fixed sky editing floater. --- indra/llinventory/llsettingssky.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index d08e2bbd03..1451162744 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -189,6 +189,11 @@ public: return mSettings[SETTING_CLOUD_TEXTUREID].asUUID(); } + void setCloudNoiseTextureId(const LLUUID &id) + { + setValue(SETTING_CLOUD_TEXTUREID, id); + } + LLColor3 getCloudPosDensity1() const { return LLColor3(mSettings[SETTING_CLOUD_POS_DENSITY1]); @@ -300,6 +305,11 @@ public: return mSettings[SETTING_MAX_Y].asReal(); } + void setMaxY(F32 val) + { + setValue(SETTING_MAX_Y, val); + } + LLQuaternion getMoonRotation() const { return LLQuaternion(mSettings[SETTING_MOON_ROTATION]); @@ -324,6 +334,11 @@ public: return mSettings[SETTING_MOON_TEXTUREID].asUUID(); } + void setMoonTextureId(LLUUID id) + { + setValue(SETTING_MOON_TEXTUREID, id); + } + F32 getStarBrightness() const { return mSettings[SETTING_STAR_BRIGHTNESS].asReal(); @@ -368,6 +383,11 @@ public: return mSettings[SETTING_SUN_TEXTUREID].asUUID(); } + void setSunTextureId(LLUUID id) + { + setValue(SETTING_SUN_TEXTUREID, id); + } + // Internal/calculated settings LLVector3 getLightDirection() const { -- cgit v1.2.3 From cef4e29b901c5a8964e53ec3eb6659faeea0059a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 11 May 2018 20:10:08 +0300 Subject: MAINT-8344 Day cycle editor (part 1) --- indra/llinventory/llsettingsdaycycle.cpp | 49 +++++++++++++++++++++++++++++++- indra/llinventory/llsettingsdaycycle.h | 3 ++ 2 files changed, 51 insertions(+), 1 deletion(-) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 70826d1410..3f60430715 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -483,7 +483,7 @@ void LLSettingsDay::updateSettings() //========================================================================= LLSettingsDay::KeyframeList_t LLSettingsDay::getTrackKeyframes(S32 trackno) { - if ((trackno < 1) || (trackno >= TRACK_MAX)) + if ((trackno < 0) || (trackno >= TRACK_MAX)) { LL_WARNS("DAYCYCLE") << "Attempt get track (#" << trackno << ") out of range!" << LL_ENDL; return KeyframeList_t(); @@ -508,6 +508,17 @@ void LLSettingsDay::setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 ke setDirtyFlag(true); } +const LLSettingsWaterPtr_t LLSettingsDay::getWaterAtKeyframe(F32 keyframe) +{ + // todo: better way to identify keyframes? + CycleTrack_t::iterator iter = mDayTracks[TRACK_WATER].find(keyframe); + if (iter != mDayTracks[TRACK_WATER].end()) + { + return std::dynamic_pointer_cast(iter->second); + } + + return LLSettingsWaterPtr_t(NULL); +} void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track) { @@ -521,6 +532,42 @@ void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe setDirtyFlag(true); } +const LLSettingsSkyPtr_t LLSettingsDay::getSkyAtKeyframe(F32 keyframe, S32 track) +{ + if ((track < 1) || (track >= TRACK_MAX)) + { + LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL; + return LLSettingsSkyPtr_t(NULL); + } + + // todo: better way to identify keyframes? + CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe); + if (iter != mDayTracks[track].end()) + { + return std::dynamic_pointer_cast(iter->second); + } + + return LLSettingsSkyPtr_t(NULL); +} + +const LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(F32 keyframe, S32 track) +{ + if ((track < 0) || (track >= TRACK_MAX)) + { + LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL; + return LLSettingsBase::ptr_t(NULL); + } + + // todo: better way to identify keyframes? + CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe); + if (iter != mDayTracks[track].end()) + { + return iter->second; + } + + return LLSettingsSkyPtr_t(NULL); +} + LLSettingsDay::TrackBound_t LLSettingsDay::getBoundingEntries(LLSettingsDay::CycleTrack_t &track, F32 keyframe) { return TrackBound_t(get_wrapping_atbefore(track, keyframe), get_wrapping_atafter(track, keyframe)); diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h index da572572c4..93c275bfb8 100644 --- a/indra/llinventory/llsettingsdaycycle.h +++ b/indra/llinventory/llsettingsdaycycle.h @@ -88,7 +88,10 @@ public: KeyframeList_t getTrackKeyframes(S32 track); void setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 keyframe); + const LLSettingsWaterPtr_t getWaterAtKeyframe(F32 keyframe); void setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track); + const LLSettingsSkyPtr_t getSkyAtKeyframe(F32 keyframe, S32 track); + const LLSettingsBase::ptr_t getSettingsAtKeyframe(F32 keyframe, S32 track); //--------------------------------------------------------------------- void startDayCycle(); -- 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/llsettingsbase.cpp | 11 ++++++++--- indra/llinventory/llsettingsbase.h | 12 ++++++++++++ indra/llinventory/llsettingssky.cpp | 24 +++++++++++++++++++----- indra/llinventory/llsettingssky.h | 35 ++++++++++++++++++++++++++++++++--- indra/llinventory/llsettingswater.cpp | 8 ++++++-- indra/llinventory/llsettingswater.h | 9 ++++++++- 6 files changed, 85 insertions(+), 14 deletions(-) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index abe1a1a04a..f2dfeaf154 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -58,14 +58,16 @@ const F64Seconds LLSettingsBlender::DEFAULT_THRESHOLD(0.01); LLSettingsBase::LLSettingsBase(): mSettings(LLSD::emptyMap()), mDirty(true), - mAssetID() + mAssetID(), + mBlendedFactor(0.0) { } LLSettingsBase::LLSettingsBase(const LLSD setting) : mSettings(setting), mDirty(true), - mAssetID() + mAssetID(), + mBlendedFactor(0.0) { } @@ -224,9 +226,12 @@ LLSD LLSettingsBase::interpolateSDMap(const LLSD &settings, const LLSD &other, F break; + case LLSD::TypeUUID: + newSettings[key_name] = value.asUUID(); + break; + // case LLSD::TypeBoolean: // case LLSD::TypeString: -// case LLSD::TypeUUID: // case LLSD::TypeURI: // case LLSD::TypeBinary: // case LLSD::TypeDate: diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 62a88cde73..2220cca336 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -96,6 +96,7 @@ public: inline void replaceSettings(LLSD settings) { mSettings = settings; + mBlendedFactor = 0.0; setDirtyFlag(true); } @@ -146,6 +147,11 @@ public: setValue(name, value.getValue()); } + inline F64 getBlendFactor() const + { + return mBlendedFactor; + } + // Note this method is marked const but may modify the settings object. // (note the internal const cast). This is so that it may be called without // special consideration from getters. @@ -237,11 +243,17 @@ protected: LLSD cloneSettings() const; + inline void setBlendFactor(F64 blendfactor) + { + mBlendedFactor = blendfactor; + } + private: bool mDirty; LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; + F64 mBlendedFactor; }; diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 7da3a336cc..45c1ca1d7f 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -106,6 +106,10 @@ const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR("exp_s const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM("linear_term"); const std::string LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM("constant_term"); +const LLUUID LLSettingsSky::DEFAULT_SUN_ID("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver +const LLUUID LLSettingsSky::DEFAULT_MOON_ID("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver +const LLUUID LLSettingsSky::DEFAULT_CLOUD_ID("1dc1368f-e8fe-f02d-a08d-9d9f11c1af6b"); + namespace { @@ -310,12 +314,18 @@ bool validateMieLayers(LLSD &value) //========================================================================= LLSettingsSky::LLSettingsSky(const LLSD &data) : - LLSettingsBase(data) + LLSettingsBase(data), + mNextSunTextureId(), + mNextMoonTextureId(), + mNextCloudTextureId() { } LLSettingsSky::LLSettingsSky(): - LLSettingsBase() + LLSettingsBase(), + mNextSunTextureId(), + mNextMoonTextureId(), + mNextCloudTextureId() { } @@ -325,6 +335,10 @@ void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf) LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf); replaceSettings(blenddata); + setBlendFactor(blendf); + mNextSunTextureId = other->getSunTextureId(); + mNextMoonTextureId = other->getMoonTextureId(); + mNextCloudTextureId = other->getCloudNoiseTextureId(); } @@ -557,9 +571,9 @@ LLSD LLSettingsSky::defaults() dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue(); dfltsetting[SETTING_BLOOM_TEXTUREID] = IMG_BLOOM1; - dfltsetting[SETTING_CLOUD_TEXTUREID] = LLUUID::null; - dfltsetting[SETTING_MOON_TEXTUREID] = IMG_MOON; // gMoonTextureID; // These two are returned by the login... wow! - dfltsetting[SETTING_SUN_TEXTUREID] = IMG_SUN; // gSunTextureID; + dfltsetting[SETTING_CLOUD_TEXTUREID] = DEFAULT_CLOUD_ID; + dfltsetting[SETTING_MOON_TEXTUREID] = DEFAULT_MOON_ID; // gMoonTextureID; // These two are returned by the login... wow! + dfltsetting[SETTING_SUN_TEXTUREID] = DEFAULT_SUN_ID; // gSunTextureID; dfltsetting[SETTING_TYPE] = "sky"; diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 1451162744..59a9dc9a43 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -79,6 +79,10 @@ public: static const std::string SETTING_DENSITY_PROFILE_CONSTANT_TERM; static const std::string SETTING_MIE_ANISOTROPY_FACTOR; + static const LLUUID DEFAULT_SUN_ID; + static const LLUUID DEFAULT_MOON_ID; + static const LLUUID DEFAULT_CLOUD_ID; + typedef std::shared_ptr ptr_t; typedef std::pair azimalt_t; @@ -449,10 +453,31 @@ public: return mTotalAmbient; } - virtual validation_list_t getValidationList() const override; - static validation_list_t validationList(); + //===================================================================== + virtual void loadTextures() { }; + + //===================================================================== + virtual validation_list_t getValidationList() const override; + static validation_list_t validationList(); + + static LLSD translateLegacySettings(LLSD legacy); + + //===================================================================== + // transient properties used in animations. + LLUUID getNextSunTextureId() const + { + return mNextSunTextureId; + } + + LLUUID getNextMoonTextureId() const + { + return mNextMoonTextureId; + } - static LLSD translateLegacySettings(LLSD legacy); + LLUUID getNextCloudNoiseTextureId() const + { + return mNextCloudTextureId; + } protected: static const std::string SETTING_LEGACY_EAST_ANGLE; @@ -492,6 +517,10 @@ private: LLColor4 mTotalAmbient; + LLUUID mNextSunTextureId; + LLUUID mNextMoonTextureId; + LLUUID mNextCloudTextureId; + typedef std::map mapNameToUniformId_t; static mapNameToUniformId_t sNameToUniformMapping; 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 diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h index 92190fa7b1..64de4486ca 100644 --- a/indra/llinventory/llsettingswater.h +++ b/indra/llinventory/llsettingswater.h @@ -199,6 +199,13 @@ public: return mWaterFogKS; } + //------------------------------------------- + LLUUID getNextNormalMapID() const + { + return mNextNormalMapID; + } + + virtual validation_list_t getValidationList() const override; static validation_list_t validationList(); @@ -224,7 +231,7 @@ protected: F32 mWaterFogKS; private: - + LLUUID mNextNormalMapID; }; #endif -- cgit v1.2.3