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

badlogic

User avatar
badlogic

Mario
  • Posts: 2168

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

badlogic

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
badlogic

Mario
  • Posts: 2168

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: 1193


Return to Unity