Pass Outline ZWrite Off Cull Back CGPROGRAM pragma target pragma verte

 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
Pass //Outline
{
ZWrite Off
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma keepalpha
uniform half4 _ASEOutlineColor;
uniform half _ASEOutlineWidth;
struct v2f
{
float4 pos : POSITION;
float4 col : COLOR;
};
v2f vert(appdata_full v)
{
appdata_full original = v;
v.vertex.xyz += ( v.normal * _ASEOutlineWidth );
v.color.a = 0;
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.col.a = 0;
return o;
}
half4 frag(v2f i) : COLOR
{
fixed4 FoW = FoWIntensity(i.pos);
FoW = FoW + (fixed4(1,1,1,1) - FoW) * _FowIgnoring;
float4 resultColor = _ASEOutlineColor;
// resultColor.a *= (FoW.g * 1.2 - 0.1);
resultColor.a = 0;
return resultColor;
}
ENDCG
}