Pipe.shader 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 
  2. Shader "Custom/Pipe"
  3. {
  4. Properties
  5. {
  6. _Cutoff("Mask Clip Value", Float) = 0.5
  7. _Speed("Speed", Range(0 , 150)) = 0.01
  8. _MainTex("MainTex", 2D) = "white" {}
  9. _Number("Number", Range(0 , 100)) = 3.082893
  10. [HideInInspector] _texcoord("", 2D) = "white" {}
  11. [HideInInspector] __dirty("", Int) = 1
  12. }
  13. SubShader
  14. {
  15. Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" }
  16. Cull Back
  17. CGPROGRAM
  18. #include "UnityShaderVariables.cginc"
  19. #pragma target 3.0
  20. #pragma surface surf Standard keepalpha addshadow fullforwardshadows
  21. struct Input
  22. {
  23. float2 uv_texcoord;
  24. };
  25. uniform sampler2D _MainTex;
  26. uniform float _Speed;
  27. uniform float _Number;
  28. uniform float _Cutoff = 0.5;
  29. void surf(Input i , inout SurfaceOutputStandard o)
  30. {
  31. float2 temp_cast_0 = (_Number).xx;
  32. float2 uv_TexCoord158 = -i.uv_texcoord * temp_cast_0;
  33. float4 tex2DNode174 = tex2D(_MainTex, ((_Speed * _Time) + uv_TexCoord158.x).xy);
  34. o.Albedo = tex2DNode174.rgb;
  35. o.Alpha = 1;
  36. clip(tex2DNode174.a - _Cutoff);
  37. }
  38. ENDCG
  39. }
  40. Fallback "Diffuse"
  41. }