klaude Posted August 9, 2018 Share Posted August 9, 2018 Hello, maybe this frequently required about preview dialog. like when shows character preview in a dialog or popup ui with new canvas. but i couldn't find the related post. in my case, not a full screen game it's web application. so, required multiple scenes for a dialog. BABYLONJS AssetsManager constructor needs a scene. and can not reuse these loaded textures with another scene in normal. when reused, it shows error like 'bindTexture: object not from this context' Is that possible to reuse loaded textures in another canvas with new scene? I don't want to request duplicated texture assets. thanks. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 9, 2018 Share Posted August 9, 2018 Texture cache is handled at the gpu level so that means it is bind to one WebglContext. As Webgl does not allow sharing texture across contexts we are bound to the same issue. In your case the easiest might be to handle caching by loading the texture through xhr as blob. From this you could reuse them across different engines with redownloading them. We do not have such automated mechanism because the browser cache in this help will help preventing redownloading the same file twice. klaude 1 Quote Link to comment Share on other sites More sharing options...
klaude Posted August 9, 2018 Author Share Posted August 9, 2018 OK, thanks @Sebavan incidentally, At first I used one webgl(babylonjs) and another canvas-2d(spine-canvas). It looks like to share texture cache. in this case, canvas-2d logic has just redrawing with HTMLImageElement. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 9, 2018 Share Posted August 9, 2018 an old topic. (around ~2014 Mozilla) Finally ( 2 weeks ago) google chrome decided to jump on that train too. google it: offscreen webgl webworkers. This is the brand new hot sh** hype on my side of the internet Multithreaded WebGL here we go. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 9, 2018 Share Posted August 9, 2018 what what what... please link me @Nabroski to what ever articles describe this. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 9, 2018 Share Posted August 9, 2018 @Pryme8 Sorry man not sure if this the right links. Look it up, its on the W E B https://games.greggman.com/game/ https://hacks.mozilla.org/2016/01/webgl-off-the-main-thread/ Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 9, 2018 Share Posted August 9, 2018 Its old. but the big thing is that Chrome is supporting it, means 80% of population using the Internet are technically now able to take advantage of new technology. Like back 10 year ago with WelGL, when not Chrome is going do anything, the idea is dead. 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.