Initialer Upload neues Unity-Projekt
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,
|
||||
float4(UnityObjectToViewPos((float3)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:
|
||||
@ -0,0 +1,69 @@
|
||||
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
|
||||
|
||||
// Unlit alpha-blended shader.
|
||||
// - no lighting
|
||||
// - no lightmap support
|
||||
// - no per-material color
|
||||
// Only change from the original: added MipMap bias support
|
||||
|
||||
Shader "Unlit/Transparent MMBias" {
|
||||
Properties {
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_MainTexMMBias("Base MipMap Bias", Float) = 0.0
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
LOD 100
|
||||
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
half _MainTexMMBias;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2Dbias(_MainTex, half4(i.texcoord.x, i.texcoord.y, 0.0, _MainTexMMBias)); // original: tex2D(_MainTex, i.texcoord);
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2d85b7dbb1832e4bb13239ecd555f29
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,70 @@
|
||||
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
|
||||
|
||||
// Unlit alpha-cutout shader.
|
||||
// - no lighting
|
||||
// - no lightmap support
|
||||
// - no per-material color
|
||||
// Only change from the original: added MipMap bias support
|
||||
|
||||
Shader "Unlit/Transparent Cutout MMBias" {
|
||||
Properties {
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_MainTexMMBias("Base MipMap Bias", Float) = 0.0
|
||||
}
|
||||
SubShader {
|
||||
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
|
||||
LOD 100
|
||||
|
||||
Lighting Off
|
||||
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
fixed _Cutoff;
|
||||
half _MainTexMMBias;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2Dbias(_MainTex, half4(i.texcoord.x, i.texcoord.y, 0.0, _MainTexMMBias)); // original: tex2D(_MainTex, i.texcoord);
|
||||
clip(col.a - _Cutoff);
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 672c396d97853fa4a9aed2f4ae7347aa
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,67 @@
|
||||
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
|
||||
|
||||
// Unlit shader. Simplest possible textured shader.
|
||||
// - no lighting
|
||||
// - no lightmap support
|
||||
// - no per-material color
|
||||
// Only change from the original: added MipMap bias support
|
||||
|
||||
Shader "Unlit/Texture MMBias" {
|
||||
Properties {
|
||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
||||
_MainTexMMBias("Base MipMap Bias", Float) = 0.0
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
LOD 100
|
||||
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
half _MainTexMMBias;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2Dbias(_MainTex, half4(i.texcoord.x, i.texcoord.y, 0.0, _MainTexMMBias)); // original: tex2D(_MainTex, i.texcoord);
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
UNITY_OPAQUE_ALPHA(col.a);
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31d0aa80bfd61974cb31771e0a522854
|
||||
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:
|
||||
8
Assets/Oculus/VR/Shaders/OVRVirtualKeyboard.meta
Normal file
8
Assets/Oculus/VR/Shaders/OVRVirtualKeyboard.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da590b1e8c1305a4a957e77ca880745d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,81 @@
|
||||
Shader "Oculus/VirtualKeyboard/OVRVirtualKeyboardMMBias"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
|
||||
_Color ("Tint", Color) = (1.000000,1.000000,1.000000,1.000000)
|
||||
[HideInInspector] _RendererColor ("RendererColor", Color) = (1.000000,1.000000,1.000000,1.000000)
|
||||
_MainTexMMBias("Mipmap Bias", Float) = 0.000000
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "CanUseSpriteAtlas"="true" "PreviewType"="Plane" }
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "CanUseSpriteAtlas"="true" "PreviewType"="Plane" }
|
||||
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
Blend One OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR0;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 color : COLOR0;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _Color;
|
||||
float4 _RendererColor;
|
||||
half _MainTexMMBias;
|
||||
|
||||
// Perform multiple samples per fragment to reduce aliasing
|
||||
// Source: https://developer.oculus.com/blog/common-rendering-mistakes-how-to-find-them-and-how-to-fix-them/
|
||||
fixed4 tex2DmultisampleBias(sampler2D tex, float2 uv, half bias)
|
||||
{
|
||||
float2 dx = ddx(uv) * 0.25;
|
||||
float2 dy = ddy(uv) * 0.25;
|
||||
|
||||
float4 sample0 = tex2Dbias(tex, half4(uv + dx + dy, 0.0, bias));
|
||||
float4 sample1 = tex2Dbias(tex, half4(uv + dx - dy, 0.0, bias));
|
||||
float4 sample2 = tex2Dbias(tex, half4(uv - dx + dy, 0.0, bias));
|
||||
float4 sample3 = tex2Dbias(tex, half4(uv - dx - dy, 0.0, bias));
|
||||
|
||||
return (sample0 + sample1 + sample2 + sample3) * 0.25;
|
||||
}
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color * _Color * _RendererColor;
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2DmultisampleBias(_MainTex, i.uv, _MainTexMMBias) * i.color;
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 502519190e12db54c8dd6a9322721a70
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
78
Assets/Oculus/VR/Shaders/Unlit Crosshair.shader
Normal file
78
Assets/Oculus/VR/Shaders/Unlit Crosshair.shader
Normal file
@ -0,0 +1,78 @@
|
||||
// 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