Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

how to load a cubeTexture in diferent sizes for mobile & desktop

$
0
0

Hi all, I would like to load the textures for a cubeTexture in different sizes, so that first only a small resolution is loaded and then the normal textures. like LOD

I would like to use the assetsManager?

 

var assetsManager = new BABYLON.AssetsManager(scene);
    var textureTask = assetsManager.addTextureTask("image task", "example/blabla.png");//?url
    textureTask.onSuccess = function(task) {

      

//my skybox function elsewhere
        createSkybox(task.texture);// dont work

console.log("cubetexture loaded");
    }

    assetsManager.load();

 

//my skybox function elsewhere

 createSkybox("example/blabla");// fine

 

 


Viewing all articles
Browse latest Browse all 388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>