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

Advanced masking

Discussion in 'Shaders' started by zinkins, Dec 4, 2018.

  1. zinkins

    zinkins

    Joined:
    Jun 3, 2015
    Posts:
    16
    Hi!
    I'm trying to solve the issue but I have a little experience with shaders so I need some help.
    I got moving holes that have following setup: renderer with depth mask shader with "Queue" = "Geometry-1" and only writing the depth. And renderer with standard shader and "Queue" = "Geometry-2" to show hole insides.
    Ground has standard shader and objects falling to holes got "Queue" = "Geometry-2".

    This works fine except the case when one hole is inside another as shown on image below.
    What I got now.png

    Is it possible to setup in such way that external side of hole that inside another hole was not rendered but internal side was?
    What I want.png

    I tried configurable shaders to fiddle with stencil and depth options but my random settings didn't work)
     
unityunity