• Unity
  • Point light does not work with Skeleton Lit shader

Related Discussions
...

Only Directional light works at all on Spine-objects with "Skeleton Lit" shader. Point light and all other types just have no effect. I would say it worked in 3.6. But now i upgdaded to 3.8 and point light does not work anymore. Any walkaround for that?

(I have a pretty big project, so it would be perfect if i do not need to upgrade everything again to the newest version)

Image supprimée en raison de l'absence de support de HTTPS. | Afficher quand même

Unity version: 2018.2.14
Spine runtime version: 3.8.2019-10-22.unitypackage

P.S. Is any documetation to spine-unity runtimes shader available? Can not find it with google.


Found examples in SpineRuntime.

Image supprimée en raison de l'absence de support de HTTPS. | Afficher quand même

Shader: Spine/Sprite/VertexLit looks better (at least it is affected by point light).

Shouldn't "Skeleton Lit" shader be used anymore? It looks identical with this project: https://github.com/traggett/UnitySpriteShaders

Is "Spine Uber Shader" a part of spine-unity runtime now?


Spine/Sprite/Vertex Lit seems to work for most skeletons.

Is any way to adjust material "sesitivity" to Light Source? So i need to light not only spine-objects, but any other 2d-lit sprites with different shaders. And it would be very handy if i can adjust how strong is object affected by one light, without to modify this light intensity.

Maltakreuz a écrit

Only Directional light works at all on Spine-objects with "Skeleton Lit" shader. Point light and all other types just have no effect.

Spine/Skeleton Lit works with all light types. I just tested it with point lights and see no problem:

Did you upgrade Unity as well? Could you please check your project settings whether anything is limiting your light interaction?

Shouldn't "Skeleton Lit" shader be used anymore? It looks identical with this project: https://github.com/traggett/UnitySpriteShaders
Is "Spine Uber Shader" a part of spine-unity runtime now?

The Spine/Sprite shaders are what was called Spine Uber Shader some time ago.
Spine/Skeleton Lit is the lightweight lit shader with a far smaller feature set than the Unity Sprite Uber Shader or Spine/Sprite shaders. It has been that way in spine-unity 3.6 already, so I wonder if you have upgraded from an even older spine-unity version?

A short Spine shader documentation listing can be found on the spine-unity documentation page:
spine-unity Runtime Documentation: Shaders

1) Normals Z Direction: Ah, now i know what was the reason: It works, but sprites are lit only from backside.

It can be easy be "repaired" by scaling -1 on Z axe. But it would be a little bit annoying do not fogtet to flip every spine-object in game, otherwise it will not be lit. Can i somehow change the default lit direction for "Spine/Skeleton Lit" to make it work "out of the box" for me? Or is something wrong with my spine project or export settings? Just looked in Spine-project, character is not flipped by -1 or like that.

btw: In "uber"-shader i need to flip default fixed normal from (0, 0, 1) to (0, 0, -1) to make lighting work at all. Is something wrong with my unity-project settings?

2) Intensity adjustment: Unfortunately i should somehow adjust spine-shader lighting and another sprites shader lighting in game, to make objects look uniform lit by one source. Is any way to adjust Intensity of lighting for a particular object or material? Like 0-1.0f slider to make object darker/lighter from same light source? It would be really great. I found how it can be done in "spine-uber" shader. I can just use fixed normals like 0, 0, -1 and then make Z value -0.4f or -2.0f. It makes intensity darker/lighter. Can i somehow adjust intenstiy of default Skeleton Lit shader?

Image supprimée en raison de l'absence de support de HTTPS. | Afficher quand même


(background and sprite-object use another shader, which has no intensity adjustment too)

3) If i will use "uber shader" (Vertex Lit) istead of Skeleton Lit shader, will it be much worse in terms of performance. I probably need like 100 spine skeletons pro scene. I do not need advanced uber-shader features like normal maps or rim-lighting. Does it make big difference in this case?

Just made a quick test: for 100 enemies it seems to make no FPS-difference at all. So i probably just can use uber shader with it's "intensity" adjustment via fixed-normals.

Image supprimée en raison de l'absence de support de HTTPS. | Afficher quand même

Maltakreuz a écrit

It can be easy be "repaired" by scaling -1 on Z axe. But it would be a little bit annoying do not fogtet to flip every spine-object in game, otherwise it will not be lit.
[..]
btw: In "uber"-shader i need to flip default fixed normal from (0, 0, 1) to (0, 0, -1) to make lighting work at all. Is something wrong with my unity-project settings?

This sounds strange indeed. I never managed to invert the camera forward axis, but maybe that's possible. Judging from your images I cannot tell whether the light is in front or behind the Sprite. If you are using the Skeleton Lit shader, then a directional light in front of your skeleton (with positive scale at every parent) that points to the skeleton shall be correctly lit - if this is not the case, then something is wrong.

To be sure: If you are using normal maps (which I think you're not), please note that there are multiple ways to configure normal and tangent generation, in the SkeletonRenderer Advanced inspector section and in the Fixed Normals section of the Spine/Sprite shaders.

Maltakreuz a écrit

Is any way to adjust Intensity of lighting for a particular object or material?

Such shader features are not included in the Skeleton Lit shader which is very basic. Since the full source code is provided, you can easily modify existing shaders to included a multiplier.

The Spine/Sprite shaders provide a color tint multiplier next to the albedo texture slot, which you could use for this purpose.