Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Depth mask with standard "fade" texture

Discussion in 'Shaders' started by Aegilluum, Sep 2, 2015.

  1. Aegilluum

    Aegilluum

    Joined:
    Sep 28, 2013
    Posts:
    28
    Hi !
    I'm using the depth mask shader, ( http://wiki.unity3d.com/index.php?title=DepthMask ) to mask part of a mesh and it has some unwilling results:

    Capture d’écran 2015-09-02 à 15.28.43.png Capture d’écran 2015-09-02 à 15.28.49.png

    So it basically hides the plane behind, which I don't want. I didn't attached the script to set the render queue on this plane. The plane behind use a standard unity shader with the option "fade" selected. The same happens if I select CutOut or transparent.

    Thanks in advance !
     
  2. Aegilluum

    Aegilluum

    Joined:
    Sep 28, 2013
    Posts:
    28
    I found a solution, if anyone face the same issue, just put a script to set the render cue of the object with the transparent texture above the object that you're want to mask!

    Code (CSharp):
    1.  
    2.    void Start () {
    3.         Renderer r = GetComponent<Renderer>();
    4.         r.material.renderQueue = 100;
    5.     }
    6.