1glayfan Posted March 19, 2018 Share Posted March 19, 2018 Hello all, As I don't know webgl and html5 deep enough, I wonder if it's possible to use babylonjs and other webgl framework on the same page (and same canvas). It seems like this not possible to do as each framework has its own rendering engine, but someone please confirm this. Another possibility is create 2 canvases, and dedicate each one for babylonjs and other framework. Same html page though. Is it viable ? In particular the framework I would like to use is the mapbox geo api (https://www.mapbox.com/mapbox-gl-js/api). Essentially this would add mapping functionality to your babylonjs app. Thank you! Quote Link to comment Share on other sites More sharing options...
Guest Posted March 19, 2018 Share Posted March 19, 2018 Hello, babylon.js can be initialized on the same gl context as any other webgl framework You do this by creating the engine like this: var engine = new BABYLON.Engine(context) But beware: as Babylon.js relies a lot on cache for performance reason, you will have to make sure to call engine.wipeCaches(true) everytime Babylon.js will render a frame Quote Link to comment Share on other sites More sharing options...
1glayfan Posted March 19, 2018 Author Share Posted March 19, 2018 @Deltakosh thanks for the reply. That means that with this approach, babylonjs + other framework should work in webvr mode as well right? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 19, 2018 Share Posted March 19, 2018 yes:) (already done for some internal projects) 1glayfan 1 Quote Link to comment Share on other sites More sharing options...
1glayfan Posted March 19, 2018 Author Share Posted March 19, 2018 Awesome!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.