title: How can I add a ZWrite pass to a transparent shader graph?
body: <p>I have been trying to achieve <a href="https://forum.unity.com/threads/transparent-depth-shader-good-for-ghosts.149511/" rel="nofollow noreferrer">this effect from Tim-C</a> (which all seems to be outdated, even the fixes posted in the comments) with ShaderGraph (Unity 2019.3.0f3), but as far as I know you can't do that within ShaderGraph, so after looking at <a href="https://docs.unity3d.com/Manual/SL-CullAndDepth.html" rel="nofollow noreferrer">this page on the ShaderLab documentation</a> I came up with the following shaders that use a shader graph I made.</p>
  
  <p>Using this shader displays the shader graph completely fine:</p>
  
  <pre><code>Shader "Custom/BlockPreview_ZWrite"
  {
      Properties
      {
          //Has the same name as 'Reference' in shader graph.
          PreviewColor("Hologram Color", Color) = (0.90, 0.90, 0.90, 0.20)
      }
  
      SubShader
      {
  
          Tags {
              "Queue" = "Transparent"
              "RenderType" = "Transparent"
              "RenderPipeline" = "UniversalPipeline"
          }
  
          UsePass "Shader Graphs/BlockPreview_Graph/Pass"
  
      }
  
  }
  </code></pre>
  
  <p>So I tried adding a ZWrite pass, but this shader will just display nothing at all (but the outline in the scene view still works like it's there):</p>
  
  <pre><code>Shader "Unlit/BlockPreviewZ"
  {
      Properties
      {
          //Has the same name as 'Reference' in shader graph.
          PreviewColor("Hologram Color", Color) = (0.90, 0.90, 0.90, 0.20)
      }
  
      SubShader
      {
  
          Tags
          {
              "Queue" = "Transparent"
              "RenderType" = "Transparent"
              "RenderPipeline" = "UniversalPipeline"
          }
  
          Pass                                                                                           //
          {                                                                                              //
              ZWrite On                                                                                  //
              ColorMask 0   //Commenting out this line will just display a solid white object.           //
          }                                                                                              //
  
          UsePass "Shader Graphs/BlockPreview_Graph/Pass"
  
      }
  
  }
  </code></pre>
  
  <p>Other than what I've wrote here, I have very little ShaderLab experience or knowledge, so what can I do to make the <code>UsePass</code> work with the <code>ZWrite</code> pass I need to add?</p>