From 6f4d7d2f0daf8c11c3557bfad19ca6e264adb4ac Mon Sep 17 00:00:00 2001 From: yoship1639 Date: Fri, 21 Jul 2023 18:20:06 +0900 Subject: [PATCH] =?UTF-8?q?MToon10=E3=81=ABDepthOnlyPass=E3=81=A8DepthNorm?= =?UTF-8?q?alsPass=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VRM10/vrmc_materials_mtoon_urp.shader | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_urp.shader b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_urp.shader index 32e2ade9d..593becb3a 100644 --- a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_urp.shader +++ b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_urp.shader @@ -161,7 +161,63 @@ Shader "VRM10/Universal Render Pipeline/MToon10" ENDHLSL } - // Shadow Caster Path + // Depth Only Pass + Pass + { + Name "DepthOnly" + Tags { "LightMode" = "DepthOnly" } + + Cull [_M_CullMode] + ZWrite On + ColorMask 0 + + HLSLPROGRAM + #pragma target 3.0 + + // Unity defined keywords + #pragma multi_compile_instancing + + #pragma multi_compile __ _ALPHATEST_ON _ALPHABLEND_ON + + #pragma vertex MToonDepthOnlyVertex + #pragma fragment MToonDepthOnlyFragment + + #define MTOON_URP + + #include "./vrmc_materials_mtoon_depthonly_vertex.hlsl" + #include "./vrmc_materials_mtoon_depthonly_fragment.hlsl" + ENDHLSL + } + + // Depth Normals Pass + Pass + { + Name "DepthNormals" + Tags { "LightMode" = "DepthNormals" } + + Cull [_M_CullMode] + ZWrite On + + HLSLPROGRAM + #pragma target 3.0 + + // Unity defined keywords + #pragma multi_compile_instancing + + #pragma multi_compile __ _ALPHATEST_ON _ALPHABLEND_ON + #pragma multi_compile __ _NORMALMAP + + #pragma vertex MToonDepthNormalsVertex + #pragma fragment MToonDepthNormalsFragment + + #define MTOON_URP + + #include "./vrmc_materials_mtoon_depthnormals_vertex.hlsl" + #include "./vrmc_materials_mtoon_depthnormals_fragment.hlsl" + ENDHLSL + } + + // Shadow Caster Pass Pass { Name "ShadowCaster"