From 4389c3d80ce687a243be49b640a83e19b350b0c4 Mon Sep 17 00:00:00 2001 From: tangxin Date: Wed, 23 Aug 2023 14:54:40 +0800 Subject: [PATCH] The texture strength attribute in aiMaterial set when importing and exporting gltf files is inconsistent --- code/AssetLib/glTF2/glTF2Importer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 86fd0ab7e..0fed11cef 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -234,7 +234,8 @@ inline void SetMaterialTextureProperty(std::vector &embeddedTexIdxs, Asset SetMaterialTextureProperty(embeddedTexIdxs, r, (glTF2::TextureInfo)prop, mat, texType, texSlot); if (prop.texture && prop.texture->source) { - mat->AddProperty(&prop.strength, 1, AI_MATKEY_GLTF_TEXTURE_STRENGTH(texType, texSlot)); + std::string textureStrengthKey = std::string(_AI_MATKEY_TEXTURE_BASE) + "." + "strength"; + mat->AddProperty(&prop.strength, 1, textureStrengthKey.c_str(), texType, texSlot); } }