Skip to content
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

[cocos2d-x] adpater to new renderer in cocos2dx v4 #1244

Open
wants to merge 6 commits into
base: 3.7
from

Conversation

5 participants
@PatriceJiang
Copy link

commented Jan 8, 2019

Cocos2d-X new renderer for Metal is in developing. https://github.com/minggo/cocos2d-x/tree/metal-support

This PR works only on the new renderer, and we may need a new branch, like 3.7-cocos2d-x-v4.

@badlogic

This comment has been minimized.

Copy link
Collaborator

commented Jan 8, 2019

This is great! I think it would make the most sense to create an interface for the batcher, and two impleme tations: one for OpenGL, and the other for Metal. The SkeletonRenderer could then select which impleme tation to use. We'd like to avoid a second branch if possible.

@PatriceJiang

This comment has been minimized.

Copy link
Author

commented Jan 8, 2019

The new renderer supports both Metal and GLES as the backend, this PR works on both platforms.
The problem is that it breaks the compatibility with the Cocos2d-x-3.x.

@badlogic

This comment has been minimized.

Copy link
Collaborator

commented Jan 8, 2019

Ah, yes, my fault :) Curious: Metal doesn't support shader compilation at runtime. I see that this PR still uses the GLES shader. How does that work?

I think we could possibly add subdirectories to the spine-cocos2dx/ dir, e.g. v3 and v4. It seems the base classes can be re-used between cocos2d-x 3 and 4, which would be rather nice. It will take me a while to get to this.

Thanks for the PR!

@PatriceJiang

This comment has been minimized.

Copy link
Author

commented Jan 9, 2019

I have updated this PR, now it can run on both v3 and v4.

Metal doesn't support shader compilation at runtime. I see that this PR still uses the GLES shader. How does that work?

@minggo can answer your question.

@minggo

This comment has been minimized.

Copy link
Contributor

commented Jan 9, 2019

Yep, in cocos2d-x, we use a modified glsl-optimizer to translate GLES shader to metal shader dynamically.

@badlogic badlogic self-assigned this Jan 23, 2019

@badlogic

This comment has been minimized.

Copy link
Collaborator

commented Jan 23, 2019

@minggo @PatriceJiang I've started working on integrating this with our repository today. To my surprise, I noticed that cocos2dx v4 isn't on GitHub.

You have this branch: https://github.com/cocos2d/cocos2d-x/tree/v4-develop

But that one is from 2015.

We can't integrate your PR without having access to cocos2dx v4. Where can we get access?

@minggo

This comment has been minimized.

Copy link
Contributor

commented Jan 24, 2019

@badlogic currently, the branch is metal-support. The final version name is not determined. It is just in alpha0 version, so i think we can do it after it is in beta version. @PatriceJiang will continue to do it after beta version is released

@badlogic badlogic added ready and removed in progress labels Jan 29, 2019

@minggo minggo referenced this pull request Feb 27, 2019

Open

Spine is not adapted #19438

@PatriceJiang PatriceJiang force-pushed the PatriceJiang:cocos2dx-v4 branch from 14c7840 to cfef942 Mar 22, 2019

@NathanSweet NathanSweet added ready and removed runtimes labels Mar 25, 2019

@minggo

This comment has been minimized.

Copy link
Contributor

commented Apr 11, 2019

@badlogic i think it is time to merge the PR, and @PatriceJiang updated to latest version. We will continue to update it after if we find bugs.

@NathanSweet NathanSweet removed the ready label Apr 12, 2019

@Bilalmirza

This comment has been minimized.

Copy link

commented Apr 16, 2019

@badlogic any idea when this will be merged?

PatriceJiang added some commits Jun 28, 2019

@PatriceJiang PatriceJiang force-pushed the PatriceJiang:cocos2dx-v4 branch from e17d378 to e4b1552 Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.