|
@@ -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.' );
|
|
@@ -344,8 +364,18 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- var texture = loader.load( fileName );
|
|
|
-
|
|
|
+ var texture;
|
|
|
+
|
|
|
+ if (textureNode.FileName.slice(textureNode.FileName.lastIndexOf('.') + 1)=='tga'){
|
|
|
+
|
|
|
+ texture = THREE.Loader.Handlers.get( '.tga' ).load( fileName );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ texture = loader.load( fileName );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
loader.setPath( currentPath );
|
|
|
|
|
|
return texture;
|