-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathWindowOcclusion.shader
57 lines (49 loc) · 1.44 KB
/
WindowOcclusion.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
56
57
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
///
/// Simple occlusion shader that can be used to hide other objects.
/// This prevents other objects from being rendered by drawing invisible 'opaque' pixels to the depth buffer.
///
Shader "MixedRealityToolkit/WindowOcclusion"
{
Properties
{
}
SubShader
{
Tags
{
"RenderType" = "Opaque"
"Queue" = "Geometry-1"
}
Pass
{
ColorMask 0 // Color will not be rendered.
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 = UnityObjectToClipPos(v.vertex);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
return o;
}
half4 frag(v2f i) : COLOR
{
return float4(1,1,1,1);
}
ENDCG
}
}
}