Skip to content

Commit

Permalink
fix: smoothness was inverted / removed even if no smoothness map existed
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Oct 11, 2022
1 parent 9d1033d commit 0a2b7f6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,9 @@ public PbrMetallicRoughness ExportPBRMetallicRoughness(Material material)
smoothness = material.GetFloat("_GlossMapScale");

var hasMetallicRoughnessMap =
material.HasProperty("metallicRoughnessTexture") ||
material.HasProperty("_MetallicRoughnessTexture") ||
material.HasProperty("_MetallicGlossMap");
(material.HasProperty("metallicRoughnessTexture") && material.GetTexture("metallicRoughnessTexture")) ||
(material.HasProperty("_MetallicRoughnessTexture") && material.GetTexture("_MetallicRoughnessTexture")) ||
(material.HasProperty("_MetallicGlossMap") && material.GetTexture("_MetallicGlossMap"));

if (!hasMetallicRoughnessMap)
pbr.RoughnessFactor = 1 - smoothness;
Expand Down

0 comments on commit 0a2b7f6

Please sign in to comment.