chicagobob123 Posted February 22, 2018 Share Posted February 22, 2018 Is there a method to asynchronously load and swap an image texture? The new Async scene loader works so nicely that I was hoping there was something like BABYLON.Texture.Async(givenFilePath, scene).then (function(scene,texture){ scene.materials[x].diffuseTexture = texture; } So I was hoping to load new texture files on the fly without killing performance. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 22, 2018 Share Posted February 22, 2018 Texture are already loaded asynchronously Only transfer to GPU cannot be done asynchronously (because of WebGL) You can then use the onLoad parameter of the texture constructor to do your swapping https://www.babylonjs-playground.com/#IKANKZ chicagobob123 1 Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted February 22, 2018 Author Share Posted February 22, 2018 Thank you 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.