Hello fellows! I’m working on my 2d game on unity, and I trying to write a shader for it. I almost done it, but I have one snag. I work with sprites so if one sprite is above than another he is not rendering in the right way. Let me show you what I mean. Here is picture of my main character standing behind the wall, but shader works wrong and you can see this:
I think my problem in this piece of code
Cull Back
Lighting Off
ZWrite Off
ZTest Always
Fog { Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
I played with this settings already and nothing is working. If I delete all code and leave behind this string
Blend SrcAlpha OneMinusSrcAlpha
I can see this changes:
Part of the wall is disappear! It is because I use pieces of walls and some of them have alpha channel
So, guys, can you help me? If you need a full code of my shader you can just ask me about it