comparison Orchestland/Assets/OVR/Shaders/OVRGUIShader.shader @ 1:f7675884f2a1

Add Orchestland project
author Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2015 23:09:20 +0900
parents
children
comparison
equal deleted inserted replaced
0:347d21cdfc22 1:f7675884f2a1
1 /************************************************************************************
2
3 Copyright : Copyright 2014 Oculus VR, LLC. All Rights reserved.
4
5 Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
6 you may not use the Oculus VR Rift SDK except in compliance with the License,
7 which is provided at the time of installation or download, or which
8 otherwise accompanies this software in either electronic or hard copy form.
9
10 You may obtain a copy of the License at
11
12 http://www.oculusvr.com/licenses/LICENSE-3.2
13
14 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19
20 ************************************************************************************/
21
22 Shader "OVRGUIShader"
23 {
24 Properties { _MainTex ("Texture", any) = "" {} }
25
26 SubShader {
27
28 Tags { "ForceSupported" = "True" "RenderType"="Overlay" "Queue"="Overlay" }
29
30 Lighting Off
31 Blend One OneMinusSrcAlpha
32 Cull Off
33 ZWrite Off
34 Fog { Mode Off }
35 ZTest Always
36
37 Pass {
38 CGPROGRAM
39 #pragma vertex vert
40 #pragma fragment frag
41 #pragma fragmentoption ARB_precision_hint_fastest
42
43 #include "UnityCG.cginc"
44
45 struct appdata_t {
46 float4 vertex : POSITION;
47 fixed4 color : COLOR;
48 float2 texcoord : TEXCOORD0;
49 };
50
51 struct v2f {
52 float4 vertex : POSITION;
53 fixed4 color : COLOR;
54 float2 texcoord : TEXCOORD0;
55 };
56
57 sampler2D _MainTex;
58
59 uniform float4 _MainTex_ST;
60
61 v2f vert (appdata_t v)
62 {
63 v2f o;
64 o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
65 o.color = v.color;
66 o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
67 return o;
68 }
69
70 fixed4 frag (v2f i) : COLOR
71 {
72 return 2.0f * tex2D(_MainTex, i.texcoord) * i.color;
73 }
74 ENDCG
75 }
76 }
77
78
79 SubShader {
80
81 Tags { "ForceSupported" = "True" "RenderType"="Overlay" }
82
83 Lighting Off
84 Blend SrcAlpha OneMinusSrcAlpha
85 Cull Off
86 ZWrite Off
87 Fog { Mode Off }
88 ZTest Always
89
90 BindChannels {
91 Bind "vertex", vertex
92 Bind "color", color
93 Bind "TexCoord", texcoord
94 }
95
96 Pass {
97 SetTexture [_MainTex] {
98 combine primary * texture DOUBLE, primary * texture DOUBLE
99 }
100 }
101 }
102
103 Fallback off
104 }