From d8dd4d9c0cd4554704cbe15b5502f4d87a4674ad Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 27 Jun 2023 20:01:52 -0700 Subject: Just about got hero reflection maps working. DRTVWR-583 --- indra/newview/llviewerobject.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e67750af7c..8930b2453b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5284,6 +5284,28 @@ S32 LLViewerObject::setTEFullbright(const U8 te, const U8 fullbright) return retval; } +S32 LLViewerObject::setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target) +{ + S32 retval = 0; + + const LLTextureEntry *tep = getTE(te); + if (!tep) + { + LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL; + } + else if (target != tep->getRenderableTarget()) + { + retval = LLPrimitive::setTERenderableTarget(te, target); + setChanged(TEXTURE); + if (mDrawable.notNull() && retval) + { + //gPipeline.markMirror(mDrawable); + } + } + + return retval; +} + S32 LLViewerObject::setTEMediaFlags(const U8 te, const U8 media_flags) { -- cgit v1.2.3 From fbecd348f897ee91a5639e7e9fe4f0578d72b8e2 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 29 Aug 2023 03:04:04 -0700 Subject: Add protocol level mirror support, and UI. --- indra/newview/llviewerobject.cpp | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 7871815fda..68162f83c0 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5296,29 +5296,6 @@ S32 LLViewerObject::setTEFullbright(const U8 te, const U8 fullbright) return retval; } -S32 LLViewerObject::setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target) -{ - S32 retval = 0; - - const LLTextureEntry *tep = getTE(te); - if (!tep) - { - LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL; - } - else if (target != tep->getRenderableTarget()) - { - retval = LLPrimitive::setTERenderableTarget(te, target); - setChanged(TEXTURE); - if (mDrawable.notNull() && retval) - { - //gPipeline.markMirror(mDrawable); - } - } - - return retval; -} - - S32 LLViewerObject::setTEMediaFlags(const U8 te, const U8 media_flags) { // this might need work for media type @@ -6251,6 +6228,11 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para { new_block = new LLReflectionProbeParams(); break; + } + case LLNetworkData::PARAMS_MIRROR: + { + new_block = new LLMirrorParams(); + break; } default: { -- cgit v1.2.3 From 32d1984bf98dce6e4938534342e67dbc40fbb073 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Fri, 1 Sep 2023 08:28:57 -0700 Subject: Temporary data model shenanigans. Should help tweak and tune placement with direct community guidance. DRTVWR-583 --- indra/newview/llviewerobject.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 59a61f0c63..7032ce41d5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1524,11 +1524,43 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, std::string temp_string; mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, temp_string, block_num ); + std::stringstream ss(temp_string); + std::string word; + bool mirror_detected = false; + while (ss >> word) + { + if (word == "Mirror") + { + mirror_detected = true; + mIsMirror = true; + } + else if (word == "XAlign" && mIsMirror) + { + mMirrorPlacementMode = 0; + } + else if (word == "YAlign" && mIsMirror) + { + mMirrorPlacementMode = 1; + } + else if (word == "ZAlign" && mIsMirror) + { + mMirrorPlacementMode = 2; + } + else if (word == "NearestPoint" && mIsMirror) + { + mMirrorPlacementMode = 3; + } + } + LLColor4U coloru; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextColor, coloru.mV, 4, block_num); - + // alpha was flipped so that it zero encoded better coloru.mV[3] = 255 - coloru.mV[3]; + + if (mirror_detected) + coloru.mV[3] = 0; + mText->setColor(LLColor4(coloru)); mText->setString(temp_string); -- cgit v1.2.3 From 25aee5e983a8de712565d8241cbdb18da832a4d1 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Fri, 8 Sep 2023 15:54:52 -0700 Subject: Some more modes for mirrors to place the probe. DRTVWR-583 --- indra/newview/llviewerobject.cpp | 93 ++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 31 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 7032ce41d5..adb4683af0 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -314,7 +314,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mLastUpdateCached(FALSE), mCachedMuteListUpdateTime(0), mCachedOwnerInMuteList(false), - mRiggedAttachedWarned(false) + mRiggedAttachedWarned(false), +mIsMirror(false), +mMirrorPlacementMode(3) { if (!is_global) { @@ -1148,6 +1150,61 @@ U32 LLViewerObject::extractSpatialExtents(LLDataPackerBinaryBuffer *dp, LLVector return parent_id; } +void detectMirror(const std::string &str, bool &mirror, U8 &mode) +{ + + std::stringstream ss(str); + std::string word; + while (ss >> word) + { + if (word == "IsMirror") + { + mirror = true; + } + else if (word == "XAlign" && mirror) + { + LL_INFOS() << "Mirror wants camera X placement." << LL_ENDL; + mode = 0; + } + else if (word == "YAlign" && mirror) + { + LL_INFOS() << "Mirror wants camera Y placement." << LL_ENDL; + mode = 1; + } + else if (word == "ZAlign" && mirror) + { + LL_INFOS() << "Mirror wants camera Z placement." << LL_ENDL; + mode = 2; + } + else if (word == "NearestPoint" && mirror) + { + LL_INFOS() << "Mirror wants nearest point placement." << LL_ENDL; + mode = 3; + } + else if (word == "Center" && mirror) + { + LL_INFOS() << "Mirror wants center of object." << LL_ENDL; + mode = 4; + } + else if (word == "XMin" && mirror) + { + mode = 5; + } + else if (word == "XMax" && mirror) + { + mode = 6; + } + else if (word == "FocusPoint" && mirror) + { + mode = 7; + } + else if (word == "Reflected" && mirror) + { + mode = 8; + } + } +} + U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, @@ -1524,33 +1581,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, std::string temp_string; mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, temp_string, block_num ); - std::stringstream ss(temp_string); - std::string word; - bool mirror_detected = false; - while (ss >> word) - { - if (word == "Mirror") - { - mirror_detected = true; - mIsMirror = true; - } - else if (word == "XAlign" && mIsMirror) - { - mMirrorPlacementMode = 0; - } - else if (word == "YAlign" && mIsMirror) - { - mMirrorPlacementMode = 1; - } - else if (word == "ZAlign" && mIsMirror) - { - mMirrorPlacementMode = 2; - } - else if (word == "NearestPoint" && mIsMirror) - { - mMirrorPlacementMode = 3; - } - } + detectMirror(temp_string, mIsMirror, mMirrorPlacementMode); LLColor4U coloru; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextColor, coloru.mV, 4, block_num); @@ -1558,9 +1589,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // alpha was flipped so that it zero encoded better coloru.mV[3] = 255 - coloru.mV[3]; - if (mirror_detected) - coloru.mV[3] = 0; - mText->setColor(LLColor4(coloru)); mText->setString(temp_string); @@ -1940,6 +1968,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, { std::string temp_string; dp->unpackString(temp_string, "Text"); + + detectMirror(temp_string, mIsMirror, mMirrorPlacementMode); + LLColor4U coloru; dp->unpackBinaryDataFixed(coloru.mV, 4, "Color"); coloru.mV[3] = 255 - coloru.mV[3]; -- cgit v1.2.3 From 091beab79872fbaf4e3e7de39c8e69ef08e5a1c7 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Fri, 8 Sep 2023 17:43:24 -0700 Subject: Even more placement modes. Reflected axis modes need work. DRTVWR-583 --- indra/newview/llviewerobject.cpp | 53 ++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index adb4683af0..950c672a42 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1163,27 +1163,22 @@ void detectMirror(const std::string &str, bool &mirror, U8 &mode) } else if (word == "XAlign" && mirror) { - LL_INFOS() << "Mirror wants camera X placement." << LL_ENDL; mode = 0; } else if (word == "YAlign" && mirror) { - LL_INFOS() << "Mirror wants camera Y placement." << LL_ENDL; mode = 1; } else if (word == "ZAlign" && mirror) { - LL_INFOS() << "Mirror wants camera Z placement." << LL_ENDL; mode = 2; } else if (word == "NearestPoint" && mirror) { - LL_INFOS() << "Mirror wants nearest point placement." << LL_ENDL; mode = 3; } else if (word == "Center" && mirror) { - LL_INFOS() << "Mirror wants center of object." << LL_ENDL; mode = 4; } else if (word == "XMin" && mirror) @@ -1194,14 +1189,58 @@ void detectMirror(const std::string &str, bool &mirror, U8 &mode) { mode = 6; } - else if (word == "FocusPoint" && mirror) + else if (word == "YMin" && mirror) { mode = 7; } - else if (word == "Reflected" && mirror) + else if (word == "YMax" && mirror) { mode = 8; } + else if (word == "ZMin" && mirror) + { + mode = 9; + } + else if (word == "ZMax" && mirror) + { + mode = 10; + } + else if (word == "FocusPoint" && mirror) + { + mode = 11; + } + else if (word == "ReflectedX" && mirror) + { + mode = 12; + } + else if (word == "ReflectedY" && mirror) + { + mode = 13; + } + else if (word == "ReflectedZ" && mirror) + { + mode = 14; + } + else if (word == "XYAlign" && mirror) + { + mode = 15; + } + else if (word == "XZAlign" && mirror) + { + mode = 16; + } + else if (word == "ZYAlign" && mirror) + { + mode = 17; + } + else if (word == "XYZAlign" && mirror) + { + mode = 18; + } + else if (word == "XYZAlignCenter" && mirror) + { + mode = 19; + } } } -- cgit v1.2.3 From d4c75b9b765631c1ccfc369e765529aefe3e061a Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Fri, 8 Sep 2023 21:29:05 -0700 Subject: Mostly fixed placement math. DRTVWR-583 --- indra/newview/llviewerobject.cpp | 74 ++-------------------------------------- 1 file changed, 3 insertions(+), 71 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 950c672a42..dcdb66a6d4 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1161,85 +1161,17 @@ void detectMirror(const std::string &str, bool &mirror, U8 &mode) { mirror = true; } - else if (word == "XAlign" && mirror) - { - mode = 0; - } - else if (word == "YAlign" && mirror) - { - mode = 1; - } - else if (word == "ZAlign" && mirror) - { - mode = 2; - } - else if (word == "NearestPoint" && mirror) - { - mode = 3; - } - else if (word == "Center" && mirror) - { - mode = 4; - } - else if (word == "XMin" && mirror) - { - mode = 5; - } - else if (word == "XMax" && mirror) - { - mode = 6; - } - else if (word == "YMin" && mirror) - { - mode = 7; - } - else if (word == "YMax" && mirror) - { - mode = 8; - } - else if (word == "ZMin" && mirror) - { - mode = 9; - } - else if (word == "ZMax" && mirror) - { - mode = 10; - } - else if (word == "FocusPoint" && mirror) - { - mode = 11; - } else if (word == "ReflectedX" && mirror) { - mode = 12; + mode = 0; } else if (word == "ReflectedY" && mirror) { - mode = 13; + mode = 1; } else if (word == "ReflectedZ" && mirror) { - mode = 14; - } - else if (word == "XYAlign" && mirror) - { - mode = 15; - } - else if (word == "XZAlign" && mirror) - { - mode = 16; - } - else if (word == "ZYAlign" && mirror) - { - mode = 17; - } - else if (word == "XYZAlign" && mirror) - { - mode = 18; - } - else if (word == "XYZAlignCenter" && mirror) - { - mode = 19; + mode = 2; } } } -- cgit v1.2.3 From 18b219cf83a1cd405cf36b9f58fc48f717409598 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Mon, 25 Sep 2023 19:20:46 -0700 Subject: Start removing the concept of placement mode - it's either a mirror or not. DRTVWR-583 --- indra/newview/llviewerobject.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index dcdb66a6d4..9ac9ef7ea6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1161,18 +1161,25 @@ void detectMirror(const std::string &str, bool &mirror, U8 &mode) { mirror = true; } - else if (word == "ReflectedX" && mirror) - { - mode = 0; - } - else if (word == "ReflectedY" && mirror) - { - mode = 1; - } - else if (word == "ReflectedZ" && mirror) - { - mode = 2; - } + + if (mirror) + { + bool num = false; + std::string::const_iterator it = word.begin(); + while (it != word.end()) + { + num = std::isdigit(*it); + ++it; + + if (!num) + break; + } + + if (num) + { + mode = atoi(word.c_str()); + } + } } } -- cgit v1.2.3 From a888531fd1fbf7de0d71b4d04195d4267c882154 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Wed, 24 Jan 2024 16:22:45 -0800 Subject: https://github.com/secondlife/viewer-issues/issues/23 Make the face selection for mirrors actually reflect what it does --- indra/newview/llviewerobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 88494f419c..691a2e14d3 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -314,8 +314,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mCachedMuteListUpdateTime(0), mCachedOwnerInMuteList(false), mRiggedAttachedWarned(false), -mIsMirror(false), -mMirrorPlacementMode(3) + mIsMirror(false), + mMirrorFace(3) { if (!is_global) { @@ -1558,7 +1558,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, std::string temp_string; mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, temp_string, block_num ); - detectMirror(temp_string, mIsMirror, mMirrorPlacementMode); + detectMirror(temp_string, mIsMirror, mMirrorFace); LLColor4U coloru; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextColor, coloru.mV, 4, block_num); @@ -1946,7 +1946,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, std::string temp_string; dp->unpackString(temp_string, "Text"); - detectMirror(temp_string, mIsMirror, mMirrorPlacementMode); + detectMirror(temp_string, mIsMirror, mMirrorFace); LLColor4U coloru; dp->unpackBinaryDataFixed(coloru.mV, 4, "Color"); -- cgit v1.2.3 From 739ff27c0649af9c74e00f31934d89405ff14373 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 6 Feb 2024 02:53:57 -0800 Subject: #740 Make sure we evaluate if the probe is a mirror probe or not. #682 Re-enable gaussian filtering, and reduce the mirror resolution back to 1024. Also just generally clean up the code a bit. --- indra/newview/llviewerobject.cpp | 46 +--------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 691a2e14d3..d71814bd3f 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -313,9 +313,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mLastUpdateCached(FALSE), mCachedMuteListUpdateTime(0), mCachedOwnerInMuteList(false), - mRiggedAttachedWarned(false), - mIsMirror(false), - mMirrorFace(3) + mRiggedAttachedWarned(false) { if (!is_global) { @@ -1149,39 +1147,6 @@ U32 LLViewerObject::extractSpatialExtents(LLDataPackerBinaryBuffer *dp, LLVector return parent_id; } -void detectMirror(const std::string &str, bool &mirror, U8 &mode) -{ - - std::stringstream ss(str); - std::string word; - while (ss >> word) - { - if (word == "IsMirror") - { - mirror = true; - } - - if (mirror) - { - bool num = false; - std::string::const_iterator it = word.begin(); - while (it != word.end()) - { - num = std::isdigit(*it); - ++it; - - if (!num) - break; - } - - if (num) - { - mode = atoi(word.c_str()); - } - } - } -} - U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, @@ -1557,8 +1522,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, std::string temp_string; mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, temp_string, block_num ); - - detectMirror(temp_string, mIsMirror, mMirrorFace); LLColor4U coloru; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextColor, coloru.mV, 4, block_num); @@ -1946,8 +1909,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, std::string temp_string; dp->unpackString(temp_string, "Text"); - detectMirror(temp_string, mIsMirror, mMirrorFace); - LLColor4U coloru; dp->unpackBinaryDataFixed(coloru.mV, 4, "Color"); coloru.mV[3] = 255 - coloru.mV[3]; @@ -6327,11 +6288,6 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para { new_block = new LLReflectionProbeParams(); break; - } - case LLNetworkData::PARAMS_MIRROR: - { - new_block = new LLMirrorParams(); - break; } default: { -- cgit v1.2.3