Ver Fonte

Updated examples builds

Mr.doob há 4 anos atrás
pai
commit
e0d858e5c8

+ 0 - 1
examples/js/exporters/GLTFExporter.js

@@ -1096,7 +1096,6 @@
 				if ( maxEmissiveComponent > 1 ) {
 				if ( maxEmissiveComponent > 1 ) {
 
 
 					emissive.multiplyScalar( 1 / maxEmissiveComponent );
 					emissive.multiplyScalar( 1 / maxEmissiveComponent );
-
 					console.warn( 'THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited' );
 					console.warn( 'THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited' );
 
 
 				}
 				}

+ 12 - 5
examples/js/loaders/GLTFLoader.js

@@ -634,7 +634,7 @@
 
 
 	}
 	}
 	/**
 	/**
- * BasisU Texture Extension
+ * BasisU THREE.Texture Extension
  *
  *
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
  */
  */
@@ -686,7 +686,7 @@
 
 
 	}
 	}
 	/**
 	/**
- * WebP Texture Extension
+ * WebP THREE.Texture Extension
  *
  *
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
  */
  */
@@ -986,7 +986,7 @@
 
 
 	}
 	}
 	/**
 	/**
- * Texture Transform Extension
+ * THREE.Texture Transform Extension
  *
  *
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
  */
  */
@@ -2340,7 +2340,9 @@
 
 
 						onLoad = function ( imageBitmap ) {
 						onLoad = function ( imageBitmap ) {
 
 
-							resolve( new THREE.CanvasTexture( imageBitmap ) );
+							const texture = new THREE.Texture( imageBitmap );
+							texture.needsUpdate = true;
+							resolve( texture );
 
 
 						};
 						};
 
 
@@ -2352,7 +2354,7 @@
 
 
 			} ).then( function ( texture ) {
 			} ).then( function ( texture ) {
 
 
-				// Clean up resources and configure Texture.
+				// Clean up resources and configure THREE.Texture.
 				if ( isObjectURL === true ) {
 				if ( isObjectURL === true ) {
 
 
 					URL.revokeObjectURL( sourceURI );
 					URL.revokeObjectURL( sourceURI );
@@ -2375,6 +2377,11 @@
 				} );
 				} );
 				return texture;
 				return texture;
 
 
+			} ).catch( function () {
+
+				console.error( 'THREE.GLTFLoader: Couldn\'t load texture', sourceURI );
+				return null;
+
 			} );
 			} );
 			this.textureCache[ cacheKey ] = promise;
 			this.textureCache[ cacheKey ] = promise;
 			return promise;
 			return promise;