From d9a468bbb4703b170a436c0a64e51ee8ba093582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20H=C3=A4rtl?= Date: Wed, 14 Aug 2019 14:14:07 +0200 Subject: [PATCH] Fixed saving of alphaMode if not OPAQUE Removed duplicated code for alphaCutoff --- tiny_gltf.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 54faf57..b18aed9 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -5412,14 +5412,10 @@ static void SerializeGltfMaterial(Material &material, json &o) { SerializeNumberProperty("alphaCutoff", material.alphaCutoff, o); } - if (material.alphaMode.compare("OPAQUE") == 0) { + if (material.alphaMode.compare("OPAQUE") != 0) { SerializeStringProperty("alphaMode", material.alphaMode, o); } - if (!TINYGLTF_DOUBLE_EQUAL(material.alphaCutoff, 0.5)) { - SerializeNumberProperty("alphaCutoff", material.alphaCutoff, o); - } - o["doubleSided"] = json(material.doubleSided); if (material.normalTexture.index >= -1) {