SSSPINE

在Unity软件中,
Spine动画 是用mesh来做的,shader中还加了投影。但是 只能投影到3D物体上。
而对于一个2D游戏来说,场景一般是图片精灵(Sprite),并且人物或可动的景物(Spine)和场景(Sprite)是平行的,想要给人物加个影子。各位路过的大佬有什么好方法吗?

已经尝试过的方法:
再创建一个Spine,偏移它的顶点,让它看起来是倾斜的。然后颜色调节成黑色。
问题是:我如果把他变成透明,会发现关节重叠的地方颜色很深,其他颜色很浅,这不是我想要的。
SSSPINE
  • 帖子: 1

Harald

您可以创建完全透明的3D对象以仅接收阴影。 然后可以将其放置在平行2D图像的前面,以模拟实际的阴影接收几何形状。 这样,您可以创建复杂的阴影接收表面。 在这里,您可以找到用于此目的的着色器:
https://forum.unity.com/threads/transparent-shader-receive-shadows.325877/#post-2114800

不幸的是,由于混合与Z缓冲区结合的性质,您所描述的使用缩放的黑色版本的骨架和重叠的半透明的解决方案并不简单。
此论坛主题中描述了一种解决方案:
Unity3D 에서 불투명한 스파인 리소스가 겹치는 문제
不幸的是,这个论坛主题大部分是英文的。 请在上面的着色器发布后告诉我们该解决方案是否仍然与您相关,然后我们可以(机器)翻译此线程中的发布。
-----
You could create completely transparent 3D object to just receive shadows. This could then be placed in front of your parallel 2D images to simulate the actual shadow receiving geometry. This way you can create complex shadow receiving surfaces. Here you can find a shader that works for this purpose:
https://forum.unity.com/threads/transparent-shader-receive-shadows.325877/#post-2114800

Your described solution of using a scaled black version of the skeleton with overlapping semi-transparent is unfortunately not trivial due to the nature of blending combined with the Z buffer.
One solution is described in this forum thread:
Unity3D 에서 불투명한 스파인 리소스가 겹치는 문제
Unfortunately this forum thread is mostly in English. Please let us know if this solution is still relevant to you after the shader posted above, then we can (machine-) translate the postings in this thread.
头像
Harald

Harri
  • 帖子: 2433


回到 中国Spine用户