FT_Additive.shader 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
  2. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  3. // Shader created with Shader Forge v1.04
  4. // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
  5. // Note: Manually altering this data may prevent you from opening it in Shader Forge
  6. /*SF_DATA;ver:1.04;sub:START;pass:START;ps:flbk:,lico:1,lgpr:1,nrmq:1,limd:0,uamb:True,mssp:True,lmpd:False,lprd:False,rprd:False,enco:False,frtr:True,vitr:True,dbil:False,rmgx:True,rpth:0,hqsc:True,hqlp:False,tesm:0,blpr:2,bsrc:0,bdst:0,culm:2,dpts:2,wrdp:False,dith:2,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:1457,x:33741,y:32634,varname:node_1457,prsc:2|normal-5334-RGB,emission-5761-OUT,custl-9525-OUT,alpha-2230-A,clip-6138-OUT,voffset-5205-OUT;n:type:ShaderForge.SFN_Tex2d,id:2230,x:31891,y:32819,ptovrint:False,ptlb:Texture,ptin:_Texture,varname:node_2230,prsc:2,tex:975b322382a24d644b37616b357e5103,ntxv:0,isnm:False|UVIN-6898-OUT;n:type:ShaderForge.SFN_Color,id:5327,x:32132,y:32537,ptovrint:False,ptlb:MainColor,ptin:_MainColor,varname:node_5327,prsc:2,glob:False,c1:1,c2:0.3529412,c3:0,c4:1;n:type:ShaderForge.SFN_Multiply,id:316,x:32493,y:32832,varname:node_316,prsc:2|A-2230-RGB,B-8967-OUT,C-5327-RGB;n:type:ShaderForge.SFN_ValueProperty,id:8967,x:32493,y:32713,ptovrint:False,ptlb:Emission,ptin:_Emission,varname:node_8967,prsc:2,glob:False,v1:16;n:type:ShaderForge.SFN_Multiply,id:7443,x:32438,y:33018,varname:node_7443,prsc:2|A-2230-R,B-2495-OUT;n:type:ShaderForge.SFN_Slider,id:2495,x:31808,y:33332,ptovrint:False,ptlb:AlphaClipAnimation,ptin:_AlphaClipAnimation,varname:node_2495,prsc:2,min:10,cur:1,max:0;n:type:ShaderForge.SFN_Vector1,id:2212,x:32368,y:33333,varname:node_2212,prsc:2,v1:0.1;n:type:ShaderForge.SFN_Add,id:7287,x:32637,y:33025,varname:node_7287,prsc:2|A-7443-OUT,B-4367-OUT;n:type:ShaderForge.SFN_Multiply,id:4367,x:32506,y:33180,varname:node_4367,prsc:2|A-2495-OUT,B-2212-OUT;n:type:ShaderForge.SFN_Add,id:4922,x:31009,y:32868,varname:node_4922,prsc:2|A-5795-UVOUT,B-347-OUT;n:type:ShaderForge.SFN_TexCoord,id:5795,x:30781,y:32666,varname:node_5795,prsc:2,uv:0;n:type:ShaderForge.SFN_Multiply,id:347,x:30819,y:32941,varname:node_347,prsc:2|A-4332-OUT,B-6096-T;n:type:ShaderForge.SFN_Append,id:4332,x:30645,y:32847,varname:node_4332,prsc:2|A-1583-OUT,B-4507-OUT;n:type:ShaderForge.SFN_Time,id:6096,x:30589,y:33064,varname:node_6096,prsc:2;n:type:ShaderForge.SFN_SwitchProperty,id:3552,x:31189,y:32821,ptovrint:False,ptlb:Use_Panner,ptin:_Use_Panner,varname:node_3552,prsc:2,on:False|A-5795-UVOUT,B-4922-OUT;n:type:ShaderForge.SFN_ValueProperty,id:1583,x:30460,y:32823,ptovrint:False,ptlb:PannerSpeed_X,ptin:_PannerSpeed_X,varname:node_1583,prsc:2,glob:False,v1:0;n:type:ShaderForge.SFN_ValueProperty,id:4507,x:30437,y:32960,ptovrint:False,ptlb:PannerSpeed_Y,ptin:_PannerSpeed_Y,varname:node_4507,prsc:2,glob:False,v1:0;n:type:ShaderForge.SFN_Vector1,id:1314,x:32707,y:32949,varname:node_1314,prsc:2,v1:1;n:type:ShaderForge.SFN_SwitchProperty,id:6138,x:33088,y:33009,ptovrint:False,ptlb:Use_AlphaClip,ptin:_Use_AlphaClip,varname:node_6138,prsc:2,on:False|A-1314-OUT,B-7287-OUT;n:type:ShaderForge.SFN_VertexColor,id:3762,x:33027,y:32494,varname:node_3762,prsc:2;n:type:ShaderForge.SFN_Multiply,id:9525,x:33230,y:32614,varname:node_9525,prsc:2|A-316-OUT,B-3762-RGB;n:type:ShaderForge.SFN_SwitchProperty,id:5205,x:33274,y:33634,ptovrint:False,ptlb:Use_Displace,ptin:_Use_Displace,varname:node_5670,prsc:2,on:False|A-4848-OUT,B-198-OUT;n:type:ShaderForge.SFN_Vector1,id:4848,x:33078,y:33647,varname:node_4848,prsc:2,v1:0;n:type:ShaderForge.SFN_NormalVector,id:8039,x:33154,y:33879,prsc:2,pt:False;n:type:ShaderForge.SFN_Multiply,id:198,x:33366,y:33774,varname:node_198,prsc:2|A-2230-RGB,B-7013-OUT,C-8039-OUT;n:type:ShaderForge.SFN_ValueProperty,id:7013,x:33154,y:34060,ptovrint:False,ptlb:DisplaceStrength,ptin:_DisplaceStrength,varname:node_9298,prsc:2,glob:False,v1:0.3;n:type:ShaderForge.SFN_Fresnel,id:2790,x:32821,y:32136,varname:node_2790,prsc:2|EXP-3614-OUT;n:type:ShaderForge.SFN_ValueProperty,id:3614,x:32599,y:32233,ptovrint:False,ptlb:Fresnel_Range,ptin:_Fresnel_Range,varname:node_3614,prsc:2,glob:False,v1:5;n:type:ShaderForge.SFN_Color,id:7002,x:32803,y:32330,ptovrint:False,ptlb:FresnelColor,ptin:_FresnelColor,varname:node_7002,prsc:2,glob:False,c1:0.4411765,c2:0.6794984,c3:1,c4:1;n:type:ShaderForge.SFN_Multiply,id:5761,x:33364,y:32230,varname:node_5761,prsc:2|A-2790-OUT,B-7002-RGB,C-7155-OUT;n:type:ShaderForge.SFN_ValueProperty,id:2338,x:32791,y:32504,ptovrint:False,ptlb:Fresnel_Emission,ptin:_Fresnel_Emission,varname:node_2338,prsc:2,glob:False,v1:1;n:type:ShaderForge.SFN_SwitchProperty,id:7155,x:33132,y:32363,ptovrint:False,ptlb:Use_Fresnel,ptin:_Use_Fresnel,varname:node_7155,prsc:2,on:True|A-1336-OUT,B-2338-OUT;n:type:ShaderForge.SFN_Vector1,id:1336,x:32771,y:32574,varname:node_1336,prsc:2,v1:0;n:type:ShaderForge.SFN_Tex2d,id:5334,x:31808,y:33079,ptovrint:False,ptlb:Normal,ptin:_Normal,varname:node_5334,prsc:2,ntxv:3,isnm:True|UVIN-3552-OUT;n:type:ShaderForge.SFN_SwitchProperty,id:6898,x:31481,y:32731,ptovrint:False,ptlb:Use_UVanim,ptin:_Use_UVanim,varname:node_6898,prsc:2,on:False|A-3552-OUT,B-1192-OUT;n:type:ShaderForge.SFN_Add,id:1192,x:31167,y:33422,varname:node_1192,prsc:2|A-2868-OUT,B-6988-OUT;n:type:ShaderForge.SFN_Append,id:6988,x:30986,y:33491,varname:node_6988,prsc:2|A-3830-OUT,B-4307-OUT;n:type:ShaderForge.SFN_OneMinus,id:4307,x:30801,y:33597,varname:node_4307,prsc:2|IN-667-OUT;n:type:ShaderForge.SFN_Divide,id:667,x:30617,y:33597,varname:node_667,prsc:2|A-1062-OUT,B-7229-OUT;n:type:ShaderForge.SFN_Floor,id:1062,x:30409,y:33597,varname:node_1062,prsc:2|IN-6290-OUT;n:type:ShaderForge.SFN_ValueProperty,id:1054,x:29523,y:33345,ptovrint:False,ptlb:UV_Rows,ptin:_UV_Rows,varname:node_5095,prsc:2,glob:False,v1:4;n:type:ShaderForge.SFN_ValueProperty,id:7611,x:29512,y:33512,ptovrint:False,ptlb:UV_Columns,ptin:_UV_Columns,varname:node_3932,prsc:2,glob:False,v1:4;n:type:ShaderForge.SFN_Divide,id:6290,x:30230,y:33605,varname:node_6290,prsc:2|A-5475-OUT,B-5832-OUT;n:type:ShaderForge.SFN_Round,id:5475,x:30047,y:33558,varname:node_5475,prsc:2|IN-3644-OUT;n:type:ShaderForge.SFN_Multiply,id:3644,x:29889,y:33517,varname:node_3644,prsc:2|A-5481-OUT,B-2503-OUT;n:type:ShaderForge.SFN_Relay,id:5832,x:30117,y:33132,varname:node_5832,prsc:2|IN-1054-OUT;n:type:ShaderForge.SFN_Relay,id:7229,x:30105,y:33310,varname:node_7229,prsc:2|IN-7611-OUT;n:type:ShaderForge.SFN_Time,id:7610,x:29427,y:33746,varname:node_7610,prsc:2;n:type:ShaderForge.SFN_Multiply,id:1080,x:29617,y:33692,varname:node_1080,prsc:2|A-5649-OUT,B-7610-T;n:type:ShaderForge.SFN_ValueProperty,id:5649,x:29323,y:33695,ptovrint:False,ptlb:UV_AnimSpeed,ptin:_UV_AnimSpeed,varname:node_5671,prsc:2,glob:False,v1:1;n:type:ShaderForge.SFN_Frac,id:2503,x:29775,y:33715,varname:node_2503,prsc:2|IN-1080-OUT;n:type:ShaderForge.SFN_Multiply,id:5481,x:29702,y:33388,varname:node_5481,prsc:2|A-1054-OUT,B-7611-OUT;n:type:ShaderForge.SFN_Divide,id:2868,x:30986,y:33343,varname:node_2868,prsc:2|A-8598-UVOUT,B-3502-OUT;n:type:ShaderForge.SFN_TexCoord,id:8598,x:30986,y:33189,varname:node_8598,prsc:2,uv:0;n:type:ShaderForge.SFN_Append,id:3502,x:30782,y:33256,varname:node_3502,prsc:2|A-5832-OUT,B-7229-OUT;n:type:ShaderForge.SFN_Divide,id:3830,x:30782,y:33452,varname:node_3830,prsc:2|A-4966-OUT,B-5832-OUT;n:type:ShaderForge.SFN_Fmod,id:4966,x:30585,y:33446,varname:node_4966,prsc:2|A-5475-OUT,B-5832-OUT;proporder:5327-2230-5334-8967-6898-1054-7611-5649-3552-1583-4507-6138-2495-5205-7013-7155-7002-2338-3614;pass:END;sub:END;*/
  7. Shader "FT/FT_Additive" {
  8. Properties {
  9. _MainColor ("MainColor", Color) = (1,0.3529412,0,1)
  10. _Texture ("Texture", 2D) = "white" {}
  11. _Normal ("Normal", 2D) = "bump" {}
  12. _Emission ("Emission", Float ) = 16
  13. [MaterialToggle] _Use_UVanim ("Use_UVanim", Float ) = 0
  14. _UV_Rows ("UV_Rows", Float ) = 4
  15. _UV_Columns ("UV_Columns", Float ) = 4
  16. _UV_AnimSpeed ("UV_AnimSpeed", Float ) = 1
  17. [MaterialToggle] _Use_Panner ("Use_Panner", Float ) = 0
  18. _PannerSpeed_X ("PannerSpeed_X", Float ) = 0
  19. _PannerSpeed_Y ("PannerSpeed_Y", Float ) = 0
  20. [MaterialToggle] _Use_AlphaClip ("Use_AlphaClip", Float ) = 1
  21. _AlphaClipAnimation ("AlphaClipAnimation", Range(10, 0)) = 1
  22. [MaterialToggle] _Use_Displace ("Use_Displace", Float ) = 0
  23. _DisplaceStrength ("DisplaceStrength", Float ) = 0.3
  24. [MaterialToggle] _Use_Fresnel ("Use_Fresnel", Float ) = 1
  25. _FresnelColor ("FresnelColor", Color) = (0.4411765,0.6794984,1,1)
  26. _Fresnel_Emission ("Fresnel_Emission", Float ) = 1
  27. _Fresnel_Range ("Fresnel_Range", Float ) = 5
  28. [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  29. }
  30. SubShader {
  31. Tags {
  32. "IgnoreProjector"="True"
  33. "Queue"="Transparent"
  34. "RenderType"="Transparent"
  35. }
  36. Pass {
  37. Name "ForwardBase"
  38. Tags {
  39. "LightMode"="ForwardBase"
  40. }
  41. Blend One One
  42. Cull Off
  43. ZWrite Off
  44. CGPROGRAM
  45. #pragma vertex vert
  46. #pragma fragment frag
  47. #define UNITY_PASS_FORWARDBASE
  48. #include "UnityCG.cginc"
  49. #pragma multi_compile_fwdbase
  50. #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
  51. #pragma target 3.0
  52. #pragma glsl
  53. uniform float4 _TimeEditor;
  54. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  55. uniform float4 _MainColor;
  56. uniform float _Emission;
  57. uniform float _AlphaClipAnimation;
  58. uniform fixed _Use_Panner;
  59. uniform float _PannerSpeed_X;
  60. uniform float _PannerSpeed_Y;
  61. uniform fixed _Use_AlphaClip;
  62. uniform fixed _Use_Displace;
  63. uniform float _DisplaceStrength;
  64. uniform float _Fresnel_Range;
  65. uniform float4 _FresnelColor;
  66. uniform float _Fresnel_Emission;
  67. uniform fixed _Use_Fresnel;
  68. uniform sampler2D _Normal; uniform float4 _Normal_ST;
  69. uniform fixed _Use_UVanim;
  70. uniform float _UV_Rows;
  71. uniform float _UV_Columns;
  72. uniform float _UV_AnimSpeed;
  73. struct VertexInput {
  74. float4 vertex : POSITION;
  75. float3 normal : NORMAL;
  76. float4 tangent : TANGENT;
  77. float2 texcoord0 : TEXCOORD0;
  78. float4 vertexColor : COLOR;
  79. };
  80. struct VertexOutput {
  81. float4 pos : SV_POSITION;
  82. float2 uv0 : TEXCOORD0;
  83. float4 posWorld : TEXCOORD1;
  84. float3 normalDir : TEXCOORD2;
  85. float3 tangentDir : TEXCOORD3;
  86. float3 binormalDir : TEXCOORD4;
  87. float4 vertexColor : COLOR;
  88. };
  89. VertexOutput vert (VertexInput v) {
  90. VertexOutput o = (VertexOutput)0;
  91. o.uv0 = v.texcoord0;
  92. o.vertexColor = v.vertexColor;
  93. o.normalDir = mul(unity_ObjectToWorld, float4(v.normal,0)).xyz;
  94. o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
  95. o.binormalDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
  96. float4 node_6096 = _Time + _TimeEditor;
  97. float2 _Use_Panner_var = lerp( o.uv0, (o.uv0+(float2(_PannerSpeed_X,_PannerSpeed_Y)*node_6096.g)), _Use_Panner );
  98. float node_5832 = _UV_Rows;
  99. float node_7229 = _UV_Columns;
  100. float4 node_7610 = _Time + _TimeEditor;
  101. float node_5475 = round(((_UV_Rows*_UV_Columns)*frac((_UV_AnimSpeed*node_7610.g))));
  102. float2 _Use_UVanim_var = lerp( _Use_Panner_var, ((o.uv0/float2(node_5832,node_7229))+float2((fmod(node_5475,node_5832)/node_5832),(1.0 - (floor((node_5475/node_5832))/node_7229)))), _Use_UVanim );
  103. float4 _Texture_var = tex2Dlod(_Texture,float4(TRANSFORM_TEX(_Use_UVanim_var, _Texture),0.0,0));
  104. v.vertex.xyz += lerp( 0.0, (_Texture_var.rgb*_DisplaceStrength*v.normal), _Use_Displace );
  105. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  106. o.pos = UnityObjectToClipPos(v.vertex);
  107. return o;
  108. }
  109. fixed4 frag(VertexOutput i) : COLOR {
  110. i.normalDir = normalize(i.normalDir);
  111. float3x3 tangentTransform = float3x3( i.tangentDir, i.binormalDir, i.normalDir);
  112. /////// Vectors:
  113. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  114. float4 node_6096 = _Time + _TimeEditor;
  115. float2 _Use_Panner_var = lerp( i.uv0, (i.uv0+(float2(_PannerSpeed_X,_PannerSpeed_Y)*node_6096.g)), _Use_Panner );
  116. float3 _Normal_var = UnpackNormal(tex2D(_Normal,TRANSFORM_TEX(_Use_Panner_var, _Normal)));
  117. float3 normalLocal = _Normal_var.rgb;
  118. float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); // Perturbed normals
  119. float nSign = sign( dot( viewDirection, i.normalDir ) ); // Reverse normal if this is a backface
  120. i.normalDir *= nSign;
  121. normalDirection *= nSign;
  122. float node_5832 = _UV_Rows;
  123. float node_7229 = _UV_Columns;
  124. float4 node_7610 = _Time + _TimeEditor;
  125. float node_5475 = round(((_UV_Rows*_UV_Columns)*frac((_UV_AnimSpeed*node_7610.g))));
  126. float2 _Use_UVanim_var = lerp( _Use_Panner_var, ((i.uv0/float2(node_5832,node_7229))+float2((fmod(node_5475,node_5832)/node_5832),(1.0 - (floor((node_5475/node_5832))/node_7229)))), _Use_UVanim );
  127. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(_Use_UVanim_var, _Texture));
  128. clip(lerp( 1.0, ((_Texture_var.r*_AlphaClipAnimation)+(_AlphaClipAnimation*0.1)), _Use_AlphaClip ) - 0.5);
  129. ////// Lighting:
  130. ////// Emissive:
  131. float3 emissive = (pow(1.0-max(0,dot(normalDirection, viewDirection)),_Fresnel_Range)*_FresnelColor.rgb*lerp( 0.0, _Fresnel_Emission, _Use_Fresnel ));
  132. float3 finalColor = emissive + ((_Texture_var.rgb*_Emission*_MainColor.rgb)*i.vertexColor.rgb);
  133. return fixed4(finalColor,_Texture_var.a);
  134. }
  135. ENDCG
  136. }
  137. Pass {
  138. Name "ShadowCollector"
  139. Tags {
  140. "LightMode"="ShadowCollector"
  141. }
  142. Cull Off
  143. Fog {Mode Off}
  144. CGPROGRAM
  145. #pragma vertex vert
  146. #pragma fragment frag
  147. #define UNITY_PASS_SHADOWCOLLECTOR
  148. #define SHADOW_COLLECTOR_PASS
  149. #include "UnityCG.cginc"
  150. #include "Lighting.cginc"
  151. #pragma fragmentoption ARB_precision_hint_fastest
  152. #pragma multi_compile_shadowcollector
  153. #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
  154. #pragma target 3.0
  155. #pragma glsl
  156. uniform float4 _TimeEditor;
  157. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  158. uniform float _AlphaClipAnimation;
  159. uniform fixed _Use_Panner;
  160. uniform float _PannerSpeed_X;
  161. uniform float _PannerSpeed_Y;
  162. uniform fixed _Use_AlphaClip;
  163. uniform fixed _Use_Displace;
  164. uniform float _DisplaceStrength;
  165. uniform fixed _Use_UVanim;
  166. uniform float _UV_Rows;
  167. uniform float _UV_Columns;
  168. uniform float _UV_AnimSpeed;
  169. struct VertexInput {
  170. float4 vertex : POSITION;
  171. float3 normal : NORMAL;
  172. float2 texcoord0 : TEXCOORD0;
  173. };
  174. struct VertexOutput {
  175. V2F_SHADOW_COLLECTOR;
  176. float2 uv0 : TEXCOORD5;
  177. float3 normalDir : TEXCOORD6;
  178. };
  179. VertexOutput vert (VertexInput v) {
  180. VertexOutput o = (VertexOutput)0;
  181. o.uv0 = v.texcoord0;
  182. o.normalDir = mul(unity_ObjectToWorld, float4(v.normal,0)).xyz;
  183. float4 node_6096 = _Time + _TimeEditor;
  184. float2 _Use_Panner_var = lerp( o.uv0, (o.uv0+(float2(_PannerSpeed_X,_PannerSpeed_Y)*node_6096.g)), _Use_Panner );
  185. float node_5832 = _UV_Rows;
  186. float node_7229 = _UV_Columns;
  187. float4 node_7610 = _Time + _TimeEditor;
  188. float node_5475 = round(((_UV_Rows*_UV_Columns)*frac((_UV_AnimSpeed*node_7610.g))));
  189. float2 _Use_UVanim_var = lerp( _Use_Panner_var, ((o.uv0/float2(node_5832,node_7229))+float2((fmod(node_5475,node_5832)/node_5832),(1.0 - (floor((node_5475/node_5832))/node_7229)))), _Use_UVanim );
  190. float4 _Texture_var = tex2Dlod(_Texture,float4(TRANSFORM_TEX(_Use_UVanim_var, _Texture),0.0,0));
  191. v.vertex.xyz += lerp( 0.0, (_Texture_var.rgb*_DisplaceStrength*v.normal), _Use_Displace );
  192. o.pos = UnityObjectToClipPos(v.vertex);
  193. TRANSFER_SHADOW_COLLECTOR(o)
  194. return o;
  195. }
  196. fixed4 frag(VertexOutput i) : COLOR {
  197. i.normalDir = normalize(i.normalDir);
  198. /////// Vectors:
  199. float4 node_6096 = _Time + _TimeEditor;
  200. float2 _Use_Panner_var = lerp( i.uv0, (i.uv0+(float2(_PannerSpeed_X,_PannerSpeed_Y)*node_6096.g)), _Use_Panner );
  201. float node_5832 = _UV_Rows;
  202. float node_7229 = _UV_Columns;
  203. float4 node_7610 = _Time + _TimeEditor;
  204. float node_5475 = round(((_UV_Rows*_UV_Columns)*frac((_UV_AnimSpeed*node_7610.g))));
  205. float2 _Use_UVanim_var = lerp( _Use_Panner_var, ((i.uv0/float2(node_5832,node_7229))+float2((fmod(node_5475,node_5832)/node_5832),(1.0 - (floor((node_5475/node_5832))/node_7229)))), _Use_UVanim );
  206. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(_Use_UVanim_var, _Texture));
  207. clip(lerp( 1.0, ((_Texture_var.r*_AlphaClipAnimation)+(_AlphaClipAnimation*0.1)), _Use_AlphaClip ) - 0.5);
  208. SHADOW_COLLECTOR_FRAGMENT(i)
  209. }
  210. ENDCG
  211. }
  212. Pass {
  213. Name "ShadowCaster"
  214. Tags {
  215. "LightMode"="ShadowCaster"
  216. }
  217. Cull Off
  218. Offset 1, 1
  219. Fog {Mode Off}
  220. CGPROGRAM
  221. #pragma vertex vert
  222. #pragma fragment frag
  223. #define UNITY_PASS_SHADOWCASTER
  224. #include "UnityCG.cginc"
  225. #include "Lighting.cginc"
  226. #pragma fragmentoption ARB_precision_hint_fastest
  227. #pragma multi_compile_shadowcaster
  228. #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
  229. #pragma target 3.0
  230. #pragma glsl
  231. uniform float4 _TimeEditor;
  232. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  233. uniform float _AlphaClipAnimation;
  234. uniform fixed _Use_Panner;
  235. uniform float _PannerSpeed_X;
  236. uniform float _PannerSpeed_Y;
  237. uniform fixed _Use_AlphaClip;
  238. uniform fixed _Use_Displace;
  239. uniform float _DisplaceStrength;
  240. uniform fixed _Use_UVanim;
  241. uniform float _UV_Rows;
  242. uniform float _UV_Columns;
  243. uniform float _UV_AnimSpeed;
  244. struct VertexInput {
  245. float4 vertex : POSITION;
  246. float3 normal : NORMAL;
  247. float2 texcoord0 : TEXCOORD0;
  248. };
  249. struct VertexOutput {
  250. V2F_SHADOW_CASTER;
  251. float2 uv0 : TEXCOORD1;
  252. float3 normalDir : TEXCOORD2;
  253. };
  254. VertexOutput vert (VertexInput v) {
  255. VertexOutput o = (VertexOutput)0;
  256. o.uv0 = v.texcoord0;
  257. o.normalDir = mul(unity_ObjectToWorld, float4(v.normal,0)).xyz;
  258. float4 node_6096 = _Time + _TimeEditor;
  259. float2 _Use_Panner_var = lerp( o.uv0, (o.uv0+(float2(_PannerSpeed_X,_PannerSpeed_Y)*node_6096.g)), _Use_Panner );
  260. float node_5832 = _UV_Rows;
  261. float node_7229 = _UV_Columns;
  262. float4 node_7610 = _Time + _TimeEditor;
  263. float node_5475 = round(((_UV_Rows*_UV_Columns)*frac((_UV_AnimSpeed*node_7610.g))));
  264. float2 _Use_UVanim_var = lerp( _Use_Panner_var, ((o.uv0/float2(node_5832,node_7229))+float2((fmod(node_5475,node_5832)/node_5832),(1.0 - (floor((node_5475/node_5832))/node_7229)))), _Use_UVanim );
  265. float4 _Texture_var = tex2Dlod(_Texture,float4(TRANSFORM_TEX(_Use_UVanim_var, _Texture),0.0,0));
  266. v.vertex.xyz += lerp( 0.0, (_Texture_var.rgb*_DisplaceStrength*v.normal), _Use_Displace );
  267. o.pos = UnityObjectToClipPos(v.vertex);
  268. TRANSFER_SHADOW_CASTER(o)
  269. return o;
  270. }
  271. fixed4 frag(VertexOutput i) : COLOR {
  272. i.normalDir = normalize(i.normalDir);
  273. /////// Vectors:
  274. float4 node_6096 = _Time + _TimeEditor;
  275. float2 _Use_Panner_var = lerp( i.uv0, (i.uv0+(float2(_PannerSpeed_X,_PannerSpeed_Y)*node_6096.g)), _Use_Panner );
  276. float node_5832 = _UV_Rows;
  277. float node_7229 = _UV_Columns;
  278. float4 node_7610 = _Time + _TimeEditor;
  279. float node_5475 = round(((_UV_Rows*_UV_Columns)*frac((_UV_AnimSpeed*node_7610.g))));
  280. float2 _Use_UVanim_var = lerp( _Use_Panner_var, ((i.uv0/float2(node_5832,node_7229))+float2((fmod(node_5475,node_5832)/node_5832),(1.0 - (floor((node_5475/node_5832))/node_7229)))), _Use_UVanim );
  281. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(_Use_UVanim_var, _Texture));
  282. clip(lerp( 1.0, ((_Texture_var.r*_AlphaClipAnimation)+(_AlphaClipAnimation*0.1)), _Use_AlphaClip ) - 0.5);
  283. SHADOW_CASTER_FRAGMENT(i)
  284. }
  285. ENDCG
  286. }
  287. }
  288. FallBack "Diffuse"
  289. CustomEditor "ShaderForgeMaterialInspector"
  290. }