pull/4786/head
Adam Beili 2023-03-26 17:13:16 +02:00 committed by GitHub
parent b6ecba9114
commit 8ac0af5c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -1236,7 +1236,7 @@ inline void Material::Read(Value &material, Asset &r) {
ReadMember(material, "alphaCutoff", this->alphaCutoff);
if (Value *extensions = FindObject(material, "extensions")) {
if (r.extensionsUsed.KHR_materials_pbrSpecularGlossiness) { //TODO: Maybe ignore this if KHR_materials_specular is also defined
if (r.extensionsUsed.KHR_materials_pbrSpecularGlossiness) {
if (Value *curPbrSpecularGlossiness = FindObject(*extensions, "KHR_materials_pbrSpecularGlossiness")) {
PbrSpecularGlossiness pbrSG;

View File

@ -424,7 +424,7 @@ namespace glTF2 {
MaterialSpecular &specular = m.materialSpecular.value;
if (specular.specularFactor != 0.f) {
if (specular.specularFactor != 0.0f) {
WriteFloat(materialSpecular, specular.specularFactor, "specularFactor", w.mAl);
WriteTex(materialSpecular, specular.specularTexture, "specularTexture", w.mAl);
}

View File

@ -221,7 +221,7 @@ TEST_F(utglTF2ImportExport, importglTF2AndExport_KHR_materials_pbrSpecularGlossi
EXPECT_NE(nullptr, scene);
// Export
ExportProperties props;
props.SetPropertyBool(, true);
props.SetPropertyBool(AI_CONFIG_USE_GLTF_PBR_SPECULAR_GLOSSINESS, true);
EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxTextured-glTF-pbrSpecularGlossiness/BoxTextured_out.glb", 0, &props));
// And re-import