summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-01-10 18:42:21 -0600
committerDave Parks <davep@lindenlab.com>2023-01-10 18:42:21 -0600
commit28c245b071e0dfdbacce6f287eb80f57f850d857 (patch)
treefcc0c662296e3fb2b13394f6a4db3ec058c7e436
parent68da705f3ba284928c7e23acd4164d56dea17af9 (diff)
parentc6ea8f9c825e823c4f1130d3448eb83a02b8af87 (diff)
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/copyF.glsl2
-rw-r--r--indra/newview/llgltfmateriallist.cpp4
-rw-r--r--indra/newview/llselectmgr.cpp1
-rw-r--r--indra/newview/lltooldraganddrop.cpp77
-rw-r--r--indra/newview/pipeline.cpp6
5 files changed, 82 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/interface/copyF.glsl b/indra/newview/app_settings/shaders/class1/interface/copyF.glsl
index 764bace621..65d3c20091 100644
--- a/indra/newview/app_settings/shaders/class1/interface/copyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/copyF.glsl
@@ -33,7 +33,7 @@ out vec4 frag_color;
void main()
{
frag_color = texture(diffuseMap, tc);
-#if COPY_DEPTH
+#if defined(COPY_DEPTH)
gl_FragDepth = texture(depthMap, tc).r;
#endif
}
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp
index d04a674e91..4aea0fcbcc 100644
--- a/indra/newview/llgltfmateriallist.cpp
+++ b/indra/newview/llgltfmateriallist.cpp
@@ -297,7 +297,7 @@ public:
// object not ready to receive override data, queue for later
gGLTFMaterialList.queueOverrideUpdate(object_override.mObjectId, results[i].mSide, results[i].mMaterial);
}
- else if (obj && obj->getTE(i) && obj->getTE(i)->isSelected())
+ else if (obj && obj->getTE(results[i].mSide) && obj->getTE(results[i].mSide)->isSelected())
{
doSelectionCallbacks(object_override.mObjectId, results[i].mSide);
}
@@ -305,7 +305,7 @@ public:
else
{
// unblock material editor
- if (obj && obj->getTE(i) && obj->getTE(i)->isSelected())
+ if (obj && obj->getTE(results[i].mSide) && obj->getTE(results[i].mSide)->isSelected())
{
doSelectionCallbacks(object_override.mObjectId, results[i].mSide);
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 4a69eba4d3..61f9d3d6d0 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5862,7 +5862,6 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
if (can_copy && can_transfer)
{
- // this should be the only place that saved textures is called
node->saveTextures(texture_ids);
}
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index cde33a5f96..53bc77daa9 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -2080,24 +2080,101 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject(
{
if (cargo_type == DAD_TEXTURE)
{
+ LLSelectNode *nodep = nullptr;
+ if (obj->isSelected())
+ {
+ // update object's saved textures
+ nodep = LLSelectMgr::getInstance()->getSelection()->findNode(obj);
+ }
+
if((mask & MASK_SHIFT))
{
dropTextureAllFaces(obj, item, mSource, mSourceID);
+
+ // If user dropped a texture onto face it implies
+ // applying texture now without cancel, save to selection
+ if (nodep)
+ {
+ uuid_vec_t texture_ids;
+ S32 num_faces = obj->getNumTEs();
+ for (S32 face = 0; face < num_faces; face++)
+ {
+ LLViewerTexture *tex = obj->getTEImage(face);
+ if (tex != nullptr)
+ {
+ texture_ids.push_back(tex->getID());
+ }
+ else
+ {
+ texture_ids.push_back(LLUUID::null);
+ }
+ }
+ nodep->saveTextures(texture_ids);
+ }
}
else
{
dropTextureOneFace(obj, face, item, mSource, mSourceID);
+
+ // If user dropped a texture onto face it implies
+ // applying texture now without cancel, save to selection
+ LLPanelFace* panel_face = gFloaterTools->getPanelFace();
+ if (nodep
+ && gFloaterTools->getVisible()
+ && panel_face
+ && panel_face->getTextureDropChannel() == 0 /*texture*/
+ && nodep->mSavedGLTFMaterialIds.size() > face)
+ {
+ LLViewerTexture *tex = obj->getTEImage(face);
+ if (tex != nullptr)
+ {
+ nodep->mSavedTextures[face] = tex->getID();
+ }
+ else
+ {
+ nodep->mSavedTextures[face] = LLUUID::null;
+ }
+ }
}
}
else if (cargo_type == DAD_MATERIAL)
{
+ LLSelectNode *nodep = nullptr;
+ if (obj->isSelected())
+ {
+ // update object's saved materials
+ nodep = LLSelectMgr::getInstance()->getSelection()->findNode(obj);
+ }
+
+ // If user dropped a material onto face it implies
+ // applying texture now without cancel, save to selection
if ((mask & MASK_SHIFT))
{
dropMaterialAllFaces(obj, item, mSource, mSourceID);
+
+ if (nodep)
+ {
+ uuid_vec_t material_ids;
+ S32 num_faces = obj->getNumTEs();
+ for (S32 face = 0; face < num_faces; face++)
+ {
+ material_ids.push_back(obj->getRenderMaterialID(face));
+ }
+ nodep->saveGLTFMaterialIds(material_ids);
+ }
}
else
{
dropMaterialOneFace(obj, face, item, mSource, mSourceID);
+
+ // If user dropped a material onto face it implies
+ // applying texture now without cancel, save to selection
+ if (nodep
+ && gFloaterTools->getVisible()
+ && nodep->mSavedGLTFMaterialIds.size() > face)
+ {
+ nodep->mSavedGLTFMaterialIds[face] = obj->getRenderMaterialID(face);
+ }
}
}
else if (cargo_type == DAD_MESH)
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d56b31a372..6ac059df91 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -855,8 +855,6 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
S32 shadow_detail = RenderShadowDetail;
bool ssao = RenderDeferredSSAO;
- const U32 occlusion_divisor = 3;
-
//allocate deferred rendering color buffers
if (!mRT->deferredScreen.allocate(resX, resY, GL_RGBA, true, true, LLTexUnit::TT_TEXTURE, false, samples)) return false;
if (!addDeferredAttachments(mRT->deferredScreen)) return false;
@@ -2495,10 +2493,10 @@ void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& d
if (scratch_space)
{
+#if 0 // TODO -- restore occlusion culling functionality
GLint bits = 0;
bits = GL_DEPTH_BUFFER_BIT;
-#if 0 // TODO -- restore occlusion culling functionality
- scratch_space->copyContents(source,
+ scratch_space->copyContents(source,
0, 0, source.getWidth(), source.getHeight(),
0, 0, scratch_space->getWidth(), scratch_space->getHeight(), bits, GL_NEAREST);
#endif