xulie.shader 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "xulie"
  4. {
  5. Properties
  6. {
  7. _TextureSample0("Texture Sample 0", 2D) = "white" {}
  8. _UV("UV", Vector) = (2,2,0,0)
  9. _Float0("Float 0", Float) = 8.63
  10. _Color0("Color 0", Color) = (1,1,1,0)
  11. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  12. [HideInInspector] __dirty( "", Int ) = 1
  13. }
  14. SubShader
  15. {
  16. Tags{ "RenderType" = "Transparent" "Queue" = "Geometry+0" "IsEmissive" = "true" }
  17. Cull Back
  18. Blend SrcAlpha OneMinusSrcAlpha , SrcAlpha OneMinusSrcAlpha
  19. CGINCLUDE
  20. #include "UnityShaderVariables.cginc"
  21. #include "UnityPBSLighting.cginc"
  22. #include "Lighting.cginc"
  23. #pragma target 3.0
  24. struct Input
  25. {
  26. float2 uv_texcoord;
  27. };
  28. uniform float4 _Color0;
  29. uniform sampler2D _TextureSample0;
  30. uniform float2 _UV;
  31. uniform float _Float0;
  32. SamplerState sampler_TextureSample0;
  33. inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
  34. {
  35. return half4 ( 0, 0, 0, s.Alpha );
  36. }
  37. void surf( Input i , inout SurfaceOutput o )
  38. {
  39. float temp_output_4_0_g1 = _UV.x;
  40. float temp_output_5_0_g1 = _UV.y;
  41. float2 appendResult7_g1 = (float2(temp_output_4_0_g1 , temp_output_5_0_g1));
  42. float totalFrames39_g1 = ( temp_output_4_0_g1 * temp_output_5_0_g1 );
  43. float2 appendResult8_g1 = (float2(totalFrames39_g1 , temp_output_5_0_g1));
  44. float mulTime7 = _Time.y * _Float0;
  45. float clampResult42_g1 = clamp( 0.0 , 0.0001 , ( totalFrames39_g1 - 1.0 ) );
  46. float temp_output_35_0_g1 = frac( ( ( mulTime7 + clampResult42_g1 ) / totalFrames39_g1 ) );
  47. float2 appendResult29_g1 = (float2(temp_output_35_0_g1 , ( 1.0 - temp_output_35_0_g1 )));
  48. float2 temp_output_15_0_g1 = ( ( i.uv_texcoord / appendResult7_g1 ) + ( floor( ( appendResult8_g1 * appendResult29_g1 ) ) / appendResult7_g1 ) );
  49. float4 tex2DNode3 = tex2D( _TextureSample0, temp_output_15_0_g1 );
  50. o.Emission = ( _Color0 * tex2DNode3 ).rgb;
  51. o.Alpha = ( _Color0.a * tex2DNode3.a );
  52. }
  53. ENDCG
  54. CGPROGRAM
  55. #pragma surface surf Unlit keepalpha fullforwardshadows
  56. ENDCG
  57. Pass
  58. {
  59. Name "ShadowCaster"
  60. Tags{ "LightMode" = "ShadowCaster" }
  61. ZWrite On
  62. CGPROGRAM
  63. #pragma vertex vert
  64. #pragma fragment frag
  65. #pragma target 3.0
  66. #pragma multi_compile_shadowcaster
  67. #pragma multi_compile UNITY_PASS_SHADOWCASTER
  68. #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
  69. #include "HLSLSupport.cginc"
  70. #if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
  71. #define CAN_SKIP_VPOS
  72. #endif
  73. #include "UnityCG.cginc"
  74. #include "Lighting.cginc"
  75. #include "UnityPBSLighting.cginc"
  76. sampler3D _DitherMaskLOD;
  77. struct v2f
  78. {
  79. V2F_SHADOW_CASTER;
  80. float2 customPack1 : TEXCOORD1;
  81. float3 worldPos : TEXCOORD2;
  82. UNITY_VERTEX_INPUT_INSTANCE_ID
  83. UNITY_VERTEX_OUTPUT_STEREO
  84. };
  85. v2f vert( appdata_full v )
  86. {
  87. v2f o;
  88. UNITY_SETUP_INSTANCE_ID( v );
  89. UNITY_INITIALIZE_OUTPUT( v2f, o );
  90. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
  91. UNITY_TRANSFER_INSTANCE_ID( v, o );
  92. Input customInputData;
  93. float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
  94. half3 worldNormal = UnityObjectToWorldNormal( v.normal );
  95. o.customPack1.xy = customInputData.uv_texcoord;
  96. o.customPack1.xy = v.texcoord;
  97. o.worldPos = worldPos;
  98. TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
  99. return o;
  100. }
  101. half4 frag( v2f IN
  102. #if !defined( CAN_SKIP_VPOS )
  103. , UNITY_VPOS_TYPE vpos : VPOS
  104. #endif
  105. ) : SV_Target
  106. {
  107. UNITY_SETUP_INSTANCE_ID( IN );
  108. Input surfIN;
  109. UNITY_INITIALIZE_OUTPUT( Input, surfIN );
  110. surfIN.uv_texcoord = IN.customPack1.xy;
  111. float3 worldPos = IN.worldPos;
  112. half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
  113. SurfaceOutput o;
  114. UNITY_INITIALIZE_OUTPUT( SurfaceOutput, o )
  115. surf( surfIN, o );
  116. #if defined( CAN_SKIP_VPOS )
  117. float2 vpos = IN.pos;
  118. #endif
  119. half alphaRef = tex3D( _DitherMaskLOD, float3( vpos.xy * 0.25, o.Alpha * 0.9375 ) ).a;
  120. clip( alphaRef - 0.01 );
  121. SHADOW_CASTER_FRAGMENT( IN )
  122. }
  123. ENDCG
  124. }
  125. }
  126. Fallback "Diffuse"
  127. CustomEditor "ASEMaterialInspector"
  128. }
  129. /*ASEBEGIN
  130. Version=18703
  131. 0;40;1906;979;1043.3;476.5715;1;True;True
  132. Node;AmplifyShaderEditor.RangedFloatNode;4;-813.2998,225.9285;Inherit;False;Property;_Float0;Float 0;3;0;Create;True;0;0;False;0;False;8.63;24.04;0;0;0;1;FLOAT;0
  133. Node;AmplifyShaderEditor.SimpleTimeNode;7;-604.2998,318.9285;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
  134. Node;AmplifyShaderEditor.Vector2Node;6;-697.2998,45.92853;Inherit;False;Property;_UV;UV;2;0;Create;True;0;0;False;0;False;2,2;6,3;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
  135. Node;AmplifyShaderEditor.FunctionNode;1;-432,18.5;Inherit;False;Flipbook;-1;;1;53c2488c220f6564ca6c90721ee16673;2,71,0,68,0;8;51;SAMPLER2D;0.0;False;13;FLOAT2;0,0;False;4;FLOAT;3;False;5;FLOAT;3;False;24;FLOAT;0;False;2;FLOAT;0;False;55;FLOAT;0;False;70;FLOAT;0;False;5;COLOR;53;FLOAT2;0;FLOAT;47;FLOAT;48;FLOAT;62
  136. Node;AmplifyShaderEditor.SamplerNode;3;-121,-27.5;Inherit;True;Property;_TextureSample0;Texture Sample 0;1;0;Create;True;0;0;False;0;False;-1;a9bb09faa9ba6e042a0c2641aa15d8ed;51424aa40bbaa584b82186503734d1a0;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  137. Node;AmplifyShaderEditor.ColorNode;9;-78.30005,-242.5715;Inherit;False;Property;_Color0;Color 0;4;0;Create;True;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  138. Node;AmplifyShaderEditor.RangedFloatNode;8;-784.2998,349.9285;Inherit;False;Constant;_Float1;Float 1;3;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
  139. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;255.7,-185.5715;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  140. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;338.7,26.4285;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  141. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;518,-100;Float;False;True;-1;2;ASEMaterialInspector;0;0;Unlit;xulie;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0.5;True;True;0;True;Transparent;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;2;5;False;-1;10;False;-1;2;5;False;-1;10;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;False;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
  142. WireConnection;7;0;4;0
  143. WireConnection;1;4;6;1
  144. WireConnection;1;5;6;2
  145. WireConnection;1;2;7;0
  146. WireConnection;3;1;1;0
  147. WireConnection;10;0;9;0
  148. WireConnection;10;1;3;0
  149. WireConnection;11;0;9;4
  150. WireConnection;11;1;3;4
  151. WireConnection;0;2;10;0
  152. WireConnection;0;9;11;0
  153. ASEEND*/
  154. //CHKSM=D78C3F0C556207D81770D09363A018456A01B0A0