Shader "Hidden/VolumetricLights/TransparentDepthWrite" { Properties { _MainTex ("Texture", 2D) = "white" {} _Color ("Color", Color) = (1,1,1) } SubShader { ColorMask A ZWrite Off Cull Off Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" struct appdata { float4 vertex : POSITION; }; struct v2f { float4 vertex : SV_POSITION; float2 depth : TEXCOORD0; }; v2f vert (appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.depth = o.vertex.zw; return o; } half4 frag (v2f i) : SV_Target { half4 color = half4(1, 1, 1, i.depth.x/i.depth.y); return color; } ENDCG } } }