PortalMask.shader 758 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
  3. Shader "Portals/Mask"
  4. {
  5. Properties {
  6. }
  7. SubShader
  8. {
  9. Tags { "RenderType"="Tranperent" "Queue"="Geometry-100"}
  10. ColorMask 0
  11. Cull Off
  12. ZWrite Off
  13. Stencil
  14. {
  15. Ref 2
  16. Comp always
  17. Pass replace
  18. }
  19. Pass
  20. {
  21. CGPROGRAM
  22. #pragma vertex vert
  23. #pragma fragment frag
  24. struct appdata
  25. {
  26. float4 vertex : POSITION;
  27. };
  28. struct v2f
  29. {
  30. float4 pos : SV_POSITION;
  31. };
  32. v2f vert(appdata v)
  33. {
  34. v2f o;
  35. o.pos = UnityObjectToClipPos(v.vertex);
  36. return o;
  37. }
  38. half4 frag(v2f i) : COLOR
  39. {
  40. return half4(1,1,0,1);
  41. }
  42. ENDCG
  43. }
  44. }
  45. }