From f0cd4039c08ab350d4b4cb074865aa2d742e7449 Mon Sep 17 00:00:00 2001 From: AoiKamishiro Date: Wed, 13 Aug 2025 16:59:05 +0900 Subject: [PATCH 1/6] =?UTF-8?q?chor:=20URP=E7=89=88=E3=82=B7=E3=82=A7?= =?UTF-8?q?=E3=83=BC=E3=83=80=E3=83=BC=E3=81=AB=20ApplicationSpaceWarp?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM10/MToon10/Editor/MToonInspector.cs | 1 + .../UnityShaderLab/Properties/MToon10Prop.cs | 3 ++ .../Properties/MToon10Properties.cs | 2 ++ .../Shaders/vrmc_materials_mtoon_urp.shader | 31 ++++++++++++++++++- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10/MToon10/Editor/MToonInspector.cs b/Assets/VRM10/MToon10/Editor/MToonInspector.cs index 0c8a3a05d..488234c5e 100644 --- a/Assets/VRM10/MToon10/Editor/MToonInspector.cs +++ b/Assets/VRM10/MToon10/Editor/MToonInspector.cs @@ -249,6 +249,7 @@ namespace VRM10.MToon10.Editor EditorGUILayout.LabelField("DstBlend", ((BlendMode)props[MToon10Prop.UnityDstBlend].floatValue).ToString()); EditorGUILayout.LabelField("ZWrite", ((UnityZWriteMode)props[MToon10Prop.UnityZWrite].floatValue).ToString()); EditorGUILayout.LabelField("AlphaToMask", ((UnityAlphaToMaskMode)props[MToon10Prop.UnityAlphaToMask].floatValue).ToString()); + EditorGUILayout.LabelField("XR Motion Vectors Pass (Space Warp)", (props[MToon10Prop.MotionVector].floatValue) > 0.5f ? "Enabled" : "Disabled"); EditorGUILayout.LabelField("Enabled Keywords", string.Join("\n", mat.shaderKeywords), EditorStyles.textArea); } } diff --git a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs index f3e896097..b9078c6a1 100644 --- a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs +++ b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs @@ -56,6 +56,9 @@ UnityDstBlend, UnityZWrite, UnityAlphaToMask, + + // Motion Vector + MotionVector, // for Editor EditorEditMode, diff --git a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs index fa9904d85..a467fba78 100644 --- a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs +++ b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs @@ -53,6 +53,8 @@ namespace VRM10.MToon10 [MToon10Prop.UnityZWrite] = "_M_ZWrite", [MToon10Prop.UnityAlphaToMask] = "_M_AlphaToMask", + [MToon10Prop.MotionVector] = "_XRMotionVectorsPass", + [MToon10Prop.EditorEditMode] = "_M_EditMode", }; diff --git a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader index 881ea9aa0..224001b0c 100644 --- a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader @@ -57,11 +57,14 @@ Shader "VRM10/Universal Render Pipeline/MToon10" _M_ZWrite ("_ZWrite", Float) = 1.0 _M_AlphaToMask ("_AlphaToMask", Float) = 0.0 + // Motion Vector + _XRMotionVectorsPass("_XRMotionVectorsPass", Float) = 1.0 + // etc _M_DebugMode ("_DebugMode", Float) = 0.0 // for Editor - _M_EditMode ("_EditMode", Float) = 0.0 + _M_EditMode ("_EditMode", Float) = 0.0 } // Shader Model 3.0 @@ -81,6 +84,32 @@ Shader "VRM10/Universal Render Pipeline/MToon10" "IgnoreProjector" = "True" } + Pass + { + Name "XRMotionVectors" + Tags { "LightMode" = "XRMotionVectors" } + ColorMask RGBA + + // Stencil write for obj motion pixels + Stencil + { + WriteMask 1 + Ref 1 + Comp Always + Pass Replace + } + + HLSLPROGRAM + #pragma shader_feature_local _ALPHATEST_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY + #define APPLICATION_SPACE_WARP_MOTION 1 + + #include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl" + ENDHLSL + } + // Universal Forward Pass Pass { From 870d540de6226bb43c128322cf98534886f8aec9 Mon Sep 17 00:00:00 2001 From: Aoi Kamishiro Date: Fri, 15 Aug 2025 10:19:28 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E5=B7=AE=E5=88=86=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader index 224001b0c..e2fe7f6e2 100644 --- a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader @@ -64,7 +64,7 @@ Shader "VRM10/Universal Render Pipeline/MToon10" _M_DebugMode ("_DebugMode", Float) = 0.0 // for Editor - _M_EditMode ("_EditMode", Float) = 0.0 + _M_EditMode ("_EditMode", Float) = 0.0 } // Shader Model 3.0 From 05ad6b8aa1c66035ea720cbe019211cbf08044ab Mon Sep 17 00:00:00 2001 From: AoiKamishiro Date: Mon, 8 Sep 2025 10:38:49 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Revert=20"=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E5=B7=AE=E5=88=86=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 870d540de6226bb43c128322cf98534886f8aec9. --- Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader index e2fe7f6e2..224001b0c 100644 --- a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader @@ -64,7 +64,7 @@ Shader "VRM10/Universal Render Pipeline/MToon10" _M_DebugMode ("_DebugMode", Float) = 0.0 // for Editor - _M_EditMode ("_EditMode", Float) = 0.0 + _M_EditMode ("_EditMode", Float) = 0.0 } // Shader Model 3.0 From e63b1802c0e3aed3710a75417fbe1a02b4e924b4 Mon Sep 17 00:00:00 2001 From: AoiKamishiro Date: Mon, 8 Sep 2025 10:38:55 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Revert=20"chor:=20URP=E7=89=88=E3=82=B7?= =?UTF-8?q?=E3=82=A7=E3=83=BC=E3=83=80=E3=83=BC=E3=81=AB=20ApplicationSpac?= =?UTF-8?q?eWarp=E5=AF=BE=E5=BF=9C=E3=82=92=E8=BF=BD=E5=8A=A0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f0cd4039c08ab350d4b4cb074865aa2d742e7449. --- Assets/VRM10/MToon10/Editor/MToonInspector.cs | 1 - .../UnityShaderLab/Properties/MToon10Prop.cs | 3 -- .../Properties/MToon10Properties.cs | 2 -- .../Shaders/vrmc_materials_mtoon_urp.shader | 31 +------------------ 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/Assets/VRM10/MToon10/Editor/MToonInspector.cs b/Assets/VRM10/MToon10/Editor/MToonInspector.cs index 488234c5e..0c8a3a05d 100644 --- a/Assets/VRM10/MToon10/Editor/MToonInspector.cs +++ b/Assets/VRM10/MToon10/Editor/MToonInspector.cs @@ -249,7 +249,6 @@ namespace VRM10.MToon10.Editor EditorGUILayout.LabelField("DstBlend", ((BlendMode)props[MToon10Prop.UnityDstBlend].floatValue).ToString()); EditorGUILayout.LabelField("ZWrite", ((UnityZWriteMode)props[MToon10Prop.UnityZWrite].floatValue).ToString()); EditorGUILayout.LabelField("AlphaToMask", ((UnityAlphaToMaskMode)props[MToon10Prop.UnityAlphaToMask].floatValue).ToString()); - EditorGUILayout.LabelField("XR Motion Vectors Pass (Space Warp)", (props[MToon10Prop.MotionVector].floatValue) > 0.5f ? "Enabled" : "Disabled"); EditorGUILayout.LabelField("Enabled Keywords", string.Join("\n", mat.shaderKeywords), EditorStyles.textArea); } } diff --git a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs index b9078c6a1..f3e896097 100644 --- a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs +++ b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Prop.cs @@ -56,9 +56,6 @@ UnityDstBlend, UnityZWrite, UnityAlphaToMask, - - // Motion Vector - MotionVector, // for Editor EditorEditMode, diff --git a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs index a467fba78..fa9904d85 100644 --- a/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs +++ b/Assets/VRM10/MToon10/Runtime/UnityShaderLab/Properties/MToon10Properties.cs @@ -53,8 +53,6 @@ namespace VRM10.MToon10 [MToon10Prop.UnityZWrite] = "_M_ZWrite", [MToon10Prop.UnityAlphaToMask] = "_M_AlphaToMask", - [MToon10Prop.MotionVector] = "_XRMotionVectorsPass", - [MToon10Prop.EditorEditMode] = "_M_EditMode", }; diff --git a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader index 224001b0c..881ea9aa0 100644 --- a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader @@ -57,14 +57,11 @@ Shader "VRM10/Universal Render Pipeline/MToon10" _M_ZWrite ("_ZWrite", Float) = 1.0 _M_AlphaToMask ("_AlphaToMask", Float) = 0.0 - // Motion Vector - _XRMotionVectorsPass("_XRMotionVectorsPass", Float) = 1.0 - // etc _M_DebugMode ("_DebugMode", Float) = 0.0 // for Editor - _M_EditMode ("_EditMode", Float) = 0.0 + _M_EditMode ("_EditMode", Float) = 0.0 } // Shader Model 3.0 @@ -84,32 +81,6 @@ Shader "VRM10/Universal Render Pipeline/MToon10" "IgnoreProjector" = "True" } - Pass - { - Name "XRMotionVectors" - Tags { "LightMode" = "XRMotionVectors" } - ColorMask RGBA - - // Stencil write for obj motion pixels - Stencil - { - WriteMask 1 - Ref 1 - Comp Always - Pass Replace - } - - HLSLPROGRAM - #pragma shader_feature_local _ALPHATEST_ON - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY - #define APPLICATION_SPACE_WARP_MOTION 1 - - #include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl" - #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl" - ENDHLSL - } - // Universal Forward Pass Pass { From 5321414a72465af0536ae51e334c8d6edfca4366 Mon Sep 17 00:00:00 2001 From: AoiKamishiro Date: Mon, 8 Sep 2025 10:39:34 +0900 Subject: [PATCH 5/6] =?UTF-8?q?chor:=20AppSW=E7=94=A8XRMotionVector?= =?UTF-8?q?=E3=83=91=E3=82=B9=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shaders/vrmc_materials_mtoon_urp.shader | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader index 881ea9aa0..74a890cdf 100644 --- a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader @@ -251,6 +251,32 @@ Shader "VRM10/Universal Render Pipeline/MToon10" #include "./vrmc_materials_mtoon_shadowcaster_fragment.hlsl" ENDHLSL } + + Pass + { + Name "XRMotionVectors" + Tags { "LightMode" = "XRMotionVectors" } + ColorMask RGBA + + // Stencil write for obj motion pixels + Stencil + { + WriteMask 1 + Ref 1 + Comp Always + Pass Replace + } + + HLSLPROGRAM + #pragma shader_feature_local _ALPHATEST_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY + #define APPLICATION_SPACE_WARP_MOTION 1 + + #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl" + ENDHLSL + } } FallBack "Hidden/Universal Render Pipeline/FallbackError" From d986dadee0bf150f4aa6d9955eb9cf3b3b584182 Mon Sep 17 00:00:00 2001 From: AoiKamishiro Date: Mon, 8 Sep 2025 10:41:37 +0900 Subject: [PATCH 6/6] =?UTF-8?q?chor:=20PackageRequirements=20=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shaders/vrmc_materials_mtoon_urp.shader | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader index 74a890cdf..1916bec17 100644 --- a/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRM10/MToon10/Shaders/vrmc_materials_mtoon_urp.shader @@ -67,12 +67,6 @@ Shader "VRM10/Universal Render Pipeline/MToon10" // Shader Model 3.0 SubShader { - PackageRequirements - { - "unity": "2021.3" - "com.unity.render-pipelines.universal": "12.0.0" - } - Tags { "RenderType" = "Opaque" @@ -84,6 +78,12 @@ Shader "VRM10/Universal Render Pipeline/MToon10" // Universal Forward Pass Pass { + PackageRequirements + { + "unity": "2021.3" + "com.unity.render-pipelines.universal": "12.0.0" + } + Name "UniversalForward" Tags { "LightMode" = "UniversalForward" } @@ -132,6 +132,12 @@ Shader "VRM10/Universal Render Pipeline/MToon10" // MToon Outline Pass Pass { + PackageRequirements + { + "unity": "2021.3" + "com.unity.render-pipelines.universal": "12.0.0" + } + Name "MToonOutline" Tags { "LightMode" = "MToonOutline" } @@ -171,6 +177,12 @@ Shader "VRM10/Universal Render Pipeline/MToon10" // Depth Only Pass Pass { + PackageRequirements + { + "unity": "2021.3" + "com.unity.render-pipelines.universal": "12.0.0" + } + Name "DepthOnly" Tags { "LightMode" = "DepthOnly" } @@ -199,6 +211,12 @@ Shader "VRM10/Universal Render Pipeline/MToon10" // Depth Normals Pass Pass { + PackageRequirements + { + "unity": "2021.3" + "com.unity.render-pipelines.universal": "12.0.0" + } + Name "DepthNormals" Tags { "LightMode" = "DepthNormals" } @@ -227,6 +245,12 @@ Shader "VRM10/Universal Render Pipeline/MToon10" // Shadow Caster Pass Pass { + PackageRequirements + { + "unity": "2021.3" + "com.unity.render-pipelines.universal": "12.0.0" + } + Name "ShadowCaster" Tags { "LightMode" = "ShadowCaster" } @@ -254,6 +278,12 @@ Shader "VRM10/Universal Render Pipeline/MToon10" Pass { + PackageRequirements + { + "unity": "6000.0" + "com.unity.render-pipelines.universal": "17.0.0" + } + Name "XRMotionVectors" Tags { "LightMode" = "XRMotionVectors" } ColorMask RGBA