From bfff027bca8d5448bfba86900885c63922d03f68 Mon Sep 17 00:00:00 2001 From: j-hirose Date: Thu, 7 Feb 2019 16:58:07 +0900 Subject: [PATCH] =?UTF-8?q?Metallic=E3=83=9E=E3=83=83=E3=83=97=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E6=99=82=E3=81=ABSmoothness=E3=81=AE=E5=80=A4?= =?UTF-8?q?=E3=82=92=E5=BE=A9=E5=85=83=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs b/Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs index 1ba34b519e..8e9cd4b031 100644 --- a/Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs +++ b/Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs @@ -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)