mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 21:58:46 +00:00
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.
This commit is contained in:
@@ -98,7 +98,7 @@ int GltfSerializer::writeMaterial(const IfcGeom::Material& style) {
|
|||||||
base[3] = 1. - style.transparency();
|
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) {
|
if (style.hasTransparency() && style.transparency() > 1.e-9) {
|
||||||
json_["materials"].back()["alphaMode"] = "BLEND";
|
json_["materials"].back()["alphaMode"] = "BLEND";
|
||||||
|
|||||||
Reference in New Issue
Block a user