• Unity
  • Best setup for shadow-casting & Spine?

Hi there,

we are starting a new project and want to keep on using Spine (high priority for us).
The project will be isometric/semi-topdown 2D and we want to have really atmospheric lighting.

From what I gathered, there seem to be 2 current options to use lighting with Spine:

  • (Normal) 3D Lights
  • (New) 2D Lights, which are still very early in development

Now, in terms of lighting, we would like to achieve something a little bit like the game "Darkwood":
Check out a trailer here: https://www.youtube.com/watch?v=3S3tmWfFACQ

What we want is to have objects that cast shadows, preferably spine-animated ones, too.
With 3D Lights I believe that this was possible?
Is it also possible to do with the new 2D Lights? They already have a "shadow caster" system, but it does not seem to work with spine objects yet.

Basically, I would like to get some feedback on what you think is the best current lighting/shadow setup for Spine to achieve highly atmospheric results (think horror game lighting)

Related Discussions
...
  • Изменено
kbm написал

Is it also possible to do with the new 2D Lights? They already have a "shadow caster" system, but it does not seem to work with spine objects yet.

It could be that your mentioned shadow caster system is relying on the caster's shader writing to the Z-buffer (having ZWrite enabled). You can have a try switching the default Spine/Skeleton shader to e.g. Spine/Skeleton Lit ZWrite or to use the Spine/Sprite/Vertex Lit shader and enable Write to Depth.

4 месяца спустя

I'm posting this here just to avoid spamming the forum too much.
I'm using the Shadow Caster component with URP for our character to cast shadows from the lights system, but I get this weird cutouts all around the character that seem to belong to the different character parts of the Spine character.
Any ideas why is this happening?
Thank you very much in advance.

Thanks for reporting, we could reproduce this issue.

Unfortuantely this seems to be a current incompatibility of the 2D shadow casting system with MeshRenderer in combination with Texture transparency. The same issue also occurs when creating a normal Cube with a Universal Render Pipeline/2D/Sprite-Lit-Default material and assigning any Texture with transparency in it. The same Texture used as a Sprite at a SpriteRenderer works as intended, as you can see below:

Unfortunately none of the Texture Importer or MeshRenderer Inspector settings changed anything in this regard, so we're running out of ideas on how to fix this. It seems as if it's currently only working with SpriteRenderer but not with a MeshRenderer.

A very poor workaround would be to enable Self Shadows at the ShadowCaster2D component, and countering the missing light in the shader. This is a very limited workaround however, for obvious reasons.

Perhaps some thirdparty 2D shadowing asset packages might work instead of using Unity's 2D shadow casting system. If anyone has any recommendations in general regarding 2D shadow casting (volumetric lighting) in combination with Spine Skeletons, any input would be much appreciated!

Well, thanks a lot for trying and the help, Harald.
It seems we'll have to wait and see if this gets fixed on future Unity versions.

Harald написал

Perhaps some thirdparty 2D shadowing asset packages might work instead of using Unity's 2D shadow casting system. If anyone has any recommendations in general regarding 2D shadow casting (volumetric lighting) in combination with Spine Skeletons, any input would be much appreciated!

We use smart lighting 2D asset from unity store. Not only because of this issue, but because it provides much better performance compared to unity 2D shadows (which tbh look like they are in beta atm and not production ready).

@Kikekun You're welcome! Thanks for getting back to us.

@DarkTI Thanks very much for your input, very much appreciated!

DarkTI написал
Harald написал

Perhaps some thirdparty 2D shadowing asset packages might work instead of using Unity's 2D shadow casting system. If anyone has any recommendations in general regarding 2D shadow casting (volumetric lighting) in combination with Spine Skeletons, any input would be much appreciated!

We use smart lighting 2D asset from unity store. Not only because of this issue, but because it provides much better performance compared to unity 2D shadows (which tbh look like they are in beta atm and not production ready).

Oh wow, thanks a million for the help! We'll look into that one for sure. Looks great.