deltavr multiplayer 2.0

This commit is contained in:
Toomas Tamm
2023-05-08 15:56:10 +03:00
parent 978809a002
commit 07b9b9e2f4
10937 changed files with 2968397 additions and 1521012 deletions

View File

@@ -0,0 +1,45 @@
Shader "MixedReality/BackgroundColor" {
Properties{
_Color("Color", Color) = (1, 1, 1, 1)
} SubShader {
Tags{"RenderType" =
"Opaque"} LOD 100 Cull Front ZTest Always ZWrite On Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f {
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _Color;
v2f vert(appdata v) {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag(v2f i) : SV_Target {
float gradient = (i.uv.y - 0.5) * 0.5;
float4 col =
float4(_Color.r + gradient, _Color.g + gradient, _Color.b + gradient, _Color.a);
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 43c7ac0d65589e040afaa622faa8842d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "MixedReality/FatFingers"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Inflation("Inflation", float) = 0
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
// Upgrade NOTE: excluded shader from DX11; has structs without semantics (struct v2f members center)
//#pragma exclude_renderers d3d11
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float3 normal : NORMAL;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float _Inflation;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex + v.normal * _Inflation);
float4 origin = mul(unity_ObjectToWorld, float4(0.0, 0.0, 0.0, 1.0));
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag(v2f i) : SV_Target {
fixed4 col = tex2D(_MainTex, i.uv);
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 839762cdf5e96427bbb1482d351d9b62
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,85 @@
// Oculus VR, LLC Proprietary and Confidential.
// clang-format off
Shader "MixedReality/GlowEffect"
{
Properties
{
_GlowColor ("Glow Color", Color) = (1.0, 1.0, 1.0)
_Pow ("Pow", Range (0.2,10)) = 2
_Intensity ("Intensity", Range (0,10)) = 1
}
SubShader {
Tags {"Queue" = "Transparent"}
Pass {
ZWrite Off
BlendOp RevSub
Blend Zero One, One OneMinusSrcAlpha
Cull Front
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
struct vertexInput {
float4 vertex : POSITION;
float3 normal: NORMAL;
float4 texcoord : TEXCOORD0;
float4 vertCol : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
half3 worldNormal : TEXCOORD3;
float3 viewDir: TEXCOORD2;
half4 localPos : TEXCOORD4;
float4 color : TEXCOORD1;
float eye : EYE;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
float4 _GlowColor;
float _Pow;
float _Intensity;
float4x4 _TrackingSpaceTransform;
v2f vert(vertexInput v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.worldNormal = UnityObjectToWorldNormal(v.normal);
o.viewDir = WorldSpaceViewDir(v.vertex);
o.localPos = v.vertex;
o.uv = v.texcoord;
o.color = v.vertCol;
return o;
}
float4 frag(v2f i) : SV_Target {
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
float fresnelNdot = (dot (normalize (i.viewDir), normalize (-i.worldNormal)));
fresnelNdot = pow(fresnelNdot,_Pow);
float4 color = _GlowColor;
color.rgb += _GlowColor.rgb * fresnelNdot * _Intensity;
color.rgb = 0;
color.a *= fresnelNdot;
return color;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: cb61bbfe44fc56e4081bee639a2b33bb
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,51 @@
Shader "MixedReality/PassthroughLine" {
Properties{
_LineLength("Line Length", float) = 1
} SubShader {
Tags{"RenderType" = "Transparent"} LOD 100
Pass {
ZWrite Off
BlendOp RevSub, Min
Blend Zero One, One One
CGPROGRAM
// Upgrade NOTE: excluded shader from DX11; has structs without semantics (struct v2f members
// center)
//#pragma exclude_renderers d3d11
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float3 normal : NORMAL;
};
struct v2f {
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v) {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
float _LineLength;
fixed4 frag(v2f i) : SV_Target {
float UVfadeRange = 0.2;
fixed widthAlpha = 1 - smoothstep(0.5 - UVfadeRange, 0.5, abs(i.uv.y - 0.5));
fixed lengthAlpha = 1 - smoothstep(0.5 - (UVfadeRange / _LineLength), 0.5, abs(i.uv.x - 0.5));
return float4(0, 0, 0, 1-(widthAlpha * lengthAlpha));
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 1301b51de6a265443a42f1bcae046aa6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,69 @@
Shader "MixedReality/SelectivePassthrough"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Inflation("Inflation", float) = 0
_InvertedAlpha("Inverted Alpha", float) = 1
[Header(DepthTest)]
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual"
[Enum(UnityEngine.Rendering.BlendOp)] _BlendOpColor("Blend Color", Float) = 2 //"ReverseSubtract"
[Enum(UnityEngine.Rendering.BlendOp)] _BlendOpAlpha("Blend Alpha", Float) = 3 //"Min"
}
SubShader
{
Tags { "RenderType"="Transparent" }
LOD 100
Pass
{
ZWrite Off
ZTest[_ZTest]
BlendOp[_BlendOpColor], [_BlendOpAlpha]
Blend Zero One, One One
CGPROGRAM
// Upgrade NOTE: excluded shader from DX11; has structs without semantics (struct v2f members center)
//#pragma exclude_renderers d3d11
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float3 normal : NORMAL;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float _Inflation;
float _InvertedAlpha;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex + v.normal * _Inflation);
float4 origin = mul(unity_ObjectToWorld, float4(0.0, 0.0, 0.0, 1.0));
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag(v2f i) : SV_Target {
fixed4 col = tex2D(_MainTex, i.uv);
float alpha = lerp(col.r, 1 - col.r, _InvertedAlpha);
return float4(0, 0, 0, alpha);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a199f698ecf1463488778ee398e3bf0c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,66 @@
Shader "MixedReality/SelectivePassthroughSoft" {
Properties{
_MainTex("Texture", 2D) = "white" {}
_SoftFade("Soft Fade Distance", Float) = 0.05
_Inflation("Inflation", float) = 0
}
SubShader {
Tags{"RenderType" = "Transparent"} LOD 100
Pass {
ZWrite Off
BlendOp RevSub, Min
Blend Zero One, One OneMinusSrcAlpha
CGPROGRAM
// Upgrade NOTE: excluded shader from DX11; has structs without semantics (struct v2f members
// center)
//#pragma exclude_renderers d3d11
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float3 normal : NORMAL;
};
struct v2f {
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float2 projPos : TEXCOORD1;
float depth : DEPTH;
};
sampler2D _MainTex;
sampler2D _CameraDepthTexture;
float4 _MainTex_ST;
float _SoftFade;
float _Inflation;
v2f vert(appdata v) {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex + v.normal * _Inflation);
float4 origin = mul(unity_ObjectToWorld, float4(0.0, 0.0, 0.0, 1.0));
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.depth = -UnityObjectToViewPos(v.vertex).z * _ProjectionParams.w;
o.projPos = (o.vertex.xy / o.vertex.w) * 0.5 + 0.5;
return o;
}
fixed4 frag(v2f i) : SV_Target {
// get a linear & normalized (0-1) depth value of the scene
float frameDepth = Linear01Depth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.projPos.xy));
// convert the normalized value to world units, with depth of 0 at this mesh
frameDepth = (frameDepth - i.depth) * _ProjectionParams.z;
// remap it to a fade distance
frameDepth = saturate(frameDepth / _SoftFade);
fixed4 col = tex2D(_MainTex, i.uv);
return float4(0, 0, 0, 1-(col.r * frameDepth));
}
ENDCG
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e1c8c96b450f6914da76c6fcf77a901f
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 67373ce8dd0b1455f93d1c23a6e2753e
folderAsset: yes
timeCreated: 1536311497
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: