Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions examples/js/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,27 @@

type = 'image/tiff';
break;

case 'tga':

if ( typeof THREE.TGALoader !== 'function' ) {

console.warn( 'FBXLoader: THREE.TGALoader is required to load TGA textures' );
return;

} else {

if ( THREE.Loader.Handlers.get( '.tga' ) === null ) {

THREE.Loader.Handlers.add( /\.tga$/i, new THREE.TGALoader() );

}

type = 'image/tga';
break;

}

default:

console.warn( 'FBXLoader: Image type "' + extension + '" is not supported.' );
Expand Down Expand Up @@ -344,8 +364,18 @@

}

var texture = loader.load( fileName );

var texture;

if ( textureNode.FileName.slice( -3 ).toLowerCase() === 'tga' ) {

texture = THREE.Loader.Handlers.get( '.tga' ).load( fileName );

} else {

texture = loader.load( fileName );

}

loader.setPath( currentPath );

return texture;
Expand Down