Thank you Harald.
The sample works in version 4.0. thank you.
However, I am still using version 3.8.
Could you please upload that sample to 3.8 unity?
I copied and pasted version 4.0, but it doesn't work in 3.8.
Thank you Harald.
The sample works in version 4.0. thank you.
However, I am still using version 3.8.
Could you please upload that sample to 3.8 unity?
I copied and pasted version 4.0, but it doesn't work in 3.8.
What does "not work"? Please always describe in detail what error messages you receive, what you expect to see and what you see instead. Otherwise it's like telling a doctor on a phone "it hurts", which will also not be enough to diagnose the situation.
I have set up different projects in Unity.
One, when I opened the sample project file of Unity Runtime 4.0 version, the render texture fade out worked well.
Another thing, when I opened the file in the Unity Runtime 3.8 sample project, the render texture fadeout did not work and the following error was sent.
Assets\Spine Examples\Scripts\RenderTextureFadeoutExample.cs(40,10): error CS0246: The type or namespace name 'SkeletonRenderTexture' could not be found (are you missing a using directive or an assembly reference?)
I copied the script along with the sample scene.
This looks as if you didn't copy the SkeletonRenderTexture.cs
file (the important one), but only the RenderTextureFadeoutExample.cs
file (the minimalistic script that just shows how to use the SkeletonRenderTexture.cs
file in the example scene).
thank you.
I'll test it again and post a video.
overwhelming gratitude
harald
The test was successful.
Thank you very much.
Now I want to actually use this script in my game.
what will you use it for
When a character dies, I want it to fade out and disappear.
I want to apply it using the script used in this example scene.
I have no idea what to do.
Do I have to set the alpha value separately for the animation where the character disappears from the game?
Or should I use this script to have this event be used for a specific event?
If you play it, it disappears and reappears, but what if you want it to disappear only once?
Sorry for so many questions. But Harald's answer will help many game makers, and animators won't struggle.
Thank you very much. esotrick software
Admittedly the example scene and component was rather minimal and perhaps a bit hard to read. I have now added a SkeletonRenderTextureFadeout
example component, and improved the documentation at all related components. The example scene has also been updated to use the new component. It's now quite simple to use and should be easy to understand: attach both components, disable both. To start the fadeout, enable the SkeletonRenderTextureFadeout
component.
New 4.0 and 4.1-beta unitypackages are available for download here as usual:
Spine Unity Download
Make sure to copy all 3 fadeout-related components and the example scene to your 3.8 project.
Thnak you sir!
I hope it helps you and other users, it should be quite easy to use now.
I just wonder, how does the Unity's CanvasGroup work so well with other Image objects stacking on each others. Is it also using RenderToTexture to fade them all together?
Likely, yes. A frame debugger might show what it does. If anyone however finds a new magic alternative, please let us know :nerd:.
Harald a écrit[...]
New 4.0 and 4.1-beta unitypackages are available for download here as usual:
spine-unity Download
Make sure to copy all 3 fadeout-related components and the example scene to your 3.8 project.
I know this post is nearly a year old, but I'm having troubles using the RenderTexture example that you made Harald when I build to mobile devices.
Specifically the alpha value is completely ignored when building to physical iOS and Android devices. I've confirmed that this is an issue with the example scene as well, and not our code, as the example scene displays properly on Desktop and in Play mode. However on iOS the Spine Boy renders properly, but doesn't fade out at all, and stays at an opacity of 1.0f, and then on Android the Spine Boy RenderTextures display nothing at all.
Curiously if I manually set the RenderTexture's to "Sprites-Default" then the RenderTexture displays properly on iOS, including the opacity. However it still doesn't display at all on Android. If I then force the SkeletonRenderTexture script to find the "Spine/RenderQuad" shader to make a new material from, by setting the quadMaterial field in the inspector to "None", then it displays on both iOS and Android, but also ignores the RenderTexture's set opacity.
I'm assuming that this is some issue with texture compression, or texture format, but haven't been able to get anything that works on Android properly, and the solution I found for iOS displays nothing at all on Android...
Some help would be greatly appreciated.
EDIT:
I believe I found a workaround for now, as it seems to be related to using the Vulkan Unity Graphics API.
If anyone is having the same problem as I am, in the Player Settings if you un-toggle Auto Graphics API, and either move OpenGLES3 to the top or remove Vulkan entirely, then the RenderTextures display as intended on Android, including their opacity.
Then for it to display properly on both iOS and Android, simply change line #94 of the SkeletonRenderTexture from:
quadMeshRenderer.material = new Material(Shader.Find("Spine/RenderQuad"));
to
quadMeshRenderer.material = new Material(Shader.Find("Sprites/Default"));
After that the RenderTextures should display properly on both iOS and Android, including the RenderTexture's set opacity. (You might need to change/remove the "Quad Material" in the Inspector of your example scene, or your actual SkeletonRenderTexture objects for this fix to fully work for you.)
Glad to hear you've figured it out, thanks very much for getting back to us.
Please note that there is no need to change the shader from Spine/RenderQuad
, the problem is likely that you have no reference to it in any of your scenes and that it's not added to the Always Included Shaders
list, and therefore is missing in your executable. A similar problem and solution was discussed here on this forum thread:
SkeletonRenderTextureがビルド後にエラーを起こします。