Guest User

Untitled

a guest
Jan 14th, 2018
208
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "MK/Toon/Free"
  2. {
  3.     Properties
  4.     {
  5.         //Main
  6.         _Color ("Color", Color) = (1,1,1,1)
  7.         _MainTex ("Color (RGB)", 2D) = "white"{}
  8.        
  9.         //Normalmap
  10.         _BumpMap ("Normalmap", 2D) = "bump" {}
  11.  
  12.         //Light
  13.         _LightThreshold("LightThreshold", Range (0.01, 1)) = 0.3
  14.  
  15.         //Render
  16.         _LightSmoothness ("Light Smoothness", Range(0,1)) = 0
  17.         _RimSmoothness ("Rim Smoothness", Range(0,1)) = 0.5
  18.  
  19.         //Custom shadow
  20.         _ShadowColor ("Shadow Color", Color) = (0.25,0.25,0.25,0.5)
  21.         _HighlightColor ("Highlight Color", Color) = (1.0, 1.0, 1.0, 1.0)
  22.         _ShadowIntensity("Shadow Intensity", Range (0.0, 2.0)) = 1.0
  23.  
  24.         //Outline
  25.         _OutlineColor ("Outline Color", Color) = (0,0,0,1.0)
  26.         _OutlineSize ("Outline Size", Float) = 0.02
  27.  
  28.         //Rim
  29.         _RimColor ("Rim Color", Color) = (1,1,1,1)
  30.         _RimSize ("Rim Size", Range(0.0,3.0)) = 1.5
  31.         _RimIntensity("Intensity", Range (0, 1)) = 0.5
  32.  
  33.         //Specular
  34.         _Shininess ("Shininess",  Range (0.01, 1)) = 0.275
  35.         _SpecColor ("Specular Color", Color) = (1,1,1,0.5)
  36.         _SpecularIntensity("Intensity", Range (0, 1)) = 0.5
  37.  
  38.         //Emission
  39.         _EmissionColor("Emission Color", Color) = (0,0,0)
  40.  
  41.         //Editor
  42.         [HideInInspector] _MKEditorShowMainBehavior ("Main Behavior", int) = 1
  43.         [HideInInspector] _MKEditorShowDetailBehavior ("Detail Behavior", int) = 0
  44.         [HideInInspector] _MKEditorShowLightBehavior ("Light Behavior", int) = 0
  45.         [HideInInspector] _MKEditorShowShadowBehavior ("Shadow Behavior", int) = 0
  46.         [HideInInspector] _MKEditorShowRenderBehavior ("Render Behavior", int) = 0
  47.         [HideInInspector] _MKEditorShowSpecularBehavior ("Specular Behavior", int) = 0
  48.         [HideInInspector] _MKEditorShowTranslucentBehavior ("Translucent Behavior", int) = 0
  49.         [HideInInspector] _MKEditorShowRimBehavior ("Rim Behavior", int) = 0
  50.         [HideInInspector] _MKEditorShowReflectionBehavior ("Reflection Behavior", int) = 0
  51.         [HideInInspector] _MKEditorShowDissolveBehavior ("Dissolve Behavior", int) = 0
  52.         [HideInInspector] _MKEditorShowOutlineBehavior ("Outline Behavior", int) = 0
  53.         [HideInInspector] _MKEditorShowSketchBehavior ("Sketch Behavior", int) = 0
  54.     }
  55.     SubShader
  56.     {
  57.         LOD 300
  58.         Tags {"RenderType"="Opaque" "PerformanceChecks"="False"}
  59.  
  60.         /////////////////////////////////////////////////////////////////////////////////////////////
  61.         // FORWARD BASE
  62.         /////////////////////////////////////////////////////////////////////////////////////////////
  63.         Pass
  64.         {
  65.             Tags { "LightMode" = "ForwardBase" }
  66.             Name "FORWARDBASE"
  67.             Cull Back
  68.             Blend One Zero
  69.             ZWrite On
  70.             ZTest LEqual
  71.  
  72.             CGPROGRAM
  73.             #pragma target 3.0
  74.             #pragma vertex vertfwd
  75.             #pragma fragment fragfwd
  76.  
  77.             #pragma multi_compile_fog
  78.             #pragma multi_compile_fwdbase
  79.             #pragma fragmentoption ARB_precision_hint_fastest
  80.  
  81.             #include "Inc/Forward/MKToonForwardBaseSetup.cginc"
  82.             #include "Inc/Forward/MKToonForward.cginc"
  83.            
  84.             ENDCG
  85.         }
  86.  
  87.         /////////////////////////////////////////////////////////////////////////////////////////////
  88.         // FORWARD ADD
  89.         /////////////////////////////////////////////////////////////////////////////////////////////
  90.         Pass
  91.         {
  92.             Tags { "LightMode" = "ForwardAdd" }
  93.             Name "FORWARDADD"
  94.             Cull Back
  95.             Blend One One
  96.             ZWrite Off
  97.             ZTest LEqual
  98.             Fog { Color (0,0,0,0) }
  99.  
  100.             CGPROGRAM
  101.             #pragma target 3.0
  102.  
  103.             #pragma vertex vertfwd
  104.             #pragma fragment fragfwd
  105.  
  106.             #pragma multi_compile_fog
  107.             #pragma multi_compile_fwdadd_fullshadows
  108.             #pragma fragmentoption ARB_precision_hint_fastest
  109.  
  110.             #include "Inc/Forward/MKToonForwardAddSetup.cginc"
  111.             #include "Inc/Forward/MKToonForward.cginc"
  112.            
  113.             ENDCG
  114.         }
  115.  
  116.         /////////////////////////////////////////////////////////////////////////////////////////////
  117.         // SHADOWCASTER
  118.         /////////////////////////////////////////////////////////////////////////////////////////////
  119.         Pass
  120.         {
  121.             Name "ShadowCaster"
  122.             Tags { "LightMode" = "ShadowCaster" }
  123.  
  124.             ZWrite On ZTest LEqual Cull Off
  125.             Offset 1, 1
  126.  
  127.             CGPROGRAM
  128.             #pragma target 3.0
  129.             #pragma fragmentoption ARB_precision_hint_fastest
  130.             #pragma multi_compile_shadowcaster
  131.  
  132.             #pragma vertex vertShadowCaster
  133.             #pragma fragment fragShadowCaster
  134.  
  135.             #include "Inc/ShadowCaster/MKToonShadowCasterSetup.cginc"
  136.             #include "Inc/ShadowCaster/MKToonShadowCaster.cginc"
  137.  
  138.             ENDCG
  139.         }
  140.  
  141.         /////////////////////////////////////////////////////////////////////////////////////////////
  142.         // META
  143.         /////////////////////////////////////////////////////////////////////////////////////////////
  144.         UsePass "Standard/META"
  145.  
  146.         /////////////////////////////////////////////////////////////////////////////////////////////
  147.         // OUTLINE
  148.         /////////////////////////////////////////////////////////////////////////////////////////////
  149.         Pass
  150.         {
  151.             LOD 300
  152.             Tags {"LightMode" = "Always"}
  153.             Name "OUTLINE_SM_3_0"
  154.             Cull Front
  155.             Blend One Zero
  156.             ZWrite On
  157.             ZTest LEqual
  158.  
  159.             CGPROGRAM
  160.             #pragma target 3.0
  161.             #pragma vertex outlinevert
  162.             #pragma fragment outlinefrag
  163.             #pragma fragmentoption ARB_precision_hint_fastest
  164.  
  165.             #pragma multi_compile_fog
  166.  
  167.             #include "/Inc/Outline/MKToonOutlineOnlySetup.cginc"
  168.             #include "/Inc/Outline/MKToonOutlineOnlyBase.cginc"
  169.             ENDCG
  170.         }
  171.     }
  172.     FallBack "Hidden/MK/Toon/FreeMobile"
  173.     CustomEditor "MK.Toon.MKToonFreeEditor"
  174. }
RAW Paste Data