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

Building WebGL libraries that work with each other in the same webgl context. #4305

Closed
trusktr opened this issue Sep 16, 2017 · 4 comments
Closed
Labels
🙏 Feature Request Community request for new features, APIs, packages. Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests.

Comments

@trusktr
Copy link

trusktr commented Sep 16, 2017

Description of the problem

It's difficult and complex these days to mix WebGL libraries together, to draw things using different libraries in the same webgl context. (examples of difficulties: mrdoob/three.js#8147, #3230, #3345, #1366, #298, jonobr1/two.js#233)

For example, suppose we would like to render Three, Babylon, and Pixi objects into the same WebGL context, in the same 3D space.

It is currently very difficult to do this because each WebGL library manages state of the context in their own ways, and these private internals often change and break solutions that people come up with because there's no standard way to do it.

Pixi.js v4 goes through efforts to make Pixi compatible with Three.js, so that it can render in a Three scene, but this is obviously fragile.

Solution

Enter Regl to the party.

Maybe if the foundations for each library (Three, Babylon, Pixi, Two, etc) were built on Regl, we'd have a common way of rendering to a single context.

Regl makes an abstraction just on top of raw WebGL for managing WebGL state. It doesn't render for you all the things that Three.js can, it only provides the minimal foundation for working with raw WebGL in a stateful way that is easy to manage.

It seems that libraries like Three, Babylon, PlayCanvas, Pixi, Two, etc, could benefit from using a standardized way for managing WebGL state, which would make it easy to combine renderings from any of these libraries into the same WebGL context.


What are your thoughts on refactoring the foundation of Pixi.js to use Regl for managing WebGL state? Does Regl offer enough flexibility for Pixi.js to do what it needs to do on top of Regl?

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Sep 17, 2017

I support the idea to try build several interfaces of popular libraries on top of something, because im doing the same thing, but oriented for production, with bonus difficulties, which is Not Safe For Newbies.

Now to bad things: whatever you make would have to exist as an alternative at least for two years, before significant portion of auditory goes for it. Are you ready to dedicate at least half-time rate to support several projects that uses it and grow userbase?

I think Regl is not enough even for pixi-v4, and new v5 of pixi that is developed in several branches has much more functional on low-level than that. The only way to understand whether its versatile enough is to try port pixi on it, that's several weeks at least and I dont want to do it after I saw regl code.

@ivanpopelyshev
Copy link
Collaborator

Btw, I did read many articles from 0fps.net , and I admire the author, even wrote him fan mail three years ago. But right now Regl is not enough to reproduce pixi features. Of course you can try :)

@themoonrat themoonrat added 🙏 Feature Request Community request for new features, APIs, packages. Renderer: WebGL labels Jul 5, 2018
@stale
Copy link

stale bot commented Feb 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Feb 24, 2019
@lock
Copy link

lock bot commented Feb 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🙏 Feature Request Community request for new features, APIs, packages. Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests.
Projects
None yet
Development

No branches or pull requests

4 participants