Ver Fonte

Updated builds.

Mr.doob há 7 anos atrás
pai
commit
47a4fdf429
3 ficheiros alterados com 407 adições e 369 exclusões
  1. 52 33
      build/three.js
  2. 303 303
      build/three.min.js
  3. 52 33
      build/three.module.js

+ 52 - 33
build/three.js

@@ -15814,12 +15814,13 @@
 
 	function setValueT1( gl, v, renderer ) {
 
+		var cache = this.cache;
 		var unit = renderer.allocTextureUnit();
 
-		if ( this.cache[ 0 ] !== unit ) {
+		if ( cache[ 0 ] !== unit ) {
 
 			gl.uniform1i( this.addr, unit );
-			this.cache[ 0 ] = unit;
+			cache[ 0 ] = unit;
 
 		}
 
@@ -15829,12 +15830,13 @@
 
 	function setValueT6( gl, v, renderer ) {
 
+		var cache = this.cache;
 		var unit = renderer.allocTextureUnit();
 
-		if ( this.cache[ 0 ] !== unit ) {
+		if ( cache[ 0 ] !== unit ) {
 
 			gl.uniform1i( this.addr, unit );
-			this.cache[ 0 ] = unit;
+			cache[ 0 ] = unit;
 
 		}
 
@@ -15846,31 +15848,37 @@
 
 	function setValue2iv( gl, v ) {
 
-		if ( arraysEqual( this.cache, v ) ) return;
+		var cache = this.cache;
+
+		if ( arraysEqual( cache, v ) ) return;
 
 		gl.uniform2iv( this.addr, v );
 
-		copyArray( this.cache, v );
+		copyArray( cache, v );
 
 	}
 
 	function setValue3iv( gl, v ) {
 
-		if ( arraysEqual( this.cache, v ) ) return;
+		var cache = this.cache;
+
+		if ( arraysEqual( cache, v ) ) return;
 
 		gl.uniform3iv( this.addr, v );
 
-		copyArray( this.cache, v );
+		copyArray( cache, v );
 
 	}
 
 	function setValue4iv( gl, v ) {
 
-		if ( arraysEqual( this.cache, v ) ) return;
+		var cache = this.cache;
+
+		if ( arraysEqual( cache, v ) ) return;
 
 		gl.uniform4iv( this.addr, v );
 
-		copyArray( this.cache, v );
+		copyArray( cache, v );
 
 	}
 
@@ -15905,13 +15913,25 @@
 
 	function setValue1fv( gl, v ) {
 
+		var cache = this.cache;
+
+		if ( arraysEqual( cache, v ) ) return;
+
 		gl.uniform1fv( this.addr, v );
 
+		copyArray( cache, v );
+
 	}
 	function setValue1iv( gl, v ) {
 
+		var cache = this.cache;
+
+		if ( arraysEqual( cache, v ) ) return;
+
 		gl.uniform1iv( this.addr, v );
 
+		copyArray( cache, v );
+
 	}
 
 	// Array of vectors (flat or from THREE classes)
@@ -15958,10 +15978,17 @@
 
 	function setValueT1a( gl, v, renderer ) {
 
-		var n = v.length,
-			units = allocTexUnits( renderer, n );
+		var cache = this.cache;
+		var n = v.length;
+
+		var units = allocTexUnits( renderer, n );
+
+		if ( arraysEqual( cache, units ) === false ) {
 
-		gl.uniform1iv( this.addr, units );
+			gl.uniform1iv( this.addr, units );
+			copyArray( cache, units );
+
+		}
 
 		for ( var i = 0; i !== n; ++ i ) {
 
@@ -15973,10 +16000,17 @@
 
 	function setValueT6a( gl, v, renderer ) {
 
-		var n = v.length,
-			units = allocTexUnits( renderer, n );
+		var cache = this.cache;
+		var n = v.length;
+
+		var units = allocTexUnits( renderer, n );
+
+		if ( arraysEqual( cache, units ) === false ) {
 
-		gl.uniform1iv( this.addr, units );
+			gl.uniform1iv( this.addr, units );
+			copyArray( cache, units );
+
+		}
 
 		for ( var i = 0; i !== n; ++ i ) {
 
@@ -16030,6 +16064,7 @@
 
 		this.id = id;
 		this.addr = addr;
+		this.cache = [];
 		this.size = activeInfo.size;
 		this.setValue = getPureArraySetter( activeInfo.type );
 
@@ -19246,23 +19281,7 @@
 
 		function enableAttribute( attribute ) {
 
-			newAttributes[ attribute ] = 1;
-
-			if ( enabledAttributes[ attribute ] === 0 ) {
-
-				gl.enableVertexAttribArray( attribute );
-				enabledAttributes[ attribute ] = 1;
-
-			}
-
-			if ( attributeDivisors[ attribute ] !== 0 ) {
-
-				var extension = extensions.get( 'ANGLE_instanced_arrays' );
-
-				extension.vertexAttribDivisorANGLE( attribute, 0 );
-				attributeDivisors[ attribute ] = 0;
-
-			}
+			enableAttributeAndDivisor( attribute, 0 );
 
 		}
 

Diff do ficheiro suprimidas por serem muito extensas
+ 303 - 303
build/three.min.js


+ 52 - 33
build/three.module.js

@@ -15808,12 +15808,13 @@ function setValue4fm( gl, v ) {
 
 function setValueT1( gl, v, renderer ) {
 
+	var cache = this.cache;
 	var unit = renderer.allocTextureUnit();
 
-	if ( this.cache[ 0 ] !== unit ) {
+	if ( cache[ 0 ] !== unit ) {
 
 		gl.uniform1i( this.addr, unit );
-		this.cache[ 0 ] = unit;
+		cache[ 0 ] = unit;
 
 	}
 
@@ -15823,12 +15824,13 @@ function setValueT1( gl, v, renderer ) {
 
 function setValueT6( gl, v, renderer ) {
 
+	var cache = this.cache;
 	var unit = renderer.allocTextureUnit();
 
-	if ( this.cache[ 0 ] !== unit ) {
+	if ( cache[ 0 ] !== unit ) {
 
 		gl.uniform1i( this.addr, unit );
-		this.cache[ 0 ] = unit;
+		cache[ 0 ] = unit;
 
 	}
 
@@ -15840,31 +15842,37 @@ function setValueT6( gl, v, renderer ) {
 
 function setValue2iv( gl, v ) {
 
-	if ( arraysEqual( this.cache, v ) ) return;
+	var cache = this.cache;
+
+	if ( arraysEqual( cache, v ) ) return;
 
 	gl.uniform2iv( this.addr, v );
 
-	copyArray( this.cache, v );
+	copyArray( cache, v );
 
 }
 
 function setValue3iv( gl, v ) {
 
-	if ( arraysEqual( this.cache, v ) ) return;
+	var cache = this.cache;
+
+	if ( arraysEqual( cache, v ) ) return;
 
 	gl.uniform3iv( this.addr, v );
 
-	copyArray( this.cache, v );
+	copyArray( cache, v );
 
 }
 
 function setValue4iv( gl, v ) {
 
-	if ( arraysEqual( this.cache, v ) ) return;
+	var cache = this.cache;
+
+	if ( arraysEqual( cache, v ) ) return;
 
 	gl.uniform4iv( this.addr, v );
 
-	copyArray( this.cache, v );
+	copyArray( cache, v );
 
 }
 
@@ -15899,13 +15907,25 @@ function getSingularSetter( type ) {
 
 function setValue1fv( gl, v ) {
 
+	var cache = this.cache;
+
+	if ( arraysEqual( cache, v ) ) return;
+
 	gl.uniform1fv( this.addr, v );
 
+	copyArray( cache, v );
+
 }
 function setValue1iv( gl, v ) {
 
+	var cache = this.cache;
+
+	if ( arraysEqual( cache, v ) ) return;
+
 	gl.uniform1iv( this.addr, v );
 
+	copyArray( cache, v );
+
 }
 
 // Array of vectors (flat or from THREE classes)
@@ -15952,10 +15972,17 @@ function setValueM4a( gl, v ) {
 
 function setValueT1a( gl, v, renderer ) {
 
-	var n = v.length,
-		units = allocTexUnits( renderer, n );
+	var cache = this.cache;
+	var n = v.length;
+
+	var units = allocTexUnits( renderer, n );
+
+	if ( arraysEqual( cache, units ) === false ) {
 
-	gl.uniform1iv( this.addr, units );
+		gl.uniform1iv( this.addr, units );
+		copyArray( cache, units );
+
+	}
 
 	for ( var i = 0; i !== n; ++ i ) {
 
@@ -15967,10 +15994,17 @@ function setValueT1a( gl, v, renderer ) {
 
 function setValueT6a( gl, v, renderer ) {
 
-	var n = v.length,
-		units = allocTexUnits( renderer, n );
+	var cache = this.cache;
+	var n = v.length;
+
+	var units = allocTexUnits( renderer, n );
+
+	if ( arraysEqual( cache, units ) === false ) {
 
-	gl.uniform1iv( this.addr, units );
+		gl.uniform1iv( this.addr, units );
+		copyArray( cache, units );
+
+	}
 
 	for ( var i = 0; i !== n; ++ i ) {
 
@@ -16024,6 +16058,7 @@ function PureArrayUniform( id, activeInfo, addr ) {
 
 	this.id = id;
 	this.addr = addr;
+	this.cache = [];
 	this.size = activeInfo.size;
 	this.setValue = getPureArraySetter( activeInfo.type );
 
@@ -19240,23 +19275,7 @@ function WebGLState( gl, extensions, utils ) {
 
 	function enableAttribute( attribute ) {
 
-		newAttributes[ attribute ] = 1;
-
-		if ( enabledAttributes[ attribute ] === 0 ) {
-
-			gl.enableVertexAttribArray( attribute );
-			enabledAttributes[ attribute ] = 1;
-
-		}
-
-		if ( attributeDivisors[ attribute ] !== 0 ) {
-
-			var extension = extensions.get( 'ANGLE_instanced_arrays' );
-
-			extension.vertexAttribDivisorANGLE( attribute, 0 );
-			attributeDivisors[ attribute ] = 0;
-
-		}
+		enableAttributeAndDivisor( attribute, 0 );
 
 	}
 

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff