- Home /
Question by
noio · Nov 13, 2014 at 06:34 PM ·
shaderlightingz-fighting
Lighting on overlapping sprites
When I have a number of overlapping sprites (same z) with the SpriteDiffuse shader, the lighting on those sprites is "added" for each sprite when using a per-vertex point light. Besides from the remark that it's bad to have objects with an identical z, is there a way to prevent unity from adding these passes?
I think this is a related problem.
screen shot 2014-11-13 at 17.15.29.png
(68.6 kB)
screen shot 2014-11-13 at 17.07.11.png
(34.3 kB)
Comment
Best Answer
Answer by noio · Aug 15, 2017 at 02:24 PM
For those still finding this question: I ended up simply making sure that my sprites never have the same Z-coord. In many cases by automatically adding a very small random offset
Answer by MercurialKid · Jan 25, 2019 at 08:42 AM
Thanks for posting. But as a solution, this won't help with tilemaps, spriteshape, or many other applications though.