// instantiate a loader var loader = new THREE.TGALoader(); // load a resource var texture = loader.load( // resource URL 'textures/crate_grey8.tga' // Function when resource is loaded function ( texture ) { console.log( 'Texture is loaded' ); }, // Function called when download progresses function ( xhr ) { console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); }, // Function called when download errors function ( xhr ) { console.log( 'An error happened' ); } ); var material = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture } );
webgl_materials_texture_tga