Skip to content

Commit

Permalink
Corrected handling of metallic and roughness factors in SceneKit import
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenm committed Apr 19, 2022
1 parent dae84fe commit 589ef13
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions GLTFKit2/GLTFKit2/GLTFSceneKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,13 @@ - (void)convertAsset {
metallicProperty.contents = metallicRoughnessImage;
GLTFConfigureSCNMaterialProperty(metallicProperty, metallicRoughnessTexture);
metallicProperty.textureComponents = SCNColorMaskBlue;
metallicProperty.intensity = material.metallicRoughness.metallicFactor;

SCNMaterialProperty *roughnessProperty = scnMaterial.roughness;
roughnessProperty.contents = metallicRoughnessImage;
GLTFConfigureSCNMaterialProperty(roughnessProperty, metallicRoughnessTexture);
roughnessProperty.textureComponents = SCNColorMaskGreen;
roughnessProperty.intensity = material.metallicRoughness.roughnessFactor;
} else {
SCNMaterialProperty *metallicProperty = scnMaterial.metalness;
metallicProperty.contents = @(material.metallicRoughness.metallicFactor);
Expand Down

0 comments on commit 589ef13

Please sign in to comment.