- Home /
 
 
               Question by 
               mmukhtar1738 · Jun 05, 2018 at 04:29 AM · 
                shadersy-axisstencilrestrictions  
              
 
              How to restrict my stencil shader to Y values under 0? ,how do I restrict a stencil to -Y values ?
Hello
I'm very new to coding. I created a stencil to create a hole effect on a plane. but the stencil still covers the objects after they come out of the hole.
what can I add to the stencil to make it restricted to Y values under 0?
here are the shader scripts, this is the mask script :
 Shader "Custom/mask"
 {
     
     SubShader
     {
         Tags { "RenderType"="Opaque" }
         LOD 100
 
         ColorMask 0 
 
     Stencil {
         Ref 1
         Pass Replace
     }
 
         Pass
         {
             Cull Front
         }
     }
 }
 
               and this is the stencil part of the shader for the object material.
 cull off
 
         Stencil {
             Ref 1
             Comp NotEqual
         }
 
               Which one am I supposed to edit and what should I add?
Thanks.
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Problem with transparency and stencil shader 1 Answer
Shader that renders pixel with highest alpha value? 0 Answers
Multi-shader Stencil Buffer not working as expected,Multi-shader Stencil not working as expected 0 Answers
Adding a Stencil to Particle Standard Surface shader 0 Answers
Stencil buffer on mobile 0 Answers