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

webgl support? #34

Open
pkieltyka opened this issue Mar 15, 2017 · 8 comments
Open

webgl support? #34

pkieltyka opened this issue Mar 15, 2017 · 8 comments

Comments

@pkieltyka
Copy link

No description provided.

@pkieltyka
Copy link
Author

as well, can you comment on differences between stage.js and pixi.js? and its intended purposes and long-term goals?

@shakiba
Copy link
Collaborator

shakiba commented Mar 15, 2017

I have no plan for webgl, and I'm not sure if there is a good reason to use webgl for 2D games (other than shader effects).

I have never used pixi.js, I had just check their website before and now again! It looks similar, however:

  • Pixi has some additional webgl features (I can't find any other additional capabilities).
  • Stage.js has pinning, layout and transition, which as far as I know Pixi does not have. Layout is very useful for making game layouts which scale to any screen size/ratio.
  • I also prefer how stage.js code looks, which is subjective.

Stage.js was created by reusing/refactoring my low level code from previous games, which I had developed to have good performance on mobile phones, so I wasn't able to use any other library. It was initially based on this game, which I guess is transpiled from Flash by Adobe. I rewrote it few times to add new features and create a reusable API, but it still inherits same architecture.

@pkieltyka
Copy link
Author

@shakiba WebGL offers hardware acceleration whereas canvas does not. To give you an emperical example, running your planck.js demos on my iPad Pro show a lower FPS than p2.js demos on the same device. p2.js' demos are using pixi with WebGL.

what do you think?

@shakiba
Copy link
Collaborator

shakiba commented Mar 15, 2017

As far as I know Canvas is also hardware-accelerated on most modern devices (except some old Androids, so I used this plugin instead). Try 006 and O! instead.

It depends on, I'm not sure which examples you have tried.

There also may be optimization issues in planck.js or its testbed, I have not optimized everything yet.

@pkieltyka
Copy link
Author

You'd know better than me, but I will do some performance testing as I have time over the weeks too

@pkieltyka
Copy link
Author

pkieltyka commented Mar 15, 2017

@shakiba
Copy link
Collaborator

shakiba commented Mar 15, 2017

As long as 2D Canvas is fast enough for a specific application, it doesn't really matter that WebGL is faster. And when it is not, I think it is better to write low level code instead of using pixi or stage.js.

But any way, thanks for bringing up this discussion, I did some quick research and learned some new 2d/webgl optimization tips!

@waningflow
Copy link

According to personal practice, WebGL is not supported well in mobile browsers. Thus it will be less fluent than Canvas2d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants