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
66
67
68
69
70
71
72
73
74
75
76
77
78
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "ASESampleShaders/RimLight"
{
Properties
{
// Color property for material inspector, default to white
_Color("Main Color", Color) = (1,1,1,1)
_Intensity("Intensity", range(0,10)) = 1
_MKGlowPower("Emission Power", range(0,10)) = 0
_MKGlowColor("Emission Color", color) = (1.0,0.95,0.8,1.0)
_StencilMask("Mask Layer", Range(0, 255)) = 1
[Enum(CompareFunction)] _StencilComp("Mask Mode", Int) = 6
}
SubShader
{
//Tags{ "Queue" = "AlphaTest" "IgnoreProjector" = "False" "RenderType" = "Transparent" "RenderType" = "MKGlow" }
Stencil
{
Ref 255
ReadMask[_StencilMask]
Comp[_StencilComp]
}
//Pass
//{
// ZWrite On
// //ZTest LEqual
// ColorMask 0
//}
Tags{ "Queue" = "AlphaTest-1" "IgnoreProjector" = "False" "RenderType" = "Transparent" "RenderType" = "MKGlow" }
Pass
{
Cull Back
ZTest LEqual
ZWrite Off
Blend One OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// vertex shader
// this time instead of using "appdata" struct, just spell inputs manually,
// and instead of returning v2f struct, also just return a single output
// float4 clip position
float4 vert(float4 vertex : POSITION) : SV_POSITION
{
return UnityObjectToClipPos(vertex);
}
// color from the material
fixed4 _Color;
float _Intensity;
fixed4 _MKGlowColor;
float _MKGlowPower;
// pixel shader, no inputs needed
fixed4 frag() : SV_Target
{
//_Color.rgb *= _Intensity;
//_Color.rgb *= _Color.a;
//_Color.rgb *= _Intensity;
//_Color *= _Intensity;
//_MKGlowColor = _Color;
//_MKGlowPower = _Intensity;
return _Color; // just return it
}
ENDCG
}
}
}
|