• Unity
  • Semi-transparent sub-meshes overlap problem

Related Discussions
...

Hello. I'm working on a game in Unity3D which has a semi-transparent effect on spine animation. In order to make it semi-transparent, I set the alpha of skeleton to 0.5

skeletonAnimation.skeleton.A = 0.4f;

As you can see, each of the submesh is semi-transparent, which make them overlaps each others and the animation looks ugly. How can I have them semi-transparent, but still be able to hide the underneath submeshes ?

Here is a similar problem without using spine:

https://forum.unity3d.com/threads/transparent-depth-shader-good-for-ghosts.149511/

As you've demonstrated, this problem isn't specific to Spine.
This is especially true for overlapping sprites because they rely on alpha blending (ignore the depth buffer). This is just how graphics works right now.

If someone has solved the problem in a convenient way in Unity, we would be doing it that way.

The usual way to solve this is to render to a texture/FBO with normal opacity, then render that texture with the opacity you want for the whole skeleton.

    8 godine kasnije

    Nate
    Sorry for necroing this but it's very relevant to my issue and I didn't find a newer discussion about it.

    I understand the principle of the solution you provided, Nate, but could it be used just for some renderers instead of a whole skeleton?
    I'm using a lot of separators for my models, and I only wanted some stockings to be semi-transparent.

    And, in case it would be possible, what would be needed? A duped material with the desired transparency?

    @Abelius This thread is long obsolete. Please see the SkeletonRenderTexture example component documentation section. You could modify this example component if you need to only render a subset of the submesh renderers.