Skip to content

Commit

Permalink
Metallicマップ設定時にSmoothnessの値を復元するように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroj committed Feb 7, 2019
1 parent 3aa0ef6 commit bfff027
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,15 @@ public virtual Material CreateMaterial(int i, glTFMaterial x)
var prop = "_MetallicGlossMap";
material.SetTexture(prop, texture.ConvertTexture(prop));
}

material.SetFloat("_Metallic", 1.0f);
material.SetFloat("_GlossMapScale", 1.0f - x.pbrMetallicRoughness.roughnessFactor);
}
else
{
material.SetFloat("_Metallic", x.pbrMetallicRoughness.metallicFactor);
material.SetFloat("_Glossiness", 1.0f - x.pbrMetallicRoughness.roughnessFactor);
}

material.SetFloat("_Metallic", x.pbrMetallicRoughness.metallicFactor);
material.SetFloat("_Glossiness", 1.0f - x.pbrMetallicRoughness.roughnessFactor);
}

if (x.normalTexture != null && x.normalTexture.index != -1)
Expand Down

0 comments on commit bfff027

Please sign in to comment.