- Home /
Can I change the transparency of a Sprite only in the area where it is overlapped by another one?
Hey there,
I am looking for a special graphical effect concerning sprites. It should occur when one sprite overlaps another. Can I make only the overlapped area transparent, but not the rest of the sprite?
I have searched google, the docs and the Forums for solutions but wasn't able to find any that fit this particular problem.
If this should not be possible with sprites, can I achieve it with any particular mesh renderer/shader?
Thank you in advance! (and sorry if noob question, but noob)
Max
You'll probably need to write your own shader to do this.
I'm no expert on shaders, but I'd imagine you'd want a transparent shader that checks if anything is already rendered, and outputs a transparent pixel. If nothing is rendered it outputs a opaque pixel.
Hey Bored$$anonymous$$ormon,
thanks for the answer, I'll give it a try!
Best wishes
Your answer
Follow this Question
Related Questions
How to change sprite opacity during runtime 3 Answers
TrailRenderer sorting layer problem. 2 Answers
Light and 2D Sprite overlapping issue 1 Answer
Transparency on overlapping 2D objects 0 Answers