mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
serialize roughnessFactor
add roughnessFactor for gltf serialization
This commit is contained in:
committed by
Thomas Krijnen
parent
d300454118
commit
21a4db7823
@@ -106,7 +106,10 @@ int GltfSerializer::writeMaterial(const ifcopenshell::geometry::taxonomy::style:
|
||||
base[3] = 1. - style->transparency;
|
||||
}
|
||||
|
||||
json_["materials"].push_back({ {"name", style->name}, {"doubleSided", true}, {"pbrMetallicRoughness", {{"baseColorFactor", base}, {"metallicFactor", 0}}}});
|
||||
if (style->has_specularity())
|
||||
json_["materials"].push_back({ {"name", style->name}, {"doubleSided", true}, {"pbrMetallicRoughness", {{"baseColorFactor", base}, {"metallicFactor", 0}, {"roughnessFactor", 1.0 / style->specularity}}}});
|
||||
else
|
||||
json_["materials"].push_back({ {"name", style->name}, {"doubleSided", true}, {"pbrMetallicRoughness", {{"baseColorFactor", base}, {"metallicFactor", 0}}}});
|
||||
|
||||
if (style->transparency == style->transparency && style->transparency > 1.e-9) {
|
||||
json_["materials"].back()["alphaMode"] = "BLEND";
|
||||
|
||||
Reference in New Issue
Block a user