|
1 | 1 | Shader "HoloToolkit/EditorHands" |
2 | 2 | { |
3 | | - Properties |
4 | | - { |
5 | | - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} |
6 | | - _Color ("Tint", Color) = (1,1,1,1) |
7 | | - |
8 | | - _StencilComp ("Stencil Comparison", Float) = 8 |
9 | | - _Stencil ("Stencil ID", Float) = 0 |
10 | | - _StencilOp ("Stencil Operation", Float) = 0 |
11 | | - _StencilWriteMask ("Stencil Write Mask", Float) = 255 |
12 | | - _StencilReadMask ("Stencil Read Mask", Float) = 255 |
| 3 | + Properties |
| 4 | + { |
| 5 | + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} |
| 6 | + [PerRendererData] _Color ("Tint", Color) = (1,1,1,1) |
| 7 | + |
| 8 | + _StencilComp ("Stencil Comparison", Float) = 8 |
| 9 | + _Stencil ("Stencil ID", Float) = 0 |
| 10 | + _StencilOp ("Stencil Operation", Float) = 0 |
| 11 | + _StencilWriteMask ("Stencil Write Mask", Float) = 255 |
| 12 | + _StencilReadMask ("Stencil Read Mask", Float) = 255 |
13 | 13 |
|
14 | | - _ColorMask ("Color Mask", Float) = 15 |
15 | | - } |
| 14 | + _ColorMask ("Color Mask", Float) = 15 |
| 15 | + } |
16 | 16 |
|
17 | | - SubShader |
18 | | - { |
19 | | - Tags |
20 | | - { |
21 | | - "Queue"="Transparent" |
22 | | - "IgnoreProjector"="True" |
23 | | - "RenderType"="Transparent" |
24 | | - "PreviewType"="Plane" |
25 | | - "CanUseSpriteAtlas"="True" |
26 | | - } |
27 | | - |
28 | | - Stencil |
29 | | - { |
30 | | - Ref [_Stencil] |
31 | | - Comp [_StencilComp] |
32 | | - Pass [_StencilOp] |
33 | | - ReadMask [_StencilReadMask] |
34 | | - WriteMask [_StencilWriteMask] |
35 | | - } |
| 17 | + SubShader |
| 18 | + { |
| 19 | + Tags |
| 20 | + { |
| 21 | + "Queue"="Transparent" |
| 22 | + "IgnoreProjector"="True" |
| 23 | + "RenderType"="Transparent" |
| 24 | + "PreviewType"="Plane" |
| 25 | + "CanUseSpriteAtlas"="True" |
| 26 | + } |
| 27 | + |
| 28 | + Stencil |
| 29 | + { |
| 30 | + Ref [_Stencil] |
| 31 | + Comp [_StencilComp] |
| 32 | + Pass [_StencilOp] |
| 33 | + ReadMask [_StencilReadMask] |
| 34 | + WriteMask [_StencilWriteMask] |
| 35 | + } |
36 | 36 |
|
37 | | - Cull Off |
38 | | - Lighting Off |
39 | | - ZWrite Off |
40 | | - ZTest [unity_GUIZTestMode] |
41 | | - Blend SrcAlpha OneMinusSrcAlpha |
42 | | - ColorMask [_ColorMask] |
| 37 | + Cull Off |
| 38 | + Lighting Off |
| 39 | + ZWrite Off |
| 40 | + ZTest [unity_GUIZTestMode] |
| 41 | + Blend SrcAlpha OneMinusSrcAlpha |
| 42 | + ColorMask [_ColorMask] |
43 | 43 |
|
44 | | - Pass |
45 | | - { |
46 | | - CGPROGRAM |
47 | | - #pragma vertex vert |
48 | | - #pragma fragment frag |
49 | | - #include "UnityCG.cginc" |
50 | | - |
51 | | - struct appdata_t |
52 | | - { |
53 | | - float4 vertex : POSITION; |
54 | | - float4 color : COLOR; |
55 | | - float2 texcoord : TEXCOORD0; |
56 | | - UNITY_VERTEX_INPUT_INSTANCE_ID |
57 | | - }; |
| 44 | + Pass |
| 45 | + { |
| 46 | + CGPROGRAM |
| 47 | + #pragma vertex vert |
| 48 | + #pragma fragment frag |
| 49 | + #include "UnityCG.cginc" |
| 50 | + |
| 51 | + struct appdata_t |
| 52 | + { |
| 53 | + float4 vertex : POSITION; |
| 54 | + float4 color : COLOR; |
| 55 | + float2 texcoord : TEXCOORD0; |
| 56 | + UNITY_VERTEX_INPUT_INSTANCE_ID |
| 57 | + }; |
| 58 | + struct v2f |
| 59 | + { |
| 60 | + float4 vertex : SV_POSITION; |
| 61 | + fixed4 color : COLOR; |
| 62 | + half2 texcoord : TEXCOORD0; |
| 63 | + UNITY_VERTEX_OUTPUT_STEREO |
| 64 | + }; |
| 65 | + fixed4 _Color; |
| 66 | + v2f vert(appdata_t IN) |
| 67 | + { |
| 68 | + UNITY_SETUP_INSTANCE_ID(IN); |
| 69 | + v2f OUT; |
| 70 | + OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); |
| 71 | + OUT.texcoord = IN.texcoord; |
| 72 | + #ifdef UNITY_HALF_TEXEL_OFFSET |
| 73 | + OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1); |
| 74 | + #endif |
| 75 | + OUT.color = IN.color * _Color; |
| 76 | + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); |
| 77 | + return OUT; |
| 78 | + } |
58 | 79 |
|
59 | | - struct v2f |
60 | | - { |
61 | | - float4 vertex : SV_POSITION; |
62 | | - fixed4 color : COLOR; |
63 | | - half2 texcoord : TEXCOORD0; |
64 | | - UNITY_VERTEX_OUTPUT_STEREO |
65 | | - }; |
66 | | - |
67 | | - fixed4 _Color; |
68 | 80 |
|
69 | | - v2f vert(appdata_t IN) |
70 | | - { |
71 | | - UNITY_SETUP_INSTANCE_ID(IN); |
| 81 | + sampler2D _MainTex; |
| 82 | + fixed4 frag(v2f IN) : SV_Target |
| 83 | + { |
| 84 | + half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; |
| 85 | + clip (color.a - 0.01); |
| 86 | + return color; |
| 87 | + } |
72 | 88 |
|
73 | | - v2f OUT; |
74 | | - OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); |
75 | | - OUT.texcoord = IN.texcoord; |
76 | | -#ifdef UNITY_HALF_TEXEL_OFFSET |
77 | | - OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1); |
78 | | -#endif |
79 | | - OUT.color = IN.color * _Color; |
80 | | - |
81 | | - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); |
82 | | - return OUT; |
83 | | - } |
84 | | - |
85 | | - sampler2D _MainTex; |
86 | | - |
87 | | - fixed4 frag(v2f IN) : SV_Target |
88 | | - { |
89 | | - half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; |
90 | | - clip (color.a - 0.01); |
91 | | - return color; |
92 | | - } |
93 | | - ENDCG |
94 | | - } |
95 | | - } |
| 89 | + ENDCG |
| 90 | + } |
| 91 | + } |
| 92 | + CustomEditor "EditorHandsMaterialInspector" |
96 | 93 | } |
0 commit comments