Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[solved] Help with stencil shader

Discussion in 'Shaders' started by TitoOliveira, Nov 29, 2019.

  1. TitoOliveira

    TitoOliveira

    Joined:
    Aug 4, 2014
    Posts:
    63
    I have this quad that is writing to the stencil buffer, which is my stencil mask. Over to the right there is an opaque cube that is working as intended, the quad masks it.

    At the bottom i have a water shader that has a gradient color based on depth. But the quad is messing with the effect. I thought it would simply be ignored, since it doesn't do any stencil stuff, but i guess the screen depth information accounts for it. Not sure how could i ignore it.

    And at the left i have an additive particle effect that reads the stencil just like the cube does. But it only gets masked correctly by the quad if the particle effect is in front of it. When i move them behind the mask, they get occluded. What's up with that?

    Thanks for the help

     
  2. TitoOliveira

    TitoOliveira

    Joined:
    Aug 4, 2014
    Posts:
    63
    All problems were solved by disabling receive and cast shadows on the Stencil Mask shader
     
unityunity