summaryrefslogtreecommitdiff
path: root/Assets/ProFlares/Shaders/ProFlareShader.shader
blob: 571bbbb2d677f05a4af996f891ad740288a85330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "ProFlares/Textured Flare Shader"
{
	Properties 
   	{
    	_MainTex ( "Texture", 2D )	= "black" {}   
  	}
    
	SubShader 
	{
		Tags { "Queue"="Transparent+100" "IgnoreProjector"="True" "RenderType"="Transparent" }

    	Pass 
		{    
			ZWrite Off
      	 	ZTest Always 
      	 	Blend One One
     		
			CGPROGRAM
			
 			#pragma vertex vert
			#pragma fragment frag
			#pragma fragmentoption ARB_precision_hint_fastest

			#include "UnityCG.cginc"

			sampler2D	_MainTex;
 
           	struct VertInput
            {
                half4 vertex	: POSITION;
                half2 texcoord	: TEXCOORD0;
			  	fixed4 color	: COLOR;
            };

           	struct Verts
            {
                half4 pos		: SV_POSITION;
                half2 uv		: TEXCOORD0;
			  	fixed4 _color   : COLOR;
            };

			Verts vert ( VertInput vert )
			{
				Verts v;

				v._color		= vert.color*(vert.color.a*3);
    			v.pos			= UnityObjectToClipPos ( vert.vertex );
   				v.uv 	  		= (vert.texcoord.xy);
   				
				return v;
			}
 	
			fixed4 frag ( Verts v ):COLOR
			{
    			return tex2D ( _MainTex, v.uv ) * v._color;
			}

			ENDCG
		}
 	}
}