您可以创建完全透明的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.