diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs index 93732b958..bf6d15af4 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MaterialValidator.cs @@ -43,12 +43,26 @@ namespace UniGLTF // main color yield return (MaterialExporter.COLOR_TEXTURE_PROP, m.GetTexture(MaterialExporter.COLOR_TEXTURE_PROP)); - if (GetGltfMaterialTypeFromUnityShaderName(m.shader.name) == "Standard") + if (GetGltfMaterialTypeFromUnityShaderName(m.shader.name) == "unlit") + { + yield break; + } + + // PBR + if (m.HasProperty(MaterialExporter.METALLIC_TEX_PROP)) { - // PBR yield return (MaterialExporter.METALLIC_TEX_PROP, m.GetTexture(MaterialExporter.METALLIC_TEX_PROP)); + } + if (m.HasProperty(MaterialExporter.NORMAL_TEX_PROP)) + { yield return (MaterialExporter.NORMAL_TEX_PROP, m.GetTexture(MaterialExporter.NORMAL_TEX_PROP)); + } + if (m.HasProperty(MaterialExporter.EMISSION_TEX_PROP)) + { yield return (MaterialExporter.EMISSION_TEX_PROP, m.GetTexture(MaterialExporter.EMISSION_TEX_PROP)); + } + if (m.HasProperty(MaterialExporter.OCCLUSION_TEX_PROP)) + { yield return (MaterialExporter.OCCLUSION_TEX_PROP, m.GetTexture(MaterialExporter.OCCLUSION_TEX_PROP)); } }