1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
- Shader "Custom/Vive Movement Border"
- {
- Properties
- {
- _MainTex ("Texture", 2D) = "white" {}
- _Color ("Color", Color) = (1, 1, 1, 1)
- _BackColor ("Color Behind Objects", Color) = (0.5,0.5,0.5,1)
- _Alpha ("Total Alpha (Transparency)", Float) = 1.0
- }
- SubShader
- {
- Tags{ "Queue" = "Overlay" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
- CGINCLUDE
- #pragma vertex vert
- #pragma fragment frag
- #include "UnityCG.cginc"
- struct appdata
- {
- float4 vertex : POSITION;
- float2 uv : TEXCOORD0;
- };
- struct v2f
- {
- float2 uv : TEXCOORD0;
- float4 vertex : SV_POSITION;
- };
- sampler2D _MainTex;
- fixed4 _Color;
- fixed4 _BackColor;
- fixed _Alpha;
- v2f vert(appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.uv = v.uv;
- return o;
- }
- ENDCG
- Pass
- {
- Blend SrcAlpha OneMinusSrcAlpha
- ZTest Greater
- ZWrite Off
- CGPROGRAM
- fixed4 frag (v2f i) : SV_Target
- {
- fixed4 col = tex2D(_MainTex, i.uv) * _BackColor;
- col.a *= _Alpha;
- return col;
- }
- ENDCG
- }
- Pass
- {
- Blend SrcAlpha OneMinusSrcAlpha
- ZTest LEqual
- ZWrite Off
- CGPROGRAM
- fixed4 frag(v2f i) : SV_Target
- {
- fixed4 col = tex2D(_MainTex, i.uv) * _Color;
- col.a *= _Alpha;
- return col;
- }
- ENDCG
- }
- }
- }
|