-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix custom program state not applied at cocos2d-x-4.0 #1787
Conversation
see also: axmolengine/axmol#234 |
Yeah, it improve programState use, not clone per frame |
Thank you! I've merged this PR and did a lot of testing on it. Works great! |
I'm getting major graphical glitches with all spine animations in my game related to these changes (with my specific use case). For example, if the textures used for each attachment are not on the same texture atlas, then the last texture used overwrites all previous textures in the different attachments. This is because the programState is assigned directly to the command, and then the uniforms in it are overwritten, causing all sorts of problems. The programState needs to be cloned, so each attachment being rendered should have it's own copy of it, that way the uniforms set on the programState belonging to a specific attachment won't affect other attachments. This method:
Needs to be modified to this:
For this line EDIT: Once a clone of the If |
So, if possible avoid clone per frame? |
It doesn't clone per frame, since the Program is still the same, as this condition takes care of it:
The only way it creates a clone is if the |
ok, your modification looks good to me |
Do you need me to create a pull request, or do you want to take care of it? |
Yes, just create a pr please |
…te was being used for each attachment, but would cause problems if the attachments did not use the same texture. (#1801)
PR merged. I'll add a multi-page atlas export sample scene for errors like these to be caught early. |
No description provided.