-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathFacePaintDebug.shader
52 lines (46 loc) · 943 Bytes
/
FacePaintDebug.shader
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
Shader "Hidden/FacePaintDebug" {
Properties {
[HideInInspector] _Mask ("0:RGBA 1:R 2:G 3:B 4:A", Int) = 0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 100
ZWrite On
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata{
float4 vertex : POSITION;
fixed4 color : COLOR;
};
struct v2f {
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
};
uniform int _Mask;
v2f vert (appdata v) {
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
if (_Mask == 0){
o.color = v.color;
} else if (_Mask == 1){
o.color = v.color.r;
} else if (_Mask == 2){
o.color = v.color.g;
} else if (_Mask == 3){
o.color = v.color.b;
} else if (_Mask == 4){
o.color = v.color.a;
}
return o;
}
fixed4 frag (v2f i) : SV_Target {
return i.color;
}
ENDCG
}
}
Fallback "Unlit"
}