Forráskód Böngészése

Updated examples builds.

Mr.doob 3 éve
szülő
commit
7e6e33ffad

+ 7 - 3
examples/js/loaders/GLTFLoader.js

@@ -2067,13 +2067,17 @@
 			this.nodeNamesUsed = {}; // Use an THREE.ImageBitmapLoader if imageBitmaps are supported. Moves much of the
 			// expensive work of uploading a texture to the GPU off the main thread.
 
-			if ( typeof createImageBitmap !== 'undefined' && /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === false ) {
+			const isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === true;
+			const isFirefox = navigator.userAgent.indexOf( 'Firefox' ) > - 1;
+			const firefoxVersion = isFirefox ? navigator.userAgent.match( /Firefox\/([0-9]+)\./ )[ 1 ] : - 1;
 
-				this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );
+			if ( typeof createImageBitmap === 'undefined' || isSafari || isFirefox && firefoxVersion < 98 ) {
+
+				this.textureLoader = new THREE.TextureLoader( this.options.manager );
 
 			} else {
 
-				this.textureLoader = new THREE.TextureLoader( this.options.manager );
+				this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );
 
 			}
 

+ 2 - 1
examples/js/objects/Reflector.js

@@ -6,6 +6,7 @@
 
 			super( geometry );
 			this.type = 'Reflector';
+			this.camera = new THREE.PerspectiveCamera();
 			const scope = this;
 			const color = options.color !== undefined ? new THREE.Color( options.color ) : new THREE.Color( 0x7F7F7F );
 			const textureWidth = options.textureWidth || 512;
@@ -25,7 +26,7 @@
 			const target = new THREE.Vector3();
 			const q = new THREE.Vector4();
 			const textureMatrix = new THREE.Matrix4();
-			const virtualCamera = new THREE.PerspectiveCamera();
+			const virtualCamera = this.camera;
 			const renderTarget = new THREE.WebGLRenderTarget( textureWidth, textureHeight, {
 				samples: multisample
 			} );

+ 2 - 1
examples/js/objects/Refractor.js

@@ -6,6 +6,7 @@
 
 			super( geometry );
 			this.type = 'Refractor';
+			this.camera = new THREE.PerspectiveCamera();
 			const scope = this;
 			const color = options.color !== undefined ? new THREE.Color( options.color ) : new THREE.Color( 0x7F7F7F );
 			const textureWidth = options.textureWidth || 512;
@@ -14,7 +15,7 @@
 			const shader = options.shader || Refractor.RefractorShader;
 			const multisample = options.multisample !== undefined ? options.multisample : 4; //
 
-			const virtualCamera = new THREE.PerspectiveCamera();
+			const virtualCamera = this.camera;
 			virtualCamera.matrixAutoUpdate = false;
 			virtualCamera.userData.refractor = true; //