Added VR libraries
This commit is contained in:
63
Assets/Oculus/VR/Shaders/OVRColorRampAlpha.shader
Normal file
63
Assets/Oculus/VR/Shaders/OVRColorRampAlpha.shader
Normal file
@@ -0,0 +1,63 @@
|
||||
Shader "OVRColorRampAlpa" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color ) = (1,1,1,1)
|
||||
_MainTex ("Diffuse (RGB) AlphaMask (A)", 2D) = "white" {}
|
||||
_ColorRamp ("Color Ramp (A)", 2D) = "white" {}
|
||||
_ColorRampOffset ("Color Ramp Offset", Range(0,1)) = 0.0
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
AlphaTest Greater .01
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) }
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ColorRamp;
|
||||
float _ColorRampOffset;
|
||||
fixed4 _Color;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_t v) {
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color;
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target {
|
||||
float4 texel = tex2D(_MainTex, i.texcoord);
|
||||
float2 colorIndex = float2( texel.x, _ColorRampOffset );
|
||||
float4 outColor = tex2D(_ColorRamp, colorIndex) * _Color;
|
||||
outColor.a = texel.a;
|
||||
return outColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Category
|
||||
9
Assets/Oculus/VR/Shaders/OVRColorRampAlpha.shader.meta
Normal file
9
Assets/Oculus/VR/Shaders/OVRColorRampAlpha.shader.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b95caf64e2cc3614892026a94bb2be84
|
||||
timeCreated: 1433268462
|
||||
licenseType: Free
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
79
Assets/Oculus/VR/Shaders/Unlit Crosshair.shader
Normal file
79
Assets/Oculus/VR/Shaders/Unlit Crosshair.shader
Normal file
@@ -0,0 +1,79 @@
|
||||
// Unlit alpha-blended shader.
|
||||
// - no lighting
|
||||
// - no lightmap support
|
||||
// - supports tint color
|
||||
|
||||
Shader "Unlit/Crosshair" {
|
||||
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {}
|
||||
_Color ("Main Color", Color) = (0.5,0.5,0.5,0.5)
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
LOD 100
|
||||
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
}
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZTest Always
|
||||
ZWrite Off
|
||||
Fog { Mode Off }
|
||||
Offset -1, -1
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
fixed4 color : COLOR;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
fixed4 color : COLOR;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
fixed4 _Color;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.color = v.color;
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : COLOR
|
||||
{
|
||||
fixed4 col = tex2D(_MainTex, i.texcoord) * i.color * _Color * 2.0;
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
5
Assets/Oculus/VR/Shaders/Unlit Crosshair.shader.meta
Normal file
5
Assets/Oculus/VR/Shaders/Unlit Crosshair.shader.meta
Normal file
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05b53b473302943b58b8e33c93a38dac
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
Reference in New Issue
Block a user