├── .gitignore ├── Assets └── Toon │ └── Shader │ └── ACiiL │ ├── ToonColor_DoubleShadeWithFeather.shader │ ├── ToonColor_DoubleShadeWithFeather_AlphaTestDither.shader │ ├── ToonColor_DoubleShadeWithFeather_ClippingCutout.shader │ ├── ToonColor_DoubleShadeWithFeather_TransClippingFade.shader │ ├── Toon_DoubleShadeWithFeather.shader │ ├── Toon_DoubleShadeWithFeather_AlphaTestDither.shader │ ├── Toon_DoubleShadeWithFeather_ClippingCutout.shader │ ├── Toon_DoubleShadeWithFeather_TransClippingFade.shader │ ├── UCTS_DoubleShadeWithFeather.cginc │ ├── UCTS_Outline.cginc │ ├── UCTS_ShadowCaster.cginc │ └── tempAllNewProperties.txt ├── Manual ├── UnityChanToonShaderVer2_Manual_en.html ├── UnityChanToonShaderVer2_Manual_en_files │ ├── 0102-04_02_eng.jpg │ ├── 0102-06_02_eng.jpg │ ├── 0102-22_03.jpg │ ├── 0105-22_01 [1]_eng.jpg │ ├── 0105-22_01_eng.jpg │ ├── 0105-22_04.jpg │ ├── 0105-22_05_eng.jpg │ ├── 0105-22_07.jpg │ ├── 0105-22_08.jpg │ ├── 0105-23_02.jpg │ ├── 0122-06_04.jpg │ ├── 0201-11_01.jpg │ ├── 0201-11_05.jpg │ ├── 0205-11_01.jpg │ ├── 0609-04_02.jpg │ ├── 0609-04_10.jpg │ ├── 0609-04_11.jpg │ ├── 0609-04_13.jpg │ ├── 0609-05_01.jpg │ ├── 0713-06_01_eng.jpg │ ├── 0801-12_05_eng.jpg │ ├── 0801-12_07.jpg │ ├── 0906-18_01_eng.jpg │ ├── 0906-18_03_eng.jpg │ ├── 1230-11_08.jpg │ ├── 1230-11_10_eng.jpg │ ├── 1230-11_11.jpg │ ├── 1230-11_14.jpg │ ├── 1230-11_15_eng.jpg │ ├── 1230-12_01_eng.jpg │ ├── AR_Image.jpg │ ├── AR_Postion.jpg │ ├── AR_UI.jpg │ ├── BoxProjection.jpg │ ├── CRS01.jpg │ ├── CRS02.jpg │ ├── CRS03.jpg │ ├── Check.jpg │ ├── HairModel.jpg │ ├── Hair_UV1.jpg │ ├── HiUni01.jpg │ ├── Image.jpg │ ├── Light_Silhouette.jpg │ ├── LookSample.jpg │ └── UI_ShadingGradeMap.jpg ├── UnityChanToonShaderVer2_Manual_ja.html └── UnityChanToonShaderVer2_Manual_ja_files │ ├── 0102-04_02.jpg │ ├── 0102-06_02.jpg │ ├── 0102-22_03.jpg │ ├── 0105-22_01 [1].jpg │ ├── 0105-22_01.jpg │ ├── 0105-22_04.jpg │ ├── 0105-22_05.jpg │ ├── 0105-22_07.jpg │ ├── 0105-22_08.jpg │ ├── 0105-23_02.jpg │ ├── 0122-06_04.jpg │ ├── 0201-11_01.jpg │ ├── 0201-11_05.jpg │ ├── 0205-11_01.jpg │ ├── 0609-04_02.jpg │ ├── 0609-04_10.jpg │ ├── 0609-04_11.jpg │ ├── 0609-04_12.jpg │ ├── 0609-04_13.jpg │ ├── 0609-05_01.jpg │ ├── 0713-06_01.jpg │ ├── 0801-12_05.jpg │ ├── 0801-12_07.jpg │ ├── 0906-18_01.jpg │ ├── 0906-18_03.jpg │ ├── 1230-11_08.jpg │ ├── 1230-11_10.jpg │ ├── 1230-11_11.jpg │ ├── 1230-11_14.jpg │ ├── 1230-11_15.jpg │ ├── 1230-12_01.jpg │ ├── AR_Image.jpg │ ├── AR_Postion.jpg │ ├── BoxProjection.jpg │ ├── CRS01.jpg │ ├── CRS02.jpg │ ├── CRS03.jpg │ ├── Check.jpg │ ├── HairModel.jpg │ ├── Hair_UV1.jpg │ ├── HiUni01.jpg │ ├── Light_Silhouette.jpg │ ├── LookSample.jpg │ ├── UI_ShadingGradeMap.jpg │ └── UI_Toon_DoubleShadeWithFeather.jpg └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | [Uu]nityPackageManager/ 7 | Assets/AssetStoreTools* 8 | 9 | # Visual Studio cache directory 10 | /.vs/ 11 | /.vscode/ 12 | 13 | # Autogenerated VS/MD/Consulo solution and project files 14 | ExportedObj/ 15 | .consulo/ 16 | *.csproj 17 | *.unityproj 18 | *.sln 19 | *.suo 20 | *.tmp 21 | *.user 22 | *.userprefs 23 | *.pidb 24 | *.booproj 25 | *.svd 26 | *.pdb 27 | 28 | # Unity3D generated meta files 29 | *.pidb.meta 30 | *.pdb.meta 31 | *.meta 32 | 33 | # Unity3D Generated File On Crash Reports 34 | sysinfo.txt 35 | 36 | # Builds 37 | *.apk -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/ToonColor_DoubleShadeWithFeather.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/NoOutline/ToonColor_DoubleShadeWithFeather" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | // _testMix ("test mix", Range(0, 1)) = 1 6 | 7 | 8 | [Space(25)] 9 | [Header(Alpha mask)] 10 | _ClippingMask ("Clipping mask", 2D) = "white" {} 11 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 12 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 13 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 14 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 15 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 16 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 17 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 18 | 19 | 20 | 21 | [Space(25)] 22 | [Header(Normal map)] 23 | _NormalMap ("NormalMap", 2D) = "bump" {} 24 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 26 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 27 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 28 | 29 | 30 | 31 | [Space(25)] 32 | [Header(Toon ramp)] 33 | _MainTex ("Main Tex", 2D) = "white" {} 34 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 35 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 36 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 37 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 38 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 39 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 40 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 41 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 42 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 43 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 44 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 45 | 46 | 47 | 48 | [Space(25)] 49 | [Header(Shadow and AO control)] 50 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 51 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 52 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 53 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 54 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 55 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 56 | 57 | 58 | 59 | [Space(25)] 60 | [Header(High Color. Specular)] 61 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 62 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 63 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 64 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 65 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 66 | _HighColor_Power ("Power", Range(0, 1)) = 0 67 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 68 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 69 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 70 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 71 | 72 | 73 | 74 | [Space(25)] 75 | [Header(Rimlights)] 76 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 77 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 79 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 80 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 81 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 82 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 83 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 84 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 85 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 86 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 87 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 88 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 89 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 90 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 91 | 92 | 93 | 94 | [Space(25)] 95 | [Header(World reflection)] 96 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 97 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 98 | 99 | 100 | 101 | [Space(25)] 102 | [Header(Matcap)] 103 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 104 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 105 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 106 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 107 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 108 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 109 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 110 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 111 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 112 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 113 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 114 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 115 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 116 | 117 | 118 | 119 | [Space(25)] 120 | [Header(Emission)] 121 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 122 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 123 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 124 | 125 | 126 | 127 | [Space(25)] 128 | [Header(Use world color settings)] 129 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 135 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 136 | 137 | 138 | 139 | [Space(25)] 140 | [Header(Stencil)] 141 | _Offset ("Offset", float) = 0 142 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 143 | _ReadMask ("ReadMask [0;255]", Int) = 255 144 | _WriteMask ("WriteMask [0;255]", Int) = 255 145 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 146 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 147 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 148 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 149 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 150 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 151 | } 152 | 153 | 154 | 155 | 156 | 157 | 158 | SubShader { 159 | Tags { 160 | "Queue"="Geometry" 161 | "RenderType"="Opaque" 162 | } 163 | 164 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather/FORWARD" 165 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather/FORWARD_DELTA" 166 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather/SHADOWCASTER" 167 | } 168 | FallBack "Legacy Shaders/VertexLit" 169 | } 170 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/ToonColor_DoubleShadeWithFeather_AlphaTestDither.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/NoOutline/ToonColor_DoubleShadeWithFeather_AlphaTestDither" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | 20 | [Space(25)] 21 | [Header(Normal map)] 22 | _NormalMap ("NormalMap", 2D) = "bump" {} 23 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 26 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 27 | 28 | 29 | 30 | [Space(25)] 31 | [Header(Toon ramp)] 32 | _MainTex ("Main Tex", 2D) = "white" {} 33 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 34 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 35 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 36 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 37 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 38 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 39 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 40 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 41 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 42 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 43 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 44 | 45 | 46 | 47 | [Space(25)] 48 | [Header(Shadow and AO control)] 49 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 50 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 51 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 52 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 53 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 54 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 55 | 56 | 57 | 58 | [Space(25)] 59 | [Header(High Color. Specular)] 60 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 61 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 62 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 63 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 64 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 65 | _HighColor_Power ("Power", Range(0, 1)) = 0 66 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 67 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 68 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 69 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 70 | 71 | 72 | 73 | [Space(25)] 74 | [Header(Rimlights)] 75 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 76 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 79 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 80 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 81 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 82 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 83 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 84 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 85 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 86 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 87 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 88 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 89 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 90 | 91 | 92 | 93 | [Space(25)] 94 | [Header(World reflection)] 95 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 96 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 97 | 98 | 99 | 100 | [Space(25)] 101 | [Header(Matcap)] 102 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 103 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 104 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 105 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 106 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 107 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 108 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 109 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 110 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 111 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 112 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 113 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 114 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 115 | 116 | 117 | 118 | [Space(25)] 119 | [Header(Emission)] 120 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 121 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 122 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 123 | 124 | 125 | 126 | [Space(25)] 127 | [Header(Use world color settings)] 128 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 135 | 136 | 137 | 138 | [Space(25)] 139 | [Header(Stencil)] 140 | _Offset ("Offset", float) = 0 141 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 142 | _ReadMask ("ReadMask [0;255]", Int) = 255 143 | _WriteMask ("WriteMask [0;255]", Int) = 255 144 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 145 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 146 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 147 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 148 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 149 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 150 | } 151 | 152 | 153 | 154 | 155 | 156 | 157 | SubShader { 158 | Tags { 159 | "Queue"="AlphaTest+50" 160 | "RenderType"="TransparentCutout" 161 | } 162 | 163 | 164 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_AlphaTestDither/FORWARD" 165 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_AlphaTestDither/FORWARD_DELTA" 166 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_AlphaTestDither/SHADOWCASTER" 167 | } 168 | FallBack "Legacy Shaders/VertexLit" 169 | } 170 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/ToonColor_DoubleShadeWithFeather_ClippingCutout.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/NoOutline/ToonColor_DoubleShadeWithFeather_ClippingCutout" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | 20 | [Space(25)] 21 | [Header(Normal map)] 22 | _NormalMap ("NormalMap", 2D) = "bump" {} 23 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 26 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 27 | 28 | 29 | 30 | [Space(25)] 31 | [Header(Toon ramp)] 32 | _MainTex ("Main Tex", 2D) = "white" {} 33 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 34 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 35 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 36 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 37 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 38 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 39 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 40 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 41 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 42 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 43 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 44 | 45 | 46 | 47 | [Space(25)] 48 | [Header(Shadow and AO control)] 49 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 50 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 51 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 52 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 53 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 54 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 55 | 56 | 57 | 58 | [Space(25)] 59 | [Header(High Color. Specular)] 60 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 61 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 62 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 63 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 64 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 65 | _HighColor_Power ("Power", Range(0, 1)) = 0 66 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 67 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 68 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 69 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 70 | 71 | 72 | 73 | [Space(25)] 74 | [Header(Rimlights)] 75 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 76 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 79 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 80 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 81 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 82 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 83 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 84 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 85 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 86 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 87 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 88 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 89 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 90 | 91 | 92 | 93 | [Space(25)] 94 | [Header(World reflection)] 95 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 96 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 97 | 98 | 99 | 100 | [Space(25)] 101 | [Header(Matcap)] 102 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 103 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 104 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 105 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 106 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 107 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 108 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 109 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 110 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 111 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 112 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 113 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 114 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 115 | 116 | 117 | 118 | [Space(25)] 119 | [Header(Emission)] 120 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 121 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 122 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 123 | 124 | 125 | 126 | [Space(25)] 127 | [Header(Use world color settings)] 128 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 135 | 136 | 137 | 138 | [Space(25)] 139 | [Header(Stencil)] 140 | _Offset ("Offset", float) = 0 141 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 142 | _ReadMask ("ReadMask [0;255]", Int) = 255 143 | _WriteMask ("WriteMask [0;255]", Int) = 255 144 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 145 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 146 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 147 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 148 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 149 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 150 | } 151 | 152 | 153 | 154 | 155 | 156 | SubShader { 157 | Tags { 158 | "Queue"="AlphaTest" 159 | "RenderType"="TransparentCutout" 160 | } 161 | 162 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_ClippingCutout/FORWARD" 163 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_ClippingCutout/FORWARD_DELTA" 164 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_ClippingCutout/SHADOWCASTER" 165 | } 166 | FallBack "Legacy Shaders/VertexLit" 167 | } 168 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/ToonColor_DoubleShadeWithFeather_TransClippingFade.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/NoOutline/ToonColor_DoubleShadeWithFeather_TransClippingFade" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | 20 | [Space(25)] 21 | [Header(Normal map)] 22 | _NormalMap ("NormalMap", 2D) = "bump" {} 23 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 26 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 27 | 28 | 29 | 30 | [Space(25)] 31 | [Header(Toon ramp)] 32 | _MainTex ("Main Tex", 2D) = "white" {} 33 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 34 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 35 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 36 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 37 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 38 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 39 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 40 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 41 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 42 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 43 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 44 | 45 | 46 | 47 | [Space(25)] 48 | [Header(Shadow and AO control)] 49 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 50 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 51 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 52 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 53 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 54 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 55 | 56 | 57 | 58 | [Space(25)] 59 | [Header(High Color. Specular)] 60 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 61 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 62 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 63 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 64 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 65 | _HighColor_Power ("Power", Range(0, 1)) = 0 66 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 67 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 68 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 69 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 70 | 71 | 72 | 73 | [Space(25)] 74 | [Header(Rimlights)] 75 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 76 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 79 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 80 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 81 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 82 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 83 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 84 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 85 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 86 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 87 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 88 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 89 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 90 | 91 | 92 | 93 | [Space(25)] 94 | [Header(World reflection)] 95 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 96 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 97 | 98 | 99 | 100 | [Space(25)] 101 | [Header(Matcap)] 102 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 103 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 104 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 105 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 106 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 107 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 108 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 109 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 110 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 111 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 112 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 113 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 114 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 115 | 116 | 117 | 118 | [Space(25)] 119 | [Header(Emission)] 120 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 121 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 122 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 123 | 124 | 125 | 126 | [Space(25)] 127 | [Header(Use world color settings)] 128 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 135 | 136 | 137 | 138 | [Space(25)] 139 | [Header(Stencil)] 140 | _Offset ("Offset", float) = 0 141 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 142 | _ReadMask ("ReadMask [0;255]", Int) = 255 143 | _WriteMask ("WriteMask [0;255]", Int) = 255 144 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 145 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 146 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 147 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 148 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 149 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 150 | } 151 | 152 | 153 | 154 | 155 | 156 | 157 | SubShader { 158 | Tags { 159 | "Queue"="AlphaTest+50" 160 | "RenderType"="TransparentCutout" 161 | } 162 | 163 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_TransClippingFade/FORWARD" 164 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_TransClippingFade/FORWARD_DELTA" 165 | UsePass "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_TransClippingFade/SHADOWCASTER" 166 | } 167 | FallBack "Legacy Shaders/VertexLit" 168 | } 169 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/Toon_DoubleShadeWithFeather.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | 20 | [Space(25)] 21 | [Header(Normal map)] 22 | _NormalMap ("NormalMap", 2D) = "bump" {} 23 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 26 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 27 | 28 | 29 | 30 | [Space(25)] 31 | [Header(Toon ramp)] 32 | _MainTex ("Main Tex", 2D) = "white" {} 33 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 34 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 35 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 36 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 37 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 38 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 39 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 40 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 41 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 42 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 43 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 44 | 45 | 46 | 47 | [Space(25)] 48 | [Header(Shadow and AO control)] 49 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 50 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 51 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 52 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 53 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 54 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 55 | 56 | 57 | 58 | [Space(25)] 59 | [Header(High Color. Specular)] 60 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 61 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 62 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 63 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 64 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 65 | _HighColor_Power ("Power", Range(0, 1)) = 0 66 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 67 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 68 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 69 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 70 | 71 | 72 | 73 | [Space(25)] 74 | [Header(Rimlights)] 75 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 76 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 79 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 80 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 81 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 82 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 83 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 84 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 85 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 86 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 87 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 88 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 89 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 90 | 91 | 92 | 93 | [Space(25)] 94 | [Header(World reflection)] 95 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 96 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 97 | 98 | 99 | 100 | [Space(25)] 101 | [Header(Matcap)] 102 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 103 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 104 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 105 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 106 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 107 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 108 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 109 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 110 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 111 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 112 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 113 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 114 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 115 | 116 | 117 | 118 | [Space(25)] 119 | [Header(Emission)] 120 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 121 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 122 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 123 | 124 | 125 | 126 | [Space(25)] 127 | [Header(Use world color settings)] 128 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 135 | 136 | 137 | 138 | [Space(25)] 139 | [Header(Outline)] 140 | [Enum(NML,0,POS,1)] _outline_mode ("OUTLINE MODE", Int) = 0 141 | _OutlineTex ("Outline tex", 2D) = "white" {} 142 | _Outline_Sampler ("Outline sampler", 2D) = "white" {} 143 | _Outline_Color ("Outline color", Color) = (0.5,0.5,0.5,1) 144 | [Toggle(_)]_Is_BlendBaseColor ("Is Blend base color", Float ) = 0 145 | [Toggle(_)]_Is_OutlineTex ("Is outline Tex", Float ) = 0 146 | _Outline_Width ("Outline width", Float ) = 1 147 | _Nearest_Distance ("Nearest distance", Float ) = 0.5 148 | _Farthest_Distance ("Farthest distance", Float ) = 10 149 | _Offset_Z ("Offset Camera Z depth", Float) = 0 150 | _OutlineshadowCastMin_black ("outline Shadow minimal dark", Range(0.0,1.0)) = 0.0 151 | 152 | 153 | 154 | [Space(25)] 155 | [Header(Stencil)] 156 | _Offset ("Offset", float) = 0 157 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 158 | _ReadMask ("ReadMask [0;255]", Int) = 255 159 | _WriteMask ("WriteMask [0;255]", Int) = 255 160 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 161 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 162 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 163 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 164 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 165 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 166 | } 167 | 168 | 169 | 170 | 171 | 172 | SubShader { 173 | Tags { 174 | "Queue"="Geometry" 175 | "RenderType"="Opaque" 176 | } 177 | 178 | 179 | 180 | Pass { 181 | Name "FORWARD" 182 | Tags { 183 | "LightMode"="ForwardBase" 184 | } 185 | Cull[_CullMode] 186 | ColorMask [_colormask] 187 | ZTest [_ZTest] 188 | ZWrite on 189 | 190 | Stencil 191 | { 192 | Ref [_Stencil] 193 | ReadMask [_ReadMask] 194 | WriteMask [_WriteMask] 195 | Comp [_StencilComp] 196 | Pass [_StencilOp] 197 | Fail [_StencilFail] 198 | ZFail [_StencilZFail] 199 | } 200 | 201 | CGPROGRAM 202 | #pragma vertex vert 203 | #pragma fragment frag 204 | #include "UnityCG.cginc" 205 | #include "AutoLight.cginc" 206 | #include "Lighting.cginc" 207 | #pragma multi_compile_fwdbase_fullshadows 208 | #pragma multi_compile_fog 209 | #pragma multi_compile UNITY_PASS_FORWARDBASE 210 | #define NotAlpha 211 | #include "UCTS_DoubleShadeWithFeather.cginc" 212 | ENDCG 213 | } 214 | 215 | 216 | 217 | Pass { 218 | Name "FORWARD_DELTA" 219 | Tags { 220 | "LightMode"="ForwardAdd" 221 | } 222 | Cull[_CullMode] 223 | Blend One One 224 | ZTest [_ZTest] 225 | ZWrite on 226 | 227 | Stencil 228 | { 229 | Ref [_Stencil] 230 | ReadMask [_ReadMask] 231 | WriteMask [_WriteMask] 232 | Comp [_StencilComp] 233 | Pass [_StencilOp] 234 | Fail [_StencilFail] 235 | ZFail [_StencilZFail] 236 | } 237 | 238 | CGPROGRAM 239 | #pragma vertex vert 240 | #pragma fragment frag 241 | #include "UnityCG.cginc" 242 | #include "AutoLight.cginc" 243 | #include "Lighting.cginc" 244 | #pragma multi_compile_fwdadd_fullshadows 245 | #pragma multi_compile_fog 246 | #pragma multi_compile UNITY_PASS_FORWARDADD 247 | #define NotAlpha 248 | #include "UCTS_DoubleShadeWithFeather.cginc" 249 | ENDCG 250 | } 251 | 252 | 253 | 254 | Pass { 255 | Name "Outline" 256 | Tags { 257 | "LightMode" = "ForwardBase" 258 | } 259 | Cull Front 260 | ColorMask [_colormask] 261 | ZTest [_ZTest] 262 | ZWrite on 263 | 264 | Stencil 265 | { 266 | Ref [_Stencil] 267 | ReadMask [_ReadMask] 268 | WriteMask [_WriteMask] 269 | Comp [_StencilComp] 270 | Pass [_StencilOp] 271 | Fail [_StencilFail] 272 | ZFail [_StencilZFail] 273 | } 274 | 275 | CGPROGRAM 276 | #pragma vertex vert 277 | #pragma fragment frag 278 | #include "UnityCG.cginc" 279 | #include "AutoLight.cginc" 280 | #include "Lighting.cginc" 281 | #pragma multi_compile_fwdbase_fullshadows 282 | #pragma multi_compile_fog 283 | #pragma multi_compile UNITY_PASS_FORWARDBASE 284 | #define NotAlpha 285 | #include "UCTS_Outline.cginc" 286 | ENDCG 287 | } 288 | 289 | 290 | 291 | Pass { 292 | Name "Outline_Delta" 293 | Tags { 294 | "LightMode" = "ForwardAdd" 295 | } 296 | Cull Front 297 | Blend One One 298 | ColorMask [_colormask] 299 | ZTest [_ZTest] 300 | ZWrite on 301 | 302 | Stencil 303 | { 304 | Ref [_Stencil] 305 | ReadMask [_ReadMask] 306 | WriteMask [_WriteMask] 307 | Comp [_StencilComp] 308 | Pass [_StencilOp] 309 | Fail [_StencilFail] 310 | ZFail [_StencilZFail] 311 | } 312 | 313 | CGPROGRAM 314 | #pragma vertex vert 315 | #pragma fragment frag 316 | #include "UnityCG.cginc" 317 | #include "AutoLight.cginc" 318 | #include "Lighting.cginc" 319 | #pragma multi_compile_fwdadd_fullshadows 320 | #pragma multi_compile_fog 321 | #pragma multi_compile UNITY_PASS_FORWARDADD 322 | #define NotAlpha 323 | #include "UCTS_Outline.cginc" 324 | ENDCG 325 | } 326 | 327 | 328 | 329 | Pass { 330 | Name "ShadowCaster" 331 | Tags { 332 | "LightMode"="ShadowCaster" 333 | } 334 | Offset 1 , 80 335 | Cull Off 336 | 337 | CGPROGRAM 338 | #pragma vertex vert 339 | #pragma fragment frag 340 | #include "UnityCG.cginc" 341 | #include "Lighting.cginc" 342 | #pragma fragmentoption ARB_precision_hint_fastest 343 | #pragma multi_compile_shadowcaster 344 | #define NotAlpha 345 | #include "UCTS_ShadowCaster.cginc" 346 | ENDCG 347 | } 348 | } 349 | FallBack "Legacy Shaders/VertexLit" 350 | } 351 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/Toon_DoubleShadeWithFeather_AlphaTestDither.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_AlphaTestDither" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | 20 | [Space(25)] 21 | [Header(Normal map)] 22 | _NormalMap ("NormalMap", 2D) = "bump" {} 23 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 26 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 27 | 28 | 29 | 30 | [Space(25)] 31 | [Header(Toon ramp)] 32 | _MainTex ("Main Tex", 2D) = "white" {} 33 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 34 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 35 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 36 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 37 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 38 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 39 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 40 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 41 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 42 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 43 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 44 | 45 | 46 | 47 | [Space(25)] 48 | [Header(Shadow and AO control)] 49 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 50 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 51 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 52 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 53 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 54 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 55 | 56 | 57 | 58 | [Space(25)] 59 | [Header(High Color. Specular)] 60 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 61 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 62 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 63 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 64 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 65 | _HighColor_Power ("Power", Range(0, 1)) = 0 66 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 67 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 68 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 69 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 70 | 71 | 72 | 73 | [Space(25)] 74 | [Header(Rimlights)] 75 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 76 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 79 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 80 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 81 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 82 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 83 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 84 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 85 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 86 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 87 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 88 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 89 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 90 | 91 | 92 | 93 | [Space(25)] 94 | [Header(World reflection)] 95 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 96 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 97 | 98 | 99 | 100 | [Space(25)] 101 | [Header(Matcap)] 102 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 103 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 104 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 105 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 106 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 107 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 108 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 109 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 110 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 111 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 112 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 113 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 114 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 115 | 116 | 117 | 118 | [Space(25)] 119 | [Header(Emission)] 120 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 121 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 122 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 123 | 124 | 125 | 126 | [Space(25)] 127 | [Header(Use world color settings)] 128 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 135 | 136 | 137 | 138 | [Space(25)] 139 | [Header(Outline)] 140 | [Enum(NML,0,POS,1)] _outline_mode ("OUTLINE MODE", Int) = 0 141 | _OutlineTex ("Outline tex", 2D) = "white" {} 142 | _Outline_Sampler ("Outline sampler", 2D) = "white" {} 143 | _Outline_Color ("Outline color", Color) = (0.5,0.5,0.5,1) 144 | [Toggle(_)]_Is_BlendBaseColor ("Is Blend base color", Float ) = 0 145 | [Toggle(_)]_Is_OutlineTex ("Is outline Tex", Float ) = 0 146 | _Outline_Width ("Outline width", Float ) = 1 147 | _Nearest_Distance ("Nearest distance", Float ) = 0.5 148 | _Farthest_Distance ("Farthest distance", Float ) = 10 149 | _Offset_Z ("Offset Camera Z depth", Float) = 0 150 | _OutlineshadowCastMin_black ("outline Shadow minimal dark", Range(0.0,1.0)) = 0.0 151 | 152 | 153 | 154 | [Space(25)] 155 | [Header(Stencil)] 156 | _Offset ("Offset", float) = 0 157 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 158 | _ReadMask ("ReadMask [0;255]", Int) = 255 159 | _WriteMask ("WriteMask [0;255]", Int) = 255 160 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 161 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 162 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 163 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 164 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 165 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 166 | } 167 | 168 | 169 | 170 | 171 | 172 | 173 | SubShader { 174 | Tags { 175 | "Queue"="AlphaTest+50" 176 | "RenderType"="TransparentCutout" 177 | } 178 | AlphaToMask on 179 | 180 | 181 | 182 | Pass { 183 | Name "Outline" 184 | Tags { 185 | "LightMode" = "ForwardBase" 186 | } 187 | Cull front 188 | Blend SrcAlpha OneMinusSrcAlpha 189 | ZTest [_ZTest] 190 | ZWrite [_ZWrite] 191 | 192 | Stencil 193 | { 194 | Ref [_Stencil] 195 | ReadMask [_ReadMask] 196 | WriteMask [_WriteMask] 197 | Comp [_StencilComp] 198 | Pass [_StencilOp] 199 | Fail [_StencilFail] 200 | ZFail [_StencilZFail] 201 | } 202 | 203 | CGPROGRAM 204 | #pragma vertex vert 205 | #pragma fragment frag 206 | #include "UnityCG.cginc" 207 | #include "AutoLight.cginc" 208 | #include "Lighting.cginc" 209 | #pragma multi_compile_fwdbase_fullshadows 210 | #pragma multi_compile_fog 211 | #pragma multi_compile _IS_OUTLINE_CLIPPING_YES 212 | #pragma multi_compile UNITY_PASS_FORWARDBASE 213 | #define UseAlphaDither 214 | #include "UCTS_Outline.cginc" 215 | ENDCG 216 | } 217 | 218 | 219 | 220 | Pass { 221 | Name "Outline_Delta" 222 | Tags { 223 | "LightMode" = "ForwardAdd" 224 | } 225 | // Blend One One 226 | Blend SrcAlpha One 227 | Cull front 228 | ZTest [_ZTest] 229 | ZWrite [_ZWrite] 230 | 231 | Stencil 232 | { 233 | Ref [_Stencil] 234 | ReadMask [_ReadMask] 235 | WriteMask [_WriteMask] 236 | Comp [_StencilComp] 237 | Pass [_StencilOp] 238 | Fail [_StencilFail] 239 | ZFail [_StencilZFail] 240 | } 241 | 242 | CGPROGRAM 243 | #pragma vertex vert 244 | #pragma fragment frag 245 | #include "UnityCG.cginc" 246 | #include "AutoLight.cginc" 247 | #include "Lighting.cginc" 248 | #pragma multi_compile_fwdadd_fullshadows 249 | #pragma multi_compile_fog 250 | #pragma multi_compile _IS_OUTLINE_CLIPPING_YES 251 | #pragma multi_compile UNITY_PASS_FORWARDADD 252 | #define UseAlphaDither 253 | #include "UCTS_Outline.cginc" 254 | ENDCG 255 | } 256 | 257 | 258 | 259 | Pass { 260 | Name "FORWARD" 261 | Tags { 262 | "LightMode"="ForwardBase" 263 | } 264 | Blend SrcAlpha OneMinusSrcAlpha 265 | Cull[_CullMode] 266 | ZTest [_ZTest] 267 | ZWrite [_ZWrite] 268 | 269 | Stencil 270 | { 271 | Ref [_Stencil] 272 | ReadMask [_ReadMask] 273 | WriteMask [_WriteMask] 274 | Comp [_StencilComp] 275 | Pass [_StencilOp] 276 | Fail [_StencilFail] 277 | ZFail [_StencilZFail] 278 | } 279 | 280 | CGPROGRAM 281 | #pragma vertex vert 282 | #pragma fragment frag 283 | #include "UnityCG.cginc" 284 | #include "AutoLight.cginc" 285 | #include "Lighting.cginc" 286 | #pragma multi_compile_fwdbase_fullshadows 287 | #pragma multi_compile_fog 288 | #pragma multi_compile UNITY_PASS_FORWARDBASE 289 | #define UseAlphaDither 290 | #include "UCTS_DoubleShadeWithFeather.cginc" 291 | ENDCG 292 | } 293 | 294 | 295 | 296 | Pass { 297 | Name "FORWARD_DELTA" 298 | Tags { 299 | "LightMode"="ForwardAdd" 300 | } 301 | Cull[_CullMode] 302 | // Blend One One 303 | Blend SrcAlpha One 304 | ZTest [_ZTest] 305 | ZWrite [_ZWrite] 306 | 307 | Stencil 308 | { 309 | Ref [_Stencil] 310 | ReadMask [_ReadMask] 311 | WriteMask [_WriteMask] 312 | Comp [_StencilComp] 313 | Pass [_StencilOp] 314 | Fail [_StencilFail] 315 | ZFail [_StencilZFail] 316 | } 317 | 318 | CGPROGRAM 319 | #pragma vertex vert 320 | #pragma fragment frag 321 | #include "UnityCG.cginc" 322 | #include "AutoLight.cginc" 323 | #include "Lighting.cginc" 324 | #pragma multi_compile_fwdadd_fullshadows 325 | #pragma multi_compile_fog 326 | #pragma multi_compile UNITY_PASS_FORWARDADD 327 | #define UseAlphaDither 328 | #include "UCTS_DoubleShadeWithFeather.cginc" 329 | ENDCG 330 | } 331 | 332 | 333 | 334 | Pass { 335 | Name "ShadowCaster" 336 | Tags { 337 | "LightMode"="ShadowCaster" 338 | } 339 | AlphaToMask Off 340 | Offset 1 , 80 341 | // Cull[_CullMode] 342 | Cull off 343 | // Zwrite Off 344 | 345 | CGPROGRAM 346 | #pragma vertex vert 347 | #pragma fragment frag 348 | #include "UnityCG.cginc" 349 | #include "Lighting.cginc" 350 | #pragma fragmentoption ARB_precision_hint_fastest 351 | #pragma multi_compile_shadowcaster 352 | #define Dither 353 | #include "UCTS_ShadowCaster.cginc" 354 | ENDCG 355 | } 356 | } 357 | FallBack "Legacy Shaders/VertexLit" 358 | } 359 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/Toon_DoubleShadeWithFeather_ClippingCutout.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_ClippingCutout" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | [Space(25)] 20 | [Header(Normal map)] 21 | _NormalMap ("NormalMap", 2D) = "bump" {} 22 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 23 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 25 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 26 | 27 | 28 | 29 | [Space(25)] 30 | [Header(Toon ramp)] 31 | _MainTex ("Main Tex", 2D) = "white" {} 32 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 33 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 34 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 35 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 36 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 37 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 38 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 39 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 40 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 41 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 42 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 43 | 44 | 45 | 46 | [Space(25)] 47 | [Header(Shadow and AO control)] 48 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 49 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 50 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 51 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 52 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 53 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 54 | 55 | 56 | 57 | [Space(25)] 58 | [Header(High Color. Specular)] 59 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 60 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 61 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 62 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 63 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 64 | _HighColor_Power ("Power", Range(0, 1)) = 0 65 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 66 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 67 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 68 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 69 | 70 | 71 | 72 | [Space(25)] 73 | [Header(Rimlights)] 74 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 75 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 76 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 78 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 79 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 80 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 81 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 82 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 83 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 84 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 85 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 86 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 87 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 88 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 89 | 90 | 91 | 92 | [Space(25)] 93 | [Header(World reflection)] 94 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 95 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 96 | 97 | 98 | 99 | [Space(25)] 100 | [Header(Matcap)] 101 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 102 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 103 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 104 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 105 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 106 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 107 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 108 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 109 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 110 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 111 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 112 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 113 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 114 | 115 | 116 | 117 | [Space(25)] 118 | [Header(Emission)] 119 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 120 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 121 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 122 | 123 | 124 | 125 | [Space(25)] 126 | [Header(Use world color settings)] 127 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 128 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 134 | 135 | 136 | 137 | [Space(25)] 138 | [Header(Outline)] 139 | [Enum(NML,0,POS,1)] _outline_mode ("OUTLINE MODE", Int) = 0 140 | _OutlineTex ("Outline tex", 2D) = "white" {} 141 | _Outline_Sampler ("Outline sampler", 2D) = "white" {} 142 | _Outline_Color ("Outline color", Color) = (0.5,0.5,0.5,1) 143 | [Toggle(_)]_Is_BlendBaseColor ("Is Blend base color", Float ) = 0 144 | [Toggle(_)]_Is_OutlineTex ("Is outline Tex", Float ) = 0 145 | _Outline_Width ("Outline width", Float ) = 1 146 | _Nearest_Distance ("Nearest distance", Float ) = 0.5 147 | _Farthest_Distance ("Farthest distance", Float ) = 10 148 | _Offset_Z ("Offset Camera Z depth", Float) = 0 149 | _OutlineshadowCastMin_black ("outline Shadow minimal dark", Range(0.0,1.0)) = 0.0 150 | 151 | 152 | 153 | [Space(25)] 154 | [Header(Stencil)] 155 | _Offset ("Offset", float) = 0 156 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 157 | _ReadMask ("ReadMask [0;255]", Int) = 255 158 | _WriteMask ("WriteMask [0;255]", Int) = 255 159 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 160 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 161 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 162 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 163 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 164 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 165 | } 166 | 167 | 168 | 169 | 170 | 171 | 172 | SubShader { 173 | Tags { 174 | "Queue"="AlphaTest" 175 | "RenderType"="TransparentCutout" 176 | } 177 | 178 | 179 | 180 | Pass { 181 | Name "FORWARD" 182 | Tags { 183 | "LightMode"="ForwardBase" 184 | } 185 | 186 | Cull[_CullMode] 187 | ColorMask [_colormask] 188 | ZTest [_ZTest] 189 | ZWrite on 190 | 191 | Stencil 192 | { 193 | Ref [_Stencil] 194 | ReadMask [_ReadMask] 195 | WriteMask [_WriteMask] 196 | Comp [_StencilComp] 197 | Pass [_StencilOp] 198 | Fail [_StencilFail] 199 | ZFail [_StencilZFail] 200 | } 201 | 202 | CGPROGRAM 203 | #pragma vertex vert 204 | #pragma fragment frag 205 | #include "UnityCG.cginc" 206 | #include "AutoLight.cginc" 207 | #include "Lighting.cginc" 208 | #pragma multi_compile_fwdbase_fullshadows 209 | #pragma multi_compile_fog 210 | #pragma multi_compile UNITY_PASS_FORWARDBASE 211 | #define IsClip 212 | #include "UCTS_DoubleShadeWithFeather.cginc" 213 | ENDCG 214 | } 215 | 216 | 217 | 218 | Pass { 219 | Name "FORWARD_DELTA" 220 | Tags { 221 | "LightMode"="ForwardAdd" 222 | } 223 | Blend One One 224 | Cull[_CullMode] 225 | ZTest [_ZTest] 226 | ZWrite on 227 | 228 | Stencil 229 | { 230 | Ref [_Stencil] 231 | ReadMask [_ReadMask] 232 | WriteMask [_WriteMask] 233 | Comp [_StencilComp] 234 | Pass [_StencilOp] 235 | Fail [_StencilFail] 236 | ZFail [_StencilZFail] 237 | } 238 | 239 | CGPROGRAM 240 | #pragma vertex vert 241 | #pragma fragment frag 242 | #include "UnityCG.cginc" 243 | #include "AutoLight.cginc" 244 | #include "Lighting.cginc" 245 | #pragma multi_compile_fwdadd_fullshadows 246 | #pragma multi_compile_fog 247 | #pragma multi_compile UNITY_PASS_FORWARDADD 248 | #define IsClip 249 | #include "UCTS_DoubleShadeWithFeather.cginc" 250 | ENDCG 251 | } 252 | 253 | 254 | 255 | Pass { 256 | Name "Outline" 257 | Tags { 258 | "LightMode" = "ForwardBase" 259 | } 260 | Cull Front 261 | ZTest [_ZTest] 262 | ZWrite on 263 | 264 | Stencil 265 | { 266 | Ref [_Stencil] 267 | ReadMask [_ReadMask] 268 | WriteMask [_WriteMask] 269 | Comp [_StencilComp] 270 | Pass [_StencilOp] 271 | Fail [_StencilFail] 272 | ZFail [_StencilZFail] 273 | } 274 | 275 | CGPROGRAM 276 | #pragma vertex vert 277 | #pragma fragment frag 278 | #include "UnityCG.cginc" 279 | #include "AutoLight.cginc" 280 | #include "Lighting.cginc" 281 | #pragma multi_compile_fwdbase_fullshadows 282 | #pragma multi_compile_fog 283 | #pragma multi_compile _IS_OUTLINE_CLIPPING_YES 284 | #pragma multi_compile UNITY_PASS_FORWARDBASE 285 | #define IsClip 286 | #include "UCTS_Outline.cginc" 287 | ENDCG 288 | } 289 | 290 | 291 | 292 | Pass { 293 | Name "Outline_Delta" 294 | Tags { 295 | "LightMode" = "ForwardAdd" 296 | } 297 | Blend One One 298 | Cull Front 299 | ZTest [_ZTest] 300 | ZWrite on 301 | 302 | Stencil 303 | { 304 | Ref [_Stencil] 305 | ReadMask [_ReadMask] 306 | WriteMask [_WriteMask] 307 | Comp [_StencilComp] 308 | Pass [_StencilOp] 309 | Fail [_StencilFail] 310 | ZFail [_StencilZFail] 311 | } 312 | 313 | CGPROGRAM 314 | #pragma vertex vert 315 | #pragma fragment frag 316 | #include "UnityCG.cginc" 317 | #include "AutoLight.cginc" 318 | #include "Lighting.cginc" 319 | #pragma multi_compile_fwdadd_fullshadows 320 | #pragma multi_compile_fog 321 | #pragma multi_compile _IS_OUTLINE_CLIPPING_YES 322 | #pragma multi_compile UNITY_PASS_FORWARDADD 323 | #define IsClip 324 | #include "UCTS_Outline.cginc" 325 | ENDCG 326 | } 327 | Pass { 328 | Name "ShadowCaster" 329 | Tags { 330 | "LightMode"="ShadowCaster" 331 | } 332 | Offset 1 , 80 333 | Cull Off 334 | 335 | CGPROGRAM 336 | #pragma vertex vert 337 | #pragma fragment frag 338 | #include "UnityCG.cginc" 339 | #include "Lighting.cginc" 340 | #pragma multi_compile_shadowcaster 341 | #define IsClip 342 | #include "UCTS_ShadowCaster.cginc" 343 | ENDCG 344 | } 345 | } 346 | FallBack "Legacy Shaders/VertexLit" 347 | } 348 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/Toon_DoubleShadeWithFeather_TransClippingFade.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityChanToonShader/ACiiL/Toon_DoubleShadeWithFeather_TransClippingFade" { 2 | Properties { 3 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 4 | 5 | 6 | 7 | [Space(25)] 8 | [Header(Alpha mask)] 9 | _ClippingMask ("Clipping mask", 2D) = "white" {} 10 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 11 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 12 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 13 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 14 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 15 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 16 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 17 | 18 | 19 | 20 | [Space(25)] 21 | [Header(Normal map)] 22 | _NormalMap ("NormalMap", 2D) = "bump" {} 23 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 25 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 26 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 27 | 28 | 29 | 30 | [Space(25)] 31 | [Header(Toon ramp)] 32 | _MainTex ("Main Tex", 2D) = "white" {} 33 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 34 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 35 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 36 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 37 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 38 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 39 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 40 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 41 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 42 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 43 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 44 | 45 | 46 | 47 | [Space(25)] 48 | [Header(Shadow and AO control)] 49 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 50 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 51 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 52 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 53 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 54 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 55 | 56 | 57 | 58 | [Space(25)] 59 | [Header(High Color. Specular)] 60 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 61 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 62 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 63 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 64 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 65 | _HighColor_Power ("Power", Range(0, 1)) = 0 66 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 67 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 68 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 69 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 70 | 71 | 72 | 73 | [Space(25)] 74 | [Header(Rimlights)] 75 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 76 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 78 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 79 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 80 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 81 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 82 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 83 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 84 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 85 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 86 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 87 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 88 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 89 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 90 | 91 | 92 | 93 | [Space(25)] 94 | [Header(World reflection)] 95 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 96 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 97 | 98 | 99 | 100 | [Space(25)] 101 | [Header(Matcap)] 102 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 103 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 104 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 105 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 106 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 107 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 108 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 109 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 110 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 111 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 112 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 113 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 114 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 115 | 116 | 117 | 118 | [Space(25)] 119 | [Header(Emission)] 120 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 121 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 122 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 123 | 124 | 125 | 126 | [Space(25)] 127 | [Header(Use world color settings)] 128 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 134 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 135 | 136 | 137 | 138 | [Space(25)] 139 | [Header(Outline)] 140 | [Enum(NML,0,POS,1)] _outline_mode ("OUTLINE MODE", Int) = 0 141 | _OutlineTex ("Outline tex", 2D) = "white" {} 142 | _Outline_Sampler ("Outline sampler", 2D) = "white" {} 143 | _Outline_Color ("Outline color", Color) = (0.5,0.5,0.5,1) 144 | [Toggle(_)]_Is_BlendBaseColor ("Is Blend base color", Float ) = 0 145 | [Toggle(_)]_Is_OutlineTex ("Is outline Tex", Float ) = 0 146 | _Outline_Width ("Outline width", Float ) = 1 147 | _Nearest_Distance ("Nearest distance", Float ) = 0.5 148 | _Farthest_Distance ("Farthest distance", Float ) = 10 149 | _Offset_Z ("Offset Camera Z depth", Float) = 0 150 | _OutlineshadowCastMin_black ("outline Shadow minimal dark", Range(0.0,1.0)) = 0.0 151 | 152 | 153 | 154 | [Space(25)] 155 | [Header(Stencil)] 156 | _Offset ("Offset", float) = 0 157 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 158 | _ReadMask ("ReadMask [0;255]", Int) = 255 159 | _WriteMask ("WriteMask [0;255]", Int) = 255 160 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 161 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 162 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 163 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 164 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 165 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 166 | } 167 | 168 | 169 | 170 | 171 | 172 | 173 | SubShader { 174 | Tags { 175 | "Queue"="AlphaTest+50" 176 | "RenderType"="TransparentCutout" 177 | } 178 | 179 | 180 | 181 | Pass { 182 | Name "Outline" 183 | Tags { 184 | "LightMode" = "ForwardBase" 185 | } 186 | Cull front 187 | Blend SrcAlpha OneMinusSrcAlpha 188 | ZTest [_ZTest] 189 | ZWrite [_ZWrite] 190 | 191 | Stencil 192 | { 193 | Ref [_Stencil] 194 | ReadMask [_ReadMask] 195 | WriteMask [_WriteMask] 196 | Comp [_StencilComp] 197 | Pass [_StencilOp] 198 | Fail [_StencilFail] 199 | ZFail [_StencilZFail] 200 | } 201 | 202 | CGPROGRAM 203 | #pragma vertex vert 204 | #pragma fragment frag 205 | #include "UnityCG.cginc" 206 | #include "AutoLight.cginc" 207 | #include "Lighting.cginc" 208 | #pragma multi_compile_fwdbase_fullshadows 209 | #pragma multi_compile_fog 210 | #pragma multi_compile _IS_OUTLINE_CLIPPING_YES 211 | #pragma multi_compile UNITY_PASS_FORWARDBASE 212 | #include "UCTS_Outline.cginc" 213 | ENDCG 214 | } 215 | 216 | 217 | 218 | Pass { 219 | Name "Outline_Delta" 220 | Tags { 221 | "LightMode" = "ForwardAdd" 222 | } 223 | // Blend One One 224 | Blend SrcAlpha One 225 | Cull front 226 | ZTest [_ZTest] 227 | ZWrite [_ZWrite] 228 | 229 | Stencil 230 | { 231 | Ref [_Stencil] 232 | ReadMask [_ReadMask] 233 | WriteMask [_WriteMask] 234 | Comp [_StencilComp] 235 | Pass [_StencilOp] 236 | Fail [_StencilFail] 237 | ZFail [_StencilZFail] 238 | } 239 | 240 | CGPROGRAM 241 | #pragma vertex vert 242 | #pragma fragment frag 243 | #include "UnityCG.cginc" 244 | #include "AutoLight.cginc" 245 | #include "Lighting.cginc" 246 | #pragma multi_compile_fwdadd_fullshadows 247 | #pragma multi_compile_fog 248 | #pragma multi_compile _IS_OUTLINE_CLIPPING_YES 249 | #pragma multi_compile UNITY_PASS_FORWARDADD 250 | #include "UCTS_Outline.cginc" 251 | ENDCG 252 | } 253 | 254 | 255 | 256 | Pass { 257 | Name "FORWARD" 258 | Tags { 259 | "LightMode"="ForwardBase" 260 | } 261 | Blend SrcAlpha OneMinusSrcAlpha 262 | Cull[_CullMode] 263 | ZTest [_ZTest] 264 | ZWrite [_ZWrite] 265 | 266 | Stencil 267 | { 268 | Ref [_Stencil] 269 | ReadMask [_ReadMask] 270 | WriteMask [_WriteMask] 271 | Comp [_StencilComp] 272 | Pass [_StencilOp] 273 | Fail [_StencilFail] 274 | ZFail [_StencilZFail] 275 | } 276 | 277 | CGPROGRAM 278 | #pragma vertex vert 279 | #pragma fragment frag 280 | #include "UnityCG.cginc" 281 | #include "AutoLight.cginc" 282 | #include "Lighting.cginc" 283 | #pragma multi_compile_fwdbase_fullshadows 284 | #pragma multi_compile_fog 285 | #pragma multi_compile UNITY_PASS_FORWARDBASE 286 | #include "UCTS_DoubleShadeWithFeather.cginc" 287 | ENDCG 288 | } 289 | 290 | 291 | 292 | Pass { 293 | Name "FORWARD_DELTA" 294 | Tags { 295 | "LightMode"="ForwardAdd" 296 | } 297 | Cull[_CullMode] 298 | // Blend One One 299 | Blend SrcAlpha One 300 | ZTest [_ZTest] 301 | ZWrite [_ZWrite] 302 | 303 | Stencil 304 | { 305 | Ref [_Stencil] 306 | ReadMask [_ReadMask] 307 | WriteMask [_WriteMask] 308 | Comp [_StencilComp] 309 | Pass [_StencilOp] 310 | Fail [_StencilFail] 311 | ZFail [_StencilZFail] 312 | } 313 | 314 | CGPROGRAM 315 | #pragma vertex vert 316 | #pragma fragment frag 317 | #include "UnityCG.cginc" 318 | #include "AutoLight.cginc" 319 | #include "Lighting.cginc" 320 | #pragma multi_compile_fwdadd_fullshadows 321 | #pragma multi_compile_fog 322 | #pragma multi_compile UNITY_PASS_FORWARDADD 323 | #include "UCTS_DoubleShadeWithFeather.cginc" 324 | ENDCG 325 | } 326 | 327 | 328 | 329 | Pass { 330 | Name "ShadowCaster" 331 | Tags { 332 | "LightMode"="ShadowCaster" 333 | } 334 | Offset 1 , 80 335 | // Cull[_CullMode] 336 | Cull off 337 | 338 | CGPROGRAM 339 | #pragma vertex vert 340 | #pragma fragment frag 341 | #include "UnityCG.cginc" 342 | #include "Lighting.cginc" 343 | #pragma fragmentoption ARB_precision_hint_fastest 344 | #pragma multi_compile_shadowcaster 345 | #include "UCTS_ShadowCaster.cginc" 346 | ENDCG 347 | } 348 | } 349 | FallBack "Legacy Shaders/VertexLit" 350 | } 351 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/UCTS_DoubleShadeWithFeather.cginc: -------------------------------------------------------------------------------- 1 | // Forked from Unity-Chan Toon Shader Ver.2.0.4 2 | // Modifications by ACiiL. 3 | // https://github.com/ACIIL/UnityChanToonShaderVer2_Project 4 | // Source: 5 | // https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project 6 | // 7 | // Coding goal is both as a personal study to self improve shader writing and make UTS2 redundant and compatible 8 | // in all typical vrchat map scene light situations. 9 | // 10 | // sample sets: normals, albedo(shades/masks), AOs, matcap, emissionColor 11 | UNITY_DECLARE_TEX2D_NOSAMPLER(_ClippingMask); uniform float4 _ClippingMask_ST; 12 | 13 | UNITY_DECLARE_TEX2D(_NormalMap); uniform float4 _NormalMap_ST; 14 | 15 | UNITY_DECLARE_TEX2D(_MainTex); uniform float4 _MainTex_ST; 16 | UNITY_DECLARE_TEX2D_NOSAMPLER(_1st_ShadeMap); uniform float4 _1st_ShadeMap_ST; 17 | UNITY_DECLARE_TEX2D_NOSAMPLER(_2nd_ShadeMap); uniform float4 _2nd_ShadeMap_ST; 18 | 19 | UNITY_DECLARE_TEX2D(_Set_1st_ShadePosition); uniform float4 _Set_1st_ShadePosition_ST; 20 | UNITY_DECLARE_TEX2D_NOSAMPLER(_Set_2nd_ShadePosition); uniform float4 _Set_2nd_ShadePosition_ST; 21 | 22 | UNITY_DECLARE_TEX2D_NOSAMPLER(_HighColor_Tex); uniform float4 _HighColor_Tex_ST; 23 | UNITY_DECLARE_TEX2D_NOSAMPLER(_Set_HighColorMask); uniform float4 _Set_HighColorMask_ST; 24 | 25 | UNITY_DECLARE_TEX2D_NOSAMPLER(_Set_RimLightMask); uniform float4 _Set_RimLightMask_ST; 26 | 27 | UNITY_DECLARE_TEX2D_NOSAMPLER(_NormalMapForMatCap); uniform float4 _NormalMapForMatCap_ST; 28 | UNITY_DECLARE_TEX2D(_MatCap_Sampler); uniform float4 _MatCap_Sampler_ST; 29 | UNITY_DECLARE_TEX2D_NOSAMPLER(_Set_MatcapMask); uniform float4 _Set_MatcapMask_ST; 30 | 31 | UNITY_DECLARE_TEX2D_NOSAMPLER(_Emissive_Tex); uniform float4 _Emissive_Tex_ST; 32 | UNITY_DECLARE_TEX2D(_EmissionColorTex); uniform float4 _EmissionColorTex_ST; 33 | 34 | sampler3D _DitherMaskLOD; 35 | 36 | 37 | 38 | // 39 | // float arraySize = 0; 40 | // float3 arrayTest[3]; 41 | // uniform half _arrayAccess; 42 | 43 | uniform half _Clipping_Level; 44 | uniform half _Tweak_transparency; 45 | uniform half _Inverse_Clipping; 46 | uniform half _IsBaseMapAlphaAsClippingMask; 47 | 48 | uniform float4 _Color; 49 | uniform float4 _1st_ShadeColor; 50 | uniform float4 _2nd_ShadeColor; 51 | 52 | uniform float4 _HighColor; 53 | 54 | uniform float4 _RimLightColor; 55 | uniform float4 _Ap_RimLightColor; 56 | 57 | uniform float4 _MatCapColor; 58 | 59 | uniform float4 _Emissive_Color; 60 | 61 | 62 | 63 | uniform half _Is_NormalMapToBase; 64 | uniform half _Is_NormalMapToHighColor; 65 | uniform half _Is_NormalMapToRimLight; 66 | uniform half _Is_NormaMapToEnv; 67 | 68 | uniform half _Use_BaseAs1st; 69 | uniform half _Use_1stAs2nd; 70 | uniform half _BaseColor_Step; 71 | uniform half _ShadeColor_Step; 72 | uniform half _BaseShade_Feather; 73 | uniform half _1st2nd_Shades_Feather; 74 | 75 | uniform half _shadowCastMin_black; 76 | uniform half _Set_SystemShadowsToBase; 77 | uniform half _Is_UseTweakHighColorOnShadow; 78 | uniform half _Tweak_SystemShadowsLevel; 79 | uniform half _shaSatRatio; 80 | 81 | uniform half _highColTexSource; 82 | uniform half _Tweak_HighColorMaskLevel; 83 | uniform half _HighColor_Power; 84 | uniform half _Is_BlendAddToHiColor; 85 | uniform half _Is_SpecularToHighColor; 86 | uniform half _TweakHighColorOnShadow; 87 | 88 | uniform half _Tweak_RimLightMaskLevel; 89 | uniform half _RimLight; 90 | uniform half _Add_Antipodean_RimLight; 91 | uniform half _RimLightSource; 92 | uniform half _RimLightMixMode; 93 | uniform half _LightDirection_MaskOn; 94 | uniform half _RimLight_FeatherOff; 95 | uniform half _Ap_RimLight_FeatherOff; 96 | uniform half _RimLightAreaOffset; 97 | uniform half _RimLight_Power; 98 | uniform half _Ap_RimLight_Power; 99 | uniform half _RimLight_InsideMask; 100 | uniform half _Tweak_LightDirection_MaskLevel; 101 | 102 | uniform half _envRoughness; 103 | uniform half _envOnRim; 104 | 105 | uniform half _Is_NormalMapForMatCap; 106 | uniform half _MatCap; 107 | uniform half _Is_BlendAddToMatCap; 108 | uniform half _Tweak_MatCapUV; 109 | uniform half _Rotate_MatCapUV; 110 | uniform half _Rotate_NormalMapForMatCapUV; 111 | uniform half _Is_UseTweakMatCapOnShadow; 112 | uniform half _TweakMatCapOnShadow; 113 | uniform half _Tweak_MatcapMaskLevel; 114 | 115 | uniform half _Is_LightColor_Base; 116 | uniform half _Is_LightColor_1st_Shade; 117 | uniform half _Is_LightColor_2nd_Shade; 118 | uniform half _Is_LightColor_HighColor; 119 | uniform half _Is_LightColor_RimLight; 120 | uniform half _Is_LightColor_Ap_RimLight; 121 | uniform half _Is_LightColor_MatCap; 122 | 123 | uniform half _testMix; 124 | static const float3 defaultLightDirection = float3(0, -1, 0); 125 | static const half softGI = .98; 126 | 127 | 128 | 129 | 130 | 131 | 132 | struct VertexInput { 133 | float4 vertex : POSITION; 134 | float3 normal : NORMAL; 135 | float4 tangent : TANGENT; 136 | float2 uv : TEXCOORD0; 137 | }; 138 | 139 | struct VertexOutput { 140 | float4 pos : SV_POSITION; 141 | float4 center : TEXCOORD0; 142 | float4 worldPos : TEXCOORD1; 143 | float3 wNormal : TEXCOORD2; 144 | float4 tangent : TEXCOORD3; 145 | float3 biNormal : TEXCOORD4; 146 | half3 vertexLighting : TEXCOORD5; 147 | half attenVert : TEXCOORD6; 148 | float3 GIdirection : TEXCOORD7; 149 | float2 uv : TEXCOORD8; 150 | float4 screenPos : TEXCOORD9; 151 | float3 vertTo0 : TEXCOORD10; 152 | UNITY_SHADOW_COORDS(11) 153 | UNITY_FOG_COORDS(12) 154 | }; 155 | 156 | 157 | 158 | // raw ambient color by direction 159 | fixed3 DecodeLightProbe( fixed3 N ){ 160 | return ShadeSH9( float4(N,1)); 161 | } 162 | 163 | // ambient color 164 | fixed3 DecodeLightProbe_average(){ 165 | //return (1 - softGI) * ShadeSH9( float4(N, 1)) + (softGI) * ShadeSH9( float4(0,0,0,1)); 166 | return ShadeSH9( float4(0,0,0,1)); 167 | } 168 | 169 | // vrchat shader community. Not sure exactly whom poked the mirror code to solve this. 170 | bool IsInMirror() 171 | { 172 | return unity_CameraProjection[2][0] != 0.f || unity_CameraProjection[2][1] != 0.f; 173 | } 174 | 175 | // Neitri's Help 176 | float3 GIsonarDirection(){ 177 | // float3 GIsonar_dir_vec = (unity_SHAr.xyz * unity_SHAr.w + unity_SHAg.xyz * unity_SHAg.w + unity_SHAb.xyz * unity_SHAb.w); 178 | float3 GIsonar_dir_vec = (unity_SHAr.xyz + unity_SHAg.xyz + unity_SHAb.xyz); 179 | UNITY_FLATTEN 180 | if ( length( GIsonar_dir_vec) > 0){ 181 | GIsonar_dir_vec = normalize(GIsonar_dir_vec); 182 | } else { 183 | GIsonar_dir_vec = float3(0,0,0); 184 | } 185 | return GIsonar_dir_vec; 186 | } 187 | 188 | // unity's modified version without the lambert tint darkening and with attenuation pass out. 189 | float3 softShade4PointLights_Atten ( 190 | float4 lightPosX, float4 lightPosY, float4 lightPosZ, 191 | float3 lightColor0, float3 lightColor1, float3 lightColor2, float3 lightColor3, 192 | float4 lightAttenSq, 193 | float3 pos, 194 | float3 normal, 195 | out float attenVert, 196 | out float3 vertTo0) 197 | { 198 | // to light vectors 199 | float4 toLightX = lightPosX - pos.x; 200 | float4 toLightY = lightPosY - pos.y; 201 | float4 toLightZ = lightPosZ - pos.z; 202 | vertTo0 = float3(toLightX[0], toLightY[0], toLightZ[0]); 203 | // squared lengths 204 | float4 lengthSq = 0; 205 | lengthSq += toLightX * toLightX; 206 | lengthSq += toLightY * toLightY; 207 | lengthSq += toLightZ * toLightZ; 208 | // don't produce NaNs if some vertex position overlaps with the light 209 | lengthSq = max(lengthSq, 0.000001); 210 | 211 | // attenuation 212 | float4 atten = 1.0 / (1.0 + lengthSq * lightAttenSq) -0.034; 213 | attenVert = atten; 214 | // float4 diff = atten; 215 | float4 diff = 1; 216 | 217 | // final color 218 | float3 col = 0; 219 | col += lightColor0 * diff.x; 220 | col += lightColor1 * diff.y; 221 | col += lightColor2 * diff.z; 222 | col += lightColor3 * diff.w; 223 | return col; 224 | } 225 | 226 | // Simplified box projection 227 | // https://catlikecoding.com/unity/tutorials/rendering/part-8/ 228 | float3 BoxProjection ( 229 | float3 direction, float3 position, 230 | float4 cubemapPosition, float3 boxMin, float3 boxMax) 231 | { 232 | UNITY_BRANCH 233 | if (cubemapPosition.w > 0) { 234 | float3 factors = 235 | ((direction > 0 ? boxMax : boxMin) - position) / direction; 236 | float scalar = min(min(factors.x, factors.y), factors.z); 237 | direction = direction * scalar + (position - cubemapPosition); 238 | } 239 | return direction; 240 | } 241 | 242 | // 243 | half SpecularStrength_ac(half3 specular) { 244 | return max(max(specular.r, specular.g), specular.b); 245 | } 246 | 247 | // Diffuse/Spec Energy conservation 248 | inline half3 EnergyConservationBetweenDiffuseAndSpecular_ac ( 249 | half conserveMode, half3 albedo, half3 specColor, out half oneMinusReflectivity 250 | ) { 251 | oneMinusReflectivity = max(0, 1 - SpecularStrength_ac(specColor)); 252 | half3 albedoAdd = albedo; 253 | half3 albedoConMono = albedo * oneMinusReflectivity; 254 | //half3 albedoConRGB = albedo * (half3(1, 1, 1) - specColor); // not HDR safe. 255 | return lerp(albedoConMono, albedoAdd, conserveMode); 256 | } 257 | 258 | // https://www.shadertoy.com/view/4djSRW 259 | float hash13(float3 p3) 260 | { 261 | // p3 = frac(p3 * .1031); 262 | p3 = frac(p3 * 13); 263 | p3 += dot(p3, p3.yzx + 19.19); 264 | return frac((p3.x + p3.y) * p3.z); 265 | } 266 | 267 | float rand3(float3 co){ 268 | return frac(sin(dot(co.xyz ,float3(12.9898,78.233,213.576))) * 43758.5453); 269 | } 270 | 271 | /* 272 | // discontinuous pseudorandom uniformly distributed in [-0.5, +0.5]^3 273 | float3 random3(float3 c) { 274 | float j = 4096.0*sin(dot(c,float3(17.0, 59.4, 15.0))); 275 | float3 r; 276 | r.z = frac(512.0*j); 277 | j *= .125; 278 | r.x = frac(512.0*j); 279 | j *= .125; 280 | r.y = frac(512.0*j); 281 | return r-0.5; 282 | } 283 | */ 284 | 285 | // 286 | float3 StereoWorldViewPos( float3 worldPos) { 287 | #if UNITY_SINGLE_PASS_STEREO 288 | float3 cameraPos = 289 | float3((unity_StereoWorldSpaceCameraPos[0] + unity_StereoWorldSpaceCameraPos[1]) * .5); 290 | #else 291 | float3 cameraPos = _WorldSpaceCameraPos; 292 | #endif 293 | return cameraPos; 294 | } 295 | 296 | // 297 | float3 StereoWorldViewDir( float3 worldPos) { 298 | float3 cameraPos = StereoWorldViewPos(worldPos); 299 | float3 worldViewDir = (cameraPos - worldPos); 300 | return worldViewDir; 301 | } 302 | 303 | // 304 | float3 HSVToRGB( float3 c ) 305 | { 306 | float4 K = float4( 1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0 ); 307 | float3 p = abs( frac( c.xxx + K.xyz ) * 6.0 - K.www ); 308 | return c.z * lerp( K.xxx, saturate( p - K.xxx ), c.y ); 309 | } 310 | 311 | // 312 | float3 RGBToHSV(float3 c) 313 | { 314 | float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 315 | float4 p = lerp( float4( c.bg, K.wz ), float4( c.gb, K.xy ), step( c.b, c.g ) ); 316 | float4 q = lerp( float4( p.xyw, c.r ), float4( c.r, p.yzx ), step( p.x, c.r ) ); 317 | float d = q.x - min( q.w, q.y ); 318 | float e = 1.0e-10; 319 | return float3( abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 320 | } 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | //// vert 334 | VertexOutput vert (VertexInput v) 335 | { 336 | VertexOutput o = (VertexOutput)0; 337 | o.pos = UnityObjectToClipPos( v.vertex ); 338 | o.worldPos = mul( unity_ObjectToWorld, v.vertex); 339 | o.center = mul( unity_ObjectToWorld, float4(0,0,0,1)); 340 | o.wNormal = UnityObjectToWorldNormal( v.normal); 341 | o.tangent = ( float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w)); 342 | o.biNormal = ( cross( o.wNormal, o.tangent ) * o.tangent.w); 343 | o.uv = v.uv; 344 | o.screenPos = ComputeScreenPos(o.pos); 345 | UNITY_TRANSFER_FOG(o, o.pos); 346 | UNITY_TRANSFER_SHADOW(o, o.uv); 347 | // TRANSFER_SHADOW_CASTER_NOPOS(o,opos) 348 | // TRANSFER_VERTEX_TO_FRAGMENT(o); 349 | 350 | #ifdef VERTEXLIGHT_ON 351 | o.vertexLighting = softShade4PointLights_Atten( 352 | unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0 353 | , unity_LightColor[0], unity_LightColor[1], unity_LightColor[2], unity_LightColor[3] 354 | , unity_4LightAtten0, o.worldPos, o.wNormal, o.attenVert, o.vertTo0); 355 | #endif 356 | #ifdef UNITY_PASS_FORWARDBASE 357 | o.GIdirection = GIsonarDirection(); 358 | #endif 359 | return o; 360 | } 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | //// frag 374 | float4 frag( 375 | VertexOutput i 376 | , bool frontFace : SV_IsFrontFace ) : SV_TARGET 377 | { 378 | // bool isInMirror = IsInMirror(); 379 | // float faceDetect = !frontFace ^ isInMirror; // unity v2017.4.15f1 VFACE is backwords in mirrors. Fixed later version. 380 | i.wNormal = normalize( i.wNormal); 381 | // if(faceDetect) { // flip normal for back faces. 382 | // i.wNormal = -i.wNormal; 383 | // } 384 | i.biNormal = ( i.biNormal); 385 | float3 worldviewPos = StereoWorldViewPos(i.worldPos.xyz); 386 | float3 viewDirection = normalize(worldviewPos - i.worldPos.xyz); 387 | 388 | // normal map 389 | float4 normalTex = UNITY_SAMPLE_TEX2D(_NormalMap, TRANSFORM_TEX( i.uv, _NormalMap)); 390 | float3 normalMap = UnpackNormal( normalTex); 391 | float3 normalLocal = normalMap.rgb; 392 | float3x3 tangentTransform = float3x3( i.tangent.xyz , i.biNormal.xyz, i.wNormal); 393 | float3 normalDirection = normalize( mul( normalLocal, tangentTransform )); 394 | //// screen pos 395 | float4 screenPos = i.screenPos; 396 | float4 screenUV = screenPos / (screenPos.w + 0.00001); 397 | #ifdef UNITY_SINGLE_PASS_STEREO 398 | screenUV.xy *= float2(_ScreenParams.x * 2, _ScreenParams.y); 399 | #else 400 | screenUV.xy *= _ScreenParams.xy; 401 | #endif 402 | 403 | 404 | 405 | //// albedo texure 406 | float4 mainTex = UNITY_SAMPLE_TEX2D( _MainTex, TRANSFORM_TEX( i.uv, _MainTex)); 407 | //// clip & alpha handling. Here now so clip() may interrupt flow. 408 | #ifndef NotAlpha 409 | float4 clipMask = UNITY_SAMPLE_TEX2D_SAMPLER( _ClippingMask, _MainTex, TRANSFORM_TEX(i.uv, _ClippingMask)); 410 | float useMainTexAlpha = (_IsBaseMapAlphaAsClippingMask) ? mainTex.a : clipMask.r; 411 | float alpha = (_Inverse_Clipping) ? (1.0 - useMainTexAlpha) : useMainTexAlpha; 412 | 413 | float clipTest = (( -_Clipping_Level + alpha - 0.001)); 414 | clip(clipTest); 415 | 416 | #ifndef IsClip 417 | // dither pattern with some a2c blending. 418 | // citation to Silent and Xiexe for guidance and research documentation. 419 | clipTest = saturate(( alpha + _Tweak_transparency)); 420 | alpha = clipTest; 421 | #ifdef UseAlphaDither 422 | //// dither hard ~16 states & matching shadow caster dither. Con. creates alpha banding 423 | float dither = tex3D(_DitherMaskLOD, float3(screenUV.xy * .25, alpha * .99), 0,0).a; 424 | alpha = dither; 425 | clip(alpha -1); 426 | #endif //// UseAlphaDither 427 | alpha = saturate(alpha); 428 | 429 | //////////////// 430 | //////////////// Alternative dither methods 431 | // { 432 | // // // dither noise based on pos. a2c best but always noisy. 433 | // alpha = saturate(( alpha + _Tweak_transparency)); 434 | // float dither = hash13(i.worldPos * 50); 435 | // // float dither = rand3(i.worldPos * 50); 436 | // float alpha2 = saturate(alpha * alpha); 437 | // float amix = lerp(dither*(1-alpha), dither*alpha, 1-alpha2); 438 | // alpha = (amix) + alpha; 439 | // alpha = saturate(alpha); 440 | // } 441 | //////////////// 442 | //////////////// 443 | // { 444 | // // hard dither pattern. Bad A2C support. 445 | // clipTest = saturate(( alpha + _Tweak_transparency)); 446 | // float dither = tex3D(_DitherMaskLOD, 447 | // float3(screenUV.x * _ScreenParams.x*.25, screenUV.y * _ScreenParams.y*.25, clipTest * .99), 0,0).a; 448 | // // float dither = tex3D(_DitherMaskLOD, float3(screenUV.xy * .25, clipTest * 0.9375)).a; 449 | 450 | // float alpha2 = saturate(alpha * alpha); 451 | // // float amix = lerp(dither*(1-alpha), dither*alpha, 1-alpha2); 452 | // // alpha = amix + alpha; 453 | // // alpha = 0.5 * (dither + alpha); 454 | // alpha = dither; 455 | // alpha = saturate(alpha); 456 | //////////////// 457 | //////////////// 458 | #else //// IsClip 459 | alpha = 1; 460 | #endif //// IsClip 461 | #else 462 | float alpha = 1; 463 | #endif //// NotAlpha 464 | 465 | 466 | float4 shadeMapTex_1 = UNITY_SAMPLE_TEX2D_SAMPLER( _1st_ShadeMap, _MainTex, TRANSFORM_TEX( i.uv, _1st_ShadeMap)); 467 | float4 shadeMapTex_2 = UNITY_SAMPLE_TEX2D_SAMPLER( _2nd_ShadeMap, _MainTex, TRANSFORM_TEX( i.uv, _2nd_ShadeMap)); 468 | if (_Use_BaseAs1st) { shadeMapTex_1 = mainTex;} 469 | if (_Use_1stAs2nd) { shadeMapTex_2 = shadeMapTex_1;} 470 | 471 | 472 | 473 | 474 | 475 | 476 | //// Redefine UNITY_LIGHT_ATTENUATION without shadow multiply from AutoLight.cginc 477 | #ifdef POINT 478 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 479 | unityShadowCoord3 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)).xyz; \ 480 | fixed destName = tex2D(_LightTexture0, dot(lightCoord, lightCoord).rr).UNITY_ATTEN_CHANNEL; 481 | #endif 482 | 483 | #ifdef SPOT 484 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 485 | unityShadowCoord4 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)); \ 486 | fixed destName = (lightCoord.z > 0) * UnitySpotCookie(lightCoord) * UnitySpotAttenuate(lightCoord.xyz); 487 | #endif 488 | 489 | #ifdef DIRECTIONAL 490 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) fixed destName = 1; 491 | // #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) fixed destName = UNITY_SHADOW_ATTENUATION(input, worldPos); 492 | #endif 493 | 494 | #ifdef POINT_COOKIE 495 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 496 | unityShadowCoord3 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)).xyz; \ 497 | fixed destName = tex2D(_LightTextureB0, dot(lightCoord, lightCoord).rr).UNITY_ATTEN_CHANNEL * texCUBE(_LightTexture0, lightCoord).w; 498 | #endif 499 | 500 | #ifdef DIRECTIONAL_COOKIE 501 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 502 | unityShadowCoord2 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)).xy; \ 503 | fixed destName = tex2D(_LightTexture0, lightCoord).w; 504 | #endif 505 | 506 | 507 | 508 | 509 | 510 | 511 | //// Light attenuation 512 | UNITY_LIGHT_ATTENUATION_NOSHADOW(lightAtten, i, i.worldPos.xyz); 513 | float shadowAtten = UNITY_SHADOW_ATTENUATION(i, i.worldPos.xyz); 514 | shadowAtten = max(shadowAtten, i.attenVert); 515 | float nLightAtten = 1 - lightAtten; 516 | float nShadowAtten = 1 - shadowAtten; 517 | // float attenRampB = ( (-(nLightAtten * nLightAtten) + 1)); 518 | float shadowAttenB = ( (-(nShadowAtten * nShadowAtten) + 1)); 519 | float attenRamp = lightAtten; 520 | // float shadowAttenB = shadowAtten; 521 | 522 | 523 | 524 | 525 | 526 | 527 | //// Light input colors 528 | //const half shadowRings = .15; 529 | #ifdef UNITY_PASS_FORWARDBASE 530 | //float shadRings = (ceil( shadowAttenB / shadowRings) * (shadowRings)); 531 | float shadRings = shadowAttenB; 532 | float3 lightIndirect = DecodeLightProbe_average(); 533 | float3 lightDirect = _LightColor0.rgb; 534 | float shadowBlackness = saturate( (shadRings+_shadowCastMin_black)/(1-_shadowCastMin_black) ); 535 | // float shadowBlackness = saturate(_shadowCastMin_black + shadRings); 536 | // float shadowBlackness = max(_shadowCastMin_black, shadRings); 537 | float shaBlackMix = shadowBlackness * attenRamp; 538 | lightDirect = lightDirect * shaBlackMix; 539 | 540 | // fuzzy logic for classifying direct light < indirect light 541 | float lightDirGray = dot(_LightColor0.rgb, 1); 542 | float lightInDirGray = dot(lightIndirect.rgb, 1); 543 | float colorIntSignal = (smoothstep(0, lightDirGray, lightInDirGray)); 544 | float3 vertexLit = i.vertexLighting * i.attenVert; 545 | float3 lightColorFinal = lightDirect + lightIndirect + vertexLit; 546 | 547 | #elif UNITY_PASS_FORWARDADD 548 | //float shadRings = ceil( shadowAttenB / shadowRings) * shadowRings; 549 | float shadRings = shadowAttenB; 550 | float3 lightIndirect = 1; 551 | float3 lightDirect = _LightColor0.rgb; 552 | float shadowBlackness = saturate( (shadRings+_shadowCastMin_black)/(1-_shadowCastMin_black) ); 553 | // float shadowBlackness = max(_shadowCastMin_black, shadRings); 554 | float shadBlackScale = lerp(1, shadowBlackness, attenRamp); 555 | shadowBlackness = shadBlackScale; 556 | float shaBlackMix = shadowBlackness * attenRamp; 557 | lightDirect = lightDirect * shaBlackMix; 558 | float3 lightColorFinal = lightDirect; 559 | float colorIntSignal = 0; 560 | #endif 561 | 562 | float3 set_LightColor = lightColorFinal; 563 | // fight how the raw light of direct + indirect overbrights 564 | // Ill change this counter many times more than now. Which is to many already! 565 | set_LightColor.x = (set_LightColor.x > 1) ? sqrt(set_LightColor.x) : set_LightColor.x; 566 | set_LightColor.y = (set_LightColor.y > 1) ? sqrt(set_LightColor.y) : set_LightColor.y; 567 | set_LightColor.z = (set_LightColor.z > 1) ? sqrt(set_LightColor.z) : set_LightColor.z; 568 | 569 | 570 | 571 | 572 | 573 | 574 | //// Light Direction vectors 575 | #ifdef UNITY_PASS_FORWARDBASE 576 | float3 viewLightDirection = normalize( UNITY_MATRIX_V[2].xyz + UNITY_MATRIX_V[1].xyz); 577 | float3 lightDir = normalize( _WorldSpaceLightPos0.xyz * dot(1, lightDirect) + (i.GIdirection) * dot(1, lightIndirect) + dot(1, vertexLit) * (i.vertTo0) + viewLightDirection *.0001); 578 | // float3 lightDir = normalize( _WorldSpaceLightPos0.xyz + (i.GIdirection) * .01 + viewLightDirection *.0001); 579 | #elif UNITY_PASS_FORWARDADD 580 | float3 lightDir = 581 | normalize( 582 | lerp( 583 | _WorldSpaceLightPos0.xyz 584 | , _WorldSpaceLightPos0.xyz - i.worldPos.xyz 585 | , _WorldSpaceLightPos0.w) 586 | ); 587 | #endif 588 | // if (faceDetect) 589 | // { 590 | // lightDir = -lightDir; 591 | // } 592 | 593 | 594 | 595 | //// dot() 596 | float3 useShadeNormal = lerp(i.wNormal, normalDirection, _Is_NormalMapToBase); 597 | float3 useEnvNormal = lerp(i.wNormal, normalDirection, _Is_NormaMapToEnv); 598 | float3 useHCNormal = lerp(i.wNormal, normalDirection, _Is_NormalMapToHighColor ); 599 | float3 useRimLightNormal = lerp(i.wNormal, normalDirection, _Is_NormalMapToRimLight); 600 | 601 | // ret refract(i, n, ?) 602 | float3 lightReflect = reflect(-viewDirection, useEnvNormal); 603 | float3 halfDirection = normalize(viewDirection + lightDir); 604 | float ndotl_pure = 0.5 * dot(i.wNormal, lightDir) + 0.5; 605 | float bdotv_pure = 0.5 * dot(i.biNormal, viewDirection) + 0.5; 606 | float ndotl_shade = 0.5 * dot(useShadeNormal, lightDir) + 0.5; 607 | float hdotn_highColor = 0.5 * dot(halfDirection, useHCNormal) + 0.5; 608 | float ndov_rim = dot(useRimLightNormal, viewDirection); // 1=norm with cam, -1=not 609 | 610 | // ndotl_shade = DisneyDiffuse(dot(i.wNormal, viewDirection), dot( i.wNormal, lightDir), dot(lightDir, halfDirection), _SinTime.w) * 0.5 + 0.5; 611 | // float3 tempR =ndotl_shade; 612 | 613 | 614 | 615 | 616 | 617 | //// Reflection 618 | Unity_GlossyEnvironmentData envData; 619 | envData.roughness = _envRoughness; 620 | envData.reflUVW = BoxProjection(lightReflect, i.worldPos 621 | , unity_SpecCube0_ProbePosition 622 | , unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax); 623 | float3 envMask = Unity_GlossyEnvironment( 624 | UNITY_PASS_TEXCUBE(unity_SpecCube0), unity_SpecCube0_HDR, envData 625 | ); // unity_SpecCube0_HDR.a 626 | float envGray = LinearRgbToLuminance(envMask); 627 | envMask = lerp(1, envGray, smoothstep(0, .2, envGray)); 628 | 629 | 630 | 631 | 632 | 633 | 634 | //// Toon Lambert 635 | // Lambert & shadow attenuation mix 636 | float4 shadowTex_1 = UNITY_SAMPLE_TEX2D( _Set_1st_ShadePosition, TRANSFORM_TEX( i.uv, _Set_1st_ShadePosition)); 637 | float4 shadowTex_2 = UNITY_SAMPLE_TEX2D_SAMPLER( _Set_2nd_ShadePosition, _Set_1st_ShadePosition, TRANSFORM_TEX( i.uv, _Set_2nd_ShadePosition)); 638 | 639 | float shadeRamp_n1 = 640 | saturate( 641 | 1.0 642 | + 643 | ( 644 | ( 645 | lerp( 646 | ndotl_shade 647 | //, ( ndotl_shade * saturate( ((shadowAtten * 0.5) + 0.5 + _Tweak_SystemShadowsLevel))) 648 | // , ( ndotl_shade * saturate(smoothstep(0, 1, shadowAtten + _Tweak_SystemShadowsLevel) ) ) 649 | , ( ndotl_shade * smoothstep(_LightShadowData.x + 0.001, 1 + _Tweak_SystemShadowsLevel, shadowAtten)) 650 | , _Set_SystemShadowsToBase 651 | ) 652 | - ( _BaseColor_Step - _BaseShade_Feather ) 653 | ) 654 | * ( (1.0 - shadowTex_1.rgb).r - 1.0 ) 655 | ) 656 | / (_BaseShade_Feather) 657 | ); 658 | 659 | // shadow1 to shadow2 mix 660 | float shadeRamp_n2 = 661 | saturate( 662 | 1.0 663 | + ( ndotl_shade - (_ShadeColor_Step - _1st2nd_Shades_Feather) ) 664 | * ( (1.0 - shadowTex_2.rgb).r - 1.0 ) 665 | / ( _1st2nd_Shades_Feather ) 666 | ); 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | //// Albedo textures 675 | // is using world color 676 | float3 baseColor_isLC = lerp(attenRamp, set_LightColor, _Is_LightColor_Base); 677 | float3 shadeColor1_isLC = lerp(attenRamp, set_LightColor, _Is_LightColor_1st_Shade); 678 | float3 shadeColor2_isLC = lerp(attenRamp, set_LightColor, _Is_LightColor_2nd_Shade); 679 | 680 | // get albedo samples 681 | float3 albetoCol_1 = mainTex.rgb; 682 | float3 albetoCol_2 = shadeMapTex_1.rgb; 683 | float3 albetoCol_3 = shadeMapTex_2.rgb; 684 | 685 | // get ramp shade color mix 686 | float3 rampWorldCol_1 = baseColor_isLC; 687 | float3 rampWorldCol_2 = shadeColor1_isLC; 688 | float3 rampWorldCol_3 = shadeColor2_isLC; 689 | 690 | float3 shadeCol_1 = _Color.rgb; 691 | float3 shadeCol_2 = _1st_ShadeColor.rgb; 692 | float3 shadeCol_3 = _2nd_ShadeColor.rgb; 693 | 694 | 695 | 696 | //// The 3 Shade mixer. Lerp: (base color, (shade 1, shade 2)) 697 | // albedo & shades mix 698 | float3 satIn_1 = albetoCol_1 * shadeCol_1; 699 | float3 satIn_2 = albetoCol_2 * shadeCol_2; 700 | float3 satIn_3 = albetoCol_3 * shadeCol_3; 701 | float3 satNoIn_1 = rampWorldCol_1; 702 | float3 satNoIn_2 = rampWorldCol_2; 703 | float3 satNoIn_3 = rampWorldCol_3; 704 | 705 | // saturate mix 706 | float3 satMix_23 = lerp(satIn_2, satIn_3, shadeRamp_n2); 707 | float3 satMix_1_23 = lerp(satIn_1, satMix_23, shadeRamp_n1); 708 | // no saturation mix 709 | float3 satNoMix_23 = lerp(satNoIn_2, satNoIn_3, shadeRamp_n2); 710 | float3 satNoMix_1_23 = lerp(satNoIn_1, satNoMix_23, shadeRamp_n1); 711 | // logic 712 | float colTest = 1 - ((saturate( ( (shadowBlackness) + (colorIntSignal))))); 713 | float colSateOffset = 1 + _shaSatRatio * colTest; 714 | 715 | float3 albedoRGBIn = satMix_1_23; 716 | float3 albedoHSV = RGBToHSV( albedoRGBIn); 717 | satMix_1_23 = HSVToRGB( float3(albedoHSV.x, ( albedoHSV.y * colSateOffset ), albedoHSV.z)); 718 | 719 | float3 shadeColor = satMix_1_23 * satNoMix_1_23; 720 | 721 | 722 | 723 | 724 | 725 | //// High Color. Specular. 726 | float4 highColorTex = UNITY_SAMPLE_TEX2D_SAMPLER( _HighColor_Tex, _MainTex, TRANSFORM_TEX( i.uv, _HighColor_Tex)); 727 | float4 highColorMask = UNITY_SAMPLE_TEX2D_SAMPLER( _Set_HighColorMask, _MainTex, TRANSFORM_TEX( i.uv, _Set_HighColorMask)); 728 | if (_highColTexSource) { highColorTex = mainTex;} 729 | 730 | 731 | float highColorMaskSetup = 732 | saturate( highColorMask.g + _Tweak_HighColorMaskLevel) 733 | * lerp( 734 | ( 1.0 - step(hdotn_highColor, ( 1.0 - _HighColor_Power)) ) 735 | , pow( hdotn_highColor, exp2( lerp( 11, 1, _HighColor_Power)) ) 736 | , _Is_SpecularToHighColor 737 | ); 738 | 739 | 740 | float3 highColor_isLC = lerp( attenRamp, set_LightColor, _Is_LightColor_HighColor); 741 | float3 highColorMix = highColorTex.rgb * _HighColor.rgb; 742 | float3 highColorTotalCol = ( highColor_isLC * highColorMix * highColorMaskSetup); 743 | 744 | 745 | 746 | 747 | 748 | 749 | //// Rim Color 750 | /* 751 | get ndotv: 1 when surface directs with cam, -1 when towards cam. 752 | 1 - value: 0 with, 2 against 753 | */ 754 | float rimlightMaskEnv = envMask; 755 | rimlightMaskEnv = lerp(1, rimlightMaskEnv, _envOnRim); 756 | float rimArea = (1.0 - ndov_rim); 757 | rimArea += _RimLightAreaOffset; 758 | //// Temp mirror correction 759 | // rimArea = (frontFace) ? rimArea : 0; 760 | rimArea = lerp(0, rimArea, saturate(ndov_rim + 1.1)); 761 | float rimLightPower = pow(rimArea, exp2( lerp( 3, 0, _RimLight_Power ))); 762 | float RimLightPowerAp = pow(rimArea, exp2( lerp( 3, 0, _Ap_RimLight_Power ))); 763 | 764 | 765 | 766 | // rim masks. 767 | float rimlightMaskSetup; 768 | // soft 769 | [branch] 770 | if ( _RimLight_FeatherOff == 0) 771 | { 772 | rimlightMaskSetup = ((rimLightPower - _RimLight_InsideMask) / (1.0 - _RimLight_InsideMask)); 773 | } 774 | // hard 775 | else 776 | { 777 | rimlightMaskSetup = step( _RimLight_InsideMask, rimLightPower); 778 | } 779 | 780 | // anti rimlight mask 781 | float rimlightApMaskSetup; 782 | // soft 783 | [branch] 784 | if ( _Ap_RimLight_FeatherOff == 0) 785 | { 786 | rimlightApMaskSetup = ((RimLightPowerAp - _RimLight_InsideMask) / (1.0 - _RimLight_InsideMask)); 787 | } 788 | // hard 789 | else 790 | { 791 | rimlightApMaskSetup = step( _RimLight_InsideMask, RimLightPowerAp); 792 | } 793 | 794 | rimlightMaskSetup = saturate( rimlightMaskSetup); 795 | rimlightApMaskSetup = saturate( rimlightApMaskSetup); 796 | float4 rimLightMaskTex = UNITY_SAMPLE_TEX2D_SAMPLER( _Set_RimLightMask, _MainTex, TRANSFORM_TEX( i.uv, _Set_RimLightMask)); 797 | float rimLightTexMask = saturate( rimLightMaskTex.g + _Tweak_RimLightMaskLevel); 798 | float rimlightMaskToward = saturate( rimlightMaskSetup + (ndotl_pure - 1.0 - _Tweak_LightDirection_MaskLevel)); 799 | float rimLightMaskAway = ndotl_pure + _Tweak_LightDirection_MaskLevel; 800 | float rimLightMask = lerp( rimlightMaskSetup, rimlightMaskToward, _LightDirection_MaskOn); 801 | // float rimlightApMask = saturate( rimlightApMaskSetup - rimLightMaskAway); 802 | // rimlightApMask = lerp( rimlightApMask, saturate(rimlightApMask - rimlightMaskToward), smoothstep(0,1,rimlightMaskToward )); 803 | float rimlightApMask = saturate( rimlightApMaskSetup - rimLightMaskAway - rimlightMaskToward); // Todo: improve rim away 804 | rimLightMask *= rimLightTexMask; 805 | rimlightApMask *= rimLightTexMask; 806 | 807 | // colors inpput 808 | float3 rimTexAlbedo; 809 | [branch] switch( _RimLightSource) 810 | { 811 | case 0: 812 | rimTexAlbedo = 1; 813 | break; 814 | case 1: 815 | rimTexAlbedo = mainTex.rgb; 816 | break; 817 | case 2: 818 | rimTexAlbedo = highColorTex.rgb; 819 | break; 820 | case 3: 821 | rimTexAlbedo = shadeMapTex_1.rgb; 822 | break; 823 | case 4: 824 | rimTexAlbedo = shadeMapTex_2.rgb; 825 | break; 826 | default: 827 | rimTexAlbedo = 1; 828 | break; 829 | } 830 | 831 | // float3 dirRimL = reflect(-viewDirection, i.wNormal); 832 | // float3 rimColSource = (DecodeLightProbe(dirRimL)) + lightDirect; 833 | // float3 rimColSource = (DecodeLightProbe(dirRimL) + DecodeLightProbe_average()) * .5 + lightDirect; 834 | // float3 rimColSource = DecodeLightProbe(i.wNormal) * .5 + lightDirect + envMask; 835 | // float3 rimColSource = DecodeLightProbe(i.wNormal) * .5 + lightDirect; 836 | 837 | float3 rimLight_isLC = lerp( attenRamp, set_LightColor, _Is_LightColor_RimLight); 838 | float3 rimLightAp_isLC = lerp( attenRamp, set_LightColor, _Is_LightColor_Ap_RimLight); 839 | float3 rimLightMix = _RimLightColor.rgb * rimLight_isLC * rimTexAlbedo * rimlightMaskEnv; 840 | float3 rimLightApMix = _Ap_RimLightColor.rgb * rimLight_isLC * rimTexAlbedo * rimlightMaskEnv; 841 | 842 | 843 | 844 | 845 | 846 | 847 | //// Matcap 848 | float rot_MatCapUV_ang = ( _Rotate_MatCapUV * 3.141592654); 849 | float rot_MatCapUV_spd = 1.0; 850 | float rot_MatCapUV_cos = cos( rot_MatCapUV_spd * rot_MatCapUV_ang); 851 | float rot_MatCapUV_sin = sin( rot_MatCapUV_spd * rot_MatCapUV_ang); 852 | float2 rot_MatCapUV_piv = float2(0.5,0.5); 853 | float rot_MatCapNmUV_ang = ( _Rotate_NormalMapForMatCapUV * 3.141592654); 854 | float rot_MatCapNmUV_spd = 1.0; 855 | float rot_MatCapNmUV_cos = cos( rot_MatCapNmUV_spd * rot_MatCapNmUV_ang); 856 | float rot_MatCapNmUV_sin = sin( rot_MatCapNmUV_spd * rot_MatCapNmUV_ang); 857 | float2 rot_MatCapNmUV_piv = float2(0.5,0.5); 858 | float2 rot_MatCapNmUV = ( mul( i.uv - rot_MatCapNmUV_piv, float2x2( rot_MatCapNmUV_cos, -rot_MatCapNmUV_sin, rot_MatCapNmUV_sin, rot_MatCapNmUV_cos)) + rot_MatCapNmUV_piv); 859 | float4 normalMapForMatCap = UNITY_SAMPLE_TEX2D_SAMPLER( _NormalMapForMatCap, _NormalMap, TRANSFORM_TEX( rot_MatCapNmUV, _NormalMapForMatCap)); 860 | float3 matCapNormalMapTex = UnpackNormal( normalMapForMatCap); 861 | 862 | 863 | 864 | //v.2.0.5: MatCap with camera skew correction. @kanihira 865 | float3 viewNormal = (mul(UNITY_MATRIX_V, float4(lerp( i.wNormal, mul( matCapNormalMapTex.rgb, tangentTransform ).rgb, _Is_NormalMapForMatCap ), 0))).xyz; 866 | float3 normalBlendMatcapUVDetail = viewNormal.xyz * float3(-1,-1,1); 867 | float3 normalBlendMatcapUVBase = (mul( UNITY_MATRIX_V, float4(viewDirection,0) ).rgb * float3(-1,-1,1)) + float3(0,0,1); 868 | float3 noSknewViewNormal = normalBlendMatcapUVBase * dot(normalBlendMatcapUVBase, normalBlendMatcapUVDetail) / normalBlendMatcapUVBase.z - normalBlendMatcapUVDetail; 869 | float2 viewNormalAsMatCapUV = ((noSknewViewNormal).xy * 0.5) + 0.5; 870 | float2 rot_MatCapUV = 871 | ( 872 | mul( 873 | ( 874 | ((viewNormalAsMatCapUV - (_Tweak_MatCapUV)) ) / (-2 * _Tweak_MatCapUV + 1.0) 875 | ) 876 | - rot_MatCapUV_piv 877 | , float2x2( rot_MatCapUV_cos, -rot_MatCapUV_sin, rot_MatCapUV_sin, rot_MatCapUV_cos) 878 | ) 879 | + rot_MatCapUV_piv 880 | ); 881 | 882 | 883 | 884 | float4 matCapTex = UNITY_SAMPLE_TEX2D( _MatCap_Sampler, TRANSFORM_TEX( rot_MatCapUV, _MatCap_Sampler)); 885 | float3 matcap_isLC = lerp( attenRamp, set_LightColor, _Is_LightColor_MatCap); 886 | float3 matCapMix = matcap_isLC * matCapTex.rgb * _MatCapColor.rgb; 887 | float3 matCapTotalCol = 888 | lerp( 889 | matCapMix 890 | // , (matCapMix * ( (1.0 - shadeRamp_n1) + (shadeRamp_n1 * _TweakMatCapOnShadow))) //slow 891 | , matCapMix * (1 + shadeRamp_n1 * (_TweakMatCapOnShadow - 1)) 892 | , _Is_UseTweakMatCapOnShadow 893 | ); 894 | float4 matcapMaskTex = UNITY_SAMPLE_TEX2D_SAMPLER(_Set_MatcapMask, _MainTex, TRANSFORM_TEX(i.uv, _Set_MatcapMask)); 895 | float matcapMaskTweak = saturate(matcapMaskTex.g + _Tweak_MatcapMaskLevel); 896 | 897 | 898 | 899 | 900 | 901 | 902 | //// Emission 903 | float4 emissiveMask = UNITY_SAMPLE_TEX2D_SAMPLER( _Emissive_Tex, _MainTex, TRANSFORM_TEX( i.uv, _Emissive_Tex)); 904 | float4 emissionColor = UNITY_SAMPLE_TEX2D( _EmissionColorTex, TRANSFORM_TEX( i.uv, _Emissive_Tex)); 905 | 906 | 907 | 908 | 909 | 910 | 911 | //// Blend, Texture Color & High Color 912 | float3 highColorIn = shadeColor; 913 | float highColorInShadow = 914 | lerp( 915 | 1 916 | // , ((1.0 - shadeRamp_n1) + (shadeRamp_n1 * _TweakHighColorOnShadow)) // slow 917 | , shadeRamp_n1 * (_TweakHighColorOnShadow - 1) + 1 918 | , _Is_UseTweakHighColorOnShadow 919 | ); 920 | float3 highColorFinal = highColorTotalCol * highColorInShadow; 921 | 922 | float hC_oneMinusReflectivity; 923 | float3 hC_albedo = EnergyConservationBetweenDiffuseAndSpecular_ac( 924 | (_Is_BlendAddToHiColor), highColorIn, highColorFinal, hC_oneMinusReflectivity 925 | ); 926 | float3 HighColorOut = hC_albedo + highColorFinal; 927 | 928 | 929 | 930 | 931 | 932 | 933 | //// Blend, (Texture & High Color) & Rim Color 934 | float3 rimLightIn = HighColorOut; 935 | float3 rimMixer1; 936 | // [branch] switch (_RimLight) 937 | switch (_RimLight) 938 | { 939 | case 0: // off 940 | rimMixer1 = rimLightIn; 941 | break; 942 | case 1: // add 943 | rimMixer1 = rimLightMix * rimLightMask + rimLightIn; 944 | break; 945 | case 2: // replace 946 | rimMixer1 = lerp(rimLightIn, rimLightMix, rimLightMask); 947 | break; 948 | default: 949 | rimMixer1 = 0; 950 | break; 951 | } 952 | 953 | float3 rimMixer2; 954 | switch (_Add_Antipodean_RimLight) 955 | { 956 | case 0: // off 957 | rimMixer2 = rimMixer1; 958 | break; 959 | case 1: // add 960 | rimMixer2 = rimLightApMix * rimlightApMask + rimMixer1; 961 | break; 962 | case 2: // replace 963 | rimMixer2 = lerp(rimMixer1, rimLightApMix, rimlightApMask); 964 | break; 965 | default: 966 | rimMixer2 = 0; 967 | break; 968 | } 969 | float3 rimLightOut = rimMixer2; 970 | 971 | 972 | //// Blend, (Texture & High & Rim) & Matcap & Emission 973 | float3 matCapIn = rimLightOut; 974 | float3 matCap_isAdd = matCapTotalCol * matcapMaskTweak + matCapIn; 975 | float3 matCap_isMulti = lerp(matCapIn, matCapIn * matCapTotalCol, matcapMaskTweak); 976 | float3 matCap_type = lerp(matCap_isMulti, matCap_isAdd, _Is_BlendAddToMatCap); 977 | float3 matCapOut = lerp(matCapIn, matCap_type, _MatCap); 978 | 979 | 980 | 981 | //// Blend, emission 982 | float3 emissionIn = matCapOut; 983 | // float emissiveMask = saturate(dot(emissiveMask.rgb, 1)); 984 | float3 emissionMix = (emissiveMask.rgb * emissionColor.rgb * _Emissive_Color.rgb); 985 | #ifdef UNITY_PASS_FORWARDBASE 986 | float3 emissionOut = emissionIn + emissionMix; 987 | #else 988 | float3 emissionOut = emissionIn; 989 | #endif 990 | 991 | 992 | 993 | // resolve NaN value colors. 994 | float3 finalColorIn = emissionOut; 995 | float3 finalColor = max(0, finalColorIn); 996 | 997 | 998 | 999 | 1000 | 1001 | // #ifdef UNITY_PASS_FORWARDBASE 1002 | // fixed4 finalRGBA = fixed4(finalColor, alpha); 1003 | // #elif UNITY_PASS_FORWARDADD 1004 | // fixed4 finalRGBA = fixed4(finalColor * alpha, 0); 1005 | // #endif 1006 | fixed4 finalRGBA = fixed4(finalColor, alpha); 1007 | 1008 | // debug 1009 | // finalRGBA = finalRGBA*.001+float4(testVar.xxx, 1); 1010 | 1011 | UNITY_APPLY_FOG(i.fogCoord, finalRGBA); 1012 | return finalRGBA; 1013 | } -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/UCTS_Outline.cginc: -------------------------------------------------------------------------------- 1 | // UCTS_Outline.cginc 2 | // Forked from Unity-Chan Toon Shader Ver.2.0.4 3 | // Modifications by ACiiL. 4 | // https://github.com/ACIIL/UnityChanToonShaderVer2_Project 5 | // Source: 6 | // https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project 7 | // 8 | uniform sampler2D _MainTex; uniform float4 _MainTex_ST; 9 | uniform sampler2D _Outline_Sampler; uniform float4 _Outline_Sampler_ST; 10 | uniform sampler2D _OutlineTex; uniform float4 _OutlineTex_ST; 11 | 12 | uniform float4 _Color; 13 | uniform float4 _Outline_Color; 14 | 15 | uniform half _Outline_Width; 16 | uniform half _Farthest_Distance; 17 | uniform half _Nearest_Distance; 18 | uniform half _Is_BlendBaseColor; 19 | uniform half _Is_LightColor_Base; 20 | uniform half _Offset_Z; 21 | uniform half _Is_OutlineTex; 22 | uniform half _OutlineshadowCastMin_black; 23 | 24 | #ifdef _IS_OUTLINE_CLIPPING_YES 25 | uniform sampler2D _ClippingMask; uniform float4 _ClippingMask_ST; 26 | uniform half _Clipping_Level; 27 | uniform half _Tweak_transparency; 28 | uniform half _Inverse_Clipping; 29 | uniform half _IsBaseMapAlphaAsClippingMask; 30 | #endif 31 | uniform half _outline_mode; 32 | static const float softGI = .5; 33 | 34 | 35 | 36 | struct VertexInput { 37 | float4 vertex : POSITION; 38 | float3 normal : NORMAL; 39 | float2 texcoord0 : TEXCOORD0; 40 | }; 41 | struct VertexOutput { 42 | float4 pos : SV_POSITION; 43 | float4 posWorld : TEXCOORD1; 44 | float2 uv0 : TEXCOORD0; 45 | float3 normalDir : TEXCOORD2; 46 | UNITY_SHADOW_COORDS(3) 47 | // LIGHTING_COORDS(3,4) 48 | UNITY_FOG_COORDS(5) 49 | half3 vertexLighting : COLOR0; 50 | half attenVert : COLOR1; 51 | }; 52 | 53 | 54 | 55 | // ambient color 56 | fixed3 DecodeLightProbe_average( fixed3 N ){ 57 | //return (1 - softGI) * ShadeSH9( float4(N, 1)) + (softGI) * ShadeSH9( float4(0,0,0,1)); 58 | return ShadeSH9( float4(0,0,0,1)); 59 | } 60 | 61 | // unity's modified version without the lambert tint darkening and with attenuation pass out. 62 | float3 softShade4PointLights_Atten ( 63 | float4 lightPosX, float4 lightPosY, float4 lightPosZ, 64 | float3 lightColor0, float3 lightColor1, float3 lightColor2, float3 lightColor3, 65 | float4 lightAttenSq, 66 | float3 pos, 67 | float3 normal, 68 | out float attenVert, 69 | out float3 vertTo0) 70 | { 71 | // to light vectors 72 | float4 toLightX = lightPosX - pos.x; 73 | float4 toLightY = lightPosY - pos.y; 74 | float4 toLightZ = lightPosZ - pos.z; 75 | vertTo0 = float3(toLightX[0], toLightY[0], toLightZ[0]); 76 | // squared lengths 77 | float4 lengthSq = 0; 78 | lengthSq += toLightX * toLightX; 79 | lengthSq += toLightY * toLightY; 80 | lengthSq += toLightZ * toLightZ; 81 | // don't produce NaNs if some vertex position overlaps with the light 82 | lengthSq = max(lengthSq, 0.000001); 83 | 84 | // attenuation 85 | float4 atten = 1.0 / (1.0 + lengthSq * lightAttenSq) -0.034; 86 | attenVert = atten; 87 | // float4 diff = atten; 88 | float4 diff = 1; 89 | 90 | // final color 91 | float3 col = 0; 92 | col += lightColor0 * diff.x; 93 | col += lightColor1 * diff.y; 94 | col += lightColor2 * diff.z; 95 | col += lightColor3 * diff.w; 96 | return col; 97 | } 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | //// vert 111 | VertexOutput vert (VertexInput v) { 112 | VertexOutput o = (VertexOutput)0; 113 | o.uv0 = v.texcoord0; 114 | o.normalDir = UnityObjectToWorldNormal( v.normal); 115 | o.posWorld = mul( unity_ObjectToWorld, v.vertex); 116 | 117 | float4 objPos = mul ( unity_ObjectToWorld, float4(0,0,0,1) ); 118 | 119 | float2 Set_UV0 = o.uv0; 120 | float4 _Outline_Sampler_var = tex2Dlod( _Outline_Sampler, float4( TRANSFORM_TEX( Set_UV0, _Outline_Sampler), 0.0, 0)); 121 | float Set_Outline_Width = 122 | ( 123 | _Outline_Width * 0.001 124 | * 125 | smoothstep( 126 | _Farthest_Distance, _Nearest_Distance, distance( o.posWorld.rgb, _WorldSpaceCameraPos) 127 | ) 128 | * _Outline_Sampler_var.rgb 129 | ).r; 130 | float3 viewDirection = ( _WorldSpaceCameraPos.xyz - o.pos.xyz); 131 | float4 viewDirectionVP = mul( UNITY_MATRIX_VP, float4( viewDirection.xyz, 1)); 132 | #if defined(UNITY_REVERSED_Z) 133 | _Offset_Z = _Offset_Z * -0.01; 134 | #else 135 | _Offset_Z = _Offset_Z * 0.01; 136 | #endif 137 | 138 | // NML 139 | if (_outline_mode == 0){ 140 | o.pos = UnityObjectToClipPos( float4( v.vertex.xyz + v.normal * Set_Outline_Width, 1) ); 141 | } 142 | // POS 143 | else if (_outline_mode == 1){ 144 | Set_Outline_Width = Set_Outline_Width * 2; 145 | o.pos = UnityObjectToClipPos( float4( v.vertex.xyz + normalize(v.vertex) * Set_Outline_Width, 1) ); 146 | } 147 | 148 | // #ifdef _OUTLINE_NML 149 | // o.pos = UnityObjectToClipPos( float4( v.vertex.xyz + v.normal * Set_Outline_Width, 1) ); 150 | 151 | // #elif _OUTLINE_POS 152 | // Set_Outline_Width = Set_Outline_Width * 2; 153 | // o.pos = UnityObjectToClipPos( float4( v.vertex.xyz + normalize(v.vertex) * Set_Outline_Width, 1) ); 154 | // #endif 155 | 156 | UNITY_TRANSFER_FOG( o, o.pos); 157 | UNITY_TRANSFER_SHADOW(o, o.uv0); 158 | // TRANSFER_VERTEX_TO_FRAGMENT(o); 159 | o.pos.z = o.pos.z + _Offset_Z * viewDirectionVP.z; 160 | #ifdef VERTEXLIGHT_ON 161 | float3 vertTo0; 162 | o.vertexLighting = softShade4PointLights_Atten( 163 | unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0 164 | , unity_LightColor[0], unity_LightColor[1], unity_LightColor[2], unity_LightColor[3] 165 | , unity_4LightAtten0, o.posWorld, 0, o.attenVert, vertTo0); 166 | #endif 167 | return o; 168 | } 169 | 170 | 171 | 172 | 173 | 174 | //// Redefine UNITY_LIGHT_ATTENUATION without shadow multiply from AutoLight.cginc 175 | #ifdef POINT 176 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 177 | unityShadowCoord3 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)).xyz; \ 178 | fixed destName = tex2D(_LightTexture0, dot(lightCoord, lightCoord).rr).UNITY_ATTEN_CHANNEL; 179 | #endif 180 | 181 | #ifdef SPOT 182 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 183 | unityShadowCoord4 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)); \ 184 | fixed destName = (lightCoord.z > 0) * UnitySpotCookie(lightCoord) * UnitySpotAttenuate(lightCoord.xyz); 185 | #endif 186 | 187 | #ifdef DIRECTIONAL 188 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) fixed destName = 1; 189 | // #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) fixed destName = UNITY_SHADOW_ATTENUATION(input, worldPos); 190 | #endif 191 | 192 | #ifdef POINT_COOKIE 193 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 194 | unityShadowCoord3 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)).xyz; \ 195 | fixed destName = tex2D(_LightTextureB0, dot(lightCoord, lightCoord).rr).UNITY_ATTEN_CHANNEL * texCUBE(_LightTexture0, lightCoord).w; 196 | #endif 197 | 198 | #ifdef DIRECTIONAL_COOKIE 199 | #define UNITY_LIGHT_ATTENUATION_NOSHADOW(destName, input, worldPos) \ 200 | unityShadowCoord2 lightCoord = mul(unity_WorldToLight, unityShadowCoord4(worldPos, 1)).xy; \ 201 | fixed destName = tex2D(_LightTexture0, lightCoord).w; 202 | #endif 203 | 204 | 205 | 206 | 207 | 208 | 209 | //// frag 210 | float4 frag(VertexOutput i) : SV_Target{ 211 | UNITY_LIGHT_ATTENUATION_NOSHADOW(lightAtten, i, i.posWorld.xyz); 212 | float shadowAtten = UNITY_SHADOW_ATTENUATION(i, i.posWorld.xyz); 213 | float nLightAtten = 1 - lightAtten; 214 | float nShadowAtten = 1 - shadowAtten; 215 | float attenRampB = ( (-(nLightAtten * nLightAtten) + 1)); 216 | float shadowAttenB = ( (-(nShadowAtten * nShadowAtten) + 1)); 217 | float attenRamp = attenRampB; 218 | 219 | 220 | 221 | #ifdef UNITY_PASS_FORWARDBASE 222 | float3 lightColor = _LightColor0.rgb; 223 | float shadowBlackness = max(_OutlineshadowCastMin_black, shadowAttenB); 224 | float3 ambientLight = DecodeLightProbe_average( i.normalDir); 225 | lightColor = lightColor * shadowBlackness * attenRamp; 226 | lightColor = (lightColor + ambientLight) + (i.vertexLighting * i.attenVert); 227 | 228 | #elif UNITY_PASS_FORWARDADD 229 | float shadRings = shadowAttenB; 230 | float shadowBlackness = max(_OutlineshadowCastMin_black, shadowAttenB); 231 | float3 lightColor = _LightColor0.rgb; 232 | float shadBlackScale = lerp(1, shadowBlackness, attenRamp); 233 | lightColor = lightColor * shadBlackScale * attenRamp; 234 | #endif 235 | 236 | // fight how the raw light of direct + indirect overbrights 237 | // Ill change this counter many time more than now. Which is to many already! 238 | float3 Set_LightColor = lightColor; 239 | Set_LightColor.x = (Set_LightColor.x > 1) ? sqrt(Set_LightColor.x) : Set_LightColor.x; 240 | Set_LightColor.y = (Set_LightColor.y > 1) ? sqrt(Set_LightColor.y) : Set_LightColor.y; 241 | Set_LightColor.z = (Set_LightColor.z > 1) ? sqrt(Set_LightColor.z) : Set_LightColor.z; 242 | 243 | 244 | 245 | float2 Set_UV0 = i.uv0; 246 | float4 _MainTex_var = tex2D(_MainTex, TRANSFORM_TEX( Set_UV0, _MainTex)); 247 | float3 _BaseColorMap_var = ( _Color.rgb * _MainTex_var.rgb ); 248 | float3 Set_BaseColor = lerp( _BaseColorMap_var * Set_LightColor, (_BaseColorMap_var * Set_LightColor.rgb), _Is_LightColor_Base ); 249 | float3 _Is_BlendBaseColor_var = lerp( (_Outline_Color.rgb * Set_LightColor.rgb), (_Outline_Color.rgb * Set_BaseColor), _Is_BlendBaseColor ); 250 | float3 _OutlineTex_var = tex2D( _OutlineTex, TRANSFORM_TEX( Set_UV0, _OutlineTex)); 251 | 252 | 253 | 254 | #ifndef NotAlpha 255 | float4 clippingMaskTex = tex2D( _ClippingMask, TRANSFORM_TEX( Set_UV0, _ClippingMask)); 256 | float useMainTexAlpha = lerp( clippingMaskTex.r, _MainTex_var.a, _IsBaseMapAlphaAsClippingMask ); 257 | float alpha = lerp( useMainTexAlpha, (1.0 - useMainTexAlpha), _Inverse_Clipping ); 258 | 259 | float clipTest = (( alpha - _Clipping_Level - 0.01)); 260 | clip(clipTest); 261 | alpha = saturate(alpha + _Tweak_transparency); 262 | #ifdef IsClip 263 | alpha = 1; 264 | #endif 265 | 266 | 267 | 268 | float4 Set_Outline_Color = 269 | lerp( 270 | float4( _Is_BlendBaseColor_var, alpha) 271 | , float4( (_OutlineTex_var.rgb * _Is_BlendBaseColor_var), alpha) 272 | , _Is_OutlineTex 273 | ); 274 | UNITY_APPLY_FOG( i.fogCoord, Set_Outline_Color); 275 | return Set_Outline_Color; 276 | #else 277 | float3 Set_Outline_Color = lerp( _Is_BlendBaseColor_var, _OutlineTex_var.rgb * _Is_BlendBaseColor_var, _Is_OutlineTex ); 278 | UNITY_APPLY_FOG( i.fogCoord, Set_Outline_Color); 279 | return fixed4(Set_Outline_Color, 1); 280 | #endif 281 | } -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/UCTS_ShadowCaster.cginc: -------------------------------------------------------------------------------- 1 | //UCTS_ShadowCaster.cginc 2 | // Forked from Unity-Chan Toon Shader Ver.2.0.4 3 | // Modifications by ACiiL. 4 | // https://github.com/ACIIL/UnityChanToonShaderVer2_Project 5 | // Source: 6 | // https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project 7 | // 8 | uniform sampler2D _ClippingMask; uniform float4 _ClippingMask_ST; 9 | uniform sampler2D _MainTex; uniform float4 _MainTex_ST; 10 | #ifdef Dither 11 | sampler3D _DitherMaskLOD; 12 | #endif 13 | 14 | uniform half _DetachShadowClipping; 15 | uniform half _Tweak_transparency; 16 | uniform half _Clipping_Level; 17 | uniform half _Clipping_Level_Shadow; 18 | uniform half _Inverse_Clipping; 19 | uniform half _IsBaseMapAlphaAsClippingMask; 20 | 21 | 22 | 23 | 24 | 25 | 26 | struct VertexInput { 27 | float4 vertex : POSITION; 28 | float2 texcoord0 : TEXCOORD0; 29 | }; 30 | 31 | 32 | 33 | struct VertexOutput { 34 | // V2F_SHADOW_CASTER; 35 | float2 uv0 : TEXCOORD0; 36 | float4 worldPos : TEXCOORD1; 37 | }; 38 | 39 | // 40 | float hash13(float3 p3) 41 | { 42 | // p3 = frac(p3 * .1031); 43 | p3 = frac(p3 * 13); 44 | p3 += dot(p3, p3.yzx + 19.19); 45 | return frac((p3.x + p3.y) * p3.z); 46 | } 47 | 48 | 49 | 50 | 51 | 52 | 53 | VertexOutput vert ( 54 | float4 vertex : POSITION, 55 | float2 uv : TEXCOORD0, 56 | out float4 outpos : SV_POSITION 57 | ) { 58 | VertexOutput o = (VertexOutput)0; 59 | o.uv0 = uv; 60 | outpos = UnityObjectToClipPos( vertex ); 61 | o.worldPos = mul( unity_ObjectToWorld, vertex); 62 | // TRANSFER_SHADOW_CASTER(o) 63 | return o; 64 | } 65 | // VertexOutput vert (VertexInput v, out float4 outpos : SV_POSITION) { 66 | // VertexOutput o = (VertexOutput)0; 67 | // o.uv0 = v.texcoord0; 68 | // outpos = UnityObjectToClipPos( v.vertex ); 69 | // TRANSFER_SHADOW_CASTER(o) 70 | // return o; 71 | // } 72 | 73 | 74 | 75 | 76 | 77 | 78 | float4 frag(VertexOutput i, UNITY_VPOS_TYPE screenPos : VPOS) : SV_TARGET { 79 | #ifndef NotAlpha 80 | float2 Set_UV0 = i.uv0; 81 | float4 clippingMaskTex = tex2D(_ClippingMask,TRANSFORM_TEX(Set_UV0, _ClippingMask)); 82 | float4 mainTex = tex2D(_MainTex, TRANSFORM_TEX(Set_UV0, _MainTex)); 83 | float useMainTexAlpha = lerp( clippingMaskTex.r, mainTex.a, _IsBaseMapAlphaAsClippingMask ); 84 | float alpha = lerp( useMainTexAlpha, (1.0 - useMainTexAlpha), _Inverse_Clipping ); 85 | 86 | float clipTest = (_DetachShadowClipping) ? _Clipping_Level_Shadow : _Clipping_Level; 87 | clip( alpha - clipTest - 0.001); 88 | clipTest = saturate(alpha + _Tweak_transparency); 89 | 90 | #ifdef Dither 91 | float dither = tex3D(_DitherMaskLOD, float3(screenPos.xy * .25, clipTest * .99)).a; 92 | // float dither2 = hash13(i.worldPos.xyz * 50); 93 | // alpha = dither * (clipTest % 16); 94 | alpha = dither; 95 | alpha = ((alpha - 0.01)) ; 96 | clip(alpha ); 97 | #else 98 | clip(clipTest); 99 | #endif 100 | SHADOW_CASTER_FRAGMENT(i) 101 | #else 102 | SHADOW_CASTER_FRAGMENT(i) 103 | #endif 104 | } 105 | -------------------------------------------------------------------------------- /Assets/Toon/Shader/ACiiL/tempAllNewProperties.txt: -------------------------------------------------------------------------------- 1 | Properties { 2 | [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", int) = 2 //OFF/FRONT/BACK 3 | 4 | 5 | 6 | [Space(25)] 7 | [Header(Alpha mask)] 8 | _ClippingMask ("Clipping mask", 2D) = "white" {} 9 | _Clipping_Level ("Clipping level", Range(0, 1)) = 0 10 | _Tweak_transparency ("Tweak transparency", Range(-1, 1)) = 0 11 | [Toggle(_)]_IsBaseMapAlphaAsClippingMask ("Use main texture Alpha", Float ) = 0 12 | [Toggle(_)]_Inverse_Clipping ("Inverse clipping", Float ) = 0 13 | [Toggle(_)]_DetachShadowClipping ("Separate Shadow Clipping", Float) = 0 14 | _Clipping_Level_Shadow ("Shadow Clipping level", Range(0, 1)) = 1 15 | [Enum(Off,0,On,1)] _ZWrite ("Z Write. Depth write", Int) = 1 16 | 17 | 18 | 19 | [Space(25)] 20 | [Header(Normal map)] 21 | _NormalMap ("NormalMap", 2D) = "bump" {} 22 | [Toggle(_)]_Is_NormalMapToBase ("On Toon", Float ) = 0 23 | [Toggle(_)]_Is_NormalMapToHighColor ("On High Color", Float ) = 0 24 | [Toggle(_)]_Is_NormalMapToRimLight ("On Rims", Float ) = 0 25 | [Toggle(_)]_Is_NormaMapToEnv ("On Reflection", Float) = 0 26 | 27 | 28 | 29 | [Space(25)] 30 | [Header(Toon ramp)] 31 | _MainTex ("Main Tex", 2D) = "white" {} 32 | _1st_ShadeMap ("1st shade Tex 1", 2D) = "white" {} 33 | _2nd_ShadeMap ("2nd shade Tex 2", 2D) = "white" {} 34 | [Enum(Self,0,BaseTex,1)]_Use_BaseAs1st ("1st shade source", float) = 1 35 | [Enum(Self,0,Shade1,1)]_Use_1stAs2nd ("2st shade source", float) = 1 36 | [HDR]_Color ("Base color", Color) = (1,1,1,1) 37 | [HDR]_1st_ShadeColor ("1st shade color 1", Color) = (1,1,1,1) 38 | [HDR]_2nd_ShadeColor ("2nd shade color 2", Color) = (1,1,1,1) 39 | _BaseColor_Step ("Step: base|shades ", Range(0, 1)) = 0.6 40 | _ShadeColor_Step ("Step: shades 1|2", Range(0, 1)) = 0.4 41 | _BaseShade_Feather ("Feather: base|shades", Range(0.0001, 1)) = 0.0001 42 | _1st2nd_Shades_Feather ("Feather: shades 1|2", Range(0.0001, 1)) = 0.0001 43 | 44 | 45 | 46 | [Space(25)] 47 | [Header(Shadow and AO control)] 48 | _Set_1st_ShadePosition ("1st AO shade Position", 2D) = "white" {} 49 | _Set_2nd_ShadePosition ("2nd AO shade Position", 2D) = "white" {} 50 | _shadowCastMin_black ("Shadow minimal dark", Range(0.0,1.0)) = 0 51 | [Toggle(_)]_Set_SystemShadowsToBase ("Shadow affects shading", Float ) = 1 52 | _Tweak_SystemShadowsLevel ("Tweak shade from shadow", Range(-0.5, 0.5)) = 0 53 | _shaSatRatio ("Shadow saturate ratio", Range(0, 2)) = 0.125 54 | 55 | 56 | 57 | [Space(25)] 58 | [Header(High Color. Specular)] 59 | _HighColor_Tex ("HighColor Tex albedo", 2D) = "white" {} 60 | _Set_HighColorMask ("HighColor Tex Mask", 2D) = "white" {} 61 | [Enum(Self,0,BaseTex,1)]_highColTexSource ("HighColor source", float) = 0 62 | _Tweak_HighColorMaskLevel ("Tweak highColor Mask", Range(-1, 1)) = 0 63 | [HDR]_HighColor ("Color", Color) = (0,0,0,1) 64 | _HighColor_Power ("Power", Range(0, 1)) = 0 65 | [Enum(Replace,0,Add,1)]_Is_BlendAddToHiColor ("Blend mode", Float ) = 1 66 | [Toggle(_)]_Is_SpecularToHighColor ("Is highColor soft", Float ) = 0 67 | [Toggle(_)]_Is_UseTweakHighColorOnShadow ("Mask highColor in shadow", Float ) = 0 68 | _TweakHighColorOnShadow ("Tweak highColor in shadow", Range(0, 1)) = 0 69 | 70 | 71 | 72 | [Space(25)] 73 | [Header(Rimlights)] 74 | _Set_RimLightMask ("RimLight Tex mask", 2D) = "white" {} 75 | _Tweak_RimLightMaskLevel ("Tweak: mask", Range(-1, 1)) = 0 76 | [Enum(Off,0,Add,1,Replace,2)]_RimLight ("Mix: RimLight", Float ) = 0 77 | [Enum(Off,0,Add,1,Replace,2)]_Add_Antipodean_RimLight ("Mix: Ap RimLight", Float ) = 0 78 | [Enum(None,0,BaseTex,1,HighColor,2,Shade1,3,Shade2,4)]_RimLightSource ("Source albedo", Float) = 0 79 | [HDR]_RimLightColor ("Color: RimLight", Color) = (1,1,1,1) 80 | [HDR]_Ap_RimLightColor ("Color: Ap RimLight", Color) = (1,1,1,1) 81 | [Toggle(_)]_LightDirection_MaskOn ("Use light direction", Float ) = 0 82 | [Toggle(_)]_RimLight_FeatherOff ("Off rimLight feather", Float ) = 0 83 | [Toggle(_)]_Ap_RimLight_FeatherOff ("Off Ap rimLight feather", Float ) = 0 84 | _RimLight_Power ("Power: RimLight", Range(0, 1)) = 0.1 85 | _Ap_RimLight_Power ("Power: Ap RimLight", Range(0, 1)) = 0.1 86 | _RimLightAreaOffset ("Offset: RimLight", Range(-1, 1)) = 0 87 | _RimLight_InsideMask ("Mask: Inside rimLight", Range(0.00001, 1)) = 0.0001 88 | _Tweak_LightDirection_MaskLevel ("Mask: Light direction", Range(0, 1)) = 0 89 | 90 | 91 | 92 | [Space(25)] 93 | [Header(World reflection)] 94 | _envRoughness ("Reflection roughness", Range(0, 1)) = 0.34 95 | _envOnRim ("Reflection on rimLights", Range(0,1)) = 0.5 96 | 97 | 98 | 99 | [Space(25)] 100 | [Header(Matcap)] 101 | _NormalMapForMatCap ("MatCap normalMap", 2D) = "bump" {} 102 | [Toggle(_)]_Is_NormalMapForMatCap ("Use matcap normalMap ", Float ) = 0 103 | _MatCap_Sampler ("MatCap Tex albedo", 2D) = "black" {} 104 | _Set_MatcapMask ("Matcap mask", 2D) = "white" {} 105 | _Tweak_MatcapMaskLevel ("Tweak: Matcap mask", Range(-1, 1)) = 0 106 | [Toggle(_)]_MatCap ("Use MatCap", Float ) = 0 107 | [HDR]_MatCapColor ("MatCap Color", Color) = (1,1,1,1) 108 | [Enum(Multiply,0,Add,1)]_Is_BlendAddToMatCap ("Matcap Blend Mode", Float) = 1 109 | _Tweak_MatCapUV ("Zoom matCap", Range(-0.5, 0.5)) = 0 110 | _Rotate_MatCapUV ("Rotate matCap", Range(-1, 1)) = 0 111 | _Rotate_NormalMapForMatCapUV ("Rotate normalMap matCap", Range(-1, 1)) = 0 112 | [Toggle(_)]_Is_UseTweakMatCapOnShadow ("Mask matCap in shadow", Float ) = 0 113 | _TweakMatCapOnShadow ("Tweak matCap in shadow", Range(0, 1)) = 0 114 | 115 | 116 | 117 | [Space(25)] 118 | [Header(Emission)] 119 | _Emissive_Tex ("Emissive mask tex", 2D) = "white" {} 120 | _EmissionColorTex ("Emissive color tex", 2D) = "white" {} 121 | [HDR]_Emissive_Color ("Emissive color", Color) = (0,0,0,1) 122 | 123 | 124 | 125 | [Space(25)] 126 | [Header(Use world color settings)] 127 | [Toggle(_)]_Is_LightColor_Base ("Use LightColor in Base", Float ) = 1 128 | [Toggle(_)]_Is_LightColor_1st_Shade ("Use LightColor in 1st_Shade", Float ) = 1 129 | [Toggle(_)]_Is_LightColor_2nd_Shade ("Use LightColor in 2nd_Shade", Float ) = 1 130 | [Toggle(_)]_Is_LightColor_HighColor ("Use LightColor in HighColor", Float ) = 1 131 | [Toggle(_)]_Is_LightColor_RimLight ("Use LightColor in RimLight", Float ) = 1 132 | [Toggle(_)]_Is_LightColor_Ap_RimLight ("Use LightColor in Ap RimLight", Float ) = 1 133 | [Toggle(_)]_Is_LightColor_MatCap ("Use LightColor in MatCap", Float ) = 1 134 | 135 | 136 | 137 | [Space(25)] 138 | [Header(Outline)] 139 | [Enum(NML,0,POS,1)] _outline_mode ("OUTLINE MODE", Int) = 0 140 | _OutlineTex ("Outline tex", 2D) = "white" {} 141 | _Outline_Sampler ("Outline sampler", 2D) = "white" {} 142 | _Outline_Color ("Outline color", Color) = (0.5,0.5,0.5,1) 143 | [Toggle(_)]_Is_BlendBaseColor ("Is Blend base color", Float ) = 0 144 | [Toggle(_)]_Is_OutlineTex ("Is outline Tex", Float ) = 0 145 | _Outline_Width ("Outline width", Float ) = 1 146 | _Nearest_Distance ("Nearest distance", Float ) = 0.5 147 | _Farthest_Distance ("Farthest distance", Float ) = 10 148 | _Offset_Z ("Offset Camera Z depth", Float) = 0 149 | _OutlineshadowCastMin_black ("outline Shadow minimal dark", Range(0.0,1.0)) = 0.0 150 | 151 | 152 | 153 | [Space(25)] 154 | [Header(Stencil)] 155 | _Offset ("Offset", float) = 0 156 | [Toggle(_)] _Stencil ("Stencil ID [0;255]", Range(0,255)) = 0 157 | _ReadMask ("ReadMask [0;255]", Int) = 255 158 | _WriteMask ("WriteMask [0;255]", Int) = 255 159 | [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Int) = 0 160 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Int) = 0 161 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilFail ("Stencil Fail", Int) = 0 162 | [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFail ("Stencil ZFail", Int) = 0 163 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Int) = 4 164 | [Enum(None,0,Alpha,1,Red,8,Green,4,Blue,2,RGB,14,RGBA,15)] _colormask ("Color Mask", Int) = 15 165 | } 166 | 167 | 168 | // ColorMask [_colormask] 169 | // ZTest [_ZTest] 170 | // ZWrite [_ZWrite] 171 | 172 | // Stencil 173 | // { 174 | // Ref [_Stencil] 175 | // ReadMask [_ReadMask] 176 | // WriteMask [_WriteMask] 177 | // Comp [_StencilComp] 178 | // Pass [_StencilOp] 179 | // Fail [_StencilFail] 180 | // ZFail [_StencilZFail] 181 | // } -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0102-04_02_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0102-04_02_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0102-06_02_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0102-06_02_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0102-22_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0102-22_03.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_01 [1]_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_01 [1]_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_01_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_01_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_04.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_05_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_05_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_07.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-22_08.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0105-23_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0105-23_02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0122-06_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0122-06_04.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0201-11_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0201-11_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0201-11_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0201-11_05.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0205-11_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0205-11_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_10.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_11.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0609-04_13.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0609-05_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0609-05_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0713-06_01_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0713-06_01_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0801-12_05_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0801-12_05_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0801-12_07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0801-12_07.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0906-18_01_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0906-18_01_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/0906-18_03_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/0906-18_03_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_08.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_10_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_10_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_11.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_14.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_15_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/1230-11_15_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/1230-12_01_eng.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/1230-12_01_eng.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/AR_Image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/AR_Image.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/AR_Postion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/AR_Postion.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/AR_UI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/AR_UI.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/BoxProjection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/BoxProjection.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/CRS01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/CRS01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/CRS02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/CRS02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/CRS03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/CRS03.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/Check.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/Check.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/HairModel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/HairModel.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/Hair_UV1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/Hair_UV1.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/HiUni01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/HiUni01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/Image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/Image.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/Light_Silhouette.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/Light_Silhouette.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/LookSample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/LookSample.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_en_files/UI_ShadingGradeMap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_en_files/UI_ShadingGradeMap.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0102-04_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0102-04_02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0102-06_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0102-06_02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0102-22_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0102-22_03.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_01 [1].jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_01 [1].jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_04.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_05.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_07.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-22_08.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-23_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0105-23_02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0122-06_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0122-06_04.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0201-11_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0201-11_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0201-11_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0201-11_05.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0205-11_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0205-11_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_10.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_11.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_12.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-04_13.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-05_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0609-05_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0713-06_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0713-06_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0801-12_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0801-12_05.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0801-12_07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0801-12_07.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0906-18_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0906-18_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/0906-18_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/0906-18_03.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_08.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_10.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_11.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_14.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-11_15.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-12_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/1230-12_01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/AR_Image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/AR_Image.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/AR_Postion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/AR_Postion.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/BoxProjection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/BoxProjection.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/CRS01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/CRS01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/CRS02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/CRS02.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/CRS03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/CRS03.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/Check.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/Check.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/HairModel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/HairModel.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/Hair_UV1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/Hair_UV1.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/HiUni01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/HiUni01.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/Light_Silhouette.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/Light_Silhouette.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/LookSample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/LookSample.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/UI_ShadingGradeMap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/UI_ShadingGradeMap.jpg -------------------------------------------------------------------------------- /Manual/UnityChanToonShaderVer2_Manual_ja_files/UI_Toon_DoubleShadeWithFeather.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACIIL/UnityChanToonShaderVer2_Project/97b50acee88fa3d0c68765903cff4a1d0d46fd6c/Manual/UnityChanToonShaderVer2_Manual_ja_files/UI_Toon_DoubleShadeWithFeather.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | README.md 2 | 3 | # Project Ended 4 | Project is DEPRECATED, please go to ACLS shader: https://github.com/ACIIL/ACLS-Shader for all my modernizations and extendtions of this source. 5 | 6 | # Intro: 7 | UTS2-ac shader, a git fork of UnityChanToonShaderVer2_Project (UTS2) with lighting improvements and bug fixes based on the v2.0.4+ versions. 8 | Tweaks by ACiiL. 9 | 10 | https://github.com/ACIIL/UnityChanToonShaderVer2_Project 11 | 12 | Credits to the original author(s) unity3d-jp for humbly providing UTS2 open source and those that helped me develop the improvements. 13 | 14 | https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project 15 | 16 | 17 | 18 | 19 | 20 | 21 | # Install: 22 | In github download the zip in the releases tab or from the branch you selected. In the zip file you will find the asset/ folder and Manual/ documentation. 23 | Copy the inner Toon/ folder into your unity assets\ project folder. Your shader listing should now have UnityChainToonShader/ACiiL sub menu installed. 24 | 25 | 26 | Watchout when applying UTS2 to news materials for when object sorting is see-threw, fix it by setting the zwrite on. 27 | 28 | 29 | 30 | 31 | 32 | 33 | # What is this and history: 34 | UTS2 is a extremely customizable toon shader. Its good for 2 to 5 "color tone" toony paint effects with many options which represent Unity standard shader appearance in a abstracted toony way. 35 | 36 | Today mainline UTS2 has moved forward to v2.0.5+ and this little side branch of mine was for v2.0.4+. It should be possible to swap other versions of UTS2 with mine for a while. 37 | 38 | This has a been about a year long on-and-off study project since middle of January 2018. Back then no one knew UnityChanToonShaderVer2_Project and it didnt work in vrchat, I was interested in making it function in vrchat. Some on and off weeks studying unity's hlsl i learned unity's lighting and how to correctly manipulate them for shaders. This Study result is UTS2-AC. 39 | 40 | After some lucky back and forth with the main author of UTS2 shader i shown them my code edits and then the main branch of UTS2 became functional in vrchat. Now we see UTS2 being used freely for commercial avatar sales on Booth.pm and the general players in vrchat who like the styles UTS2 provides. 41 | 42 | My UTS2 branch is its own separate fork. I have my own methods to approach unity engine's lighting system and my own goals to take it. I want to give artists the power to select UTS2 shader effects without disobeying unity's light system (to much) under the common bad map lighting seen in vrchat maps. 43 | 44 | In regards to community improvements i will accept code contribution as pull requests! Pass me bug fixes for my fork, preferably within github. 45 | 46 | 47 | 48 | 49 | 50 | 51 | # Manual: 52 | Read the documentation for UTS2. 53 | See the latest mainline UTS2 release manual, it contain videos and examples of setup: 54 | 55 | https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/blob/master/Manual/ 56 | 57 | Note my fork is somewhat different from the mainline readme version. 58 | 59 | 60 | 61 | 62 | 63 | 64 | # Shader keywords limit notes and solutions for avatar creators and shader writers. 65 | A common problem to all vrchat shaders is sharing the limited space of shader keywords. When the limit is hit durring a play session strange visual bug will happen to new shaders loading in. The keyword space can also be flooded in your unity project avoid that by only enabling shaders you use. 66 | 67 | # How do clean up keywords before avatar upload manually: 68 | There is a way to clean up unused keywords in materials between shader swaps and updates! 69 | Select your material -> set debug by using the drop down gear right of the inspector tab row -> read out the "keywords" text box and test deleting that list. If things look ok after you are lucky. 70 | 71 | 72 | 73 | For shader writers, avoid methods that create keywords. See how i implemented [toggle(_)] for toggles and number enum's, and see how defines do not use 74 | \#pragma shader_feature or \#pragma multi_compile 75 | 76 | 77 | 78 | 79 | 80 | 81 | # Forks differences and features. 82 | Details what's different in UTS2-AC. See the official UTS2 readme for everything. 83 | 84 | 85 | 86 | * Face _CullMode, if faces render both/back/forward. 87 | 88 | 89 | 90 | * For alpha shaders, The alpha texture mask and settings 91 | * Alpha is alpha to converage, screen space alpha cutout. Use fade for best and most redundant alpha sorting and supports shadow receives and casting. 92 | * Checkmark "use main texture alpha" when it has the alpha channel, otherwise use a custom grayscale texture that represents the alpha. 93 | * Zwrite off may give strange invisible appearance. Default on unless you want alphas textures that is see threw completely. 94 | 95 | 96 | 97 | * The dynamic toon ramp system 98 | * Begin with basic texture assignment. UTS2 is intended to have 3d custom edited textures however you may set the main texture and reuse with dropdowns. 99 | * UTS2 has 3 concepts for light in subsets of different properties: 100 | * "Direct to light" 101 | * "Core ambient in shadow" 102 | * "Facing away from light" 103 | * What makes UTS2 unique is the 3 layer toon ramp system built with: ramps, painted albedo textures, and ambient occlusion textures. Use these to strictly control how you character appears in light and shadows. 104 | * UTS2 mixes shading as two lerps as: (LightSide | (Tone1 | Tone3)). 105 | * LightSide disappears in shadow or facing away from light, depending how you setup. 106 | * (Tone 1 and 2) becomes what's in the ambient and facing away from light depending how you setup. 107 | * The "ambient occlusion" slots as "Set_N_shadePosition" are used to down ramp the shading toward: 1st what is considered not direct to light, and 2nd forcing away from light shadows. You can also use the AOs to colorize areas as you wish depending how you setup. 108 | * For artistic and natural looking toon shading tones, saturation the shadow colors textures (with a point editor) and shift the hue towards blue. Avoid gray tones except for metallics. 109 | * For skin ramps, down ramp the shade to the color of the skin, however saturate the color at most 15%. Remember to shift hud towards blue from red/yellow. 110 | * Shadows have a minimal shadow blackness setting. Use it to ignore the extremely black contribution of dynamic shadow casts (see black shadow and no ambient light in that space). Use this when you find yourself in harsh maps without ambient lights to soften black shadows; Its a realism compromise. 111 | 112 | 113 | 114 | * Custom shadow cast and falloff system. 115 | * Bit of a pain and most of my work. The entire light mixing is most of my original code in this fork. 116 | * Direct and indirect light as well as vertex lights is what makes UTS2-ac a demo for how adaptable shaders can be to typical Vrchat maps that do lighting wrong and miss things. 117 | * Shadow attenuation and falloff is split. From my work there is far smarter control to how light attenuation is used and mixes with ambient light. 118 | * I treat dyanmic shadows as a "dynamic toon ramp" that influences the appearance over the static toon ramp. 119 | * A shadow cast dynamic saturation setting - albedo color saturation goes up the stronger shadow is in dark ambiance. It looks nice, like a fake bit of light bouncing in AO corners. 120 | * Light falloff dimming is minimized to the limit of the light radius, as to minimize toning toon colors. This is possible with my light attenuation refractor. 121 | * to help control "shadow cast stepping" artifacts on the toon ramp, Shadow attenuation is remapped, its not perfect because there is no way to control shadow casting flaws. 122 | * From my lighting refactor, point and spot light shadows weaken over distance. 123 | 124 | 125 | 126 | * (Specular) highColor. The Toon shine effect. 127 | * This is specular. To enable set color tint other than black and raise the power. 128 | * Mixing has two modes: replace or add. You can then leave it without texture source or give a texture to control how the specular tints. There is surprisingly a lot of control. 129 | 130 | 131 | 132 | * The RimLight. 133 | * UTS rim setup choices is huge. Controls for harshness, power, falloff,etc. 134 | * I have extended the rim light mixing: 135 | * Mix mode is additive or replace. Use replace to setup darkern brightness. 136 | * Abedo can set as a texture instead of solid tone. For example, sample the main texture with a solid Red rim color in Replace mode for a neat effect. 137 | * Rim can be offset from the surface corners, combined with feature new hard rimlight edges are possible and better than the old hard edge mode. 138 | * UTS2 has a anti-rim light, this grows in intensity against light. Very powerful to fake ambience or fake subsurface scattering! Use it for skin effects or glossiness. 139 | * A bugfix for front and back rims stacking in two-face culling and in mirrors over the main UTS2. 140 | 141 | * World reflection. 142 | * Sample the world reflect cube and set roughness. 143 | * Currently acts as a grayscale mask for Rim lights. Use it make rims more lively by view angle or set rimlights for glossy appearance. 144 | 145 | 146 | 147 | * Matcap. Assign the matcap and enable. Settings allow extensive control of light mixing and texture scale. 148 | * Use matcap to fake: glossiness, metallics, reflection, etc. 149 | * For matcap that look like specular or rim lights please use the above effects for a better dynamic result. Use matcap for reflection and iridescence maps. 150 | * My fork adopts v2.0.5+ matcap with the camera pan correction. 151 | 152 | 153 | 154 | * Emission. A mask texture and color texture as well as a HDR color pick for intensity. 155 | 156 | 157 | * "LightColor" switches, these make each effect follow the world lighting or stay static, use it for a unlit mode that reacts to light attenuation. 158 | 159 | 160 | 161 | * Outlines. Are shader pass based and not geometry. In concept outlines change thickness by distance to camera. You adjust the near and far range in object space (it scales to the object size regardless of world space rescale) 162 | * Outlines match the alpha of the albedo texture when shader is alpha type. 163 | * There is a minimal shadow blackness setting to remove shadow casts on the outlines. 164 | 165 | 166 | 167 | * Stencil settings are all combined into a list. 168 | * NOTICE: Feature is incomplete from the GUI. I recommend using ThryEditor for setting a custom queue, as you will have to make sure the mask appears in queue before the pass threw shader. 169 | * To setup eyes passing over hair: 170 | Mark you eyes with and queue before hair: 171 | Stencil { 172 | Ref[_StencilNo] 173 | Comp Always 174 | Pass Replace 175 | Fail Replace 176 | } 177 | Mark your hair with and queue after eyes: 178 | Stencil { 179 | Ref[_StencilNo] 180 | Comp NotEqual 181 | Pass Keep 182 | Fail Keep 183 | } 184 | 185 | 186 | 187 | 188 | 189 | 190 | # Shader file usage and render error avoidances. 191 | Start by using the no-outlines version for best performance (outlines are extra passes. So i typically use it for non alpha or skin materials). 192 | * Your default shader is: ToonColor_DoubleShadeWithFeather. 193 | * Your clipping shader is: ToonColor_DoubleShadeWithFeather_ClippingCutout. 194 | * Your transparency is ToonColor_DoubleShadeWithFeather_TransClippingFade.shader 195 | 196 | I use dither cutout alpha. It should be able to handle any alpha texture and mesh layering after a bit of calibration in the settings. You only pay the cost of a screenspace pattern and quality improves as you raise MSAA or screen resolution. 197 | 198 | 199 | 200 | # Limitations of alpha. 201 | True transparency queue shaders will not have z sorting issues, however the unity engine cannot do shadow receiving and thus dynamic toon ramps will be full bright. I made my fork use dithered cutout with alpha as a solution. 202 | 203 | 204 | 205 | # Color balancing and map bloom control. 206 | Its really easy to get the stack of effects in UTS2 to overbright. Basically dont use full white color tints on effects. 207 | I recommend installing unity post processing stack in your scene with bloom on and watch when bloom is too strong with a default directional light and ambience. 208 | Bloom happens when HRD color values goes higher than 110% and you should know many maps like to push lights above this value in vrchat! 209 | 210 | So to limit blooming make your toon ramps darker than 95% luminance. Set your base color ramp to (0.95, 0.95, 0.95, 1) and go down brightness in the shadows. You will be fairly resistant to over brighting in maps and its a good average to how lambart darking in Standard shader averages. 211 | 212 | To control specular effects you actually can go higher than 100%, just watch the bloom. 213 | 214 | If you come across very badly lit shadows in vrchat maps there is a way to compensate. Increase the "minimal shadow caster blackness" from 0 (which is natural). 215 | 216 | 217 | 218 | # Outlines setup. 219 | Please default your outline color to 50% bright and balance from there. Please Use outlines with Opaque mode only. 220 | 221 | 222 | 223 | 224 | # Bugs: 225 | Please send issue reports to my github page. 226 | 227 | Some vrchat maps are setup light incorrectly, in a perfect world they obey unity's light models, where direct lights (dynamics and shadows) are counter balanced by indirect lights (ambient) and reflection sources, and correct post processing for HDR practices. 228 | 229 | If you come across a map too bright or shadows too black, please contact the author and promptly yell until they fix it on standard shader. For maps where standard shader avatars looks fine and UTS does not i will be interested in debugging. Provide me with the map name and author to visit. 230 | 231 | Outlines have an outstanding shadow caster bug. Directional light shadows bleed threw the outlines. Fixing will need a geometry in shadow caster rewrite. 232 | 233 | Stencil currently requires manual file editing. 234 | 235 | Is your model pure black when you apply UTS2? Default your model import settings: You want unity to calculate tangent normals. 236 | 237 | 238 | 239 | 240 | 241 | 242 | # Support credits to: 243 | Noe, TCL, June, Cubed, Silent, RetroGeo, Xiexe, Mel0n, Cibbi, Hakanai, Neitri, 1001, Kaj, Error.mdl, d4rkpl4y3r, poiyomi, Thryrallo, many more. 244 | 245 | 246 | 247 | 248 | 249 | 250 | # Hosting site: 251 | 252 | https://github.com/ACIIL/UnityChanToonShaderVer2_Project 253 | 254 | A fork of: 255 | 256 | https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project 257 | 258 | 259 | 260 | 261 | 262 | 263 | # License: 264 | I inherent the Unity-Chan Toon Shader license (UCL2_0). In addition if you use my forks separate methods or tips please credit towards my github and name; I really appreciate citation and i will do the same. Contact me by discord or twitter if you want to sort out what of this code is fully my work or UTS2 original. 265 | 266 | Unity-Chan Toon Shader 2.0 is provided under the Unity-Chan License 2.0 terms. 267 | Please refer to the following link for information regarding the Unity-Chan License. 268 | http://unity-chan.com/contents/guideline_en/ 269 | 270 | 271 | --------------------------------------------------------------- 272 | --------------------------------------------------------------------------------