Pārlūkot izejas kodu

Fix GLTFLoader DDSExtension

Takahiro 6 gadi atpakaļ
vecāks
revīzija
c00575eb8f
1 mainītis faili ar 13 papildinājumiem un 9 dzēšanām
  1. 13 9
      examples/js/loaders/GLTFLoader.js

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

@@ -2116,15 +2116,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;
+
+				}
 
 			}