diff --git a/code/AssetLib/glTF2/glTF2AssetWriter.inl b/code/AssetLib/glTF2/glTF2AssetWriter.inl index 30f2580a2..bfd9135d3 100644 --- a/code/AssetLib/glTF2/glTF2AssetWriter.inl +++ b/code/AssetLib/glTF2/glTF2AssetWriter.inl @@ -426,13 +426,14 @@ namespace glTF2 { if (specular.specularFactor != 0.0f) { WriteFloat(materialSpecular, specular.specularFactor, "specularFactor", w.mAl); - WriteTex(materialSpecular, specular.specularTexture, "specularTexture", w.mAl); } if (specular.specularColorFactor[0] != defaultSpecularColorFactor[0] && specular.specularColorFactor[1] != defaultSpecularColorFactor[1] && specular.specularColorFactor[2] != defaultSpecularColorFactor[2]) { WriteVec(materialSpecular, specular.specularColorFactor, "specularColorFactor", w.mAl); - WriteTex(materialSpecular, specular.specularColorTexture, "specularColorTexture", w.mAl); } + WriteTex(materialSpecular, specular.specularTexture, "specularTexture", w.mAl); + WriteTex(materialSpecular, specular.specularColorTexture, "specularColorTexture", w.mAl); + if (!materialSpecular.ObjectEmpty()) { exts.AddMember("KHR_materials_specular", materialSpecular, w.mAl); }