Bladeren bron

Updated builds.

Mr.doob 8 jaren geleden
bovenliggende
commit
8e7f533d0c
3 gewijzigde bestanden met toevoegingen van 261 en 260 verwijderingen
  1. 34 33
      build/three.js
  2. 193 194
      build/three.min.js
  3. 34 33
      build/three.module.js

+ 34 - 33
build/three.js

@@ -9194,12 +9194,13 @@
 
 
 			// render depth map
 			// render depth map
 
 
-			var faceCount, isPointLight;
+			var faceCount;
 
 
 			for ( var i = 0, il = _lightShadows.length; i < il; i ++ ) {
 			for ( var i = 0, il = _lightShadows.length; i < il; i ++ ) {
 
 
 				var light = _lightShadows[ i ];
 				var light = _lightShadows[ i ];
 				var shadow = light.shadow;
 				var shadow = light.shadow;
+				var isPointLight = light && light.isPointLight;
 
 
 				if ( shadow === undefined ) {
 				if ( shadow === undefined ) {
 
 
@@ -9208,25 +9209,12 @@
 
 
 				}
 				}
 
 
-				if ( shadow.isSpotLightShadow ) {
-
-					shadow.update( light );
-
-				}
-
 				var shadowCamera = shadow.camera;
 				var shadowCamera = shadow.camera;
-				var shadowMatrix = shadow.matrix;
-
-				_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
-				shadowCamera.position.copy( _lightPositionWorld );
 
 
 				_shadowMapSize.copy( shadow.mapSize );
 				_shadowMapSize.copy( shadow.mapSize );
 				_shadowMapSize.min( _maxShadowMapSize );
 				_shadowMapSize.min( _maxShadowMapSize );
 
 
-				if ( light && light.isPointLight ) {
-
-					faceCount = 6;
-					isPointLight = true;
+				if ( isPointLight ) {
 
 
 					var vpWidth = _shadowMapSize.x;
 					var vpWidth = _shadowMapSize.x;
 					var vpHeight = _shadowMapSize.y;
 					var vpHeight = _shadowMapSize.y;
@@ -9260,6 +9248,34 @@
 					_shadowMapSize.x *= 4.0;
 					_shadowMapSize.x *= 4.0;
 					_shadowMapSize.y *= 2.0;
 					_shadowMapSize.y *= 2.0;
 
 
+				}
+
+				if ( shadow.map === null ) {
+
+					var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
+
+					shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
+					shadow.map.texture.name = light.name + ".shadowMap";
+
+					shadowCamera.updateProjectionMatrix();
+
+				}
+
+				if ( shadow.isSpotLightShadow ) {
+
+					shadow.update( light );
+
+				}
+
+				var shadowMap = shadow.map;
+				var shadowMatrix = shadow.matrix;
+
+				_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
+				shadowCamera.position.copy( _lightPositionWorld );
+
+				if ( isPointLight ) {
+
+					faceCount = 6;
 
 
 					// for point lights we set the shadow matrix to be a translation-only matrix
 					// for point lights we set the shadow matrix to be a translation-only matrix
 					// equal to inverse of the light's position
 					// equal to inverse of the light's position
@@ -9269,7 +9285,6 @@
 				} else {
 				} else {
 
 
 					faceCount = 1;
 					faceCount = 1;
-					isPointLight = false;
 
 
 					_lookTarget.setFromMatrixPosition( light.target.matrixWorld );
 					_lookTarget.setFromMatrixPosition( light.target.matrixWorld );
 					shadowCamera.lookAt( _lookTarget );
 					shadowCamera.lookAt( _lookTarget );
@@ -9290,19 +9305,6 @@
 
 
 				}
 				}
 
 
-				if ( shadow.map === null ) {
-
-					var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
-
-					shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
-					shadow.map.texture.name = light.name + ".shadowMap";
-
-					shadowCamera.updateProjectionMatrix();
-
-				}
-
-				var shadowMap = shadow.map;
-
 				_renderer.setRenderTarget( shadowMap );
 				_renderer.setRenderTarget( shadowMap );
 				_renderer.clear();
 				_renderer.clear();
 
 
@@ -10533,10 +10535,6 @@
 		this.renderOrder = 0;
 		this.renderOrder = 0;
 
 
 		this.userData = {};
 		this.userData = {};
-
-		this.onBeforeRender = function () {};
-		this.onAfterRender = function () {};
-
 	}
 	}
 
 
 	Object3D.DefaultUp = new Vector3( 0, 1, 0 );
 	Object3D.DefaultUp = new Vector3( 0, 1, 0 );
@@ -10546,6 +10544,9 @@
 
 
 		isObject3D: true,
 		isObject3D: true,
 
 
+		onBeforeRender: function () {},
+		onAfterRender: function () {},
+
 		applyMatrix: function ( matrix ) {
 		applyMatrix: function ( matrix ) {
 
 
 			this.matrix.multiplyMatrices( matrix, this.matrix );
 			this.matrix.multiplyMatrices( matrix, this.matrix );

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


+ 34 - 33
build/three.module.js

@@ -9188,12 +9188,13 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 
 
 		// render depth map
 		// render depth map
 
 
-		var faceCount, isPointLight;
+		var faceCount;
 
 
 		for ( var i = 0, il = _lightShadows.length; i < il; i ++ ) {
 		for ( var i = 0, il = _lightShadows.length; i < il; i ++ ) {
 
 
 			var light = _lightShadows[ i ];
 			var light = _lightShadows[ i ];
 			var shadow = light.shadow;
 			var shadow = light.shadow;
+			var isPointLight = light && light.isPointLight;
 
 
 			if ( shadow === undefined ) {
 			if ( shadow === undefined ) {
 
 
@@ -9202,25 +9203,12 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 
 
 			}
 			}
 
 
-			if ( shadow.isSpotLightShadow ) {
-
-				shadow.update( light );
-
-			}
-
 			var shadowCamera = shadow.camera;
 			var shadowCamera = shadow.camera;
-			var shadowMatrix = shadow.matrix;
-
-			_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
-			shadowCamera.position.copy( _lightPositionWorld );
 
 
 			_shadowMapSize.copy( shadow.mapSize );
 			_shadowMapSize.copy( shadow.mapSize );
 			_shadowMapSize.min( _maxShadowMapSize );
 			_shadowMapSize.min( _maxShadowMapSize );
 
 
-			if ( light && light.isPointLight ) {
-
-				faceCount = 6;
-				isPointLight = true;
+			if ( isPointLight ) {
 
 
 				var vpWidth = _shadowMapSize.x;
 				var vpWidth = _shadowMapSize.x;
 				var vpHeight = _shadowMapSize.y;
 				var vpHeight = _shadowMapSize.y;
@@ -9254,6 +9242,34 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 				_shadowMapSize.x *= 4.0;
 				_shadowMapSize.x *= 4.0;
 				_shadowMapSize.y *= 2.0;
 				_shadowMapSize.y *= 2.0;
 
 
+			}
+
+			if ( shadow.map === null ) {
+
+				var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
+
+				shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
+				shadow.map.texture.name = light.name + ".shadowMap";
+
+				shadowCamera.updateProjectionMatrix();
+
+			}
+
+			if ( shadow.isSpotLightShadow ) {
+
+				shadow.update( light );
+
+			}
+
+			var shadowMap = shadow.map;
+			var shadowMatrix = shadow.matrix;
+
+			_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
+			shadowCamera.position.copy( _lightPositionWorld );
+
+			if ( isPointLight ) {
+
+				faceCount = 6;
 
 
 				// for point lights we set the shadow matrix to be a translation-only matrix
 				// for point lights we set the shadow matrix to be a translation-only matrix
 				// equal to inverse of the light's position
 				// equal to inverse of the light's position
@@ -9263,7 +9279,6 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 			} else {
 			} else {
 
 
 				faceCount = 1;
 				faceCount = 1;
-				isPointLight = false;
 
 
 				_lookTarget.setFromMatrixPosition( light.target.matrixWorld );
 				_lookTarget.setFromMatrixPosition( light.target.matrixWorld );
 				shadowCamera.lookAt( _lookTarget );
 				shadowCamera.lookAt( _lookTarget );
@@ -9284,19 +9299,6 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
 
 
 			}
 			}
 
 
-			if ( shadow.map === null ) {
-
-				var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
-
-				shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
-				shadow.map.texture.name = light.name + ".shadowMap";
-
-				shadowCamera.updateProjectionMatrix();
-
-			}
-
-			var shadowMap = shadow.map;
-
 			_renderer.setRenderTarget( shadowMap );
 			_renderer.setRenderTarget( shadowMap );
 			_renderer.clear();
 			_renderer.clear();
 
 
@@ -10527,10 +10529,6 @@ function Object3D() {
 	this.renderOrder = 0;
 	this.renderOrder = 0;
 
 
 	this.userData = {};
 	this.userData = {};
-
-	this.onBeforeRender = function () {};
-	this.onAfterRender = function () {};
-
 }
 }
 
 
 Object3D.DefaultUp = new Vector3( 0, 1, 0 );
 Object3D.DefaultUp = new Vector3( 0, 1, 0 );
@@ -10540,6 +10538,9 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 
 	isObject3D: true,
 	isObject3D: true,
 
 
+	onBeforeRender: function () {},
+	onAfterRender: function () {},
+
 	applyMatrix: function ( matrix ) {
 	applyMatrix: function ( matrix ) {
 
 
 		this.matrix.multiplyMatrices( matrix, this.matrix );
 		this.matrix.multiplyMatrices( matrix, this.matrix );

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