Skip to content

Commit

Permalink
Fix metal-rough factor when no map but metal-rough factor not 0 (#1045)
Browse files Browse the repository at this point in the history
* Fix metal-rough factor when no map but metal-rough factor not 0

* Remove redundant null check
  • Loading branch information
rt-nikowiss authored Apr 13, 2022
1 parent 546d859 commit a44c4e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 3ds Max/Max2Babylon/Exporter/BabylonExporter.Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ private void ExportPhysicalMaterial(IIGameMaterial materialNode, IIPropertyConta
// Change the factor to zero if combining partial channel to avoid issue (in case of image compression).
// ie - if no metallic map, then b MUSt be fully black. However channel of jpeg MAY not beeing fully black
// cause of the compression algorithm. Keeping MetallicFactor to 1 will make visible artifact onto texture. So set to Zero instead.
babylonMaterial.metallic = areTexturesAlreadyMerged || metallicTexmap != null ? 1.0f : 0.0f;
babylonMaterial.roughness = areTexturesAlreadyMerged || roughnessTexmap != null ? 1.0f : 0.0f;
babylonMaterial.metallic = areTexturesAlreadyMerged || metallicTexmap != null || babylonMaterial.metallic != 0 ? 1.0f : 0.0f;
babylonMaterial.roughness = areTexturesAlreadyMerged || roughnessTexmap != null || babylonMaterial.roughness != 0 ? 1.0f : 0.0f;
}
}
}
Expand Down Expand Up @@ -959,8 +959,8 @@ private void ExportArnoldMaterial(IIGameMaterial materialNode, IIPropertyContain
// Change the factor to zero if combining partial channel to avoid issue (in case of image compression).
// ie - if no metallic map, then b MUSt be fully black. However channel of jpeg MAY not beeing fully black
// cause of the compression algorithm. Keeping MetallicFactor to 1 will make visible artifact onto texture. So set to Zero instead.
babylonMaterial.metallic = areTexturesAlreadyMerged || metallicTexmap != null ? 1.0f : 0.0f;
babylonMaterial.roughness = areTexturesAlreadyMerged || roughnessTexmap != null ? 1.0f : 0.0f;
babylonMaterial.metallic = areTexturesAlreadyMerged || metallicTexmap != null || babylonMaterial.metallic != 0 ? 1.0f : 0.0f;
babylonMaterial.roughness = areTexturesAlreadyMerged || roughnessTexmap != null || babylonMaterial.roughness != 0 ? 1.0f : 0.0f;
}
}
}
Expand Down

0 comments on commit a44c4e7

Please sign in to comment.