Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. Shader "Custom/HolePrepare" {
  2. Properties{
  3. }
  4.  
  5. SubShader{
  6. Tags { "RenderType" = "Opaque" "Queue" = "Geometry+1"}
  7. ColorMask 0
  8. ZWrite off
  9. Stencil {
  10. Ref 1
  11. Comp always
  12. Pass replace
  13. }
  14.  
  15. CGINCLUDE
  16. struct appdata {
  17. float4 vertex : POSITION;
  18. };
  19. struct v2f {
  20. float4 pos : SV_POSITION;
  21. };
  22. v2f vert(appdata v) {
  23. v2f o;
  24. o.pos = UnityObjectToClipPos(v.vertex);
  25. return o;
  26. }
  27. half4 frag(v2f i) : SV_Target {
  28. return half4(1,1,0,1);
  29. }
  30. ENDCG
  31.  
  32. Pass {
  33. Cull Front
  34. ZTest Less
  35.  
  36. CGPROGRAM
  37. #pragma vertex vert
  38. #pragma fragment frag
  39. ENDCG
  40. }
  41. Pass {
  42. Cull Back
  43. ZTest Greater
  44.  
  45. CGPROGRAM
  46. #pragma vertex vert
  47. #pragma fragment frag
  48. ENDCG
  49. }
  50. }
  51. }
  52.  
  53. Shader "Custom/Hole" {
  54. Properties{
  55. }
  56. SubShader{
  57. Tags{ "Queue" = "Geometry+10" }
  58.  
  59. ColorMask RGB
  60. ZWrite On
  61.  
  62. Stencil {
  63. Ref 1
  64. Comp notequal
  65. Pass Zero
  66. }
  67.  
  68. Pass{}
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement