Merge pull request #188 from ux3d/fix/alphaMode

Fixed saving of alphaMode if not OPAQUE
This commit is contained in:
Syoyo Fujita 2019-08-14 21:40:07 +09:00 committed by GitHub
commit 67d3d2504d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5412,14 +5412,10 @@ static void SerializeGltfMaterial(Material &material, json &o) {
SerializeNumberProperty("alphaCutoff", material.alphaCutoff, o); SerializeNumberProperty("alphaCutoff", material.alphaCutoff, o);
} }
if (material.alphaMode.compare("OPAQUE") == 0) { if (material.alphaMode.compare("OPAQUE") != 0) {
SerializeStringProperty("alphaMode", material.alphaMode, o); SerializeStringProperty("alphaMode", material.alphaMode, o);
} }
if (!TINYGLTF_DOUBLE_EQUAL(material.alphaCutoff, 0.5)) {
SerializeNumberProperty("alphaCutoff", material.alphaCutoff, o);
}
o["doubleSided"] = json(material.doubleSided); o["doubleSided"] = json(material.doubleSided);
if (material.normalTexture.index >= -1) { if (material.normalTexture.index >= -1) {