TGALoader

Class for loading a .tga texture.

Constructor

TGALoader( manager )

manager — The loadingManager for the loader to use. Default is THREE.DefaultLoadingManager.
Creates a new TGALoader.

Methods

.load ( url, onLoad, onProgress, onError )

url — required
onLoad — Will be called when load completes. The argument will be the loaded DataTexture.
onProgress — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .total and .loaded bytes.
onError — Will be called when load errors.
Begin loading from url and pass the loaded texture to onLoad. The texture is also directly returned for immediate use (but may not be fully loaded).

Example

// 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

Source

examples/js/loaders/TGALoader.js
Edit