hhfan

Currently, the character (an assassin) that I am working on has the power of making himself invisible, therefore I need to make my character translucent to show that he is invisible.
I was planning to adjust the picture’s alpha value to achieve this effect. However, when I done it, all the pictures have become translucent, and the result was not what I was looking for. The pictures with low sorting layer value were no longer been fully covered by the pictures with high sorting layer value. So, is there any way to achieve the translucent effect that I was really looking for?

This is my character below:
原版.png


This is how it became when I was trying to make it translucent in my way:
错误.png


This is what I was really looking for, so could you pls help me to achieve the effect below in Unity?
正确.png
You do not have the required permissions to view the files attached to this post.
hhfan
  • Posts: 24

Mario

User avatar
Mario

Mario
  • Posts: 2489

hhfan

Thanks for the reply. Unfortunately, I have used Shader for another function, so that I could not use Shader for this matter.
Is there any other alternatives which will help me to solve my problem? Any other suggestions?
hhfan
  • Posts: 24

Mario

I'm afraid there's no way around using the method described in the post. The problems stems from the order in which attachments are rendered (or not rendered at all). Note that this is not a problem specific to Spine, but a general problem when rendering translucent images on top of each other.
User avatar
Mario

Mario
  • Posts: 2489

Harald

One alternative would be to use a RenderTexture: https://docs.unity3d.com/Manual/class-RenderTexture.html.

You could render the character to the RenderTexture at 100% opacity (so without the transparency applied yet) and then overlay the RenderTexture to your scene at the desired opacity via a simple quad with the RenderTexture applied at a simple transparent material (lets say 50% transparent). This would be the quickest and easiest solution in your case.

We are planning to provide an example scene in the future to show common fade-out scenarios.
User avatar
Harald

Harri
  • Posts: 2410

Aurigan

Hi, was the example ever built/included? I couldn't see it as-of v3.8.95. Thanks!
Aurigan
  • Posts: 8

Harald

Unfortunately we did not yet get to add it for spine-unity, sorry!
(It will not be included in the Spine Editor but on the runtime side.)

The issue ticket can be found here: [unity] Add fadeout example scene · #1337
User avatar
Harald

Harri
  • Posts: 2410


Return to Unity