I quickly pulled the latest code and dumped the lit shader into it. Result:
Loading Image
What I observe:
When using multiple atlas pages, sorting doesn't work. @Nate mentioned that this should be fixed in the next unity update.
Some sort of additive blending occurs when skeletons get lit from close, I'm not sure why this is. If I create a quad, slap a texture on it and apply the lit shader everything works as intended. No z-fighting, no weird blending, nothing.
A note, for this screenshot I set zWrite = true in the shader. What this does is solve the sorting issues but introduces z-fighting in the skeletons (not for the quads, even when they occupy the same position).
What I suspect is the issue:
I think it's the way the skeletons are generated. They're not double sided so they go invisible if you flip them, turning backface culling off solves this but stops the lighting from working because normals are facing the wrong direction and the triangle order is wrong. I've tried to reverse both with no luck 🙁 Because the skeletons generate quads with the same z-value, z-fighting (order of images keeps changing rapidly) occurs. This ONLY happens with skeletons and I have no idea why flips table I'll study @Nate's code again when I can and see if I can perform some wizardry.
Maybe when the awesome new 2D stuff (sorting layers I'm looking at you) comes in we'll find a better solution :yes: