stencil in unity3d

Pass {
            Stencil { 
              Ref 1 
              Comp Always 
              Pass REPLACE 
            }
            
            AlphaTest Greater 0
            Blend SrcAlpha OneMinusSrcAlpha 
            Color[_Color]
            SetTexture[_MainTex] {
                Combine texture
            }
        }
        
        // render outline
        
        Pass {
        
            Stencil {
                Ref 1
                //Comp Always
                Comp NotEqual
               
            }
            
            Cull Off
            ZWrite Off
            
            AlphaTest Greater 0.9
            Blend SrcAlpha OneMinusSrcAlpha 
...
}
原文地址:https://www.cnblogs.com/lightlfyan/p/4260380.html