summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llgltfmaterial.cpp
diff options
context:
space:
mode:
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
+}