From 08d8657588802063bf9325d672fa78441634b4e7 Mon Sep 17 00:00:00 2001 From: Chetan Date: Mon, 31 Jul 2023 15:38:51 +0800 Subject: [PATCH] When creating a GLTF file, make the material double sided to fix a bug where some surfaces were transparent. This will allow surfaces created from a mesh to be be viewed from all angles regardless of the shape of the mesh or the directions of the normals. --- src/serializers/GltfSerializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serializers/GltfSerializer.cpp b/src/serializers/GltfSerializer.cpp index 2a2c5cb9e7..ffebf97935 100644 --- a/src/serializers/GltfSerializer.cpp +++ b/src/serializers/GltfSerializer.cpp @@ -98,7 +98,7 @@ int GltfSerializer::writeMaterial(const IfcGeom::Material& style) { base[3] = 1. - style.transparency(); } - json_["materials"].push_back({ {"pbrMetallicRoughness", {{"baseColorFactor", base}, {"metallicFactor", 0}}} }); + json_["materials"].push_back({ {"doubleSided", true}, {"pbrMetallicRoughness", {{"baseColorFactor", base}, {"metallicFactor", 0}}} }); if (style.hasTransparency() && style.transparency() > 1.e-9) { json_["materials"].back()["alphaMode"] = "BLEND";