@akeboshi Thanks for the additional information and the screenshot.
Please note that this question is independent of Spine and the spine-unity runtime. What should the shadow look like and how should it be projected onto a 2D plane without depth information? You may want to search the Unity forum how you can project a 2D shadow from a MeshRenderer
or a Sprite
, or use one of the techniques described below on a Unity how-to article on 2D lights and shadows:
https://unity.com/how-to/2d-light-shadow-techniques-in-the-universal-render-pipeline#creating-2d-shadows
If you need more precise 2.5D shadows, I would recommend switching from the 2D Renderer
to the normal 3D URP renderer. Then you could utilize proper 3D shadow casting by tilting your skeleton character assets away from the ground plane.
Another way to fake a shadow that looks like the character might be to use the RenderExistingMesh
component and re-render the same Spine skeleton in a scaled or distorted way with a transparent black fake-shadow material. This shadow material could use a custom shader which is set to semi-transparent black with multiply blend mode. However, to get rid of double- and triple-shadowed areas where attachments overlap you would need to render the skeleton to a render texture first. You could try the SkeletonRenderTexture
example component. Unfortunately this component uses functionality which is not fully compatible with the URP pipeline, and lighting affecting the skeleton before it is rendered to the RenderTexture will be ignored and the skeleton itself will then always be fully lit (as with an unlit shader, just showing the unmodified texture).