Hi all,
i got a little question about shaders.
I googled and searched a lot but i’m really stuck…
I got a simple game object with a sprite renderer. (the image is a Trunk)
I want to add another game object inside the trunk (a Cut) that renders on the edge of it.
The hard part for me is applying the transparency of the Cut sprite ON the Trunk sprite (so that the background becomes visible through both).
I already managed to write (by cutting and pasting some code and playing a bit with it) a shader to make a single color transparent on a sprite, so my hope is that i can manage to apply the transparency EVEN on objects on the back of the object itself.
I searched / tested / read about many shader commands and such but i don’t even know if what i’m looking for is possible(Cull, ZTest, Queue, Blend etc…).
(i’m totally noob with shaders and started from just 2 weeks ago with unity2d in spare time)
Attached the idea explained in the image and the two zombie-shaders i stealed from the web.
Please be patient and remember that i’m a noob! (and my english is not so good )
thanks a lot,
David
2187936–145129–VerticalSpriteCutter.shader (1.55 KB)
2187936–145130–Transparentizer.shader (1.94 KB)