- Изменено
Problematic material setup at Spine Animation (But it's not)
I keep getting this error (see below). I want to have Linear color space.
I exported it with PMA unchecked in Spine, and set this in the material and texture settings. See attached images.
First i had another shader that didn't have the straight alpha texture option, so I changed the shader to this one.
I tried to reset it by deleting the material and tried to create a new one, but it totally messed things up.
It just sticks to "NoRender Material" and I can't choose anything else, it just reverts to that.
So I had to revert from a previous commit to the scene.
The shader/material and texture setup below:
Note that everything is working, I'm just trying to clear Unity console from warnings.
Any ideas?
Problematic material setup at Spine Animation:
Warning: Premultiply-alpha atlas textures not supported in Linear color space!
Please
a) re-export atlas as straight alpha texture with 'premultiply alpha' unchecked
(if you have already done this, please set the 'Straight Alpha Texture' Material parameter to 'true') or
b) switch to Gamma color space via
Project Settings - Player - Other Settings - Color Space.
UnityEngine.Debug:LogWarningFormat(Object, String, Object[])
Spine.Unity.SkeletonRenderer:Initialize(Boolean) (at Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs:365)
Spine.Unity.SkeletonAnimation:Initialize(Boolean) (at Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs:161)
Spine.Unity.Editor.SpineEditorUtilities:ReinitializeComponent(SkeletonRenderer) (at Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs:229)
Spine.Unity.Editor.SpineEditorUtilities:ReloadSkeletonDataAssetAndComponent(SkeletonRenderer) (at Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs:199)
Spine.Unity.Editor.SkeletonRendererInspector:DrawInspectorGUI(Boolean) (at Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs:190)
Spine.Unity.Editor.SkeletonAnimationInspector:DrawInspectorGUI(Boolean) (at Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs:53)
Spine.Unity.Editor.SkeletonRendererInspector:OnInspectorGUI() (at Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs:172)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
It shows the warning here too. Is there anything here that might be incorrectly setup?
After doing some digging, i opened up the material in a text editor, and found the keyword "_ALPHAPREMULTIPLY_ON" that the error message is checking for. i couldn't see how to disable it from Unity, so i deleted it in the text editor.
Now the error's gone.
But why did this happen, and is it safe to delete it this way?
I guess it could be something left when switching shaders, as I was confused to which shader to use.
Yeah, I occasionally get this warning when exporting new skeletons after switching to linear color space. The solution recommended to me was to switch inspector to debug mode and delete _ALPHAPREMULTIPLY_ON keyword from shader keywords on the material in question. Works well so far.
nicmar написалI guess it could be something left when switching shaders, as I was confused to which shader to use.
This is exactly what happened. When switching from one Material to another, the shader keywords are carried over. Now when the new shader does not use it, it is not cleared automatically.
We will make the material checks more precise so that the exact shader is respected when checking for certein keywords. We have just created an issue ticket here:
https://github.com/EsotericSoftware/spine-runtimes/issues/1856
We will let you know when the issue has been resolved. Sorry for the inconvenience and thanks for reporting!
[Edit: Thanks @DarkTI for answering as well, I overlooked your earlier reply identical to the hint below]
Please note that instead of editing the material in a text editor, you could also switch the Unity Inspector to Debug
view on the top right and have a look at and edit the Shader Keywords
this way.
We have just fixed this incorrect warning. A new 3.8 spine-unity unitypackage is available for download here as usual:
Spine Unity Download: Download
Please let us know if you still receive any incorrect warnings. Thanks for reporting!
Thanks, that was quick! The debug view was great, didn't think of that.
You're welcome, thanks for reporting!