• RuntimesUnity
  • Spine object like shadow on the ground with Unity 2d

Hi Team!
tl;dr: is it possible to create a Spine character shape like a shadow from Unity 2D?

Upon checking on the below post, it seems like this is possible by using skeleton-lit, but when I import this, the shader is not working with URP (I can change it if needed) and does not import to the unity project anymore (in the shader > failed to compile)
Link: https://zh.esotericsoftware.com/forum/d/1403-unity-lighting-shadows-and-performance-improvements

What is the best practice to make a "spine object shape like" shadow with Unity 2D?

I am willing to change everything (except unity 2d to 3d possibly) to make this shadow!

Thanks!

  • Harald ha risposto a questo messaggio
    Related Discussions
    ...
    kun ha cambiato il titolo in Spine object like shadow on the ground with Unity 2d .
    • Modificato

    @kun Please note that the post you linked is ten years old! Any information about how to achieve certain things is certainly outdated by now.

    kun Upon checking on the below post, it seems like this is possible by using skeleton-lit, but when I import this, the shader is not working with URP (I can change it if needed) and does not import to the unity project anymore (in the shader > failed to compile)

    As the documentation says, the spine-unity core package only provides shaders for the built-in render pipeline. Spine URP shader variants are available via an extension UPM package:
    https://esotericsoftware.com/spine-unity#Shaders
    https://esotericsoftware.com/spine-unity#URP-Shaders---Extension-UPM-Package

    By "Unity 2D", do you mean that you are using the URP 2D Renderer? If so, why do you use the 2D Renderer when you want to cast 3D shadows? You could quite easily achieve your goal by using URP 3D Renderer with any of the lit Spine URP shaders.

    Hi @Harald thank you for your reply!

    Indeed, I am using unity 2d URP for the current setup. I understand it is a basic question, but is it possible to use unity 3d URP with Unity 2D?

    Could you please kindly share with me some tutorials on this?
    Is it possible to achieve this shadow via an extension UPM package?

    @kun What exactly do you mean by "Unity 2D"? If you mean that you have selected the project template "2D (URP)", this just means the following according to the template description:

    This is an empty project configured for 2D apps. It uses Unity’s Universal Render Pipeline pre-configured with 2D Renderer.

    So there is no hard line that separates a project from being a 2D or 3D project apart from using the 2D URP renderer here. When using the URP 2D Renderer, you have to use the specific 2D Lights system (no automatic 3D shadow casting), normal (3D) lights have no effect. The opposite applies to when using a URP 3D Renderer, which will ignore 2D lights.

    Could you please kindly share with me some tutorials on this?

    Unfortunately I don't know of any good tutorials on this matter. In general I would always recommend having a look at the official Unity documentation first, both their Manual (text) as well as their tutorial videos.

    Is it possible to achieve this shadow via an extension UPM package?

    Please see the spine-unity documention page on shaders:
    https://esotericsoftware.com/spine-unity#Shaders

    Your shaders have to match the active render pipeline.

    • a) When using the built-in render pipeline (not URP), you can use all shaders in spine-unity.
    • b) When using URP 2D Renderer or URP with a 3D Renderer, you need to install and use the shaders of the Spine URP Shaders UPM package instead. Here you can't use Universal Render Pipeline/2D/* shaders with a 3D Renderer and vice versa.