From fc206b82259f74983d9ce8649d016481d53bb0ee Mon Sep 17 00:00:00 2001 From: notargs Date: Fri, 13 Dec 2024 20:20:28 +0900 Subject: [PATCH] Fix MaterialValueBindingMerger built-in RP lock-in --- .../Expression/MaterialValueBindingMerger.cs | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/Expression/MaterialValueBindingMerger.cs b/Assets/VRM10/Runtime/Components/Expression/MaterialValueBindingMerger.cs index 97cb99ff9..30983ea60 100644 --- a/Assets/VRM10/Runtime/Components/Expression/MaterialValueBindingMerger.cs +++ b/Assets/VRM10/Runtime/Components/Expression/MaterialValueBindingMerger.cs @@ -231,29 +231,6 @@ namespace UniVRM10 } } - // UVアクセスするテクスチャーのScaleOffsetプロパティの一覧 - static Dictionary UVPropMap = new Dictionary - { - {"Standard", new string[]{ - "_MainTex_ST", - }}, - {"VRM10/MToon10", new string[]{ - "_MainTex_ST", - }}, - }; - static string[] DefaultProps = { "_MainTex_ST" }; - public static String[] GetUVProps(string shaderName) - { - if (UVPropMap.TryGetValue(shaderName, out string[] props)) - { - return props; - } - else - { - return DefaultProps; - } - } - HashSet m_used = new HashSet(); public void Apply() { @@ -302,10 +279,8 @@ namespace UniVRM10 // // Standard and MToon use _MainTex_ST as uv0 scale/offset // - foreach (var prop in GetUVProps(item.Material.shader.name)) - { - item.Material.SetVector(prop, kv.Value); - } + item.Material.mainTextureScale = new Vector2(kv.Value.x, kv.Value.y); + item.Material.mainTextureOffset = new Vector2(kv.Value.z, kv.Value.w); } } m_materialUVMap.Clear();