Search Unity

Question Depth Mask Working in Isometric View but not in Perspective View..? (2020.2)

Discussion in 'Shader Graph' started by Kobold_the_Kobold, Apr 1, 2021.

  1. Kobold_the_Kobold

    Kobold_the_Kobold

    Joined:
    Jan 16, 2018
    Posts:
    5
    As title says, and seen in screenshot below, my -really standard- depth mask shader is working properly in Isometric View, but cease to work in Perspective View (both for the scene view AND the game camera). I am not using particular render pipeline or fancy graphics stuff; just straight out-of-the-box Unity 2020.2

    I am currently using 2020.2.3f1, and everything worked perfectly fine when I tested in 2019.4.0f1

    What could be causing the issue to appear only in 2020? Is there a specific graphics setting I should turn off?


    Isometric Scene View:


    Perspective Scene View:


    Depth mask shader:
    Code (CSharp):
    1. Shader "Custom/DepthMask"
    2. {
    3.     SubShader
    4.     {
    5.         //Render the mask after regular geometry, but before masked geometry and transparent stuff
    6.         Tags { "Queue"="Geometry+1" }
    7.        
    8.         //Don't draw in the RGBA channels
    9.         ColorMask 0
    10.         ZWrite On
    11.  
    12.         //Do nothing in pass
    13.         Pass {}
    14.  
    15.     }
    16. }