Glow.shader 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "Glow" {
  3. Properties{
  4. _MainTex("Texture", 2D) = "white" {}
  5. _Color("Color", Color) = (1,1,1,1)
  6. _Glow("Intensity", Range(0, 3)) = 1
  7. }
  8. SubShader{
  9. Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  10. LOD 100
  11. Cull Off
  12. ZWrite On
  13. Blend SrcAlpha OneMinusSrcAlpha
  14. Pass {
  15. CGPROGRAM
  16. #pragma vertex vert
  17. #pragma fragment frag
  18. sampler2D _MainTex;
  19. half4 _MainTex_ST;
  20. fixed4 _Color;
  21. half _Glow;
  22. struct vertIn {
  23. float4 pos : POSITION;
  24. half2 tex : TEXCOORD0;
  25. };
  26. struct v2f {
  27. float4 pos : SV_POSITION;
  28. half2 tex : TEXCOORD0;
  29. };
  30. v2f vert(vertIn v) {
  31. v2f o;
  32. o.pos = UnityObjectToClipPos(v.pos);
  33. o.tex = v.tex * _MainTex_ST.xy + _MainTex_ST.zw;
  34. return o;
  35. }
  36. fixed4 frag(v2f f) : SV_Target {
  37. fixed4 col = tex2D(_MainTex, f.tex);
  38. col *= _Color;
  39. col *= _Glow;
  40. return col;
  41. }
  42. ENDCG
  43. }
  44. }
  45. }