pull/4786/head
parent
b6ecba9114
commit
8ac0af5c58
|
@ -1236,7 +1236,7 @@ inline void Material::Read(Value &material, Asset &r) {
|
||||||
ReadMember(material, "alphaCutoff", this->alphaCutoff);
|
ReadMember(material, "alphaCutoff", this->alphaCutoff);
|
||||||
|
|
||||||
if (Value *extensions = FindObject(material, "extensions")) {
|
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")) {
|
if (Value *curPbrSpecularGlossiness = FindObject(*extensions, "KHR_materials_pbrSpecularGlossiness")) {
|
||||||
PbrSpecularGlossiness pbrSG;
|
PbrSpecularGlossiness pbrSG;
|
||||||
|
|
||||||
|
|
|
@ -424,7 +424,7 @@ namespace glTF2 {
|
||||||
|
|
||||||
MaterialSpecular &specular = m.materialSpecular.value;
|
MaterialSpecular &specular = m.materialSpecular.value;
|
||||||
|
|
||||||
if (specular.specularFactor != 0.f) {
|
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);
|
WriteTex(materialSpecular, specular.specularTexture, "specularTexture", w.mAl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ TEST_F(utglTF2ImportExport, importglTF2AndExport_KHR_materials_pbrSpecularGlossi
|
||||||
EXPECT_NE(nullptr, scene);
|
EXPECT_NE(nullptr, scene);
|
||||||
// Export
|
// Export
|
||||||
ExportProperties props;
|
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));
|
EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "glb2", ASSIMP_TEST_MODELS_DIR "/glTF2/BoxTextured-glTF-pbrSpecularGlossiness/BoxTextured_out.glb", 0, &props));
|
||||||
|
|
||||||
// And re-import
|
// And re-import
|
||||||
|
|
Loading…
Reference in New Issue