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

Added support for mixing WebGL context inside a layer. #282

Closed
wants to merge 1 commit into from
Closed

Added support for mixing WebGL context inside a layer. #282

wants to merge 1 commit into from

Conversation

tpetrina
Copy link

Canvas uses 2d context by default, it doesn't allow for optional
configuration. This creates conflicts with WebGL (e.g. with three.js
library).

For this to happen, an additional configuration parameter was necessary for both Kinetic.Canvas and for Kinetic.Layer. In the former case, a constant string was replaced, and in the latter case you can supply your own "canvas" (a class inheriting Kinetic.Canvas).

Canvas uses 2d context by default, it doesn't allow for optional
configuration. This creates conflicts with WebGL (e.g. with three.js
library).
@ericdrowell
Copy link
Owner

After more thought, I've decided not to support none 2d contexts. It just doesn't make sense with KineticJS. I created several variants of KineticJS + Three.js, and I found that the easiest thing to do is to just overlay a KineticJS stage on top of a Three.js canvas, or vice versa. There's just absolutely no benefit to having this built into KineticJS. I'll put up a lab on html5canvastutorials.com that shows a clean way to combine KineticJS and Three.js. Thanks!

@tpetrina
Copy link
Author

I look forward to that tutorial since I was unable to do it cleanly myself. Adding support for special layers seemed like the best idea.

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

Successfully merging this pull request may close these issues.

2 participants