Advertisement
Guest User

StencilMask.shader

a guest
Oct 9th, 2017
5,649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Shader "FX/StencilMask" {
  2. Properties{
  3.  
  4. _ID("Mask ID", Int) = 1
  5. }
  6. SubShader{
  7. Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+1" }
  8. ColorMask 0
  9. ZWrite off
  10. Stencil{
  11. Ref[_ID]
  12. Comp always
  13. Pass replace
  14. }
  15. Pass{
  16. CGINCLUDE
  17. struct appdata {
  18. float4 vertex : POSITION;
  19. };
  20. struct v2f {
  21. float4 pos : SV_POSITION;
  22. };
  23.  
  24.  
  25. v2f vert(appdata v) {
  26. v2f o;
  27. o.pos = UnityObjectToClipPos(v.vertex);
  28. return o;
  29. }
  30. half4 frag(v2f i) : SV_Target{
  31.  
  32. return half4(1,1,1,1);
  33. }
  34. ENDCG
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement