Browse Source

Updated builds.

Mr.doob 7 years ago
parent
commit
454cc07403
3 changed files with 336 additions and 386 deletions
  1. 32 57
      build/three.js
  2. 272 272
      build/three.min.js
  3. 32 57
      build/three.module.js

+ 32 - 57
build/three.js

@@ -11921,7 +11921,6 @@
 
 			var index = this.index;
 			var attributes = this.attributes;
-			var groups = this.groups;
 
 			if ( attributes.position ) {
 
@@ -11957,46 +11956,31 @@
 
 					var indices = index.array;
 
-					if ( groups.length === 0 ) {
-
-						this.addGroup( 0, indices.length );
-
-					}
-
-					for ( var j = 0, jl = groups.length; j < jl; ++ j ) {
-
-						var group = groups[ j ];
-
-						var start = group.start;
-						var count = group.count;
+					for ( var i = 0, il = index.count; i < il; i += 3 ) {
 
-						for ( var i = start, il = start + count; i < il; i += 3 ) {
+						vA = indices[ i + 0 ] * 3;
+						vB = indices[ i + 1 ] * 3;
+						vC = indices[ i + 2 ] * 3;
 
-							vA = indices[ i + 0 ] * 3;
-							vB = indices[ i + 1 ] * 3;
-							vC = indices[ i + 2 ] * 3;
+						pA.fromArray( positions, vA );
+						pB.fromArray( positions, vB );
+						pC.fromArray( positions, vC );
 
-							pA.fromArray( positions, vA );
-							pB.fromArray( positions, vB );
-							pC.fromArray( positions, vC );
-
-							cb.subVectors( pC, pB );
-							ab.subVectors( pA, pB );
-							cb.cross( ab );
-
-							normals[ vA ] += cb.x;
-							normals[ vA + 1 ] += cb.y;
-							normals[ vA + 2 ] += cb.z;
+						cb.subVectors( pC, pB );
+						ab.subVectors( pA, pB );
+						cb.cross( ab );
 
-							normals[ vB ] += cb.x;
-							normals[ vB + 1 ] += cb.y;
-							normals[ vB + 2 ] += cb.z;
+						normals[ vA ] += cb.x;
+						normals[ vA + 1 ] += cb.y;
+						normals[ vA + 2 ] += cb.z;
 
-							normals[ vC ] += cb.x;
-							normals[ vC + 1 ] += cb.y;
-							normals[ vC + 2 ] += cb.z;
+						normals[ vB ] += cb.x;
+						normals[ vB + 1 ] += cb.y;
+						normals[ vB + 2 ] += cb.z;
 
-						}
+						normals[ vC ] += cb.x;
+						normals[ vC + 1 ] += cb.y;
+						normals[ vC + 2 ] += cb.z;
 
 					}
 
@@ -21534,21 +21518,9 @@
 
 		};
 
-		this.submitFrame = function ( scene, camera ) {
+		this.submitFrame = function () {
 
-			if ( isPresenting() ) {
-
-				device.submitFrame();
-
-				if ( device.capabilities.hasExternalDisplay ) {
-
-					scope.enabled = false;
-					renderer.render( scene, camera );
-					scope.enabled = true;
-
-				}
-
-			}
+			if ( isPresenting() ) device.submitFrame();
 
 		};
 
@@ -21969,7 +21941,6 @@
 
 			// frustum
 
-			_camera = null,
 			_frustum = new Frustum(),
 
 			// clipping
@@ -22854,7 +22825,6 @@
 			_currentGeometryProgram.wireframe = false;
 			_currentMaterialId = - 1;
 			_currentCamera = null;
-			_camera = camera;
 
 			// update scene graph
 
@@ -22936,7 +22906,12 @@
 
 			} else {
 
+				// opaque pass (front-to-back order)
+
 				if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera );
+
+				// transparent pass (back-to-front order)
+
 				if ( transparentObjects.length ) renderObjects( transparentObjects, scene, camera );
 
 			}
@@ -22961,7 +22936,7 @@
 
 			if ( vr.enabled ) {
 
-				vr.submitFrame( scene, _camera );
+				vr.submitFrame();
 
 			}
 
@@ -23173,6 +23148,8 @@
 
 							}
 
+							currentRenderState.setupLights( camera2 );
+
 							renderObject( object, scene, camera2, geometry, material, group );
 
 						}
@@ -23498,7 +23475,7 @@
 
 			}
 
-			if ( refreshProgram || camera !== _currentCamera ) {
+			if ( refreshProgram || _currentCamera !== camera ) {
 
 				p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
 
@@ -23509,11 +23486,9 @@
 
 				}
 
-				// Avoid unneeded uniform updates per ArrayCamera's sub-camera
-
-				if ( _currentCamera !== ( _currentArrayCamera || camera ) ) {
+				if ( _currentCamera !== camera ) {
 
-					_currentCamera = ( _currentArrayCamera || camera );
+					_currentCamera = camera;
 
 					// lighting uniforms depend on the camera so enforce an update
 					// now, in case this material supports lights - or later, when

File diff suppressed because it is too large
+ 272 - 272
build/three.min.js


+ 32 - 57
build/three.module.js

@@ -11915,7 +11915,6 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 		var index = this.index;
 		var attributes = this.attributes;
-		var groups = this.groups;
 
 		if ( attributes.position ) {
 
@@ -11951,46 +11950,31 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 				var indices = index.array;
 
-				if ( groups.length === 0 ) {
-
-					this.addGroup( 0, indices.length );
-
-				}
-
-				for ( var j = 0, jl = groups.length; j < jl; ++ j ) {
-
-					var group = groups[ j ];
-
-					var start = group.start;
-					var count = group.count;
+				for ( var i = 0, il = index.count; i < il; i += 3 ) {
 
-					for ( var i = start, il = start + count; i < il; i += 3 ) {
+					vA = indices[ i + 0 ] * 3;
+					vB = indices[ i + 1 ] * 3;
+					vC = indices[ i + 2 ] * 3;
 
-						vA = indices[ i + 0 ] * 3;
-						vB = indices[ i + 1 ] * 3;
-						vC = indices[ i + 2 ] * 3;
+					pA.fromArray( positions, vA );
+					pB.fromArray( positions, vB );
+					pC.fromArray( positions, vC );
 
-						pA.fromArray( positions, vA );
-						pB.fromArray( positions, vB );
-						pC.fromArray( positions, vC );
-
-						cb.subVectors( pC, pB );
-						ab.subVectors( pA, pB );
-						cb.cross( ab );
-
-						normals[ vA ] += cb.x;
-						normals[ vA + 1 ] += cb.y;
-						normals[ vA + 2 ] += cb.z;
+					cb.subVectors( pC, pB );
+					ab.subVectors( pA, pB );
+					cb.cross( ab );
 
-						normals[ vB ] += cb.x;
-						normals[ vB + 1 ] += cb.y;
-						normals[ vB + 2 ] += cb.z;
+					normals[ vA ] += cb.x;
+					normals[ vA + 1 ] += cb.y;
+					normals[ vA + 2 ] += cb.z;
 
-						normals[ vC ] += cb.x;
-						normals[ vC + 1 ] += cb.y;
-						normals[ vC + 2 ] += cb.z;
+					normals[ vB ] += cb.x;
+					normals[ vB + 1 ] += cb.y;
+					normals[ vB + 2 ] += cb.z;
 
-					}
+					normals[ vC ] += cb.x;
+					normals[ vC + 1 ] += cb.y;
+					normals[ vC + 2 ] += cb.z;
 
 				}
 
@@ -21528,21 +21512,9 @@ function WebVRManager( renderer ) {
 
 	};
 
-	this.submitFrame = function ( scene, camera ) {
+	this.submitFrame = function () {
 
-		if ( isPresenting() ) {
-
-			device.submitFrame();
-
-			if ( device.capabilities.hasExternalDisplay ) {
-
-				scope.enabled = false;
-				renderer.render( scene, camera );
-				scope.enabled = true;
-
-			}
-
-		}
+		if ( isPresenting() ) device.submitFrame();
 
 	};
 
@@ -21963,7 +21935,6 @@ function WebGLRenderer( parameters ) {
 
 		// frustum
 
-		_camera = null,
 		_frustum = new Frustum(),
 
 		// clipping
@@ -22848,7 +22819,6 @@ function WebGLRenderer( parameters ) {
 		_currentGeometryProgram.wireframe = false;
 		_currentMaterialId = - 1;
 		_currentCamera = null;
-		_camera = camera;
 
 		// update scene graph
 
@@ -22930,7 +22900,12 @@ function WebGLRenderer( parameters ) {
 
 		} else {
 
+			// opaque pass (front-to-back order)
+
 			if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera );
+
+			// transparent pass (back-to-front order)
+
 			if ( transparentObjects.length ) renderObjects( transparentObjects, scene, camera );
 
 		}
@@ -22955,7 +22930,7 @@ function WebGLRenderer( parameters ) {
 
 		if ( vr.enabled ) {
 
-			vr.submitFrame( scene, _camera );
+			vr.submitFrame();
 
 		}
 
@@ -23167,6 +23142,8 @@ function WebGLRenderer( parameters ) {
 
 						}
 
+						currentRenderState.setupLights( camera2 );
+
 						renderObject( object, scene, camera2, geometry, material, group );
 
 					}
@@ -23492,7 +23469,7 @@ function WebGLRenderer( parameters ) {
 
 		}
 
-		if ( refreshProgram || camera !== _currentCamera ) {
+		if ( refreshProgram || _currentCamera !== camera ) {
 
 			p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
 
@@ -23503,11 +23480,9 @@ function WebGLRenderer( parameters ) {
 
 			}
 
-			// Avoid unneeded uniform updates per ArrayCamera's sub-camera
-
-			if ( _currentCamera !== ( _currentArrayCamera || camera ) ) {
+			if ( _currentCamera !== camera ) {
 
-				_currentCamera = ( _currentArrayCamera || camera );
+				_currentCamera = camera;
 
 				// lighting uniforms depend on the camera so enforce an update
 				// now, in case this material supports lights - or later, when

Some files were not shown because too many files changed in this diff