Advertisement
tonynogo

Demo 09 - Mask stencil

Jul 6th, 2017
11,009
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Custom/Mask" {
  2.     SubShader {
  3.         Tags { "RenderType"="Transparent" }
  4.         Stencil {
  5.             Ref 1
  6.             Comp always
  7.             Pass replace
  8.         }
  9.  
  10.         CGPROGRAM
  11.         #pragma surface surf Lambert alpha
  12.  
  13.         struct Input {
  14.             fixed3 Albedo;
  15.         };
  16.  
  17.         void surf (Input IN, inout SurfaceOutput o) {
  18.             o.Albedo = fixed3(1, 1, 1);
  19.             o.Alpha = 0;
  20.         }
  21.         ENDCG
  22.     }
  23.     FallBack "Diffuse"
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement