deltavr multiplayer 2.0
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user