Mole_Particles_Alpha.shader 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Shader "MoleGame/Particles/Alpha" {
  2. Properties{
  3. _TintColor("Tint Color", Color) = (0.5,0.5,0.5,0.5)
  4. _MainTex("Particle Texture", 2D) = "white" {}
  5. //_InvFade("Soft Particles Factor", Range(0.01,3.0)) = 1.0
  6. //4 equal
  7. [HideInInspector] _StencilComp("Stencil Comparison", Float) = 8
  8. //2 ui mask
  9. [HideInInspector] _Stencil("Stencil ID", Float) = 0
  10. }
  11. Category{
  12. Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" }
  13. Stencil{
  14. Ref[_Stencil]
  15. Comp[_StencilComp]
  16. }
  17. Blend SrcAlpha OneMinusSrcAlpha
  18. //ColorMask RGB
  19. Cull Off Lighting Off ZWrite Off
  20. SubShader{
  21. Pass{
  22. CGPROGRAM
  23. #pragma vertex vert
  24. #pragma fragment frag
  25. #pragma target 2.0
  26. //#pragma multi_compile_particles
  27. //#pragma multi_compile_fog
  28. #include "UnityCG.cginc"
  29. sampler2D _MainTex;
  30. float4 _MainTex_ST;
  31. fixed4 _TintColor;
  32. struct appdata_t {
  33. float4 vertex : POSITION;
  34. fixed4 color : COLOR;
  35. float2 texcoord : TEXCOORD0;
  36. };
  37. struct v2f {
  38. float4 vertex : SV_POSITION;
  39. fixed4 color : COLOR;
  40. float2 texcoord : TEXCOORD0;
  41. };
  42. v2f vert(appdata_t v)
  43. {
  44. v2f o;
  45. o.vertex = UnityObjectToClipPos(v.vertex);
  46. o.color = v.color;
  47. o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
  48. return o;
  49. }
  50. fixed4 frag(v2f i) : SV_Target
  51. {
  52. fixed4 col = 2.0f * i.color * _TintColor * tex2D(_MainTex, i.texcoord);
  53. return col;
  54. }
  55. ENDCG
  56. }
  57. }
  58. }
  59. }