diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs
index 539bac542..0cbbb87aa 100644
--- a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs
+++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs
@@ -49,7 +49,7 @@ namespace UniGLTF
Data.MigrationFlags.IsRoughnessTextureValueSquared);
MaterialFactory = new MaterialFactory(ExternalObjectMap
.Where(x => x.Value is Material)
- .ToDictionary(x => x.Key, x => (Material)x.Value), MaterialFallback.FallbackShaders);
+ .ToDictionary(x => x.Key, x => (Material)x.Value));
AnimationClipFactory = new AnimationClipFactory(ExternalObjectMap
.Where(x => x.Value is AnimationClip)
.ToDictionary(x => x.Key, x => (AnimationClip)x.Value));
diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/MaterialFallback.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/MaterialFallback.cs
deleted file mode 100644
index 3b4978bce..000000000
--- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/MaterialFallback.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System.Collections.Generic;
-
-namespace UniGLTF
-{
- ///
- /// 過去バージョンに含まれていたが、廃止・統合された Shader のフォールバック情報
- ///
- public static class MaterialFallback
- {
- static Dictionary s_fallbackShaders = new Dictionary
- {
- {"VRM/UnlitTexture", "Unlit/Texture"},
- {"VRM/UnlitTransparent", "Unlit/Transparent"},
- {"VRM/UnlitCutout", "Unlit/Transparent Cutout"},
- {"UniGLTF/StandardVColor", UniGLTF.UniUnlit.UniUnlitUtil.ShaderName},
- };
-
- public static IReadOnlyDictionary FallbackShaders => s_fallbackShaders;
- }
-}
diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/MaterialFallback.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/MaterialFallback.cs.meta
deleted file mode 100644
index ab0c0d9d4..000000000
--- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/MaterialFallback.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: feb59fa02250d3d4db41cfa1c2e2b032
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/VRM/Runtime/IO/MaterialIO/BuiltInRP/Import/Materials/BuiltInVrmMToonMaterialImporter.cs b/Assets/VRM/Runtime/IO/MaterialIO/BuiltInRP/Import/Materials/BuiltInVrmMToonMaterialImporter.cs
index 026de35e2..954dd5d3b 100644
--- a/Assets/VRM/Runtime/IO/MaterialIO/BuiltInRP/Import/Materials/BuiltInVrmMToonMaterialImporter.cs
+++ b/Assets/VRM/Runtime/IO/MaterialIO/BuiltInRP/Import/Materials/BuiltInVrmMToonMaterialImporter.cs
@@ -9,6 +9,17 @@ namespace VRM
{
public static class BuiltInVrmMToonMaterialImporter
{
+ ///
+ /// 過去バージョンに含まれていたが、廃止・統合された Shader のフォールバック情報
+ ///
+ public static Dictionary FallbackShaders = new Dictionary
+ {
+ {"VRM/UnlitTexture", "Unlit/Texture"},
+ {"VRM/UnlitTransparent", "Unlit/Transparent"},
+ {"VRM/UnlitCutout", "Unlit/Transparent Cutout"},
+ {"UniGLTF/StandardVColor", UniGLTF.UniUnlit.UniUnlitUtil.ShaderName},
+ };
+
private static readonly string[] MToonTextureSlots = new string[]
{
"_MainTex",
@@ -51,6 +62,11 @@ namespace VRM
//
// use material.name, because material name may renamed in GltfParser.
var name = data.GLTF.materials[materialIdx].name;
+ var shaderName = vrmMaterial.shader;
+ if (FallbackShaders.ContainsKey(shaderName))
+ {
+ shaderName = FallbackShaders[shaderName];
+ }
var textureSlots = new Dictionary();
var floatValues = new Dictionary();
@@ -59,7 +75,7 @@ namespace VRM
var actions = new List>();
matDesc = new MaterialDescriptor(
name,
- vrmMaterial.shader,
+ shaderName,
vrmMaterial.renderQueue,
textureSlots,
floatValues,
diff --git a/Assets/VRM/Runtime/VRM.asmdef b/Assets/VRM/Runtime/VRM.asmdef
index 0a3337f3e..e18ce1e85 100644
--- a/Assets/VRM/Runtime/VRM.asmdef
+++ b/Assets/VRM/Runtime/VRM.asmdef
@@ -8,7 +8,8 @@
"GUID:301b251fd9834274c9228e0532f444f7",
"GUID:a9bc101fb0471f94a8f99fd242fdd934",
"GUID:ac229b552c3025545b074203f857547c",
- "GUID:1cd941934d098654fa21a13f28346412"
+ "GUID:1cd941934d098654fa21a13f28346412",
+ "GUID:60c8346e00a8ddd4cafc5a02eceeec57"
],
"includePlatforms": [],
"excludePlatforms": [],
diff --git a/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialFactory.cs b/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialFactory.cs
index 90e08f6d8..e968c3194 100644
--- a/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialFactory.cs
+++ b/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialFactory.cs
@@ -12,12 +12,10 @@ namespace VRMShaders
public class MaterialFactory : IResponsibilityForDestroyObjects
{
private readonly IReadOnlyDictionary m_externalMap;
- private readonly IReadOnlyDictionary m_fallbackShaders;
- public MaterialFactory(IReadOnlyDictionary externalMaterialMap, IReadOnlyDictionary fallbackShaders)
+ public MaterialFactory(IReadOnlyDictionary externalMaterialMap)
{
m_externalMap = externalMaterialMap;
- m_fallbackShaders = fallbackShaders;
}
public struct MaterialLoadInfo
@@ -108,11 +106,6 @@ namespace VRMShaders
{
throw new Exception("no shader name");
}
- if (m_fallbackShaders.TryGetValue(shaderName, out string fallback))
- {
- Debug.LogWarning($"fallback: {shaderName} => {fallback}");
- shaderName = fallback;
- }
var shader = Shader.Find(shaderName);
if (shader == null)