From cbd3777fa9f29333c618eacb7b01857b953d729d Mon Sep 17 00:00:00 2001 From: Seto <61304189@qq.com> Date: Wed, 1 May 2019 03:48:41 +0800 Subject: [PATCH] fix 2019.1 compatibility issue --- MToon/Resources/Shaders/MToon.shader | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/MToon/Resources/Shaders/MToon.shader b/MToon/Resources/Shaders/MToon.shader index 91c5052..e689195 100644 --- a/MToon/Resources/Shaders/MToon.shader +++ b/MToon/Resources/Shaders/MToon.shader @@ -130,8 +130,30 @@ Shader "VRM/MToon" ENDCG } - // Cast transparent shadow - UsePass "Standard/SHADOWCASTER" + // ------------------------------------------------------------------ + // Shadow rendering pass + Pass { + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + ZWrite On ZTest LEqual + + CGPROGRAM + #pragma target 2.0 + + #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma skip_variants SHADOWS_SOFT + #pragma multi_compile_shadowcaster + + #pragma vertex vertShadowCaster + #pragma fragment fragShadowCaster + + #include "UnityStandardShadow.cginc" + + ENDCG + } } Fallback "Unlit/Texture"