summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp43
1 files changed, 18 insertions, 25 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 3c0a08cee1..e217ede067 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4992,10 +4992,10 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)
if (mat != nullptr)
{
- mat->mBaseColorTexture = fetch_texture(mat->mBaseColorId);
- mat->mNormalTexture = fetch_texture(mat->mNormalId);
- mat->mMetallicRoughnessTexture = fetch_texture(mat->mMetallicRoughnessId);
- mat->mEmissiveTexture= fetch_texture(mat->mEmissiveId);
+ mat->mBaseColorTexture = fetch_texture(mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR]);
+ mat->mNormalTexture = fetch_texture(mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL]);
+ mat->mMetallicRoughnessTexture = fetch_texture(mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS]);
+ mat->mEmissiveTexture= fetch_texture(mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE]);
}
}
@@ -6289,6 +6289,11 @@ void LLViewerObject::parameterChanged(U16 param_type, LLNetworkData* data, BOOL
{
if (local_origin)
{
+ // *NOTE: Do not send the render material ID in this way as it will get
+ // out-of-sync with other sent client data.
+ // See LLViewerObject::setRenderMaterialID and LLGLTFMaterialList
+ llassert(param_type != LLNetworkData::PARAMS_RENDER_MATERIAL);
+
LLViewerRegion* regionp = getRegion();
if(!regionp) return;
@@ -7245,18 +7250,6 @@ void LLViewerObject::setRenderMaterialID(S32 te_in, const LLUUID& id, bool updat
});
}
- if (update_server)
- {
- // update via ModifyMaterialParams cap (server will echo back changes)
- for (S32 te = start_idx; te < end_idx; ++te)
- {
- // This sends a cleared version of this object's current material
- // override, but the override should already be cleared due to
- // calling setBaseMaterial above.
- LLGLTFMaterialList::queueApply(this, te, id);
- }
- }
-
// predictively update LLRenderMaterialParams (don't wait for server)
if (param_block)
{ // update existing parameter block
@@ -7264,17 +7257,17 @@ void LLViewerObject::setRenderMaterialID(S32 te_in, const LLUUID& id, bool updat
{
param_block->setMaterial(te, id);
}
+ }
- if (update_server)
+ if (update_server)
+ {
+ // update via ModifyMaterialParams cap (server will echo back changes)
+ for (S32 te = start_idx; te < end_idx; ++te)
{
- // If 'in use' changes, it will send an update itself.
- bool in_use_changed = setParameterEntryInUse(LLNetworkData::PARAMS_RENDER_MATERIAL, !param_block->isEmpty(), true);
-
- if (!in_use_changed)
- {
- // In use didn't change, but the parameter did, send an update
- parameterChanged(LLNetworkData::PARAMS_RENDER_MATERIAL, param_block, !param_block->isEmpty(), true);
- }
+ // This sends a cleared version of this object's current material
+ // override, but the override should already be cleared due to
+ // calling setBaseMaterial above.
+ LLGLTFMaterialList::queueApply(this, te, id);
}
}
}