Explorar o código

Updated builds.

Mr.doob %!s(int64=7) %!d(string=hai) anos
pai
achega
7fedf92670
Modificáronse 3 ficheiros con 124 adicións e 445 borrados
  1. 19 33
      build/three.js
  2. 86 379
      build/three.min.js
  3. 19 33
      build/three.module.js

+ 19 - 33
build/three.js

@@ -17452,7 +17452,7 @@
 
 		}
 
-		function clear() {
+		function dispose() {
 
 			updateList = {};
 
@@ -17461,7 +17461,7 @@
 		return {
 
 			update: update,
-			clear: clear
+			dispose: dispose
 
 		};
 
@@ -18489,7 +18489,7 @@
 	 * @author mrdoob / http://mrdoob.com/
 	 */
 
-	function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, infoMemory ) {
+	function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, infoMemory, infoRender ) {
 
 		var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
 		var _videoTextures = {};
@@ -18684,6 +18684,8 @@
 
 			var textureProperties = properties.get( texture );
 
+			if ( texture.isVideoTexture ) updateVideoTexture( texture );
+
 			if ( texture.version > 0 && textureProperties.__version !== texture.version ) {
 
 				var image = texture.image;
@@ -18895,12 +18897,6 @@
 
 				textureProperties.__webglTexture = _gl.createTexture();
 
-				if ( texture.isVideoTexture ) {
-
-					_videoTextures[ texture.id ] = texture;
-
-				}
-
 				infoMemory.textures ++;
 
 			}
@@ -19282,11 +19278,17 @@
 
 		}
 
-		function updateVideoTextures() {
+		function updateVideoTexture( texture ) {
+
+			var id = texture.id;
+			var frame = infoRender.frame;
+
+			// Check the last frame we updated the VideoTexture
 
-			for ( var id in _videoTextures ) {
+			if ( _videoTextures[ id ] !== frame ) {
 
-				_videoTextures[ id ].update();
+				_videoTextures[ id ] = frame;
+				texture.update();
 
 			}
 
@@ -19297,7 +19299,6 @@
 		this.setTextureCubeDynamic = setTextureCubeDynamic;
 		this.setupRenderTarget = setupRenderTarget;
 		this.updateRenderTargetMipmap = updateRenderTargetMipmap;
-		this.updateVideoTextures = updateVideoTextures;
 
 	}
 
@@ -19331,7 +19332,7 @@
 
 		}
 
-		function clear() {
+		function dispose() {
 
 			properties = {};
 
@@ -19340,7 +19341,7 @@
 		return {
 			get: get,
 			remove: remove,
-			clear: clear
+			dispose: dispose
 		};
 
 	}
@@ -21478,7 +21479,7 @@
 			state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
 
 			properties = new WebGLProperties();
-			textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, _infoMemory );
+			textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, _infoMemory, _infoRender );
 			attributes = new WebGLAttributes( _gl );
 			geometries = new WebGLGeometries( _gl, attributes, _infoMemory );
 			objects = new WebGLObjects( geometries, _infoRender );
@@ -21715,6 +21716,8 @@
 			_canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );
 
 			renderLists.dispose();
+			properties.dispose();
+			objects.dispose();
 
 			vr.dispose();
 
@@ -22335,10 +22338,6 @@
 
 			//
 
-			textures.updateVideoTextures();
-
-			//
-
 			if ( _clippingEnabled ) _clipping.beginShadows();
 
 			shadowMap.render( shadowsArray, scene, camera );
@@ -25154,19 +25153,6 @@
 
 		this.generateMipmaps = false;
 
-		// Set needsUpdate when first frame is ready
-
-		var scope = this;
-
-		function onLoaded() {
-
-			video.removeEventListener( 'loadeddata', onLoaded, false );
-			scope.needsUpdate = true;
-
-		}
-
-		video.addEventListener( 'loadeddata', onLoaded, false );
-
 	}
 
 	VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 86 - 379
build/three.min.js


+ 19 - 33
build/three.module.js

@@ -17446,7 +17446,7 @@ function WebGLObjects( geometries, infoRender ) {
 
 	}
 
-	function clear() {
+	function dispose() {
 
 		updateList = {};
 
@@ -17455,7 +17455,7 @@ function WebGLObjects( geometries, infoRender ) {
 	return {
 
 		update: update,
-		clear: clear
+		dispose: dispose
 
 	};
 
@@ -18483,7 +18483,7 @@ function WebGLPrograms( renderer, extensions, capabilities ) {
  * @author mrdoob / http://mrdoob.com/
  */
 
-function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, infoMemory ) {
+function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, infoMemory, infoRender ) {
 
 	var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
 	var _videoTextures = {};
@@ -18678,6 +18678,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 		var textureProperties = properties.get( texture );
 
+		if ( texture.isVideoTexture ) updateVideoTexture( texture );
+
 		if ( texture.version > 0 && textureProperties.__version !== texture.version ) {
 
 			var image = texture.image;
@@ -18889,12 +18891,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 			textureProperties.__webglTexture = _gl.createTexture();
 
-			if ( texture.isVideoTexture ) {
-
-				_videoTextures[ texture.id ] = texture;
-
-			}
-
 			infoMemory.textures ++;
 
 		}
@@ -19276,11 +19272,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 	}
 
-	function updateVideoTextures() {
+	function updateVideoTexture( texture ) {
+
+		var id = texture.id;
+		var frame = infoRender.frame;
+
+		// Check the last frame we updated the VideoTexture
 
-		for ( var id in _videoTextures ) {
+		if ( _videoTextures[ id ] !== frame ) {
 
-			_videoTextures[ id ].update();
+			_videoTextures[ id ] = frame;
+			texture.update();
 
 		}
 
@@ -19291,7 +19293,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 	this.setTextureCubeDynamic = setTextureCubeDynamic;
 	this.setupRenderTarget = setupRenderTarget;
 	this.updateRenderTargetMipmap = updateRenderTargetMipmap;
-	this.updateVideoTextures = updateVideoTextures;
 
 }
 
@@ -19325,7 +19326,7 @@ function WebGLProperties() {
 
 	}
 
-	function clear() {
+	function dispose() {
 
 		properties = {};
 
@@ -19334,7 +19335,7 @@ function WebGLProperties() {
 	return {
 		get: get,
 		remove: remove,
-		clear: clear
+		dispose: dispose
 	};
 
 }
@@ -21472,7 +21473,7 @@ function WebGLRenderer( parameters ) {
 		state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
 
 		properties = new WebGLProperties();
-		textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, _infoMemory );
+		textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, _infoMemory, _infoRender );
 		attributes = new WebGLAttributes( _gl );
 		geometries = new WebGLGeometries( _gl, attributes, _infoMemory );
 		objects = new WebGLObjects( geometries, _infoRender );
@@ -21709,6 +21710,8 @@ function WebGLRenderer( parameters ) {
 		_canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );
 
 		renderLists.dispose();
+		properties.dispose();
+		objects.dispose();
 
 		vr.dispose();
 
@@ -22329,10 +22332,6 @@ function WebGLRenderer( parameters ) {
 
 		//
 
-		textures.updateVideoTextures();
-
-		//
-
 		if ( _clippingEnabled ) _clipping.beginShadows();
 
 		shadowMap.render( shadowsArray, scene, camera );
@@ -25148,19 +25147,6 @@ function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, forma
 
 	this.generateMipmaps = false;
 
-	// Set needsUpdate when first frame is ready
-
-	var scope = this;
-
-	function onLoaded() {
-
-		video.removeEventListener( 'loadeddata', onLoaded, false );
-		scope.needsUpdate = true;
-
-	}
-
-	video.addEventListener( 'loadeddata', onLoaded, false );
-
 }
 
 VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio