summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llgltfmaterial.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-10-19 17:23:54 -0500
committerDave Parks <davep@lindenlab.com>2022-10-19 17:23:54 -0500
commit8741c05cc10d3f39f272bb4739e7313309539d07 (patch)
tree871d2340a7e22cce1504948a79a703811a084d5a /indra/llprimitive/llgltfmaterial.cpp
parentde4c018499ddaebbe466fb5a8938554a2d4a3b19 (diff)
SL-18105 Hook up TE override material to render pipe by way of render material.
Diffstat (limited to 'indra/llprimitive/llgltfmaterial.cpp')
-rw-r--r--indra/llprimitive/llgltfmaterial.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index 19081cd76f..b9ef2de61a 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -446,3 +446,28 @@ void LLGLTFMaterial::writeOverridesToModel(tinygltf::Model& model, S32 mat_index
material_out.doubleSided = mDoubleSided;
}
}
+
+void LLGLTFMaterial::applyOverride(const LLGLTFMaterial& override_mat)
+{
+ if (override_mat.mBaseColorId != getDefaultBaseColorId())
+ {
+ mBaseColorId = override_mat.mBaseColorId;
+ }
+
+ if (override_mat.mNormalId != getDefaultNormalId())
+ {
+ mNormalId = override_mat.mNormalId;
+ }
+
+ if (override_mat.mMetallicRoughnessId != getDefaultMetallicRoughnessId())
+ {
+ mMetallicRoughnessId = override_mat.mMetallicRoughnessId;
+ }
+
+ if (override_mat.mEmissiveId != getDefaultEmissiveId())
+ {
+ mEmissiveId = override_mat.mEmissiveId;
+ }
+
+ //TODO -- implement non texture parameters
+}