glTF KHR_materials_specular fixes

pull/5388/head
Alexey Medvedev 2023-11-25 16:30:55 -08:00 committed by Kim Kulling
parent dc399f7343
commit 762ad8e9b7
1 changed files with 3 additions and 2 deletions

View File

@ -426,13 +426,14 @@ namespace glTF2 {
if (specular.specularFactor != 0.0f) { if (specular.specularFactor != 0.0f) {
WriteFloat(materialSpecular, specular.specularFactor, "specularFactor", w.mAl); 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]) { if (specular.specularColorFactor[0] != defaultSpecularColorFactor[0] && specular.specularColorFactor[1] != defaultSpecularColorFactor[1] && specular.specularColorFactor[2] != defaultSpecularColorFactor[2]) {
WriteVec(materialSpecular, specular.specularColorFactor, "specularColorFactor", w.mAl); 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()) { if (!materialSpecular.ObjectEmpty()) {
exts.AddMember("KHR_materials_specular", materialSpecular, w.mAl); exts.AddMember("KHR_materials_specular", materialSpecular, w.mAl);
} }