ToddRivers wroteHmm sorry I think I might've uploaded a broken SkeletonRenderer.cs.
I do have go this all working locally so it is possible, but yeah Spines unity runtime needs to be changed to build proper tangents - without them bump lighting just can't work.
Could you try downloading the shaders package from the first post again? I've added my current skeletonrenderer and tangent solver to it. Hopefully that should sort things, its def working for me now finally!
Also I've added a 'SpineFlipper' component I've been using to flip spine animations in the editor, which you should be doing instead of rotating the sprite 180 around the Yaixs or giving it negative scale. (Just add the component to a gameobject with a SkeletonAnimation and then you can set the two flip flags to flip animation in the scene view).
@Pharan I've also found a bug with the BoneFollower component which means it doesn work properly when the skeleon is flipped. I can share my fix with you if you want?
I've re-downloaded the attachment from the original post and started a new project as the original one seems to have coloured all of the textures a flat bright pink.
I've imported spine-unity and SpriteShaders.unitypackage.
I've baked a dragon from the Examples folder and changed the shader on the dragon's material the Game/Sprite Pixel Lit.
I've included a directional light and am getting the same results as before.
However, I haven't been able to find this window:
Loading Image
The script "Skeleton Animation" doesn't seem to exist in my project:
These are the scripts I can add as components to the prefab:
Ok I've switched to an example scene which includes the dragon as a spine object rather than a baked unity object.
This time I get the Skeleton Animation component appearing and I have selected the 2 required options.
However, the lighting is still incorrect. This is most obvious on the tail where some segments are lit from below and some from above:
Also, the rear leg is lit from above but the rear foot is lit from below.
26 Mar 2016, 11:31
Here's a video of spine lighting from over a year ago by the developer.
There seems to have been no progress in over a year on this 😢
This is the effect I'm wanting.
How do I achieve it?
26 Mar 2016, 12:48
I've exported a brand new version of SpineBoy with atlas rotation turned off.
When I light him up in Unity the lighting is now correct on all body parts!
Success!
Actually, not quite..
As soon as I select an animation, the lighting doesn't update correctly based upon the new rotations 😢
As you can see, his rear leg appears to be lit from the bottom by the bright blue/white light (really it's being lit from the top right).
But he does look really good with just a couple of lights.
It's a real shame that spine isn't compatible with unity shaders and lighting
(unity shaders are one of, if not the most important, parts of unity - without shaders nothing would be drawn to the screen - I can't comprehend how an animation modelling system wouldn't be compatible with the core process of drawing things to the screen - it kind of defeats the purpose)
Thanks Todd for all your hard work on writing custom shaders for spine, but really spine should be compatible with any of the other custom shaders for unity and most certainly the default shaders..
I could go one but there's no point.
I'll just get a refund on Spine and if they ever fix their tool to be compatible with Unity I will purchase it again.