-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spine Two-Color Tint Bug #1824
Comments
You means update to 4.1 branch: https://github.com/EsotericSoftware/spine-runtimes/tree/4.1 EDIT: seems no changes since 4.1-54fac9d, so I assume need update to spine-runtimes latest 4.2 branch? |
No, not 4.2: Each major Spine runtime is incompatible with the previous and post versions. So the 4.1 runtimes aren't compatible with 4.2, 4.0, etc.
Okay I just triple checked and in Axmol the commit that updates the Spine runtimes to 4.1-54fac9d was done on February 26th of this year, and the 2.1.2 Axmol Release was cut on February 24th of this year. I got Axmol from the 2.1.2 release: so that explains why I had the bug until I updated the runtimes. Sorry, that one was my fault (though since it does fix a Spine related crash, perhaps a 2.1.3 is in-order soon?) Thanks for the correction. |
Why reopen, does this issue still require any changes? |
I only closed it by accident. The main issue for this still exists, and that is that the two-color tint bug with Spine Skeletons that I outlined with the majority of this bug report. |
An update on this bug report. The team behind Spine, Esoteric Software investigated the issue and are pushing the fix back to the maintainers of Cocos2d-x (and/or it's forks, i.e. Axmol). They say that the Spine runtimes are working properly based on their findings and that the issue is with the Cocos2d-x two-color tint renderer itself. I've copy and pasted badlogic's response below for brevity:
Hopefully this information is helpful to fix the issue. I attempted for about a day and a half and made no progress on this issue, I ended up disabling two-color tinting on our skeletons in the meantime. However this really sucks, since we use the two-color tinting system in order to telegraph specific attack types to our players... |
Never mind! I forgot to turn on the debug bones and meshes to see them popup before the first frame of the textures. I see the issue now. |
@TyelorD If you have a bit of time, can you please try this: In
Change it to this:
Check if that fixes the issue for you. I can't tell if this affects the two color tinting though, since the Raptor example still looks the same, and I'm not even sure if the Raptor example has two color tinting on any of the slots. |
Tested the tank Spine sample ( |
Based on a quick smoke test, this solution does indeed appear to fix the issue I was experiencing. Our skeletons which use two-color tinting are also still tinting properly, while also rendering correctly on the first frame. Thanks a ton @rh101, I assumed we'd have to engineer a different solution to the effect we were getting by using two-color tinting, but you seem to have saved the day! I recommend submitting your solution as a PR as well :) |
Excellent! I noticed the post on the Spine repo, so I assume they'll be fixing it there themselves. The Axmol runtimes are here, and this issue is for all versions in that repo. @halx99 I'll create PR in Axmol to fix this, but do you want me to generate a PR for each of the different versions in the |
@rh101 I invite you as collaborator of repo: |
No worries, I'll update all the runtimes today. |
Steps to Reproduce:
auto glview = director->getOpenGLView();
toauto glview = director->getGLView();
and line # 65 fromdirector->setOpenGLView(glview);
todirector->setGLView(glview);
This bug also exists in Cocos2d-x v4.0, but not Cocos2d-x v3.17.2, likely due to all the Renderer, GL, and Shader changes made to support Metal on Apple devices.
I've submitted a bug report to the Esoteric Software team as well, but it's very possible that their fix will need to be back ported to Axmol from Cocos2d-x (it'd be nice if they started supporting Axmol officially since Cocos2d-x is dead, but I don't see that happening anytime soon).
I will mention that in my use case it sometimes takes 24 frames or more before the skeleton renders for the first time, and not a single frame like the repro steps I provided.
I've played around with trying to update the skeleton, and the SkeletonTwoColorBatch with
deltaTime = 0.0f
, I've tried to force flush for the lastTwoColorTrianglesCommand on each draw, I've tried disabling culling, setting the skeleton to its setup pose, and updating its world transforms, but nothing solves the issue.This does bring up two additional Spine related bugs:
The version of Spine packaged with Axmol contains the following bug, and should be updated the latest source code from GitHub to fix this bug. This is a critical issue that causes the game to crash when attempting to load a skeleton that contains mesh deformations (which was a headache I had to deal with last week).(That one was my fault due to getting the Axmol 2.1.2 release and not the latest code from GitHub.)
CC_USE_CULLING is used in the SkeletonRenderer.cpp code for the Spine Cocos2d-x runtimes, and thus the Axmol runtimes without modifications, but CC_USE_CULLING is never defined to be an alias for AX_USE_CULLING. This causes the Spine runtimes to ignore the Axmol AX_USE_CULLING config option in the Configs.h file.(With the merge of Add CC_USE_CULLING Alias to cocos2d.h #1825, this issue is now fixed.)
The text was updated successfully, but these errors were encountered: