|
@@ -237,7 +237,27 @@
|
|
|
|
|
|
type = 'image/tiff';
|
|
type = 'image/tiff';
|
|
break;
|
|
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:
|
|
default:
|
|
|
|
|
|
console.warn( 'FBXLoader: Image type "' + extension + '" is not supported.' );
|
|
console.warn( 'FBXLoader: Image type "' + extension + '" is not supported.' );
|
|
@@ -336,8 +356,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 );
|
|
loader.setPath( currentPath );
|
|
|
|
|
|
return texture;
|
|
return texture;
|