I have a 2D game, I make a fog of war in it. I use a quad with a material with a transparency shader. And transparency works, but for some reason only objects with sorting layer = default are visible.
Objects have at least a sprite renderer.
Here is the shader
Shader "Custom/FogOfWarCG" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Tags { "RenderType" = "Transparent" "Queue" = "Transparent" } Blend SrcAlpha OneMinusSrcAlpha Cull Off LOD 200 Lighting off pass { CGPROGRAM #pragma vertex vert_img #pragma fragment frag #include "UnityCG.cginc" uniform sampler2D _MainTex; fixed4 frag(v2f_img i) : SV_Target { return tex2D(_MainTex, i.uv); } ENDCG } } FallBack "Diffuse" }
It is not clear why. Is it possible to selectively show other layers?