源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB

  1. Shader "MyShader/Illusion/Alpha" {
  2. Properties {
  3. _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
  4. _MainTex ("Particle Texture", 2D) = "white" {}
  5. _MulRatio("MulRatio", Range(0, 5)) = 1
  6. }
  7. Category {
  8. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
  9. Blend SrcAlpha OneMinusSrcAlpha
  10. Cull Off Lighting Off ZWrite Off Fog { Mode off }
  11. SubShader {
  12. Pass {
  13. CGPROGRAM
  14. #pragma vertex vert
  15. #pragma fragment frag
  16. #pragma multi_compile_particles
  17. #pragma multi_compile_fog
  18. #include "UnityCG.cginc"
  19. sampler2D _MainTex;
  20. float4 _MainTex_ST;
  21. fixed4 _TintColor;
  22. fixed _MulRatio;
  23. struct appdata_t {
  24. float4 vertex : POSITION;
  25. fixed4 color : COLOR;
  26. float2 texcoord : TEXCOORD0;
  27. };
  28. struct v2f {
  29. float4 vertex : POSITION;
  30. fixed4 color : COLOR;
  31. float2 texcoord : TEXCOORD0;
  32. UNITY_FOG_COORDS(1)
  33. };
  34. v2f vert (appdata_t v)
  35. {
  36. v2f o;
  37. o.vertex = UnityObjectToClipPos(v.vertex);
  38. o.color = v.color * _TintColor;
  39. o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
  40. UNITY_TRANSFER_FOG(o,o.vertex);
  41. return o;
  42. }
  43. half4 frag (v2f i) : COLOR
  44. {
  45. half4 result = 2.0f * i.color * tex2D(_MainTex, i.texcoord);
  46. result.a = saturate(result.a);
  47. UNITY_APPLY_FOG(i.fogCoord, result);
  48. result.rgb *= _MulRatio;
  49. return result;
  50. }
  51. ENDCG
  52. }
  53. }
  54. }
  55. }