ZED_StencilToMask.shader 791 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //======= Copyright (c) Stereolabs Corporation, All rights reserved. ===============
  2. // Sets the stencil to a texture to be used as a mask
  3. Shader "ZED/ZED StencilToMask"
  4. {
  5. Properties
  6. {
  7. }
  8. SubShader
  9. {
  10. Tags { "RenderType"="Opaque" }
  11. Pass
  12. {
  13. Stencil{
  14. Ref 148
  15. Comp Equal
  16. }
  17. CGPROGRAM
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. #include "UnityCG.cginc"
  21. struct appdata
  22. {
  23. float4 vertex : POSITION;
  24. float2 uv : TEXCOORD0;
  25. };
  26. struct v2f
  27. {
  28. float4 vertex : SV_POSITION;
  29. };
  30. v2f vert (appdata v)
  31. {
  32. v2f o;
  33. o.vertex = UnityObjectToClipPos(v.vertex);
  34. return o;
  35. }
  36. fixed4 frag (v2f i) : SV_Target
  37. {
  38. return float4(1,0,0,1);
  39. }
  40. ENDCG
  41. }
  42. }
  43. }