Advertisement
Doomlaser

Untitled

Nov 18th, 2019
1,379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License. See LICENSE in the project root for license information.
  3.  
  4. ///
  5. /// Simple occlusion shader that can be used to hide other objects.
  6. /// This prevents other objects from being rendered by drawing invisible 'opaque' pixels to the depth buffer.
  7. ///
  8. Shader "MixedRealityToolkit/WindowOcclusion"
  9. {
  10.     Properties
  11.     {
  12.     }
  13.     SubShader
  14.     {
  15.         Tags
  16.         {
  17.             "RenderType" = "Opaque"
  18.             "Queue" = "Geometry-1"
  19.         }
  20.  
  21.         Pass
  22.         {
  23.             ColorMask 0 // Color will not be rendered.
  24.  
  25.             CGPROGRAM
  26.             #pragma vertex vert
  27.             #pragma fragment frag
  28.  
  29.             // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5.
  30.             #pragma target 5.0
  31.             #pragma only_renderers d3d11
  32.  
  33.             #include "UnityCG.cginc"
  34.  
  35.             struct v2f
  36.             {
  37.                 float4 pos : SV_POSITION;
  38.                 UNITY_VERTEX_OUTPUT_STEREO
  39.             };
  40.  
  41.             v2f vert(appdata_base v)
  42.             {
  43.                 UNITY_SETUP_INSTANCE_ID(v);
  44.                 v2f o;
  45.                 o.pos = UnityObjectToClipPos(v.vertex);
  46.                 UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  47.                 return o;
  48.             }
  49.  
  50.             half4 frag(v2f i) : COLOR
  51.             {
  52.                 return float4(1,1,1,1);
  53.             }
  54.             ENDCG
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement