Jump to content

Is that possible to reuse loaded textures in another canvas with new scene?


klaude
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...