ProFlareShaderLinear.shader 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "ProFlares/Textured Flare Shader Linear "
  3. {
  4. Properties
  5. {
  6. _MainTex ( "Texture", 2D ) = "black" {}
  7. }
  8. SubShader
  9. {
  10. Tags { "Queue"="Transparent+100" "IgnoreProjector"="True" "RenderType"="Transparent" }
  11. Pass
  12. {
  13. ZWrite Off
  14. ZTest Always
  15. Blend One One
  16. CGPROGRAM
  17. #pragma vertex vert
  18. #pragma fragment frag
  19. #pragma fragmentoption ARB_precision_hint_fastest
  20. #include "UnityCG.cginc"
  21. sampler2D _MainTex;
  22. struct VertInput
  23. {
  24. half4 vertex : POSITION;
  25. half2 texcoord : TEXCOORD0;
  26. fixed4 color : COLOR;
  27. };
  28. struct Verts
  29. {
  30. half4 pos : SV_POSITION;
  31. half2 uv : TEXCOORD0;
  32. fixed4 _color : COLOR;
  33. };
  34. Verts vert ( VertInput vert )
  35. {
  36. Verts v;
  37. v._color = pow(vert.color*(vert.color.a*3),2.2);
  38. v.pos = UnityObjectToClipPos ( vert.vertex );
  39. v.uv = (vert.texcoord.xy);
  40. return v;
  41. }
  42. fixed4 frag ( Verts v ):COLOR
  43. {
  44. return tex2D ( _MainTex, v.uv ) * v._color;
  45. }
  46. ENDCG
  47. }
  48. }
  49. }