• Unity
  • 2D Lighting in Unity 2019.2

Hi Esoteric Team,

Unity is about to allow all users working in 2D to have 2D specific lighting. The way they allow the lighting to work is by changing the material of the objects in Unity. The material in Spine I imagine is a bit different from this new material. Is there going to be support for a lighting system that works with Spine objects in Unity?

Tim

Related Discussions
...

Hi Tim,

Yes, we are planning to support the 2D Renderer and 2D Light pipeline introduced in Unity 2019.2 (although experimental).
There is now an issue ticket here:
[unity] Support 2D Lights of Unity 2019.2 · #1413

Note however that we have other important tickets to support recent Unity additions in line before this task.

We have just recently finished development of a Spine LWRP Shaders UPM package that now provides support for the previously existing Spine shaders Spine/Skeleton Lit and Spine/Sprite/Pixel Lit and Vertex Lit which rendered pink due to not being supported in LWRP.
There will be an official release blog post soon (however, the Spine 3.8 release comes first). It was tracked in this ticket if you are interested:
https://github.com/EsotericSoftware/spine-runtimes/issues/1255

Harald yazdı

Hi Tim,

Yes, we are planning to support the 2D Renderer and 2D Light pipeline introduced in Unity 2019.2 (although experimental).
There is now an issue ticket here:
[unity] Support 2D Lights of Unity 2019.2 · #1413

Note however that we have other important tickets to support recent Unity additions in line before this task.

We have just recently finished development of a Spine LWRP Shaders UPM package that now provides support for the previously existing Spine shaders Spine/Skeleton Lit and Spine/Sprite/Pixel Lit and Vertex Lit which rendered pink due to not being supported in LWRP.
There will be an official release blog post soon (however, the Spine 3.8 release comes first). It was tracked in this ticket if you are interested:
https://github.com/EsotericSoftware/spine-runtimes/issues/1255

Oh wow this is AMAZING news! We can finally take advantage of LWRP in unity! Any news on supporting light map baking as well? 🙂

Glad you like it 🙂.

Which use case of lightmap baking are you thinking of regarding the Spine shaders?
BTW: Light Probes are supported in the new LWRP shaders.

Harald yazdı

Glad you like it 🙂.

Which use case of lightmap baking are you thinking of regarding the Spine shaders?
BTW: Light Probes are supported in the new LWRP shaders.

In terms of use case, being able to bake the light and shadow information, overall, helps a ton for optimization and performance.

You mean Light Probes will work on the newest Spine/ Sprite/ Pixel Lit (LWRP) shaders, right? :o

Because I tried using Light Probes last year but it didn't work with the Spine Shaders. I was tempted to switch everything over to Unity's standard shader, but it made some Spine assets look awful. :zipper: :scared:

IndieDoroid yazdı

In terms of use case, being able to bake the light and shadow information, overall, helps a ton for optimization and performance.

The questions is why would you want to assign the Spine shader at static geometry? Lightmaps will not affect dynamic objects. Typically you will have light probes in place that save the lighting state at a point during time ob lightmap baking and then have your dynamic objects lit by those light probes.

IndieDoroid yazdı

You mean Light Probes will work on the newest Spine/ Sprite/ Pixel Lit (LWRP) shaders, right? :o

Yes, they are supported in the glorious new Lightweight Render Pipeline/Spine/Sprite shader. 🙂

IndieDoroid yazdı

Because I tried using Light Probes last year but it didn't work with the Spine Shaders. I was tempted to switch everything over to Unity's standard shader, but it made some Spine assets look awful. :zipper: :scared:

Sorry to hear that. Actually the previous Spine/Sprite shaders supported light probes by enabling the Spherical Harmonics parameter. Thanks for the hint, I will change this name on the 3.8-beta branch, as this is hiding the actual feature from those who know that light probes are stored as spherical harmonics.

Btw: even more features are enabled by enabling the Spherical Harmonics parameter, if you look at the hint-text:

"Enable to use spherical harmonics to calculate ambient light / light probes. In vertex-lit mode this will be approximated from scenes ambient trilight settings."

Harald yazdı

The questions is why would you want to assign the Spine shader at static geometry? Lightmaps will not affect dynamic objects. Typically you will have light probes in place that save the lighting state at a point during time ob lightmap baking and then have your dynamic objects lit by those light probes.

I prefer the flattened look of the Spine Shader on my environmental assets. 🙂

Harald yazdı

Yes, they are supported in the glorious new Lightweight Render Pipeline/Spine/Sprite shader. 🙂

I can't wait to give these a try! But I wonder how painful it's going to be to convert all my scenes to LWRP ... I guess I'll find out lol

Harald yazdı

Sorry to hear that. Actually the previous Spine/Sprite shaders supported light probes by enabling the Spherical Harmonics parameter. Thanks for the hint, I will change this name on the 3.8-beta branch, as this is hiding the actual feature from those who know that light probes are stored as spherical harmonics.

Btw: even more features are enabled by enabling the Spherical Harmonics parameter, if you look at the hint-text:

"Enable to use spherical harmonics to calculate ambient light / light probes. In vertex-lit mode this will be approximated from scenes ambient trilight settings."

Oh wow! I didn't knot the full extent of Spherical Harmonics, was this something you guys added or was it always there in the original shader? :scared:

Will these LWRP shaders work with 2018.4 ? Or we should update to 2019.2?

IndieDoroid yazdı

I prefer the flattened look of the Spine Shader on my environmental assets. 🙂

Ok, I didn't expect that. 🙂

IndieDoroid yazdı

Oh wow! I didn't knot the full extent of Spherical Harmonics, was this something you guys added or was it always there in the original shader? :scared:

Spherical harmonics have been supported in the Spine/Sprite shaders for quite some time, it was not added too recently. BTW: I have renamed the paremeter and released a new unitypackage yesterday.

IndieDoroid yazdı

Will these LWRP shaders work with 2018.4 ? Or we should update to 2019.2?

We recommend using Unity 2019.1 when using Unity's LWRP packages in general.
Long story: The LWRP packages available for Unity 2018 were different and marked as preview packages, ending at version number 4.10. Using this preview package, we received shader compile errors which we did not get to resolve quickly, so out of the box this will not be compatible. We support versions of the com.unity.render-pipelines.lightweight package from 5.7.2 onward, which I fear cannot simply be copied over to an existing Unity 2018 project.

Harald yazdı

Spherical harmonics have been supported in the Spine/Sprite shaders for quite some time, it was not added too recently. BTW: I have renamed the paremeter and released a new unitypackage yesterday.

We recommend using Unity 2019.1 when using Unity's LWRP packages in general.
Long story: The LWRP packages available for Unity 2018 were different and marked as preview packages, ending at version number 4.10. Using this preview package, we received shader compile errors which we did not get to resolve quickly, so out of the box this will not be compatible. We support versions of the com.unity.render-pipelines.lightweight package from 5.7.2 onward, which I fear cannot simply be copied over to an existing Unity 2018 project.

Ok got it! Thanks for the update. No big deal, I'll probably move over to 2019 at some point! 8)

4 ay sonra

I have a project in production and we've just opened a branch for upgrading to the 2D Rendering in URP. It's looking like that is ultimately we would like transition over to it in the main branch too, but we'd need to get our spine animations to work with the new renderer.

I noticed that all of my spine animations are properly lit by the 2D renderer if i use Unity's LWRP-2D-Sprite-Lit-Default shader except my main character who appears completely black. The only difference I can see that might be causing this is that my main character has multiple materials (3, one for each seperate atlas texture it uses).

Could anyone offer any insight into why this might be the case? I'd love to find a workaround that would let me keep progressing with the 2D lighting system while you folks work on proper compatible shaders.

Thanks for sharing any workarounds in the meantime, very much appreciated!
We are sorry that it takes longer than we would have liked it to take to get to this task.

17 gün sonra

With 2019.3 and its 2D tools stable release upon us it would be nice to see Spine support as well.

Yes, guys, please, 2019.3 is a pretty essential update for devs, and we will transition there as soon as it is out. ( Given that Spine is ready )

Our company is really hopes for Spine and 2D tools friendship.

Jumping on the bandwagon here - my team is starting on a project where we are spending the next two months making a vertical slice demo that we'll be using to try to get a publisher. Lighting is a huge part of the visuals, so I'm in a weird in-between state where I'm not sure if I can use the new 2D tools or not (I would REALLY like to).

I think I'll give it a try with the Unity LWRP-2D-Sprite-Lit-Default shader like @SpiralCircus was mentioning. None of my characters need to use more than one material. Worth giving it a try!

Just to let people know, it wasn't the multiple materials that was causing my problem. Pretty sure it was unrelated to Spine and was just some quirk of my particular prefab setup. I rebuilt the prefab and it worked again.

I have since put together several shaders in shadergraph using the 2D master nodes (lit and unlit) with URP and they all work perfectly with spine animations. So don't feel like you shouldn't try the new unity systems because you're waiting on spine support. Unity's built-in URP + 2D renderer shaders work perfectly.

Thanks for the confirmation of the importance of Unity 2019.3 support and the 2D Lighting tools, we are currently removing the last hurdles of general problems with Unity 2019.3 and can then finally implement support for the 2D lighting tools.

Harald yazdı

Thanks for the confirmation of the importance of Unity 2019.3 support and the 2D Lighting tools, we are currently removing the last hurdles of general problems with Unity 2019.3 and can then finally implement support for the 2D lighting tools.

Whoohooooooo!! 🙂

We are glad to announce the first (for now experimental) upload of the Universal Render Pipeline extension package, including support for 2D Renderer (and thus 2D lights):
Spine Unity Download

Please note that you need to use the special newer spine-unity 3.8 runtime package as noted on the download page, as it contains some necessary modifications.

We will officially release this package next week if everything goes well.