Advertisement
evelynshilosky

OutlineMask - Part 5

Feb 25th, 2025
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. Shader "Custom/Outline Mask" {
  2.   Properties {
  3.     [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 0
  4.   }
  5.  
  6.   SubShader {
  7.     Tags {
  8.       "Queue" = "Transparent+100"
  9.       "RenderType" = "Transparent"
  10.     }
  11.  
  12.     Pass {
  13.       Name "Mask"
  14.       Cull Off
  15.       ZTest [_ZTest]
  16.       ZWrite Off
  17.       ColorMask 0
  18.  
  19.       Stencil {
  20.         Ref 1
  21.         Pass Replace
  22.       }
  23.  
  24.       CGPROGRAM
  25.       #pragma vertex vert
  26.       #pragma fragment frag
  27.  
  28.       struct appdata {
  29.         float4 vertex : POSITION;
  30.       };
  31.  
  32.       struct v2f {
  33.         float4 position : SV_POSITION;
  34.       };
  35.  
  36.       v2f vert(appdata input) {
  37.         v2f output;
  38.         output.position = UnityObjectToClipPos(input.vertex);
  39.         return output;
  40.       }
  41.  
  42.       fixed4 frag(v2f input) : SV_Target {
  43.         return 0;
  44.       }
  45.       ENDCG
  46.     }
  47.   }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement