summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-25 09:27:49 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-25 09:27:49 -0700
commit73870cb0b41144dc9932947d13d6aa27952d8849 (patch)
treef712491a5baffb2e7be797d4d9110602687865d8
parent3ff3e1a3537a5d051180aaf6223f5ddd8b540d35 (diff)
parent3da26ee8df6cc7e57ba3acbb91437ec97e151002 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583
-rw-r--r--.github/workflows/build.yaml3
-rw-r--r--indra/llinventory/llsettingssky.cpp9
-rw-r--r--indra/llinventory/llsettingssky.h2
-rw-r--r--indra/llmath/llvolume.cpp34
-rw-r--r--indra/llmessage/CMakeLists.txt2
-rw-r--r--indra/llmessage/llgenericstreamingmessage.cpp72
-rw-r--r--indra/llmessage/llgenericstreamingmessage.h50
-rw-r--r--indra/llmessage/message_prehash.cpp1
-rw-r--r--indra/llmessage/message_prehash.h1
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp172
-rw-r--r--indra/llprimitive/llgltfmaterial.h9
-rw-r--r--indra/llrender/llrender.cpp4
-rw-r--r--indra/llrender/llshadermgr.cpp2
-rw-r--r--indra/llrender/llshadermgr.h2
-rw-r--r--indra/llwindow/llwindowwin32.cpp28
-rw-r--r--indra/newview/app_settings/settings.xml69
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl31
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/waterF.glsl4
-rw-r--r--indra/newview/llappviewer.cpp2
-rw-r--r--indra/newview/llface.cpp46
-rw-r--r--indra/newview/llface.h10
-rw-r--r--indra/newview/llfloaterperms.cpp2
-rw-r--r--indra/newview/llfloaterperms.h1
-rw-r--r--indra/newview/llgltfmateriallist.cpp105
-rw-r--r--indra/newview/llgltfmateriallist.h3
-rw-r--r--indra/newview/llpanelface.cpp40
-rw-r--r--indra/newview/llpanelvolume.cpp22
-rw-r--r--indra/newview/llreflectionmap.cpp12
-rw-r--r--indra/newview/llselectmgr.cpp57
-rw-r--r--indra/newview/llsettingsvo.cpp24
-rw-r--r--indra/newview/llstartup.cpp1
-rw-r--r--indra/newview/lltexturectrl.cpp17
-rw-r--r--indra/newview/lltexturectrl.h4
-rw-r--r--indra/newview/lltooldraganddrop.cpp2
-rw-r--r--indra/newview/llviewergenericmessage.cpp18
-rw-r--r--indra/newview/llviewergenericmessage.h1
-rwxr-xr-xindra/newview/llviewerregion.cpp16
-rw-r--r--indra/newview/llviewertexture.cpp3
-rw-r--r--indra/newview/llvocache.cpp34
-rw-r--r--indra/newview/llvocache.h2
-rw-r--r--indra/newview/llvovolume.cpp18
-rw-r--r--indra/newview/pipeline.cpp12
-rwxr-xr-xscripts/messages/message_template.msg19
-rwxr-xr-xscripts/messages/message_template.msg.sha12
52 files changed, 864 insertions, 167 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 0835f9751e..77127856c3 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -15,9 +15,6 @@ jobs:
configuration: [ReleaseOS]
addrsize: [64]
include:
- - runner: windows-large
- configuration: ReleaseOS
- addrsize: 32
- runner: macos-12-xl
developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
runs-on: ${{ matrix.runner }}
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 3f4b15b8b1..fedbed2990 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -32,6 +32,7 @@
#include "llfasttimer.h"
#include "v3colorutil.h"
+
//=========================================================================
namespace
{
@@ -135,6 +136,8 @@ const std::string LLSettingsSky::SETTING_REFLECTION_PROBE_AMBIANCE("reflection_p
const LLUUID LLSettingsSky::DEFAULT_ASSET_ID("651510b8-5f4d-8991-1592-e7eeab2a5a06");
+F32 LLSettingsSky::sAutoAdjustProbeAmbiance = 1.f;
+
static const LLUUID DEFAULT_SUN_ID("32bfbcea-24b1-fb9d-1ef9-48a28a63730f"); // dataserver
static const LLUUID DEFAULT_MOON_ID("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
static const LLUUID DEFAULT_CLOUD_ID("1dc1368f-e8fe-f02d-a08d-9d9f11c1af6b");
@@ -1438,7 +1441,7 @@ F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
{
if (auto_adjust && canAutoAdjust())
{
- return 1.f;
+ return sAutoAdjustProbeAmbiance;
}
return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
@@ -1446,6 +1449,7 @@ F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale, bool auto_adjust) const
{
+#if 0
// feed cloud shadow back into reflection probe ambiance to mimic pre-reflection-probe behavior
// without brightening dark/interior spaces
F32 probe_ambiance = getReflectionProbeAmbiance(auto_adjust);
@@ -1456,6 +1460,9 @@ F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale, bool
}
return probe_ambiance;
+#else
+ return getReflectionProbeAmbiance(auto_adjust);
+#endif
}
F32 LLSettingsSky::getSkyBottomRadius() const
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index f55e9f0631..7ba7a9ba06 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -103,6 +103,8 @@ public:
static const LLUUID DEFAULT_ASSET_ID;
+ static F32 sAutoAdjustProbeAmbiance;
+
typedef PTR_NAMESPACE::shared_ptr<LLSettingsSky> ptr_t;
//---------------------------------------------------------------------
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 0e3792fda3..6d36daa92a 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5626,29 +5626,29 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
mWeights[dst_idx].loadua(data.w[src_idx].mV);
}
}
+
+ // put back in normalized coordinate frame
+ LLVector4a inv_scale(1.f/mNormalizedScale.mV[0], 1.f / mNormalizedScale.mV[1], 1.f / mNormalizedScale.mV[2]);
+ LLVector4a scale;
+ scale.load3(mNormalizedScale.mV);
+ scale.getF32ptr()[3] = 1.f;
+
+ for (int i = 0; i < mNumVertices; ++i)
+ {
+ mPositions[i].mul(inv_scale);
+ mNormals[i].mul(scale);
+ mNormals[i].normalize3();
+ F32 w = mTangents[i].getF32ptr()[3];
+ mTangents[i].mul(scale);
+ mTangents[i].normalize3();
+ mTangents[i].getF32ptr()[3] = w;
+ }
}
else
{
// blew past the max vertex size limit, use legacy tangent generation which never adds verts
createTangents();
}
-
- // put back in normalized coordinate frame
- LLVector4a inv_scale(1.f/mNormalizedScale.mV[0], 1.f / mNormalizedScale.mV[1], 1.f / mNormalizedScale.mV[2]);
- LLVector4a scale;
- scale.load3(mNormalizedScale.mV);
- scale.getF32ptr()[3] = 1.f;
-
- for (int i = 0; i < mNumVertices; ++i)
- {
- mPositions[i].mul(inv_scale);
- mNormals[i].mul(scale);
- mNormals[i].normalize3();
- F32 w = mTangents[i].getF32ptr()[3];
- mTangents[i].mul(scale);
- mTangents[i].normalize3();
- mTangents[i].getF32ptr()[3] = w;
- }
}
// cache optimize index buffer
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index 4786956e85..e44309476b 100644
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -30,6 +30,7 @@ set(llmessage_SOURCE_FILES
lldispatcher.cpp
llexperiencecache.cpp
llfiltersd2xmlrpc.cpp
+ llgenericstreamingmessage.cpp
llhost.cpp
llhttpnode.cpp
llhttpsdhandler.cpp
@@ -114,6 +115,7 @@ set(llmessage_HEADER_FILES
llextendedstatus.h
llfiltersd2xmlrpc.h
llfollowcamparams.h
+ llgenericstreamingmessage.h
llhost.h
llhttpnode.h
llhttpnodeadapter.h
diff --git a/indra/llmessage/llgenericstreamingmessage.cpp b/indra/llmessage/llgenericstreamingmessage.cpp
new file mode 100644
index 0000000000..8627675c54
--- /dev/null
+++ b/indra/llmessage/llgenericstreamingmessage.cpp
@@ -0,0 +1,72 @@
+/**
+ * @file llgenericstreamingmessage.cpp
+ * @brief Generic Streaming Message helpers. Shared between viewer and simulator.
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2023, 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 "linden_common.h"
+
+#include "llgenericstreamingmessage.h"
+
+#include "message.h"
+
+void LLGenericStreamingMessage::send(LLMessageSystem* msg)
+{
+#if 0 // viewer cannot send GenericStreamingMessage
+ msg->newMessageFast(_PREHASH_GenericStreamingMessage);
+
+ if (mData.size() < 1024 * 7)
+ { // disable warning about big messages unless we're sending a REALLY big message
+ msg->tempDisableWarnAboutBigMessage();
+ }
+ else
+ {
+ LL_WARNS("Messaging") << "Attempted to send too large GenericStreamingMessage, dropping." << LL_ENDL;
+ return;
+ }
+
+ msg->nextBlockFast(_PREHASH_MethodData);
+ msg->addU16Fast(_PREHASH_Method, mMethod);
+ msg->nextBlockFast(_PREHASH_DataBlock);
+ msg->addStringFast(_PREHASH_Data, mData.c_str());
+#endif
+}
+
+void LLGenericStreamingMessage::unpack(LLMessageSystem* msg)
+{
+ U16* m = (U16*)&mMethod; // squirrely pass enum as U16 by reference
+ msg->getU16Fast(_PREHASH_MethodData, _PREHASH_Method, *m);
+
+ constexpr int MAX_SIZE = 7 * 1024;
+
+ char buffer[MAX_SIZE];
+
+ // NOTE: don't use getStringFast to avoid 1200 byte truncation
+ U32 size = msg->getSizeFast(_PREHASH_DataBlock, _PREHASH_Data);
+ msg->getBinaryDataFast(_PREHASH_DataBlock, _PREHASH_Data, buffer, size, 0, MAX_SIZE);
+
+ mData.assign(buffer, size);
+}
+
+
+
diff --git a/indra/llmessage/llgenericstreamingmessage.h b/indra/llmessage/llgenericstreamingmessage.h
new file mode 100644
index 0000000000..9ac9719ea1
--- /dev/null
+++ b/indra/llmessage/llgenericstreamingmessage.h
@@ -0,0 +1,50 @@
+/**
+ * @file llgenericstreamingmessage.h
+ * @brief Generic Streaming Message helpers. Shared between viewer and simulator.
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2023, 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$
+ */
+
+#pragma once
+
+#include <string>
+#include "stdtypes.h"
+
+class LLMessageSystem;
+
+class LLGenericStreamingMessage
+{
+public:
+ enum Method : U16
+ {
+ METHOD_GLTF_MATERIAL_OVERRIDE = 0x4175,
+ METHOD_UNKNOWN = 0xFFFF,
+ };
+
+ void send(LLMessageSystem* msg);
+ void unpack(LLMessageSystem* msg);
+
+ Method mMethod = METHOD_UNKNOWN;
+ std::string mData;
+};
+
+
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index 57ea954054..4dccacb889 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1367,6 +1367,7 @@ char const* const _PREHASH_MuteType = LLMessageStringTable::getInstance()->getSt
char const* const _PREHASH_IMViaEMail = LLMessageStringTable::getInstance()->getString("IMViaEMail");
char const* const _PREHASH_RentPrice = LLMessageStringTable::getInstance()->getString("RentPrice");
char const* const _PREHASH_GenericMessage = LLMessageStringTable::getInstance()->getString("GenericMessage");
+char const* const _PREHASH_GenericStreamingMessage = LLMessageStringTable::getInstance()->getString("GenericStreamingMessage");
char const* const _PREHASH_ChildAgentAlive = LLMessageStringTable::getInstance()->getString("ChildAgentAlive");
char const* const _PREHASH_AssetType = LLMessageStringTable::getInstance()->getString("AssetType");
char const* const _PREHASH_SpawnPointBlock = LLMessageStringTable::getInstance()->getString("SpawnPointBlock");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index 572dadd408..a393bbabb2 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1368,6 +1368,7 @@ extern char const* const _PREHASH_MuteType;
extern char const* const _PREHASH_IMViaEMail;
extern char const* const _PREHASH_RentPrice;
extern char const* const _PREHASH_GenericMessage;
+extern char const* const _PREHASH_GenericStreamingMessage;
extern char const* const _PREHASH_ChildAgentAlive;
extern char const* const _PREHASH_AssetType;
extern char const* const _PREHASH_SpawnPointBlock;
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index c16803d39d..19b7413934 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -27,6 +27,7 @@
#include "linden_common.h"
#include "llgltfmaterial.h"
+#include "llsdserialize.h"
// NOTE -- this should be the one and only place tiny_gltf.h is included
#include "tinygltf/tiny_gltf.h"
@@ -693,6 +694,177 @@ void LLGLTFMaterial::applyOverride(const LLGLTFMaterial& override_mat)
}
}
+void LLGLTFMaterial::getOverrideLLSD(const LLGLTFMaterial& override_mat, LLSD& data)
+{
+ LL_PROFILE_ZONE_SCOPED;
+ llassert(data.isUndefined());
+
+ // make every effort to shave bytes here
+
+ for (int i = 0; i < GLTF_TEXTURE_INFO_COUNT; ++i)
+ {
+ LLUUID& texture_id = mTextureId[i];
+ const LLUUID& override_texture_id = override_mat.mTextureId[i];
+ if (override_texture_id.notNull() && override_texture_id != texture_id)
+ {
+ data["tex"][i] = LLSD::UUID(override_texture_id);
+ }
+
+ }
+
+ if (override_mat.mBaseColor != getDefaultBaseColor())
+ {
+ data["bc"] = override_mat.mBaseColor.getValue();
+ }
+
+ if (override_mat.mEmissiveColor != getDefaultEmissiveColor())
+ {
+ data["ec"] = override_mat.mEmissiveColor.getValue();
+ }
+
+ if (override_mat.mMetallicFactor != getDefaultMetallicFactor())
+ {
+ data["mf"] = override_mat.mMetallicFactor;
+ }
+
+ if (override_mat.mRoughnessFactor != getDefaultRoughnessFactor())
+ {
+ data["rf"] = override_mat.mRoughnessFactor;
+ }
+
+ if (override_mat.mAlphaMode != getDefaultAlphaMode() || override_mat.mOverrideAlphaMode)
+ {
+ data["am"] = override_mat.mAlphaMode;
+ }
+
+ if (override_mat.mAlphaCutoff != getDefaultAlphaCutoff())
+ {
+ data["ac"] = override_mat.mAlphaCutoff;
+ }
+
+ if (override_mat.mDoubleSided != getDefaultDoubleSided() || override_mat.mOverrideDoubleSided)
+ {
+ data["ds"] = override_mat.mDoubleSided;
+ }
+
+ for (int i = 0; i < GLTF_TEXTURE_INFO_COUNT; ++i)
+ {
+ if (override_mat.mTextureTransform[i].mOffset != getDefaultTextureOffset())
+ {
+ data["ti"][i]["o"] = override_mat.mTextureTransform[i].mOffset.getValue();
+ }
+
+ if (override_mat.mTextureTransform[i].mScale != getDefaultTextureScale())
+ {
+ data["ti"][i]["s"] = override_mat.mTextureTransform[i].mScale.getValue();
+ }
+
+ if (override_mat.mTextureTransform[i].mRotation != getDefaultTextureRotation())
+ {
+ data["ti"][i]["r"] = override_mat.mTextureTransform[i].mRotation;
+ }
+ }
+
+#if 0
+ {
+ std::ostringstream ostr;
+ LLSDSerialize::serialize(data, ostr, LLSDSerialize::LLSD_NOTATION);
+ std::string param_str(ostr.str());
+ LL_INFOS() << param_str << LL_ENDL;
+ LL_INFOS() << "Notation size: " << param_str.size() << LL_ENDL;
+ }
+
+ {
+ std::ostringstream ostr;
+ LLSDSerialize::serialize(data, ostr, LLSDSerialize::LLSD_BINARY);
+ std::string param_str(ostr.str());
+ LL_INFOS() << "Binary size: " << param_str.size() << LL_ENDL;
+ }
+#endif
+}
+
+
+void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
+{
+ const LLSD& tex = data["tex"];
+
+ if (tex.isArray())
+ {
+ for (int i = 0; i < tex.size(); ++i)
+ {
+ mTextureId[i] = tex[i].asUUID();
+ }
+ }
+
+ const LLSD& bc = data["bc"];
+ if (bc.isDefined())
+ {
+ mBaseColor.setValue(bc);
+ }
+
+ const LLSD& ec = data["ec"];
+ if (ec.isDefined())
+ {
+ mEmissiveColor.setValue(ec);
+ }
+
+ const LLSD& mf = data["mf"];
+ if (mf.isReal())
+ {
+ mMetallicFactor = mf.asReal();
+ }
+
+ const LLSD& rf = data["rf"];
+ if (rf.isReal())
+ {
+ mRoughnessFactor = rf.asReal();
+ }
+
+ const LLSD& am = data["am"];
+ if (am.isInteger())
+ {
+ mAlphaMode = (AlphaMode) am.asInteger();
+ }
+
+ const LLSD& ac = data["ac"];
+ if (ac.isReal())
+ {
+ mAlphaCutoff = ac.asReal();
+ }
+
+ const LLSD& ds = data["ds"];
+ if (ds.isBoolean())
+ {
+ mDoubleSided = ds.asBoolean();
+ mOverrideDoubleSided = true;
+ }
+
+ const LLSD& ti = data["ti"];
+ if (ti.isArray())
+ {
+ for (int i = 0; i < GLTF_TEXTURE_INFO_COUNT; ++i)
+ {
+ const LLSD& o = ti[i]["o"];
+ if (o.isDefined())
+ {
+ mTextureTransform[i].mOffset.setValue(o);
+ }
+
+ const LLSD& s = ti[i]["s"];
+ if (s.isDefined())
+ {
+ mTextureTransform[i].mScale.setValue(s);
+ }
+
+ const LLSD& r = ti[i]["r"];
+ if (r.isReal())
+ {
+ mTextureTransform[i].mRotation = r.asReal();
+ }
+ }
+ }
+}
+
LLUUID LLGLTFMaterial::getHash() const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index ad7784f6d1..ca27507707 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -176,6 +176,7 @@ public:
// get the contents of this LLGLTFMaterial as a json string
std::string asJSON(bool prettyprint = false) const;
+
// initialize from given tinygltf::Model
// model - the model to reference
// mat_index - index of material in model's material array
@@ -185,6 +186,14 @@ public:
void writeToModel(tinygltf::Model& model, S32 mat_index) const;
void applyOverride(const LLGLTFMaterial& override_mat);
+
+ // apply the given LLSD override data
+ void applyOverrideLLSD(const LLSD& data);
+
+ // Get the given override on this LLGLTFMaterial as LLSD
+ // override_mat -- the override source data
+ // data -- output LLSD object (should be passed in empty)
+ void getOverrideLLSD(const LLGLTFMaterial& override_mat, LLSD& data);
// For base materials only (i.e. assets). Clears transforms to
// default since they're not supported in assets yet.
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 8430d13093..ee66122774 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -975,8 +975,8 @@ void LLRender::syncLightState()
shader->uniform3fv(LLShaderMgr::LIGHT_AMBIENT, 1, mAmbientLightColor.mV);
shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, sun_primary[0] ? 1 : 0);
//shader->uniform3fv(LLShaderMgr::AMBIENT, 1, mAmbientLightColor.mV);
- shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, diffuse[0].mV);
- shader->uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, diffuse_b[0].mV);
+ //shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, diffuse[0].mV);
+ //shader->uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, diffuse_b[0].mV);
}
}
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 8bb5be0332..645a78bfac 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1276,6 +1276,8 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("sunlight_color");
mReservedUniforms.push_back("ambient_color");
mReservedUniforms.push_back("sky_hdr_scale");
+ mReservedUniforms.push_back("sky_sunlight_scale");
+ mReservedUniforms.push_back("sky_ambient_scale");
mReservedUniforms.push_back("blue_horizon");
mReservedUniforms.push_back("blue_density");
mReservedUniforms.push_back("haze_horizon");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 6a5243a898..a326a5593d 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -104,6 +104,8 @@ public:
SUNLIGHT_COLOR, // "sunlight_color"
AMBIENT, // "ambient_color"
SKY_HDR_SCALE, // "sky_hdr_scale"
+ SKY_SUNLIGHT_SCALE, // "sky_sunlight_scale"
+ SKY_AMBIENT_SCALE, // "sky_ambient_scale"
BLUE_HORIZON, // "blue_horizon"
BLUE_DENSITY, // "blue_density"
HAZE_HORIZON, // "haze_horizon"
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 1f91cbbaa8..42ec4ee29d 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -352,6 +352,11 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
void run() override;
+ void glReady()
+ {
+ mGLReady = true;
+ }
+
// initialzie DXGI adapter (for querying available VRAM)
void initDX();
@@ -410,6 +415,9 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
HWND mWindowHandle = NULL;
HDC mhDC = 0;
+ // *HACK: Attempt to prevent startup crashes by deferring memory accounting
+ // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18
+ bool mGLReady = false;
// best guess at available video memory in MB
std::atomic<U32> mAvailableVRAM;
@@ -1720,6 +1728,13 @@ const S32 max_format = (S32)num_formats - 1;
// ok to post quit messages now
mPostQuit = TRUE;
+ // *HACK: Attempt to prevent startup crashes by deferring memory accounting
+ // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18
+ mWindowThread->post([=]()
+ {
+ mWindowThread->glReady();
+ });
+
if (auto_show)
{
show();
@@ -4692,6 +4707,8 @@ void debugEnumerateGraphicsAdapters()
void LLWindowWin32::LLWindowWin32Thread::initDX()
{
+ if (!mGLReady) { return; }
+
if (mDXGIAdapter == NULL)
{
debugEnumerateGraphicsAdapters();
@@ -4726,6 +4743,8 @@ void LLWindowWin32::LLWindowWin32Thread::initDX()
void LLWindowWin32::LLWindowWin32Thread::initD3D()
{
+ if (!mGLReady) { return; }
+
if (mDXGIAdapter == NULL && mD3DDevice == NULL && mWindowHandle != 0)
{
mD3D = Direct3DCreate9(D3D_SDK_VERSION);
@@ -4752,6 +4771,8 @@ void LLWindowWin32::LLWindowWin32Thread::initD3D()
void LLWindowWin32::LLWindowWin32Thread::updateVRAMUsage()
{
LL_PROFILE_ZONE_SCOPED;
+ if (!mGLReady) { return; }
+
if (mDXGIAdapter != nullptr)
{
// NOTE: what lies below is hand wavy math based on compatibility testing and observation against a variety of hardware
@@ -4825,8 +4846,6 @@ void LLWindowWin32::LLWindowWin32Thread::run()
sWindowThreadId = std::this_thread::get_id();
LogChange logger("Window");
- initDX();
-
//as good a place as any to up the MM timer resolution (see ms_sleep)
//attempt to set timer resolution to 1ms
TIMECAPS tc;
@@ -4839,9 +4858,12 @@ void LLWindowWin32::LLWindowWin32Thread::run()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_WIN32;
+ // lazily call initD3D inside this loop to catch when mGLReady has been set to true
+ initDX();
+
if (mWindowHandle != 0)
{
- // lazily call initD3D inside this loop to catch when mWindowHandle has been set
+ // lazily call initD3D inside this loop to catch when mWindowHandle has been set, and mGLReady has been set to true
// *TODO: Shutdown if this fails when mWindowHandle exists
initD3D();
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 750125a1a8..f4e0682ee6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10687,7 +10687,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>0.5</real>
+ <real>1.0</real>
</map>
<key>RenderSkyAutoAdjustHDRScale</key>
<map>
@@ -10700,6 +10700,73 @@
<key>Value</key>
<real>2.0</real>
</map>
+ <key>RendeSkyAutoAdjustBlueHorizonScale</key>
+ <map>
+ <key>Comment</key>
+ <string>Blue Horizon Scale value to use when auto-adjusting legacy skies</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>1.0</real>
+ </map>
+ <key>RendeSkyAutoAdjustBlueDensityScale</key>
+ <map>
+ <key>Comment</key>
+ <string>Blue Horizon Scale value to use when auto-adjusting legacy skies</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>1.0</real>
+ </map>
+ <key>RenderSkyAutoAdjustSunColorScale</key>
+ <map>
+ <key>Comment</key>
+ <string>Sun color scalar when auto-adjusting legacy skies</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>1.0</real>
+ </map>
+ <key>RenderSkyAutoAdjustProbeAmbiance</key>
+ <map>
+ <key>Comment</key>
+ <string>Probe ambiance value when auto-adjusting legacy skies</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.001</real>
+ </map>
+ <key>RenderSkySunlightScale</key>
+ <map>
+ <key>Comment</key>
+ <string>Sunlight scale fudge factor for matching with pre-PBR viewer</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>1.0</real>
+ </map>
+ <key>RenderSkyAmbientScale</key>
+ <map>
+ <key>Comment</key>
+ <string>Ambient scale fudge factor for matching with pre-PBR viewer</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.7</real>
+ </map>
+
<key>RenderReflectionProbeMaxLocalLightAmbiance</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index 53e4f02314..64e6bc9da2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -105,7 +105,8 @@ vec3 toneMap(vec3 color)
color *= exposure * exp_scale;
- color = toneMapACES_Hill(color);
+ // mix ACES and Linear here as a compromise to avoid over-darkening legacy content
+ color = mix(toneMapACES_Hill(color), color, 0.333);
#endif
return color;
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index 437fa0a6d5..a8aa5a36a3 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -39,7 +39,8 @@ uniform float max_y;
uniform vec3 glow;
uniform float scene_light_strength;
uniform float sun_moon_glow_factor;
-uniform float sky_hdr_scale;
+uniform float sky_sunlight_scale;
+uniform float sky_ambient_scale;
float getAmbientClamp() { return 1.0f; }
@@ -148,12 +149,9 @@ void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, ou
// multiply to get similar colors as when the "scaleSoftClip" implementation was doubling color values
// (allows for mixing of light sources other than sunlight e.g. reflection probes)
- sunlit *= 1.5;
- amblit *= 0.5;
+ sunlit *= sky_sunlight_scale;
+ amblit *= sky_ambient_scale;
- // override amblit with ambient_color if sky probe ambiance is not zero
- amblit = mix(amblit, ambient_color, clamp(sky_hdr_scale-1.0, 0.0, 1.0));
-
amblit = srgb_to_linear(amblit);
amblit *= ambientLighting(norm, light_dir);
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index da5f997429..3a251af240 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -85,7 +85,7 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
float getAmbientClamp();
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, float ambiance)
{
@@ -251,7 +251,7 @@ void main()
vec3 irradiance;
vec3 glossenv;
vec3 legacyenv;
- sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true);
+ sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true, amblit_linear);
float da = dot(norm.xyz, light_dir.xyz);
@@ -266,7 +266,7 @@ void main()
vec3 sun_contrib = min(final_da, shadow) * sunlit_linear;
- color.rgb = max(amblit, irradiance);
+ color.rgb = irradiance;
color.rgb += sun_contrib;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
index e8db856b1f..be66b6feb2 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
@@ -92,7 +92,7 @@ void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float
float calcLegacyDistanceAttenuation(float distance, float falloff);
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear);
void waterClip(vec3 pos);
@@ -224,11 +224,8 @@ void main()
float gloss = 1.0 - perceptualRoughness;
vec3 irradiance = vec3(0);
vec3 radiance = vec3(0);
- sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true);
- // Take maximium of legacy ambient vs irradiance sample as irradiance
- // NOTE: ao is applied in pbrIbl (see pbrBaseLight), do not apply here
- irradiance = max(amblit,irradiance);
-
+ sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true, amblit);
+
vec3 diffuseColor;
vec3 specularColor;
calcDiffuseSpecular(col.rgb, metallic, diffuseColor, specularColor);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
index aa6f5a3b62..52e71edcac 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
@@ -34,7 +34,7 @@ uniform mat3 env_mat;
vec3 srgb_to_linear(vec3 c);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear)
{
ambenv = vec3(reflection_probe_ambiance * 0.25);
@@ -44,9 +44,9 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
}
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, vec3 amblit_linear)
{
- sampleReflectionProbes(ambenv, glossenv, tc, pos, norm, glossiness, false);
+ sampleReflectionProbes(ambenv, glossenv, tc, pos, norm, glossiness, false, amblit_linear);
}
vec4 sampleReflectionProbesDebug(vec3 pos)
@@ -56,7 +56,7 @@ vec4 sampleReflectionProbesDebug(vec3 pos)
}
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear)
{
ambenv = vec3(reflection_probe_ambiance * 0.25);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
index 1537714bb7..54a887262b 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
@@ -49,7 +49,7 @@ vec3 srgb_to_linear(vec3 c);
// reflection probe interface
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
@@ -80,7 +80,7 @@ void main()
vec3 legacyenv;
vec3 norm = normalize(vary_texcoord1.xyz);
vec4 spec = vec4(0,0,0,0);
- sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity, false);
+ sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity, false, amblit);
color.rgb = legacy_adjust(color.rgb);
color.rgb = srgb_to_linear(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 82e2de0c0f..319f2f25b7 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -60,7 +60,7 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
#endif
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
@@ -339,10 +339,9 @@ void main()
vec3 ambenv;
vec3 glossenv;
vec3 legacyenv;
- sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env, true);
+ sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env, true, amblit_linear);
- // use sky settings ambient or irradiance map sample, whichever is brighter
- color = max(amblit_linear, ambenv);
+ color = ambenv;
float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0);
vec3 sun_contrib = min(da, shadow) * sunlit_linear;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 549ac50280..d9dc83bb10 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -531,7 +531,7 @@ vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c,
// w - weight of sample (distance and angular attenuation)
// dw - weight of sample (distance only)
// i - index of probe
-vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int i)
+vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int i, vec3 amblit)
{
// parallax adjustment
vec3 v;
@@ -557,9 +557,12 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int
v -= c;
v = env_mat * v;
- {
- return textureLod(irradianceProbes, vec4(v.xyz, refIndex[i].x), 0).rgb * refParams[i].x;
- }
+
+ vec3 col = textureLod(irradianceProbes, vec4(v.xyz, refIndex[i].x), 0).rgb * refParams[i].x;
+
+ col = mix(amblit, col, min(refParams[i].x, 1.0));
+
+ return col;
}
vec3 sampleProbes(vec3 pos, vec3 dir, float lod)
@@ -620,7 +623,7 @@ vec3 sampleProbes(vec3 pos, vec3 dir, float lod)
return col[1]+col[0];
}
-vec3 sampleProbeAmbient(vec3 pos, vec3 dir)
+vec3 sampleProbeAmbient(vec3 pos, vec3 dir, vec3 amblit)
{
// modified copy/paste of sampleProbes follows, will likely diverge from sampleProbes further
// as irradiance map mixing is tuned independently of radiance map mixing
@@ -650,7 +653,7 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir)
float w = 0;
float dw = 0;
- vec3 refcol = tapIrradianceMap(pos, dir, w, dw, refSphere[i].xyz, i);
+ vec3 refcol = tapIrradianceMap(pos, dir, w, dw, refSphere[i].xyz, i, amblit);
col[p] += refcol*w;
wsum[p] += w;
@@ -680,14 +683,14 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir)
}
void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit)
{
// TODO - don't hard code lods
float reflection_lods = max_probe_lod;
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
- ambenv = sampleProbeAmbient(pos, norm);
+ ambenv = sampleProbeAmbient(pos, norm, amblit);
float lod = (1.0-glossiness)*reflection_lods;
glossenv = sampleProbes(pos, normalize(refnormpersp), lod);
@@ -713,14 +716,14 @@ void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
}
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit)
{
preProbeSample(pos);
- doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness, transparent);
+ doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness, transparent, amblit);
}
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, vec3 amblit)
{
// don't sample automatic probes for water
sample_automatic = false;
@@ -729,7 +732,7 @@ void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
// always include void probe on water
probeIndex[probeInfluences++] = 0;
- doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness, false);
+ doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness, false, amblit);
// fudge factor to get PBR water at a similar luminance ot legacy water
glossenv *= 0.4;
@@ -784,14 +787,14 @@ vec4 sampleReflectionProbesDebug(vec3 pos)
}
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit)
{
float reflection_lods = max_probe_lod;
preProbeSample(pos);
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
- ambenv = sampleProbeAmbient(pos, norm);
+ ambenv = sampleProbeAmbient(pos, norm, amblit);
if (glossiness > 0.0)
{
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 2483355205..20a5ad66b6 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -77,9 +77,9 @@ vec3 scaleSoftClipFragLinear(vec3 l);
// reflection probe interface
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear);
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
float getDepth(vec2 pos_screen);
@@ -125,10 +125,10 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
vec3 l); //surface point to light
-void adjustIrradiance(inout vec3 irradiance, vec3 amblit_linear, float ambocc)
+void adjustIrradiance(inout vec3 irradiance, float ambocc)
{
// use sky settings ambient or irradiance map sample, whichever is brighter
- irradiance = max(amblit_linear, irradiance);
+ //irradiance = max(amblit_linear, irradiance);
#if defined(HAS_SSAO)
irradiance = mix(ssao_effect_mat * min(irradiance.rgb*ssao_irradiance_scale, vec3(ssao_irradiance_max)), irradiance.rgb, ambocc);
@@ -202,9 +202,9 @@ void main()
// PBR IBL
float gloss = 1.0 - perceptualRoughness;
- sampleReflectionProbes(irradiance, radiance, tc, pos.xyz, norm.xyz, gloss, false);
+ sampleReflectionProbes(irradiance, radiance, tc, pos.xyz, norm.xyz, gloss, false, amblit_linear);
- adjustIrradiance(irradiance, amblit_linear, ambocc);
+ adjustIrradiance(irradiance, ambocc);
vec3 diffuseColor;
vec3 specularColor;
@@ -244,9 +244,9 @@ void main()
vec3 glossenv = vec3(0);
vec3 legacyenv = vec3(0);
- sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, tc, pos.xyz, norm.xyz, spec.a, envIntensity, false);
+ sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, tc, pos.xyz, norm.xyz, spec.a, envIntensity, false, amblit_linear);
- adjustIrradiance(irradiance, amblit_linear, ambocc);
+ adjustIrradiance(irradiance, ambocc);
// apply lambertian IBL only (see pbrIbl)
color.rgb = irradiance;
diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
index 8fee259933..4f79dd1ac5 100644
--- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
@@ -124,7 +124,7 @@ vec3 transform_normal(vec3 vNt)
}
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, vec3 amblit_linear);
vec3 getPositionWithNDC(vec3 ndc);
@@ -237,7 +237,7 @@ void main()
vec3 irradiance = vec3(0);
vec3 radiance = vec3(0);
- sampleReflectionProbesWater(irradiance, radiance, distort2, pos.xyz, wave_ibl.xyz, gloss);
+ sampleReflectionProbesWater(irradiance, radiance, distort2, pos.xyz, wave_ibl.xyz, gloss, amblit);
irradiance = vec3(0);
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1b2858cdc2..0bece6367e 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4169,7 +4169,7 @@ U32 LLAppViewer::getObjectCacheVersion()
{
// Viewer object cache version, change if object update
// format changes. JC
- const U32 INDRA_OBJECT_CACHE_VERSION = 16;
+ const U32 INDRA_OBJECT_CACHE_VERSION = 17;
return INDRA_OBJECT_CACHE_VERSION;
}
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index cec1f47a4c..c1776705f9 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1144,22 +1144,32 @@ void push_for_transform(LLVertexBuffer* buff, U32 source_count, U32 dest_count)
}
BOOL LLFace::getGeometryVolume(const LLVolume& volume,
- const S32 &f,
- const LLMatrix4& mat_vert_in, const LLMatrix3& mat_norm_in,
- const U16 &index_offset,
- bool force_rebuild)
+ S32 face_index,
+ const LLMatrix4& mat_vert_in,
+ const LLMatrix3& mat_norm_in,
+ U16 index_offset,
+ bool force_rebuild,
+ bool no_debug_assert)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE;
llassert(verify());
- if (volume.getNumVolumeFaces() <= f) {
- LL_WARNS() << "Attempt get volume face out of range! Total Faces: " << volume.getNumVolumeFaces() << " Attempt get access to: " << f << LL_ENDL;
- return FALSE;
- }
+ if (face_index < 0 || face_index >= volume.getNumVolumeFaces())
+ {
+ if (gDebugGL)
+ {
+ LL_WARNS() << "Face index is out of bounds!" << LL_ENDL;
+ LL_WARNS() << "Attempt get volume face out of range!"
+ " Total Faces: " << volume.getNumVolumeFaces() <<
+ " Attempt get access to: " << face_index << LL_ENDL;
+ llassert(no_debug_assert);
+ }
+ return FALSE;
+ }
bool rigged = isState(RIGGED);
- const LLVolumeFace &vf = volume.getVolumeFace(f);
+ const LLVolumeFace &vf = volume.getVolumeFace(face_index);
S32 num_vertices = (S32)vf.mNumVertices;
S32 num_indices = (S32) vf.mNumIndices;
@@ -1174,14 +1184,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (gDebugGL)
{
- LL_WARNS() << "Index buffer overflow!" << LL_ENDL;
+ LL_WARNS() << "Index buffer overflow!" << LL_ENDL;
LL_WARNS() << "Indices Count: " << mIndicesCount
<< " VF Num Indices: " << num_indices
<< " Indices Index: " << mIndicesIndex
<< " VB Num Indices: " << mVertexBuffer->getNumIndices() << LL_ENDL;
- LL_WARNS() << " Face Index: " << f
+ LL_WARNS() << " Face Index: " << face_index
<< " Pool Type: " << mPoolType << LL_ENDL;
- llassert(false);
+ llassert(no_debug_assert);
}
return FALSE;
}
@@ -1191,7 +1201,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (gDebugGL)
{
LL_WARNS() << "Vertex buffer overflow!" << LL_ENDL;
- llassert(false);
+ llassert(no_debug_assert);
}
return FALSE;
}
@@ -1228,7 +1238,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
bool rebuild_tangent = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_TANGENT);
bool rebuild_weights = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_WEIGHT4);
- const LLTextureEntry *tep = mVObjp->getTE(f);
+ const LLTextureEntry *tep = mVObjp->getTE(face_index);
const U8 bump_code = tep ? tep->getBumpmap() : 0;
BOOL is_static = mDrawablep->isStatic();
@@ -1443,7 +1453,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (bump_code)
{
- mVObjp->getVolume()->genTangents(f);
+ mVObjp->getVolume()->genTangents(face_index);
F32 offset_multiple;
switch( bump_code )
{
@@ -1492,7 +1502,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
U8 texgen = getTextureEntry()->getTexGen();
if (rebuild_tcoord && texgen != LLTextureEntry::TEX_GEN_DEFAULT)
{ //planar texgen needs binormals
- mVObjp->getVolume()->genTangents(f);
+ mVObjp->getVolume()->genTangents(face_index);
}
U8 tex_mode = 0;
@@ -1775,7 +1785,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
mVertexBuffer->getTexCoord1Strider(tex_coords1, mGeomIndex, mGeomCount);
- mVObjp->getVolume()->genTangents(f);
+ mVObjp->getVolume()->genTangents(face_index);
for (S32 i = 0; i < num_vertices; i++)
{
@@ -1895,7 +1905,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
mVertexBuffer->getTangentStrider(tangent, mGeomIndex, mGeomCount);
F32* tangents = (F32*) tangent.get();
- mVObjp->getVolume()->genTangents(f);
+ mVObjp->getVolume()->genTangents(face_index);
LLVector4Logical mask;
mask.clear();
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 0a66dc6ba6..eb3b47d6d6 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -156,10 +156,12 @@ public:
void updateRebuildFlags();
bool canRenderAsMask(); // logic helper
BOOL getGeometryVolume(const LLVolume& volume,
- const S32 &f,
- const LLMatrix4& mat_vert, const LLMatrix3& mat_normal,
- const U16 &index_offset,
- bool force_rebuild = false);
+ S32 face_index,
+ const LLMatrix4& mat_vert,
+ const LLMatrix3& mat_normal,
+ U16 index_offset,
+ bool force_rebuild = false,
+ bool no_debug_assert = false);
// For avatar
U16 getGeometryAvatar(
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index fb55c6c6c4..b53839977e 100644
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -122,7 +122,7 @@ const std::string LLFloaterPermsDefault::sCategoryNames[CAT_LAST] =
"Notecards",
"Gestures",
"Wearables",
- "Settings"
+ "Settings",
"Materials"
};
diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h
index 02359a256e..97ddec7cba 100644
--- a/indra/newview/llfloaterperms.h
+++ b/indra/newview/llfloaterperms.h
@@ -75,6 +75,7 @@ enum Categories
CAT_GESTURES,
CAT_WEARABLES,
CAT_SETTINGS,
+ CAT_MATERIALS,
CAT_LAST
};
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp
index 99a052f719..8919229c78 100644
--- a/indra/newview/llgltfmateriallist.cpp
+++ b/indra/newview/llgltfmateriallist.cpp
@@ -160,9 +160,9 @@ public:
// sides - array of S32 indices of texture entries
// gltf_json - array of corresponding Strings of GLTF json for override data
-
LLSD message;
bool success = true;
+#if 0 //deprecated
for(const std::string& llsdRaw : strings)
{
std::istringstream llsdData(llsdRaw);
@@ -198,6 +198,7 @@ public:
applyData(object_override);
}
+#endif
return success;
}
@@ -213,6 +214,7 @@ public:
{
// Parse the data
+#if 0 // DEPRECATED
LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop");
LL::WorkQueue::ptr_t general_queue = LL::WorkQueue::getInstance("General");
@@ -235,24 +237,17 @@ public:
results.reserve(sides.size());
// parse json
- std::unordered_map<S32, std::string>::const_iterator iter = sides.begin();
- std::unordered_map<S32, std::string>::const_iterator end = sides.end();
+ std::unordered_map<S32, LLSD>::const_iterator iter = sides.begin();
+ std::unordered_map<S32, LLSD>::const_iterator end = sides.end();
while (iter != end)
{
- std::string warn_msg, error_msg;
-
ReturnData result;
- bool success = result.mMaterial.fromJSON(iter->second, warn_msg, error_msg);
-
- result.mSuccess = success;
+ result.mMaterial.applyOverrideLLSD(iter->second);
+
+ result.mSuccess = true;
result.mSide = iter->first;
- if (!success)
- {
- LL_WARNS("GLTF") << "failed to parse GLTF override data. errors: " << error_msg << " | warnings: " << warn_msg << LL_ENDL;
- }
-
results.push_back(result);
iter++;
}
@@ -318,6 +313,7 @@ public:
}
});
}
+#endif
}
private:
@@ -330,6 +326,89 @@ namespace
LLGLTFMaterialOverrideDispatchHandler handle_gltf_override_message;
}
+void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::string& data_in)
+{
+ std::istringstream str(data_in);
+
+ LLSD data;
+
+ LLSDSerialize::fromNotation(data, str, data_in.length());
+
+ const LLHost& host = msg->getSender();
+
+ LLViewerRegion* region = LLWorld::instance().getRegion(host);
+ llassert(region);
+
+ if (region)
+ {
+ U32 local_id = data.get("id").asInteger();
+ LLUUID id;
+ gObjectList.getUUIDFromLocal(id, local_id, host.getAddress(), host.getPort());
+ LLViewerObject* obj = gObjectList.findObject(id);
+
+ // NOTE: obj may be null if the viewer hasn't heard about the object yet, cache update in any case
+
+ if (obj && gShowObjectUpdates)
+ { // display a cyan blip for override updates when "Show Updates to Objects" enabled
+ LLColor4 color(0.f, 1.f, 1.f, 1.f);
+ gPipeline.addDebugBlip(obj->getPositionAgent(), color);
+ }
+
+ const LLSD& tes = data["te"];
+ const LLSD& od = data["od"];
+
+ constexpr U32 MAX_TES = 45;
+ bool has_te[MAX_TES] = { false };
+
+ if (tes.isArray()) // NOTE: if no "te" array exists, this is a malformed message (null out all overrides will come in as an empty te array)
+ {
+ LLGLTFOverrideCacheEntry cache;
+ cache.mLocalId = local_id;
+ cache.mObjectId = id;
+ cache.mRegionHandle = region->getHandle();
+
+ U32 count = llmin(tes.size(), MAX_TES);
+ for (U32 i = 0; i < count; ++i)
+ {
+ LLGLTFMaterial* mat = new LLGLTFMaterial(); // setTEGLTFMaterialOverride and cache will take ownership
+ mat->applyOverrideLLSD(od[i]);
+
+ S32 te = tes[i].asInteger();
+
+ has_te[te] = true;
+ cache.mSides[te] = od[i];
+ cache.mGLTFMaterial[te] = mat;
+
+ if (obj)
+ {
+ obj->setTEGLTFMaterialOverride(te, mat);
+ if (obj->getTE(te) && obj->getTE(te)->isSelected())
+ {
+ handle_gltf_override_message.doSelectionCallbacks(id, te);
+ }
+ }
+ }
+
+ if (obj)
+ { // null out overrides on TEs that shouldn't have them
+ U32 count = llmin(obj->getNumTEs(), MAX_TES);
+ for (U32 i = 0; i < count; ++i)
+ {
+ LLTextureEntry* te = obj->getTE(i);
+ if (!has_te[i] && te && te->getGLTFMaterialOverride())
+ {
+ obj->setTEGLTFMaterialOverride(i, nullptr);
+ handle_gltf_override_message.doSelectionCallbacks(id, i);
+ }
+ }
+ }
+
+ region->cacheFullUpdateGLTFOverride(cache);
+ }
+
+ }
+}
+
void LLGLTFMaterialList::queueOverrideUpdate(const LLUUID& id, S32 side, LLGLTFMaterial* override_data)
{
#if 0
diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h
index ce8781baba..7317214019 100644
--- a/indra/newview/llgltfmateriallist.h
+++ b/indra/newview/llgltfmateriallist.h
@@ -101,6 +101,9 @@ public:
static void loadCacheOverrides(const LLGLTFOverrideCacheEntry& override);
+ // Apply an override update with the given data
+ void applyOverrideMessage(LLMessageSystem* msg, const std::string& data);
+
private:
friend class LLGLTFMaterialOverrideDispatchHandler;
// save an override update that we got from the simulator for later (for example, if an override arrived for an unknown object)
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index aa96487907..dce92260a0 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1010,6 +1010,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
&& objectp->permModify())
{
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
+ BOOL attachment = objectp->isAttachment();
bool has_pbr_material;
bool has_faces_without_pbr;
@@ -1306,6 +1307,18 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
texture_ctrl->setBakeTextureEnabled(TRUE);
}
+
+ if (attachment)
+ {
+ // attachments are in world and in inventory,
+ // server doesn't support changing permissions
+ // in such case
+ texture_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ }
+ else
+ {
+ texture_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ }
}
if (shinytexture_ctrl)
@@ -1313,6 +1326,15 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
shinytexture_ctrl->setTentative( !identical_spec );
shinytexture_ctrl->setEnabled( editable && !has_pbr_material);
shinytexture_ctrl->setImageAssetID( specmap_id );
+
+ if (attachment)
+ {
+ shinytexture_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ }
+ else
+ {
+ shinytexture_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ }
}
if (bumpytexture_ctrl)
@@ -1320,6 +1342,15 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bumpytexture_ctrl->setTentative( !identical_norm );
bumpytexture_ctrl->setEnabled( editable && !has_pbr_material);
bumpytexture_ctrl->setImageAssetID( normmap_id );
+
+ if (attachment)
+ {
+ bumpytexture_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ }
+ else
+ {
+ bumpytexture_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ }
}
}
@@ -1905,6 +1936,15 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
pbr_ctrl->setTentative(identical_pbr ? FALSE : TRUE);
pbr_ctrl->setEnabled(settable);
pbr_ctrl->setImageAssetID(pbr_id);
+
+ if (objectp->isAttachment())
+ {
+ pbr_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER | PERM_MODIFY);
+ }
+ else
+ {
+ pbr_ctrl->setImmediateFilterPermMask(PERM_NONE);
+ }
}
getChildView("pbr_from_inventory")->setEnabled(settable);
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 74c02099f8..2bad5d4235 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -374,6 +374,15 @@ void LLPanelVolume::getState( )
{
LightTextureCtrl->setEnabled(FALSE);
LightTextureCtrl->setValid(FALSE);
+
+ if (objectp->isAttachment())
+ {
+ LightTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
+ }
+ else
+ {
+ LightTextureCtrl->setImmediateFilterPermMask(PERM_NONE);
+ }
}
getChildView("Light Intensity")->setEnabled(false);
@@ -1439,6 +1448,19 @@ void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item
if (volobjp)
{
LLViewerInventoryItem* item = gInventory.getItem(item_id);
+
+ if (item && volobjp->isAttachment())
+ {
+ const LLPermissions& perm = item->getPermissions();
+ BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
+ if (!unrestricted)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return;
+ }
+ }
+
if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
{
LLToolDragAndDrop::handleDropMaterialProtections(volobjp, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index c2cb8f183a..07c712a9a6 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -158,6 +158,10 @@ void LLReflectionMap::autoAdjustOrigin()
}
mRadius = llmax(sqrtf(r2.getF32()), 8.f);
+
+ // make sure near clip doesn't poke through ground
+ fp[2] = llmax(fp[2], height+mRadius*0.5f);
+
}
}
else if (mViewerObject)
@@ -205,6 +209,14 @@ F32 LLReflectionMap::getNearClip()
{
ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeNearClip();
}
+ else if (mGroup)
+ {
+ ret = mRadius * 0.5f; // default to half radius for automatic object probes
+ }
+ else
+ {
+ ret = 1.f; // default to 1m for automatic terrain probes
+ }
return llmax(ret, MINIMUM_NEAR_CLIP);
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 6692d124d8..ecc2783eb1 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1852,10 +1852,24 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid)
f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mImageID(id) {}
bool apply(LLViewerObject* objectp, S32 te)
{
- if(objectp && !objectp->permModify())
+ if(!objectp || !objectp->permModify())
{
return false;
}
+
+ // Might be better to run willObjectAcceptInventory
+ if (mItem && objectp->isAttachment())
+ {
+ const LLPermissions& perm = mItem->getPermissions();
+ BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
+ if (!unrestricted)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return false;
+ }
+ }
+
if (mItem)
{
LLToolDragAndDrop::dropTextureOneFace(objectp,
@@ -1938,10 +1952,21 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mMatId(id) {}
bool apply(LLViewerObject* objectp, S32 te)
{
- if (objectp && !objectp->permModify())
+ if (!objectp || !objectp->permModify())
{
return false;
}
+ if (mItem && objectp->isAttachment())
+ {
+ const LLPermissions& perm = mItem->getPermissions();
+ BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
+ if (!unrestricted)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return false;
+ }
+ }
LLUUID asset_id = mMatId;
if (mItem)
{
@@ -2256,7 +2281,19 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id)
if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
{
LLViewerObject *object = mSelectedObjects->getFirstRootObject();
- if (!object) return;
+ if (!object)
+ {
+ return;
+ }
+ const LLPermissions& perm = item->getPermissions();
+ BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
+ BOOL attached = object->isAttachment();
+ if (attached && !unrestricted)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return;
+ }
LLToolDragAndDrop::handleDropMaterialProtections(object, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
}
getSelection()->applyToTEs(&setfunc);
@@ -2316,7 +2353,19 @@ void LLSelectMgr::selectionSetShiny(U8 shiny, const LLUUID &image_id)
if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
{
LLViewerObject *object = mSelectedObjects->getFirstRootObject();
- if (!object) return;
+ if (!object)
+ {
+ return;
+ }
+ const LLPermissions& perm = item->getPermissions();
+ BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
+ BOOL attached = object->isAttachment();
+ if (attached && !unrestricted)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return;
+ }
LLToolDragAndDrop::handleDropMaterialProtections(object, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
}
getSelection()->applyToTEs(&setfunc);
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index ab5a154f08..b0edb9d2f6 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -721,6 +721,15 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<F32> auto_adjust_ambient_scale(gSavedSettings, "RenderSkyAutoAdjustAmbientScale", 0.75f);
static LLCachedControl<F32> auto_adjust_hdr_scale(gSavedSettings, "RenderSkyAutoAdjustHDRScale", 2.f);
+ static LLCachedControl<F32> auto_adjust_blue_horizon_scale(gSavedSettings, "RenderSkyAutoAdjustBlueHorizonScale", 1.f);
+ static LLCachedControl<F32> auto_adjust_blue_density_scale(gSavedSettings, "RenderSkyAutoAdjustBlueDensityScale", 1.f);
+ static LLCachedControl<F32> auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f);
+ static LLCachedControl<F32> auto_adjust_probe_ambiance(gSavedSettings, "RenderSkyAutoAdjustProbeAmbiance", 1.f);
+ static LLCachedControl<F32> sunlight_scale(gSavedSettings, "RenderSkySunlightScale", 1.5f);
+ static LLCachedControl<F32> ambient_scale(gSavedSettings, "RenderSkyAmbientScale", 1.5f);
+
+ shader->uniform1f(LLShaderMgr::SKY_SUNLIGHT_SCALE, sunlight_scale);
+ shader->uniform1f(LLShaderMgr::SKY_AMBIENT_SCALE, ambient_scale);
static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f);
F32 probe_ambiance = getTotalReflectionProbeAmbiance(cloud_shadow_scale);
@@ -733,14 +742,23 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
{
if (psky->getReflectionProbeAmbiance() != 0.f)
{
- shader->uniform3fv(LLShaderMgr::AMBIENT, getAmbientColor().mV);
+ shader->uniform3fv(LLShaderMgr::AMBIENT, LLVector3(ambient.mV));
shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, sqrtf(g)*2.0); // use a modifier here so 1.0 maps to the "most desirable" default and the maximum value doesn't go off the rails
}
else if (psky->canAutoAdjust() && should_auto_adjust)
{ // auto-adjust legacy sky to take advantage of probe ambiance
shader->uniform3fv(LLShaderMgr::AMBIENT, (ambient * auto_adjust_ambient_scale).mV);
shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, auto_adjust_hdr_scale);
- probe_ambiance = 1.f; // NOTE -- must match LLSettingsSky::getReflectionProbeAmbiance value for "auto_adjust" true
+ LLColor3 blue_horizon = getBlueHorizon() * auto_adjust_blue_horizon_scale;
+ LLColor3 blue_density = getBlueDensity() * auto_adjust_blue_density_scale;
+ LLColor3 sun_diffuse = getSunDiffuse() * auto_adjust_sun_color_scale;
+
+ shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, sun_diffuse.mV);
+ shader->uniform3fv(LLShaderMgr::BLUE_DENSITY, blue_density.mV);
+ shader->uniform3fv(LLShaderMgr::BLUE_HORIZON, blue_horizon.mV);
+
+ LLSettingsSky::sAutoAdjustProbeAmbiance = auto_adjust_probe_ambiance;
+ probe_ambiance = auto_adjust_probe_ambiance; // NOTE -- must match LLSettingsSky::getReflectionProbeAmbiance value for "auto_adjust" true
}
else
{
@@ -755,7 +773,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor());
shader->uniform1f(LLShaderMgr::DENSITY_MULTIPLIER, getDensityMultiplier());
shader->uniform1f(LLShaderMgr::DISTANCE_MULTIPLIER, getDistanceMultiplier());
-
+
shader->uniform1f(LLShaderMgr::GAMMA, g);
}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 97324bff22..e2a4eb1c48 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2712,6 +2712,7 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFunc("InitiateDownload", process_initiate_download);
msg->setHandlerFunc("LandStatReply", LLFloaterTopObjects::handle_land_reply);
msg->setHandlerFunc("GenericMessage", process_generic_message);
+ msg->setHandlerFunc("GenericStreamingMessage", process_generic_streaming_message);
msg->setHandlerFunc("LargeGenericMessage", process_large_generic_message);
msg->setHandlerFuncFast(_PREHASH_FeatureDisabled, process_feature_disabled_message);
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index c13376d0a6..7e399a6808 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -1339,6 +1339,12 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT
}
}
+void LLFloaterTexturePicker::setImmediateFilterPermMask(PermissionMask mask)
+{
+ mImmediateFilterPermMask = mask;
+ mInventoryPanel->setFilterPermMask(mask);
+}
+
void LLFloaterTexturePicker::onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle)
{
std::vector<std::string>::const_iterator iter = filenames.begin();
@@ -1526,6 +1532,17 @@ void LLTextureCtrl::setCanApply(bool can_preview, bool can_apply)
}
}
+void LLTextureCtrl::setImmediateFilterPermMask(PermissionMask mask)
+{
+ mImmediateFilterPermMask = mask;
+
+ LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
+ if (floaterp)
+ {
+ floaterp->setImmediateFilterPermMask(mask);
+ }
+}
+
void LLTextureCtrl::setVisible( BOOL visible )
{
if( !visible )
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index ba310dd9a6..d82a167c93 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -184,8 +184,7 @@ public:
void setCanApply(bool can_preview, bool can_apply);
- void setImmediateFilterPermMask(PermissionMask mask)
- { mImmediateFilterPermMask = mask; }
+ void setImmediateFilterPermMask(PermissionMask mask);
void setDnDFilterPermMask(PermissionMask mask)
{ mDnDFilterPermMask = mask; }
PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; }
@@ -351,6 +350,7 @@ public:
void setBakeTextureEnabled(BOOL enabled);
void setInventoryPickType(LLTextureCtrl::EPickInventoryType type);
+ void setImmediateFilterPermMask(PermissionMask mask);
static void onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle);
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index afcdb26f1a..1b65439b2b 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1648,6 +1648,8 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
if(attached && !unrestricted)
{
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
return ACCEPT_NO_LOCKED;
}
else if(modify && transfer && volume && !worn)
diff --git a/indra/newview/llviewergenericmessage.cpp b/indra/newview/llviewergenericmessage.cpp
index d3de9d72bf..aaa1313ff6 100644
--- a/indra/newview/llviewergenericmessage.cpp
+++ b/indra/newview/llviewergenericmessage.cpp
@@ -32,9 +32,10 @@
#include "lldispatcher.h"
#include "lluuid.h"
#include "message.h"
+#include "llgenericstreamingmessage.h"
#include "llagent.h"
-
+#include "llgltfmateriallist.h"
LLDispatcher gGenericDispatcher;
@@ -92,6 +93,21 @@ void process_generic_message(LLMessageSystem* msg, void**)
}
}
+void process_generic_streaming_message(LLMessageSystem* msg, void**)
+{
+ LLGenericStreamingMessage data;
+ data.unpack(msg);
+ switch (data.mMethod)
+ {
+ case LLGenericStreamingMessage::METHOD_GLTF_MATERIAL_OVERRIDE:
+ gGLTFMaterialList.applyOverrideMessage(msg, data.mData);
+ break;
+ default:
+ LL_WARNS_ONCE() << "Received unknown method" << LL_ENDL;
+ break;
+ }
+}
+
void process_large_generic_message(LLMessageSystem* msg, void**)
{
LLUUID agent_id;
diff --git a/indra/newview/llviewergenericmessage.h b/indra/newview/llviewergenericmessage.h
index 170f38a485..96a73a3d5f 100644
--- a/indra/newview/llviewergenericmessage.h
+++ b/indra/newview/llviewergenericmessage.h
@@ -38,6 +38,7 @@ void send_generic_message(const std::string& method,
const LLUUID& invoice = LLUUID::null);
void process_generic_message(LLMessageSystem* msg, void**);
+void process_generic_streaming_message(LLMessageSystem* msg, void**);
void process_large_generic_message(LLMessageSystem* msg, void**);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 870639c754..8c76950da2 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -222,7 +222,7 @@ public:
LLVOCacheEntry::vocache_entry_set_t mVisibleEntries; //must-be-created visible entries wait for objects creation.
LLVOCacheEntry::vocache_entry_priority_list_t mWaitingList; //transient list storing sorted visible entries waiting for object creation.
std::set<U32> mNonCacheableCreatedList; //list of local ids of all non-cacheable objects
- LLVOCacheEntry::vocache_gltf_overrides_map_t mGLTFOverridesJson; // for materials
+ LLVOCacheEntry::vocache_gltf_overrides_map_t mGLTFOverridesLLSD; // for materials
// time?
// LRU info?
@@ -795,7 +795,7 @@ void LLViewerRegion::loadObjectCache()
{
LLVOCache & vocache = LLVOCache::instance();
vocache.readFromCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap);
- vocache.readGenericExtrasFromCache(mHandle, mImpl->mCacheID, mImpl->mGLTFOverridesJson);
+ vocache.readGenericExtrasFromCache(mHandle, mImpl->mCacheID, mImpl->mGLTFOverridesLLSD);
if (mImpl->mCacheMap.empty())
{
@@ -825,7 +825,7 @@ void LLViewerRegion::saveObjectCache()
LLVOCache & instance = LLVOCache::instance();
instance.writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, removal_enabled);
- instance.writeGenericExtrasToCache(mHandle, mImpl->mCacheID, mImpl->mGLTFOverridesJson, mCacheDirty, removal_enabled);
+ instance.writeGenericExtrasToCache(mHandle, mImpl->mCacheID, mImpl->mGLTFOverridesLLSD, mCacheDirty, removal_enabled);
mCacheDirty = FALSE;
}
@@ -2664,7 +2664,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec
void LLViewerRegion::cacheFullUpdateGLTFOverride(const LLGLTFOverrideCacheEntry &override_data)
{
U32 local_id = override_data.mLocalId;
- mImpl->mGLTFOverridesJson[local_id] = override_data;
+ mImpl->mGLTFOverridesLLSD[local_id] = override_data;
}
LLVOCacheEntry* LLViewerRegion::getCacheEntryForOctree(U32 local_id)
@@ -3656,8 +3656,8 @@ std::string LLViewerRegion::getSimHostName()
void LLViewerRegion::loadCacheMiscExtras(U32 local_id)
{
- auto iter = mImpl->mGLTFOverridesJson.find(local_id);
- if (iter != mImpl->mGLTFOverridesJson.end())
+ auto iter = mImpl->mGLTFOverridesLLSD.find(local_id);
+ if (iter != mImpl->mGLTFOverridesLLSD.end())
{
LLGLTFMaterialList::loadCacheOverrides(iter->second);
}
@@ -3669,8 +3669,8 @@ void LLViewerRegion::applyCacheMiscExtras(LLViewerObject* obj)
llassert(obj);
U32 local_id = obj->getLocalID();
- auto iter = mImpl->mGLTFOverridesJson.find(local_id);
- if (iter != mImpl->mGLTFOverridesJson.end())
+ auto iter = mImpl->mGLTFOverridesLLSD.find(local_id);
+ if (iter != mImpl->mGLTFOverridesLLSD.end())
{
llassert(iter->second.mGLTFMaterial.size() == iter->second.mSides.size());
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index cb58588848..9fc092d4b9 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -2096,7 +2096,8 @@ bool LLViewerFetchedTexture::updateFetch()
}
}
- llassert_always(mRawImage.notNull() || (!mNeedsCreateTexture && !mIsRawImageValid));
+ llassert_always(mRawImage.notNull() || !mIsRawImageValid);
+ llassert_always(mRawImage.notNull() || !mNeedsCreateTexture);
return mIsFetching ? true : false;
}
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index a92057d010..dd5b9f9fd5 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -85,40 +85,24 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
// message should be interpreted thusly:
/// sides is a list of face indices
- // gltf_json is a list of corresponding json
+ // gltf_llsd is a list of corresponding GLTF override LLSD
// any side not represented in "sides" has no override
- if (data.has("sides") && data.has("gltf_json"))
+ if (data.has("sides") && data.has("gltf_llsd"))
{
LLSD const& sides = data.get("sides");
- LLSD const& gltf_json = data.get("gltf_json");
+ LLSD const& gltf_llsd = data.get("gltf_llsd");
- if (sides.isArray() && gltf_json.isArray() &&
+ if (sides.isArray() && gltf_llsd.isArray() &&
sides.size() != 0 &&
- sides.size() == gltf_json.size())
+ sides.size() == gltf_llsd.size())
{
for (int i = 0; i < sides.size(); ++i)
{
S32 side_idx = sides[i].asInteger();
- std::string gltf_json_str = gltf_json[i].asString();
- mSides[side_idx] = gltf_json_str;
+ mSides[side_idx] = gltf_llsd[i];
LLGLTFMaterial* override_mat = new LLGLTFMaterial();
- std::string error, warn;
- if (override_mat->fromJSON(gltf_json_str, warn, error))
- {
- mGLTFMaterial[side_idx] = override_mat;
- }
- else
- {
- LL_WARNS() << "Invalid GLTF string: \n" << gltf_json_str << LL_ENDL;
- if (!error.empty())
- {
- LL_WARNS() << "Error: " << error << LL_ENDL;
- }
- if (!warn.empty())
- {
- LL_WARNS() << "Warning: " << warn << LL_ENDL;
- }
- }
+ override_mat->applyOverrideLLSD(gltf_llsd[i]);
+ mGLTFMaterial[side_idx] = override_mat;
}
}
else
@@ -157,7 +141,7 @@ LLSD LLGLTFOverrideCacheEntry::toLLSD() const
// check that mSides and mGLTFMaterial have exactly the same keys present
llassert(mGLTFMaterial.count(side.first) == 1);
data["sides"].append(LLSD::Integer(side.first));
- data["gltf_json"].append(side.second);
+ data["gltf_llsd"].append(side.second);
}
return data;
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index ec0df31828..8525edd121 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -48,7 +48,7 @@ public:
LLUUID mObjectId;
U32 mLocalId = 0;
- std::unordered_map<S32, std::string> mSides; //json per side
+ std::unordered_map<S32, LLSD> mSides; //override LLSD per side
std::unordered_map<S32, LLPointer<LLGLTFMaterial> > mGLTFMaterial; //GLTF material per side
U64 mRegionHandle = 0;
};
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 23580c4ec0..0ea315af1b 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -6135,12 +6135,18 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
LLVertexBuffer* buff = face->getVertexBuffer();
if (buff)
{
- if (!face->getGeometryVolume(*volume, face->getTEOffset(),
- vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex()))
- { //something's gone wrong with the vertex buffer accounting, rebuild this group
- group->dirtyGeom();
- gPipeline.markRebuild(group);
- }
+ if (!face->getGeometryVolume(*volume, // volume
+ face->getTEOffset(), // face_index
+ vobj->getRelativeXform(), // mat_vert_in
+ vobj->getRelativeXformInvTrans(), // mat_norm_in
+ face->getGeomIndex(), // index_offset
+ false, // force_rebuild
+ true)) // no_debug_assert
+ { // Something's gone wrong with the vertex buffer accounting,
+ // rebuild this group with no debug assert because MESH_DIRTY
+ group->dirtyGeom();
+ gPipeline.markRebuild(group);
+ }
buff->unmapBuffer();
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index af2a26f54d..ffa20aec2d 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7753,7 +7753,17 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m);
}
- shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV);
+ // auto adjust legacy sun color if needed
+ static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
+ static LLCachedControl<F32> auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f);
+ LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
+ LLColor3 sun_diffuse(mSunDiffuse.mV);
+ if (should_auto_adjust && psky->canAutoAdjust())
+ {
+ sun_diffuse *= auto_adjust_sun_color_scale;
+ }
+
+ shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, sun_diffuse.mV);
shader.uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV);
shader.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mReflectionMapManager.mMaxProbeLOD);
diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg
index a3ddc6d336..c019a76793 100755
--- a/scripts/messages/message_template.msg
+++ b/scripts/messages/message_template.msg
@@ -5790,6 +5790,25 @@ version 2.0
}
}
+// GenericStreamingMessage
+// Optimized generic message for streaming arbitrary data to viewer
+// Avoid payloads over 7KB (8KB ceiling)
+// Method -- magic number indicating method to use to decode payload:
+// 0x4175 - GLTF material override data
+// Payload -- data to be decoded
+{
+ GenericStreamingMessage High 31 Trusted Unencoded
+ {
+ MethodData Single
+ { Method U16 }
+ }
+
+ {
+ DataBlock Single
+ { Data Variable 2 }
+ }
+}
+
// LargeGenericMessage
// Similar to the above messages, but can handle larger payloads and serialized
// LLSD. Uses HTTP transport
diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1
index 4712a03e8d..5ad85458e9 100755
--- a/scripts/messages/message_template.msg.sha1
+++ b/scripts/messages/message_template.msg.sha1
@@ -1 +1 @@
-dddb11f7e45f1779ff536819f36a20e63d572ba8 \ No newline at end of file
+e3bd0529a647d938ab6d48f26d21dd52c07ebc6e \ No newline at end of file