clean project
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: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Oculus/VR/Shaders/OVRTrackedKeyboard.meta
Normal file
8
Assets/Oculus/VR/Shaders/OVRTrackedKeyboard.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00644b74c8ac5304dbc24df028ab523e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,142 @@
|
||||
Shader "Hands Billboard Edge Fading Mask"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Intensity("Intensity", Range(0,1)) = 1.0
|
||||
|
||||
[Space(5)]
|
||||
[Header(PARAMETRIC GLOW)]
|
||||
_Scale("Scale", Range(0,.1)) = 0.055
|
||||
_Falloff("Falloff", float) = 4.0
|
||||
_Power("Power", float) = 15.0
|
||||
|
||||
[Space(5)]
|
||||
[Header(EDGE FADING)]
|
||||
[Toggle] _EdgeFading("Enable", Int) = 1
|
||||
_KeyboardPosition("Keyboard Position", Vector) = (0, 0, 0, 0)
|
||||
_KeyboardRotation("Keyboard Rotation", Vector) = (0, 0, 0, 0)
|
||||
_KeyboardScale("Keyboard Scale", Vector) = (1, 1, 1, 0)
|
||||
_FadingFalloff("Falloff", Range(0, .1)) = 0.05
|
||||
_ColorMultiply("Color multiply", Range(0, 3)) = 2.0
|
||||
|
||||
// Blend modes
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]_SrcBlendMode("Src Blend Factor", Int) = 0 // Zero
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]_DstBlendMode("Dst Blend Factor", Int) = 4 // SrcColor
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
// Transparent+1 to render after key labels
|
||||
Tags {"Queue" = "Transparent+1" "IgnoreProjector" = "True" "RenderType" = "Transparent"}
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Blend [_SrcBlendMode] [_DstBlendMode]
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_instancing
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
uniform float _Intensity;
|
||||
uniform float _Scale;
|
||||
float _Falloff;
|
||||
float _Power;
|
||||
|
||||
int _EdgeFading;
|
||||
float4 _KeyboardPosition;
|
||||
float4 _KeyboardRotation;
|
||||
float4 _KeyboardScale;
|
||||
float _FadingFalloff;
|
||||
float _ColorMultiply;
|
||||
|
||||
struct vertexInput
|
||||
{
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
float4 vertex : POSITION;
|
||||
float4 tex : TEXCOORD0;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct vertexOutput
|
||||
{
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
float4 pos : SV_POSITION;
|
||||
float4 tex : TEXCOORD0;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
UNITY_INSTANCING_BUFFER_START(Props)
|
||||
//UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
|
||||
UNITY_INSTANCING_BUFFER_END(Props)
|
||||
|
||||
float4 RotateAroundYInDegrees(float4 vertex, float degrees)
|
||||
{
|
||||
float alpha = degrees * UNITY_PI / 180.0;
|
||||
float sina, cosa;
|
||||
sincos(alpha, sina, cosa);
|
||||
float2x2 m = float2x2(cosa, -sina, sina, cosa);
|
||||
return float4(mul(m, vertex.xz), vertex.yw).xzyw;
|
||||
}
|
||||
|
||||
float4 BoundingBox(float4 vert, float4 position, float4 rotation, float4 scale)
|
||||
{
|
||||
float4 worldPos = mul(unity_ObjectToWorld, vert);
|
||||
float4 bboxOrientation = RotateAroundYInDegrees(worldPos - position, rotation.y);
|
||||
bboxOrientation = abs(bboxOrientation);
|
||||
|
||||
scale *= 0.5f;
|
||||
|
||||
float distX = (bboxOrientation.x - scale.x) / ((scale.x + _FadingFalloff) - scale.x);
|
||||
float distY = (bboxOrientation.y - scale.y) / ((scale.y + _FadingFalloff) - scale.y);
|
||||
float distZ = (bboxOrientation.z - scale.z) / ((scale.z + _FadingFalloff) - scale.z);
|
||||
float bBoxH = max(distX, distZ);
|
||||
float bBoxV = max(bBoxH, distY);
|
||||
float bBox = clamp(0,1,bBoxV);
|
||||
return float4(bBox, bBox, bBox, bBox);
|
||||
}
|
||||
|
||||
vertexOutput vert(vertexInput input)
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
|
||||
vertexOutput output;
|
||||
output.pos = mul(UNITY_MATRIX_P,
|
||||
mul(UNITY_MATRIX_MV, float4(0.0, 0.0, 0.0, 1.0))
|
||||
+ float4(input.vertex.x, input.vertex.y, 0.0, 0.0)
|
||||
* float4(_Scale, _Scale, 1.0, 1.0));
|
||||
|
||||
output.tex = input.tex;
|
||||
output.color = BoundingBox(input.vertex, _KeyboardPosition, _KeyboardRotation, _KeyboardScale);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
fixed BorderFade(float2 uv, float falloff, float intensity)
|
||||
{
|
||||
uv *= 1.0 - uv.yx;
|
||||
float fade = uv.x * uv.y * intensity;
|
||||
fade = pow(fade, falloff);
|
||||
return fade;
|
||||
}
|
||||
|
||||
float4 frag(vertexOutput input) : COLOR
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
float glow = BorderFade(input.tex, _Falloff, _Power);
|
||||
float color = glow * _ColorMultiply;
|
||||
float4 circleAlpha = float4(color, color, color, glow) * _Intensity;
|
||||
float4 finalAlpha = circleAlpha * (1 - input.color.a);
|
||||
float4 transition = 1 - lerp(circleAlpha, finalAlpha, _EdgeFading);
|
||||
|
||||
return transition;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 488b60f10f2b48e4f9ff49f81068b166
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
37
Assets/Oculus/VR/Shaders/OVRTrackedKeyboard/HandMask.shader
Normal file
37
Assets/Oculus/VR/Shaders/OVRTrackedKeyboard/HandMask.shader
Normal file
@@ -0,0 +1,37 @@
|
||||
Shader "Unlit/HandMask"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color("Color", Color) = (1, 1, 1, 1)
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" "RenderType"="Transparent" }
|
||||
LOD 200
|
||||
Blend One Zero, One Zero
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf NoLighting keepalpha
|
||||
|
||||
#pragma target 3.0
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten) {
|
||||
return fixed4(s.Albedo, s.Alpha);
|
||||
}
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
fixed4 _Color;
|
||||
|
||||
void surf(Input IN, inout SurfaceOutput o) {
|
||||
o.Albedo = 0;
|
||||
float alpha = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Alpha = 0;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96496359528875c4f87b57d6ee52723a
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
Shader "Punch Through Passthrough"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue" = "Geometry"}
|
||||
ZWrite On
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Blend Zero Zero
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#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;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = v.uv;
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
return fixed4(0, 0, 0, 0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8120257754b48344b8a1a0961bad0c46
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
67
Assets/Oculus/VR/Shaders/OVRVignette.shader
Normal file
67
Assets/Oculus/VR/Shaders/OVRVignette.shader
Normal file
@@ -0,0 +1,67 @@
|
||||
Shader "Oculus/OVRVignette"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color("Color", Color) = (0,0,0,0)
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]_BlendSrc ("Blend Source", Float) = 1
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]_BlendDst ("Blend Destination", Float) = 0
|
||||
_ZWrite ("Z Write", Float) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector" = "True" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend [_BlendSrc] [_BlendDst]
|
||||
ZTest Always
|
||||
ZWrite [_ZWrite]
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile _ QUADRATIC_FALLOFF
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half4 color : COLOR;
|
||||
};
|
||||
|
||||
float4 _ScaleAndOffset0[2];
|
||||
float4 _ScaleAndOffset1[2];
|
||||
float4 _Color;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
float4 scaleAndOffset = lerp(_ScaleAndOffset0[unity_StereoEyeIndex], _ScaleAndOffset1[unity_StereoEyeIndex], v.uv.x);
|
||||
|
||||
o.vertex = float4(scaleAndOffset.zw + v.vertex.xy * scaleAndOffset.xy, _ProjectionParams.y, 1);
|
||||
|
||||
o.color.rgb = _Color.rgb;
|
||||
o.color.a = v.uv.y;
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
#if QUADRATIC_FALLOFF
|
||||
i.color.a *= i.color.a;
|
||||
#endif
|
||||
return i.color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Assets/Oculus/VR/Shaders/OVRVignette.shader.meta
Normal file
8
Assets/Oculus/VR/Shaders/OVRVignette.shader.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d034fa3f535a1648b5059e6907c647d
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
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