Nay spine-unity Runtime 4.1.0
Does the Unity Package Manager read 4.1.0? If it reads 4.1.0, it is very old already, as the current 4.1 version is 4.1.36 (see here). How did you install the spine-unity package, where did you get the version number 4.1.0 from?
Nay It appears that older documentation mentions that this setup is not supported
Could you please describe what "that older documentation" you are referring to? The spine-unity documentation page is kept up to date with the latest beta version releases (so currently 4.2-beta), it should never be more than a week behind, after feature commits it may lag behind a few days.
but recent updates suggest that it can be achieved by enabling multiple canvas renderers.
Yes. Please also see the message at the bottom of your screenshot, we've implemented multiple messages of this kind to detect incorrect setup and describe the possible solutions.
The question remains whether SkeletonGraphic can utilize one atlas at a time without requiring multiple canvas renderers? Is there an example scene with that kind of setup?
What do you mean by "one atlas at a time"? Do you mean that you have 5 atlas pages, but always only require a single atlas page through active attachments never needing the other pages? If so, then you could use SkeletonGraphic with a single CanvasRenderer
, then there is no need to enable Multiple Canvas Renderers
, yes.
Note however that that does not seem to be the case with your SkeletonGraphic
component in the screenshot, as the message is only displayed when the skeleton mesh actually requires two or more submeshes. Likely there are some attachments from another atlas page active, or you're using attachments with different blend modes.
Regarding example scenes: that's demonstrated in the example scene Spine Examples/Other Examples/Blend Modes
.
I can see that the SkeletonGraphic
documentation section about multiple canvas renderers is missing to mention that multiple active blend mode materials require additional canvas renderers just as multiple atlas pages do, thanks for bringing this to our attention!
Nay To fix it, I basically copied the SkeletonGraphic material, ticked the CanvasGroup Compatible box, and slapped it under each SkeletonData asset.
By "slapped it under each SkeletonData asset", do you mean in the Inspector of the SkeletonGraphic
component you assigned it at the Material
property? If so, that's correct. if not, please explain what you mean by this sentence.
Nay To set up multiple blend modes correctly, is it necessary to employ multiple canvas renderers?
Basically yes. CanvasRenderer is limited to a single material and a single texture. Whenever multiple materials or multiple textures are required, you need to enable Multiple Canvas Renderers
. If your skeleton's active attachments require multiple textures or materials (blend modes), you thus need to enable Multiple Canvas Renderers
. That's what the warning message in your screenshot tells you.
Additionally, How does this approach negatively impact performance?
General Unity rules apply here, it requires additional draw calls as normal when different materials are used.
Nay If CanvasGroup is enabled in the SkeletonGraphic material - Dissable PMA vertex colors
If a shader is SkeletonGraphic shader and or a thirdparty shader which uses PMA additive blend mode Blend One OneMinusSrcAlpha - then Enable PMA vertex color.
This is correct, yes.
Sorry that the documenation was hard to understand. We will change the wording so that it's easier to understand.
Nay What if it's using SkeletonGraphic with Canvas group enabled and we are using Blending additive blend mode ?
If you enable CanvasGroup compatible
(because you need CanvasGroup alpha blending), you need to disable PMA Vertex Colors
. As a result, you can't handle additive blending via the main SkeletonGraphic
shader but instead require a separate material like SkeletonGraphicAdditive
, which you should see automatically assigned at your Advanced
- BlendModeMaterials
property in the Inspector. At all your assigned blend mode materials (including SkeletonGraphicAdditive
), you also want to have CanvasGroup Compatible
enabled, so you will want to create duplicates of these blend mode materials and assign them at the respective Additive/Multiply/Screen Material
property.
Sorry that this setup is quite complicated, and I can see that this combination also needs to be mentioned in the documentation accordingly.
In general thanks for sharing all your issues with the documentation with us, we're always happy to improve it and make it clearer where possible! I've created an issue ticket here to improve the documentation:
EsotericSoftware/spine-runtimes2464
Nay Layout Scale mode
-That doesn't look like it is an option in newer versions, please confirm.
If it's mentioned on the spine-unity documentation page, it's present in the latest beta version. This property is also present in the latest 4.1 spine-unity runtime release. If you don't see this property, you're using an old spine-unity runtime version. Please update.