forked from microsoft/MixedRealityToolkit-Unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Occlusion.shader
55 lines (48 loc) · 1.26 KB
/
Occlusion.shader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
///
/// Basic occlusion shader that can be used with spatial mapping meshes.
/// No pixels will be rendered at the object's location.
///
Shader "HoloToolkit/Occlusion"
{
Properties
{
}
SubShader
{
Tags
{
"RenderType" = "Opaque"
"Queue" = "Geometry-1"
}
Pass
{
ColorMask 0 // Color will not be rendered.
Offset 50, 100
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// We only target the HoloLens (and the Unity editor), so take advantage of shader model 5.
#pragma target 5.0
#pragma only_renderers d3d11
#include "UnityCG.cginc"
struct v2f
{
float4 pos : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(appdata_base v)
{
UNITY_SETUP_INSTANCE_ID(v);
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
return o;
}
half4 frag(v2f i) : COLOR
{
return float4(1,1,1,1);
}
ENDCG
}
}
}