WTGame-Scene-AtomSphere_A.shader 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "WTGame/Scene/AtomSphere_A" {
  3. Properties {
  4. _Color("Main Color",Color) = (1,1,1,1)
  5. _XSpeed("XSpeed",float) = 0
  6. _MainTex ("Particle Texture", 2D) = "white" {}
  7. _MaskTex ("Mask Texture", 2D) = "white" {}
  8. }
  9. SubShader {
  10. Tags { "Queue"="Transparent-10" "IgnoreProjector"="True" }
  11. Fog { Mode Off }
  12. Blend SrcAlpha One
  13. Cull Off
  14. ZWrite Off
  15. pass
  16. {
  17. CGPROGRAM
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. #include "UnityCG.cginc"
  21. half _XSpeed;
  22. fixed4 _Color;
  23. sampler2D _MainTex;
  24. sampler2D _MaskTex;
  25. float4 _MaskTex_ST;
  26. float4 _MainTex_ST;
  27. struct appdata
  28. {
  29. float4 vertex : POSITION;
  30. half2 texcoord : TEXCOORD0;
  31. half2 maskcoord : TEXCOORD1;
  32. };
  33. struct v2f {
  34. half4 vertex:SV_POSITION;
  35. half2 texcoord:TEXCOORD0;
  36. half2 maskCoord:TEXCOORD1;
  37. };
  38. v2f vert (appdata v)
  39. {
  40. v2f o;
  41. o.vertex = UnityObjectToClipPos (v.vertex);
  42. o.maskCoord = TRANSFORM_TEX(v.maskcoord, _MaskTex);
  43. o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
  44. return o;
  45. }
  46. fixed4 frag(v2f i):COLOR
  47. {
  48. fixed4 msk = tex2D(_MaskTex, i.maskCoord);
  49. fixed4 tex = tex2D(_MainTex, i.texcoord + float2(_Time.x * _XSpeed,0));
  50. fixed4 c = fixed4(_Color.rgb * tex.rgb * tex.a,1) * msk * 2.5;
  51. c.a = saturate(c.a);
  52. return c;
  53. }
  54. ENDCG
  55. }
  56. }
  57. }