Explorar o código

Merge pull request #16167 from takahirox/FixGLTFLoaderDDSExtension

Fix GLTFLoader DDSExtension
Mr.doob %!s(int64=6) %!d(string=hai) anos
pai
achega
5fa3d1d954
Modificáronse 1 ficheiros con 13 adicións e 9 borrados
  1. 13 9
      examples/js/loaders/GLTFLoader.js

+ 13 - 9
examples/js/loaders/GLTFLoader.js

@@ -2117,15 +2117,19 @@ THREE.GLTFLoader = ( function () {
 
 		return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {
 
-			switch ( mapName ) {
-
-				case 'aoMap':
-				case 'emissiveMap':
-				case 'metalnessMap':
-				case 'normalMap':
-				case 'roughnessMap':
-					texture.format = THREE.RGBFormat;
-					break;
+			if ( ! texture.isCompressedTexture ) {
+
+				switch ( mapName ) {
+
+					case 'aoMap':
+					case 'emissiveMap':
+					case 'metalnessMap':
+					case 'normalMap':
+					case 'roughnessMap':
+						texture.format = THREE.RGBFormat;
+						break;
+
+				}
 
 			}