Can anyone advise on how to efficiently load multiple textures using the new THREE.TextureLoader from Three.js?
Currently, I am loading my textures individually as shown below:
var texture1 = THREE.ImageUtils.loadTexture('texture1.jpg');
var texture2 = THREE.ImageUtils.loadTexture('texture2.jpg');
var texture3 = THREE.ImageUtils.loadTexture('texture3.jpg');
var texture4 = THREE.ImageUtils.loadTexture('texture4.jpg');
var texture5 = THREE.ImageUtils.loadTexture('texture5.jpg');
...
However, Chrome's developer tools display the warning message:
THREE.ImageUtils.loadTexture is being deprecated. Use THREE.TextureLoader() instead.
I have attempted to use the new THREE.TextureLoader:
var loader = new THREE.TextureLoader();
loader.load('texture1.jpg',function ( texture1 ) {});
loader.load('texture2.jpg',function ( texture2 ) {});
loader.load('texture3.jpg',function ( texture3 ) {});
loader.load('texture4.jpg',function ( texture4 ) {});
loader.load('texture5.jpg',function ( texture5 ) {});
Could someone point out if there is an error in my approach?
More information about TextureLoader