Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
e09bf29da6
2 changed files with 339 additions and 179 deletions
  1. 224 67
      build/three.js
  2. 115 112
      build/three.min.js

+ 224 - 67
build/three.js

@@ -7820,17 +7820,17 @@ THREE.Object3D = function () {
 	var quaternion = new THREE.Quaternion();
 	var quaternion = new THREE.Quaternion();
 	var scale = new THREE.Vector3( 1, 1, 1 );
 	var scale = new THREE.Vector3( 1, 1, 1 );
 
 
-	var onRotationChange = function () {
+	function onRotationChange() {
 
 
 		quaternion.setFromEuler( rotation, false );
 		quaternion.setFromEuler( rotation, false );
 
 
-	};
+	}
 
 
-	var onQuaternionChange = function () {
+	function onQuaternionChange() {
 
 
 		rotation.setFromQuaternion( quaternion, undefined, false );
 		rotation.setFromQuaternion( quaternion, undefined, false );
 
 
-	};
+	}
 
 
 	rotation.onChange( onRotationChange );
 	rotation.onChange( onRotationChange );
 	quaternion.onChange( onQuaternionChange );
 	quaternion.onChange( onQuaternionChange );
@@ -7889,7 +7889,7 @@ THREE.Object3D.prototype = {
 
 
 	get eulerOrder () {
 	get eulerOrder () {
 
 
-		console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
+		console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
 
 
 		return this.rotation.order;
 		return this.rotation.order;
 
 
@@ -7897,7 +7897,7 @@ THREE.Object3D.prototype = {
 
 
 	set eulerOrder ( value ) {
 	set eulerOrder ( value ) {
 
 
-		console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
+		console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );
 
 
 		this.rotation.order = value;
 		this.rotation.order = value;
 
 
@@ -7921,6 +7921,8 @@ THREE.Object3D.prototype = {
 
 
 	},
 	},
 
 
+	//
+
 	applyMatrix: function ( matrix ) {
 	applyMatrix: function ( matrix ) {
 
 
 		this.matrix.multiplyMatrices( matrix, this.matrix );
 		this.matrix.multiplyMatrices( matrix, this.matrix );
@@ -21482,9 +21484,9 @@ THREE.WebGLRenderer = function ( parameters ) {
 	var lights = [];
 	var lights = [];
 
 
 	var opaqueObjects = [];
 	var opaqueObjects = [];
-	var opaqueObjectsLastIndex = -1;
+	var opaqueObjectsLastIndex = - 1;
 	var transparentObjects = [];
 	var transparentObjects = [];
-	var transparentObjectsLastIndex = -1;
+	var transparentObjectsLastIndex = - 1;
 
 
 	var morphInfluences = new Float32Array( 8 );
 	var morphInfluences = new Float32Array( 8 );
 
 
@@ -22008,10 +22010,11 @@ THREE.WebGLRenderer = function ( parameters ) {
 	function deallocateRenderTarget( renderTarget ) {
 	function deallocateRenderTarget( renderTarget ) {
 
 
 		var renderTargetProperties = properties.get( renderTarget );
 		var renderTargetProperties = properties.get( renderTarget );
+		var textureProperties = properties.get( renderTarget.texture );
 
 
-		if ( ! renderTarget || renderTargetProperties.__webglTexture === undefined ) return;
+		if ( ! renderTarget || textureProperties.__webglTexture === undefined ) return;
 
 
-		_gl.deleteTexture( renderTargetProperties.__webglTexture );
+		_gl.deleteTexture( textureProperties.__webglTexture );
 
 
 		if ( renderTarget instanceof THREE.WebGLRenderTargetCube ) {
 		if ( renderTarget instanceof THREE.WebGLRenderTargetCube ) {
 
 
@@ -22029,6 +22032,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		}
 		}
 
 
+		properties.delete( renderTarget.texture );
 		properties.delete( renderTarget );
 		properties.delete( renderTarget );
 
 
 	}
 	}
@@ -22051,6 +22055,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( programInfo !== undefined ) {
 		if ( programInfo !== undefined ) {
 
 
 			programCache.releaseProgram( programInfo );
 			programCache.releaseProgram( programInfo );
+
 		}
 		}
 
 
 	}
 	}
@@ -22541,8 +22546,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		lights.length = 0;
 		lights.length = 0;
 
 
-		opaqueObjectsLastIndex = -1;
-		transparentObjectsLastIndex = -1;
+		opaqueObjectsLastIndex = - 1;
+		transparentObjectsLastIndex = - 1;
 
 
 		sprites.length = 0;
 		sprites.length = 0;
 		lensFlares.length = 0;
 		lensFlares.length = 0;
@@ -22607,9 +22612,15 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		// Generate mipmap if we're using any kind of mipmap filtering
 		// Generate mipmap if we're using any kind of mipmap filtering
 
 
-		if ( renderTarget && renderTarget.generateMipmaps && renderTarget.minFilter !== THREE.NearestFilter && renderTarget.minFilter !== THREE.LinearFilter ) {
+		if ( renderTarget ) {
+
+			var texture = renderTarget.texture;
+			var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height );
+			if ( texture.generateMipmaps && isTargetPowerOfTwo && texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) {
 
 
-			updateRenderTargetMipmap( renderTarget );
+				 updateRenderTargetMipmap( renderTarget );
+
+			}
 
 
 		}
 		}
 
 
@@ -22778,17 +22789,17 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			if ( object instanceof THREE.ImmediateRenderObject ) {
 			if ( object instanceof THREE.ImmediateRenderObject ) {
 
 
-					setMaterial( material );
+				setMaterial( material );
 
 
-					var program = setProgram( camera, lights, fog, material, object );
+				var program = setProgram( camera, lights, fog, material, object );
 
 
-					_currentGeometryProgram = '';
+				_currentGeometryProgram = '';
 
 
-					object.render( function ( object ) {
+				object.render( function ( object ) {
 
 
-						_this.renderBufferImmediate( object, program, material );
+					_this.renderBufferImmediate( object, program, material );
 
 
-					} );
+				} );
 
 
 			} else {
 			} else {
 
 
@@ -23250,6 +23261,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		if ( uvScaleMap !== undefined ) {
 		if ( uvScaleMap !== undefined ) {
 
 
+			if ( uvScaleMap instanceof THREE.WebGLRenderTarget ) uvScaleMap = uvScaleMap.texture;
 			var offset = uvScaleMap.offset;
 			var offset = uvScaleMap.offset;
 			var repeat = uvScaleMap.repeat;
 			var repeat = uvScaleMap.repeat;
 
 
@@ -23764,7 +23776,11 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 					} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
 					} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
 
 
-						setCubeTextureDynamic( texture, textureUnit );
+						setCubeTextureDynamic( texture.texture, textureUnit );
+
+					} else if ( texture instanceof THREE.WebGLRenderTarget ) {
+
+						_this.setTexture( texture.texture, textureUnit );
 
 
 					} else {
 					} else {
 
 
@@ -23806,9 +23822,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 							setCubeTexture( texture, textureUnit );
 							setCubeTexture( texture, textureUnit );
 
 
+						} else if ( texture instanceof THREE.WebGLRenderTarget ) {
+
+							_this.setTexture( texture.texture, textureUnit );
+
 						} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
 						} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
 
 
-							setCubeTextureDynamic( texture, textureUnit );
+							setCubeTextureDynamic( texture.texture, textureUnit );
 
 
 						} else {
 						} else {
 
 
@@ -24425,7 +24445,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 	function setupFrameBuffer ( framebuffer, renderTarget, textureTarget ) {
 	function setupFrameBuffer ( framebuffer, renderTarget, textureTarget ) {
 
 
 		_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
 		_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
-		_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureTarget, properties.get( renderTarget ).__webglTexture, 0 );
+		_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 );
 
 
 	}
 	}
 
 
@@ -24465,30 +24485,31 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) {
 		if ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) {
 
 
 			var renderTargetProperties = properties.get( renderTarget );
 			var renderTargetProperties = properties.get( renderTarget );
+			var textureProperties = properties.get( renderTarget.texture );
 
 
 			if ( renderTarget.depthBuffer === undefined ) renderTarget.depthBuffer = true;
 			if ( renderTarget.depthBuffer === undefined ) renderTarget.depthBuffer = true;
 			if ( renderTarget.stencilBuffer === undefined ) renderTarget.stencilBuffer = true;
 			if ( renderTarget.stencilBuffer === undefined ) renderTarget.stencilBuffer = true;
 
 
 			renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
 			renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
 
 
-			renderTargetProperties.__webglTexture = _gl.createTexture();
+			textureProperties.__webglTexture = _gl.createTexture();
 
 
 			_infoMemory.textures ++;
 			_infoMemory.textures ++;
 
 
 			// Setup texture, create render and frame buffers
 			// Setup texture, create render and frame buffers
 
 
 			var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height ),
 			var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height ),
-				glFormat = paramThreeToGL( renderTarget.format ),
-				glType = paramThreeToGL( renderTarget.type );
+				glFormat = paramThreeToGL( renderTarget.texture.format ),
+				glType = paramThreeToGL( renderTarget.texture.type );
 
 
 			if ( isCube ) {
 			if ( isCube ) {
 
 
 				renderTargetProperties.__webglFramebuffer = [];
 				renderTargetProperties.__webglFramebuffer = [];
 				renderTargetProperties.__webglRenderbuffer = [];
 				renderTargetProperties.__webglRenderbuffer = [];
 
 
-				state.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTargetProperties.__webglTexture );
+				state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );
 
 
-				setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget, isTargetPowerOfTwo );
+				setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo );
 
 
 				for ( var i = 0; i < 6; i ++ ) {
 				for ( var i = 0; i < 6; i ++ ) {
 
 
@@ -24501,7 +24522,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 				}
 				}
 
 
-				if ( renderTarget.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );
+				if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );
 
 
 			} else {
 			} else {
 
 
@@ -24517,8 +24538,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 				}
 				}
 
 
-				state.bindTexture( _gl.TEXTURE_2D, renderTargetProperties.__webglTexture );
-				setTextureParameters( _gl.TEXTURE_2D, renderTarget, isTargetPowerOfTwo );
+				state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );
+				setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );
 
 
 				state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
 				state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
 
 
@@ -24542,7 +24563,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 				}
 				}
 
 
-				if ( renderTarget.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );
+				if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );
 
 
 			}
 			}
 
 
@@ -24608,8 +24629,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		if ( isCube ) {
 		if ( isCube ) {
 
 
-			var renderTargetProperties = properties.get( renderTarget );
-			_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0,  _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, renderTargetProperties.__webglTexture, 0 );
+			var textureProperties = properties.get( renderTarget.texture );
+			_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0,  _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, 0 );
 
 
 		}
 		}
 
 
@@ -24639,14 +24660,14 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			}
 			}
 
 
-			if ( renderTarget.format !== THREE.RGBAFormat && paramThreeToGL( renderTarget.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
+			if ( renderTarget.texture.format !== THREE.RGBAFormat && paramThreeToGL( renderTarget.texture.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
 
 
 				console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
 				console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
 				return;
 				return;
 
 
 			}
 			}
 
 
-			if ( renderTarget.type !== THREE.UnsignedByteType && paramThreeToGL( renderTarget.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) ) {
+			if ( renderTarget.texture.type !== THREE.UnsignedByteType && paramThreeToGL( renderTarget.texture.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) ) {
 
 
 				console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
 				console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
 				return;
 				return;
@@ -24655,7 +24676,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) {
 			if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) {
 
 
-				_gl.readPixels( x, y, width, height, paramThreeToGL( renderTarget.format ), paramThreeToGL( renderTarget.type ), buffer );
+				_gl.readPixels( x, y, width, height, paramThreeToGL( renderTarget.texture.format ), paramThreeToGL( renderTarget.texture.type ), buffer );
 
 
 			} else {
 			} else {
 
 
@@ -24676,7 +24697,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 	function updateRenderTargetMipmap( renderTarget ) {
 	function updateRenderTargetMipmap( renderTarget ) {
 
 
 		var target = renderTarget instanceof THREE.WebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;
 		var target = renderTarget instanceof THREE.WebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;
-		var texture = properties.get( renderTarget ).__webglTexture;
+		var texture = properties.get( renderTarget.texture ).__webglTexture;
 
 
 		state.bindTexture( target, texture );
 		state.bindTexture( target, texture );
 		_gl.generateMipmap( target );
 		_gl.generateMipmap( target );
@@ -24950,25 +24971,13 @@ THREE.WebGLRenderTarget = function ( width, height, options ) {
 
 
 	options = options || {};
 	options = options || {};
 
 
-	this.wrapS = options.wrapS !== undefined ? options.wrapS : THREE.ClampToEdgeWrapping;
-	this.wrapT = options.wrapT !== undefined ? options.wrapT : THREE.ClampToEdgeWrapping;
-
-	this.magFilter = options.magFilter !== undefined ? options.magFilter : THREE.LinearFilter;
-	this.minFilter = options.minFilter !== undefined ? options.minFilter : THREE.LinearMipMapLinearFilter;
-
-	this.anisotropy = options.anisotropy !== undefined ? options.anisotropy : 1;
+	if ( options.minFilter === undefined ) options.minFilter = THREE.LinearFilter;
 
 
-	this.offset = new THREE.Vector2( 0, 0 );
-	this.repeat = new THREE.Vector2( 1, 1 );
-
-	this.format = options.format !== undefined ? options.format : THREE.RGBAFormat;
-	this.type = options.type !== undefined ? options.type : THREE.UnsignedByteType;
+	this.texture = new THREE.Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy );
 
 
 	this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
 	this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
 	this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
 	this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
 
 
-	this.generateMipmaps = true;
-
 	this.shareDepthFrom = options.shareDepthFrom !== undefined ? options.shareDepthFrom : null;
 	this.shareDepthFrom = options.shareDepthFrom !== undefined ? options.shareDepthFrom : null;
 
 
 };
 };
@@ -24977,6 +24986,168 @@ THREE.WebGLRenderTarget.prototype = {
 
 
 	constructor: THREE.WebGLRenderTarget,
 	constructor: THREE.WebGLRenderTarget,
 
 
+	get wrapS() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
+
+		return this.texture.wrapS;
+
+	},
+
+	set wrapS( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );
+
+		this.texture.wrapS = value;
+
+	},
+
+	get wrapT() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
+
+		return this.texture.wrapT;
+
+	},
+
+	set wrapT( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );
+
+		this.texture.wrapT = value;
+
+	},
+
+	get magFilter() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
+
+		return this.texture.magFilter;
+
+	},
+
+	set magFilter( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );
+
+		this.texture.magFilter = value;
+
+	},
+
+	get minFilter() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
+
+		return this.texture.minFilter;
+
+	},
+
+	set minFilter( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );
+
+		this.texture.minFilter = value;
+
+	},
+
+	get anisotropy() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
+
+		return this.texture.anisotropy;
+
+	},
+
+	set anisotropy( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );
+
+		this.texture.anisotropy = value;
+
+	},
+
+	get offset() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
+
+		return this.texture.offset;
+
+	},
+
+	set offset( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );
+
+		this.texture.offset = value;
+
+	},
+
+	get repeat() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
+
+		return this.texture.repeat;
+
+	},
+
+	set repeat( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );
+
+		this.texture.repeat = value;
+
+	},
+
+	get format() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
+
+		return this.texture.format;
+
+	},
+
+	set format( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );
+
+		this.texture.format = value;
+
+	},
+
+	get type() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
+
+		return this.texture.type;
+
+	},
+
+	set type( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );
+
+		this.texture.type = value;
+
+	},
+
+	get generateMipmaps() {
+
+		console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
+
+		return this.texture.generateMipmaps;
+
+	},
+
+	set generateMipmaps( value ) {
+
+		console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );
+
+		this.texture.generateMipmaps = value;
+
+	},
+
+	//
+
 	setSize: function ( width, height ) {
 	setSize: function ( width, height ) {
 
 
 		if ( this.width !== width || this.height !== height ) {
 		if ( this.width !== width || this.height !== height ) {
@@ -25001,25 +25172,11 @@ THREE.WebGLRenderTarget.prototype = {
 		this.width = source.width;
 		this.width = source.width;
 		this.height = source.height;
 		this.height = source.height;
 
 
-		this.wrapS = source.wrapS;
-		this.wrapT = source.wrapT;
-
-		this.magFilter = source.magFilter;
-		this.minFilter = source.minFilter;
-
-		this.anisotropy = source.anisotropy;
-
-		this.offset.copy( source.offset );
-		this.repeat.copy( source.repeat );
-
-		this.format = source.format;
-		this.type = source.type;
+		this.texture = source.texture.clone();
 
 
 		this.depthBuffer = source.depthBuffer;
 		this.depthBuffer = source.depthBuffer;
 		this.stencilBuffer = source.stencilBuffer;
 		this.stencilBuffer = source.stencilBuffer;
 
 
-		this.generateMipmaps = source.generateMipmaps;
-
 		this.shareDepthFrom = source.shareDepthFrom;
 		this.shareDepthFrom = source.shareDepthFrom;
 
 
 		return this;
 		return this;

+ 115 - 112
build/three.min.js

@@ -106,8 +106,8 @@ e=Math.sin(e);if("XYZ"===a.order){a=g*h;var l=g*e,k=c*h,n=c*e;b[0]=f*h;b[4]=-f*e
 n*d+a,b[9]=l*d-k,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=k*e+l,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+k,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=l*e-k,b[2]=k*e-l,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
 n*d+a,b[9]=l*d-k,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=k*e+l,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+k,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=l*e-k,b[2]=k*e-l,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
 return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,l=e+e;a=c*f;var k=c*h,c=c*l,n=d*h,d=d*l,e=e*l,f=g*f,h=g*h,g=g*l;b[0]=1-(n+e);b[4]=k-g;b[8]=c+h;b[1]=k+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);
 return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,l=e+e;a=c*f;var k=c*h,c=c*l,n=d*h,d=d*l,e=e*l,f=g*f,h=g*h,g=g*l;b[0]=1-(n+e);b[4]=k-g;b[8]=c+h;b[1]=k+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);
 var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,
 var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,
-b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],l=c[12],k=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],v=c[14],x=c[3],u=c[7],B=c[11],c=c[15],w=d[0],C=d[4],E=d[8],z=d[12],D=d[1],G=d[5],K=d[9],A=d[13],I=d[2],M=d[6],N=d[10],H=d[14],y=d[3],L=d[7],O=d[11],d=d[15];e[0]=g*w+f*D+h*I+l*y;e[4]=g*C+f*G+h*M+l*L;e[8]=g*E+f*K+h*N+l*O;e[12]=g*z+f*A+h*H+l*d;e[1]=k*w+n*D+p*I+m*y;e[5]=k*C+n*G+p*M+m*L;e[9]=k*E+n*K+p*N+m*O;e[13]=k*z+n*A+p*H+m*d;e[2]=q*w+s*D+t*I+v*y;e[6]=q*C+s*G+t*M+v*L;e[10]=
-q*E+s*K+t*N+v*O;e[14]=q*z+s*A+t*H+v*d;e[3]=x*w+u*D+B*I+c*y;e[7]=x*C+u*G+B*M+c*L;e[11]=x*E+u*K+B*N+c*O;e[15]=x*z+u*A+B*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=
+b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],l=c[12],k=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],v=c[14],x=c[3],u=c[7],B=c[11],c=c[15],w=d[0],C=d[4],E=d[8],z=d[12],D=d[1],G=d[5],K=d[9],A=d[13],I=d[2],M=d[6],O=d[10],H=d[14],y=d[3],L=d[7],P=d[11],d=d[15];e[0]=g*w+f*D+h*I+l*y;e[4]=g*C+f*G+h*M+l*L;e[8]=g*E+f*K+h*O+l*P;e[12]=g*z+f*A+h*H+l*d;e[1]=k*w+n*D+p*I+m*y;e[5]=k*C+n*G+p*M+m*L;e[9]=k*E+n*K+p*O+m*P;e[13]=k*z+n*A+p*H+m*d;e[2]=q*w+s*D+t*I+v*y;e[6]=q*C+s*G+t*M+v*L;e[10]=
+q*E+s*K+t*O+v*P;e[14]=q*z+s*A+t*H+v*d;e[3]=x*w+u*D+B*I+c*y;e[7]=x*C+u*G+B*M+c*L;e[11]=x*E+u*K+B*O+c*P;e[15]=x*z+u*A+B*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=
 a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],l=a[13],k=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*l*
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],l=a[13],k=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*l*
@@ -165,20 +165,20 @@ intersectObject:function(a,e){var g=[];c(a,this,g,e);g.sort(b);return g},interse
 THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,
 THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,
 value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d},modelViewMatrix:{value:new THREE.Matrix4},normalMatrix:{value:new THREE.Matrix3}});this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=THREE.Object3D.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}};
 value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d},modelViewMatrix:{value:new THREE.Matrix4},normalMatrix:{value:new THREE.Matrix3}});this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=THREE.Object3D.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}};
 THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0);THREE.Object3D.DefaultMatrixAutoUpdate=!0;
 THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0);THREE.Object3D.DefaultMatrixAutoUpdate=!0;
-THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},
-set renderDepth(a){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},
-rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){a.setFromAxisAngle(b,c);this.quaternion.multiply(a);return this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,
-c){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));return this}}(),translate:function(a,b){console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");return this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=
-new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);
-return this}if(a===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",a),this;a instanceof THREE.Object3D?(null!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a);return this},remove:function(a){if(1<arguments.length)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);b=this.children.indexOf(a);-1!==b&&(a.parent=null,a.dispatchEvent({type:"removed"}),
-this.children.splice(b,1))},getChildByName:function(a){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a)},getObjectById:function(a){return this.getObjectByProperty("id",a)},getObjectByName:function(a){return this.getObjectByProperty("name",a)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){a=
-a||new THREE.Vector3;this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){c=c||new THREE.Quaternion;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Euler;this.getWorldQuaternion(a);return b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=
-new THREE.Vector3,b=new THREE.Quaternion;return function(c){c=c||new THREE.Vector3;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=
-this.children,c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}},traverseAncestors:function(a){var b=this.parent;null!==b&&(a(b),b.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,
-this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a,d={};c&&(a={geometries:{},materials:{},textures:{},images:{}},d.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var e={};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);"{}"!==JSON.stringify(this.userData)&&(e.userData=
-this.userData);!0!==this.visible&&(e.visible=this.visible);e.matrix=this.matrix.toArray();void 0!==this.geometry&&(void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a)),e.geometry=this.geometry.uuid);void 0!==this.material&&(void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a)),e.material=this.material.uuid);if(0<this.children.length){e.children=[];for(var g=0;g<this.children.length;g++)e.children.push(this.children[g].toJSON(a).object)}if(c){var c=
-b(a.geometries),g=b(a.materials),f=b(a.textures);a=b(a.images);0<c.length&&(d.geometries=c);0<g.length&&(d.materials=g);0<f.length&&(d.textures=f);0<a.length&&(d.images=a)}d.object=e;return d},clone:function(a){return(new this.constructor).copy(this,a)},copy:function(a,b){void 0===b&&(b=!0);this.name=a.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.rotationAutoUpdate=a.rotationAutoUpdate;this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);
-this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.visible=a.visible;this.castShadow=a.castShadow;this.receiveShadow=a.receiveShadow;this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;this.userData=JSON.parse(JSON.stringify(a.userData));if(!0===b)for(var c=0;c<a.children.length;c++)this.add(a.children[c].clone());return this}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
+THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set renderDepth(a){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},
+applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){a.setFromAxisAngle(b,
+c);this.quaternion.multiply(a);return this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));
+return this}}(),translate:function(a,b){console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");return this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,
+b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}if(a===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",
+a),this;a instanceof THREE.Object3D?(null!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a);return this},remove:function(a){if(1<arguments.length)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);b=this.children.indexOf(a);-1!==b&&(a.parent=null,a.dispatchEvent({type:"removed"}),this.children.splice(b,1))},getChildByName:function(a){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");
+return this.getObjectByName(a)},getObjectById:function(a){return this.getObjectByProperty("id",a)},getObjectByName:function(a){return this.getObjectByProperty("name",a)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){a=a||new THREE.Vector3;this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=
+new THREE.Vector3,b=new THREE.Vector3;return function(c){c=c||new THREE.Quaternion;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Euler;this.getWorldQuaternion(a);return b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){c=c||new THREE.Vector3;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,
+b,c);return c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}},traverseAncestors:function(a){var b=this.parent;null!==b&&(a(b),b.traverseAncestors(a))},
+updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(a){function b(a){var b=
+[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a,d={};c&&(a={geometries:{},materials:{},textures:{},images:{}},d.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var e={};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);"{}"!==JSON.stringify(this.userData)&&(e.userData=this.userData);!0!==this.visible&&(e.visible=this.visible);e.matrix=this.matrix.toArray();void 0!==this.geometry&&(void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=
+this.geometry.toJSON(a)),e.geometry=this.geometry.uuid);void 0!==this.material&&(void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a)),e.material=this.material.uuid);if(0<this.children.length){e.children=[];for(var g=0;g<this.children.length;g++)e.children.push(this.children[g].toJSON(a).object)}if(c){var c=b(a.geometries),g=b(a.materials),f=b(a.textures);a=b(a.images);0<c.length&&(d.geometries=c);0<g.length&&(d.materials=g);0<f.length&&(d.textures=f);
+0<a.length&&(d.images=a)}d.object=e;return d},clone:function(a){return(new this.constructor).copy(this,a)},copy:function(a,b){void 0===b&&(b=!0);this.name=a.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.rotationAutoUpdate=a.rotationAutoUpdate;this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.visible=a.visible;this.castShadow=
+a.castShadow;this.receiveShadow=a.receiveShadow;this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;this.userData=JSON.parse(JSON.stringify(a.userData));if(!0===b)for(var c=0;c<a.children.length;c++)this.add(a.children[c].clone());return this}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=Array.isArray(d)?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==g?g:0};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=Array.isArray(d)?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==g?g:0};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.normal.copy(a.normal);this.color.copy(a.color);this.materialIndex=a.materialIndex;for(var b=0,c=a.vertexNormals.length;b<c;b++)this.vertexNormals[b]=a.vertexNormals[b].clone();b=0;for(c=a.vertexColors.length;b<c;b++)this.vertexColors[b]=a.vertexColors[b].clone();return this}};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.normal.copy(a.normal);this.color.copy(a.color);this.materialIndex=a.materialIndex;for(var b=0,c=a.vertexNormals.length;b<c;b++)this.vertexNormals[b]=a.vertexNormals[b].clone();b=0;for(c=a.vertexColors.length;b<c;b++)this.vertexColors[b]=a.vertexColors[b].clone();return this}};
 THREE.Face4=function(a,b,c,d,e,g,f){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,g,f)};THREE.BufferAttribute=function(a,b){this.uuid=THREE.Math.generateUUID();this.array=a;this.itemSize=b;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0};
 THREE.Face4=function(a,b,c,d,e,g,f){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,g,f)};THREE.BufferAttribute=function(a,b){this.uuid=THREE.Math.generateUUID();this.array=a;this.itemSize=b;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0};
@@ -441,8 +441,8 @@ THREE.Mesh.prototype.raycast=function(){function a(a,b,c,d,e,f,g){THREE.Triangle
 return function(q,x){var u=this.geometry,B=this.material;if(void 0!==B&&(null===u.boundingSphere&&u.computeBoundingSphere(),d.copy(u.boundingSphere),d.applyMatrix4(this.matrixWorld),!1!==q.ray.isIntersectionSphere(d)&&(b.getInverse(this.matrixWorld),c.copy(q.ray).applyMatrix4(b),null===u.boundingBox||!1!==c.isIntersectionBox(u.boundingBox)))){var w,C,E;if(u instanceof THREE.BufferGeometry)if(w=u.index,u=u.attributes,null!==w)for(var z=w.array,D=u.position.array,G=0,K=z.length;G<K;G+=3){w=z[G];C=z[G+
 return function(q,x){var u=this.geometry,B=this.material;if(void 0!==B&&(null===u.boundingSphere&&u.computeBoundingSphere(),d.copy(u.boundingSphere),d.applyMatrix4(this.matrixWorld),!1!==q.ray.isIntersectionSphere(d)&&(b.getInverse(this.matrixWorld),c.copy(q.ray).applyMatrix4(b),null===u.boundingBox||!1!==c.isIntersectionBox(u.boundingBox)))){var w,C,E;if(u instanceof THREE.BufferGeometry)if(w=u.index,u=u.attributes,null!==w)for(var z=w.array,D=u.position.array,G=0,K=z.length;G<K;G+=3){w=z[G];C=z[G+
 1];E=z[G+2];e.fromArray(D,3*w);g.fromArray(D,3*C);f.fromArray(D,3*E);if(B.side===THREE.BackSide){if(null===c.intersectTriangle(f,g,e,!0,s))continue}else if(null===c.intersectTriangle(e,g,f,B.side!==THREE.DoubleSide,s))continue;t.copy(s);t.applyMatrix4(this.matrixWorld);var A=q.ray.origin.distanceTo(t);if(!(A<q.near||A>q.far)){var I;void 0!==u.uv&&(I=u.uv.array,n.fromArray(I,2*w),p.fromArray(I,2*C),m.fromArray(I,2*E),I=a(s,e,g,f,n,p,m));x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w,
 1];E=z[G+2];e.fromArray(D,3*w);g.fromArray(D,3*C);f.fromArray(D,3*E);if(B.side===THREE.BackSide){if(null===c.intersectTriangle(f,g,e,!0,s))continue}else if(null===c.intersectTriangle(e,g,f,B.side!==THREE.DoubleSide,s))continue;t.copy(s);t.applyMatrix4(this.matrixWorld);var A=q.ray.origin.distanceTo(t);if(!(A<q.near||A>q.far)){var I;void 0!==u.uv&&(I=u.uv.array,n.fromArray(I,2*w),p.fromArray(I,2*C),m.fromArray(I,2*E),I=a(s,e,g,f,n,p,m));x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w,
 C,E,THREE.Triangle.normal(e,g,f)),faceIndex:Math.floor(G/3),object:this})}}else for(D=u.position.array,G=0,K=D.length;G<K;G+=9){e.fromArray(D,G);g.fromArray(D,G+3);f.fromArray(D,G+6);if(B.side===THREE.BackSide){if(null===c.intersectTriangle(f,g,e,!0,s))continue}else if(null===c.intersectTriangle(e,g,f,B.side!==THREE.DoubleSide,s))continue;t.copy(s);t.applyMatrix4(this.matrixWorld);A=q.ray.origin.distanceTo(t);A<q.near||A>q.far||(void 0!==u.uv&&(I=u.uv.array,n.fromArray(I,G),p.fromArray(I,G+2),m.fromArray(I,
 C,E,THREE.Triangle.normal(e,g,f)),faceIndex:Math.floor(G/3),object:this})}}else for(D=u.position.array,G=0,K=D.length;G<K;G+=9){e.fromArray(D,G);g.fromArray(D,G+3);f.fromArray(D,G+6);if(B.side===THREE.BackSide){if(null===c.intersectTriangle(f,g,e,!0,s))continue}else if(null===c.intersectTriangle(e,g,f,B.side!==THREE.DoubleSide,s))continue;t.copy(s);t.applyMatrix4(this.matrixWorld);A=q.ray.origin.distanceTo(t);A<q.near||A>q.far||(void 0!==u.uv&&(I=u.uv.array,n.fromArray(I,G),p.fromArray(I,G+2),m.fromArray(I,
-G+4),I=a(s,e,g,f,n,p,m)),w=G/3,C=w+1,E=w+2,x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w,C,E,THREE.Triangle.normal(e,g,f)),index:w,object:this}))}else if(u instanceof THREE.Geometry)for(var z=B instanceof THREE.MeshFaceMaterial,D=!0===z?B.materials:null,G=u.vertices,K=u.faces,M=0,N=K.length;M<N;M++){var H=K[M],A=!0===z?D[H.materialIndex]:B;if(void 0!==A){w=G[H.a];C=G[H.b];E=G[H.c];if(!0===A.morphTargets){var y=u.morphTargets,L=this.morphTargetInfluences;e.set(0,0,0);g.set(0,0,0);
-f.set(0,0,0);for(var O=0,T=y.length;O<T;O++){var Q=L[O];if(0!==Q){var R=y[O].vertices;e.addScaledVector(h.subVectors(R[H.a],w),Q);g.addScaledVector(l.subVectors(R[H.b],C),Q);f.addScaledVector(k.subVectors(R[H.c],E),Q)}}e.add(w);g.add(C);f.add(E);w=e;C=g;E=f}if(A.side===THREE.BackSide){if(null===c.intersectTriangle(E,C,w,!0,s))continue}else if(null===c.intersectTriangle(w,C,E,A.side!==THREE.DoubleSide,s))continue;t.copy(s);t.applyMatrix4(this.matrixWorld);A=q.ray.origin.distanceTo(t);A<q.near||A>q.far||
+G+4),I=a(s,e,g,f,n,p,m)),w=G/3,C=w+1,E=w+2,x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w,C,E,THREE.Triangle.normal(e,g,f)),index:w,object:this}))}else if(u instanceof THREE.Geometry)for(var z=B instanceof THREE.MeshFaceMaterial,D=!0===z?B.materials:null,G=u.vertices,K=u.faces,M=0,O=K.length;M<O;M++){var H=K[M],A=!0===z?D[H.materialIndex]:B;if(void 0!==A){w=G[H.a];C=G[H.b];E=G[H.c];if(!0===A.morphTargets){var y=u.morphTargets,L=this.morphTargetInfluences;e.set(0,0,0);g.set(0,0,0);
+f.set(0,0,0);for(var P=0,T=y.length;P<T;P++){var Q=L[P];if(0!==Q){var R=y[P].vertices;e.addScaledVector(h.subVectors(R[H.a],w),Q);g.addScaledVector(l.subVectors(R[H.b],C),Q);f.addScaledVector(k.subVectors(R[H.c],E),Q)}}e.add(w);g.add(C);f.add(E);w=e;C=g;E=f}if(A.side===THREE.BackSide){if(null===c.intersectTriangle(E,C,w,!0,s))continue}else if(null===c.intersectTriangle(w,C,E,A.side!==THREE.DoubleSide,s))continue;t.copy(s);t.applyMatrix4(this.matrixWorld);A=q.ray.origin.distanceTo(t);A<q.near||A>q.far||
 (0<u.faceVertexUvs[0].length&&(I=u.faceVertexUvs[0][M],n.copy(I[0]),p.copy(I[1]),m.copy(I[2]),I=a(s,w,C,E,n,p,m)),x.push({distance:A,point:t.clone(),uv:I,face:H,faceIndex:M,object:this}))}}}}}();THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
 (0<u.faceVertexUvs[0].length&&(I=u.faceVertexUvs[0][M],n.copy(I[0]),p.copy(I[1]),m.copy(I[2]),I=a(s,w,C,E,n,p,m)),x.push({distance:A,point:t.clone(),uv:I,face:H,faceIndex:M,object:this}))}}}}}();THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
 THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
 THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)):
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)):
@@ -532,89 +532,92 @@ THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sa
 "vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")},
 "vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")},
 distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;\n}"].join("\n"),fragmentShader:["uniform vec3 lightPos;\nvarying vec4 vWorldPosition;",
 distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;\n}"].join("\n"),fragmentShader:["uniform vec3 lightPos;\nvarying vec4 vWorldPosition;",
 THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n   depth /= 1000.0;\n   const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = fract( depth * bitSh );\n\tres -= res.xxyz * bitMsk;\n\treturn res; \n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}"].join("\n")}};
 THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n   depth /= 1000.0;\n   const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = fract( depth * bitSh );\n\tres -= res.xxyz * bitMsk;\n\treturn res; \n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){J.init();r.viewport(na,oa,pa,qa);b(V.r,V.g,V.b,U)}function d(){ra=za=null;sa="";ta=-1;wa=!0;J.reset()}function e(a){a.preventDefault();d();c();X.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=X.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}X.delete(a)}la.textures--}
-function f(a){a=a.target;a.removeEventListener("dispose",f);var b=X.get(a);if(a&&void 0!==b.__webglTexture){r.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);X.delete(a)}la.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);l(a);X.delete(a)}function l(a){var b=
-X.get(a).program;a.program=void 0;void 0!==b&&ua.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b,c,d,e){var f;c.transparent?(d=ca,f=++$):(d=ea,f=++fa);
-f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=W.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:W.z,group:e},d.push(f))}function q(a){if(!1!==a.visible){if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)ja.push(a);else if(a instanceof THREE.LensFlare)ba.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===da.sortObjects&&(W.setFromMatrixPosition(a.matrixWorld),W.applyProjection(xa)),m(a,null,a.material,W.z,null);else if(a instanceof
-THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===Aa.intersectsObject(a)){var b=a.material;if(!0===b.visible){!0===da.sortObjects&&(W.setFromMatrixPosition(a.matrixWorld),W.applyProjection(xa));var c=va.update(a);if(b instanceof THREE.MeshFaceMaterial)for(var d=c.groups,e=b.materials,b=0,f=d.length;b<f;b++){var g=d[b],h=e[g.materialIndex];!0===h.visible&&m(a,c,h,W.z,g)}else m(a,c,b,W.z,null)}}a=a.children;
-b=0;for(f=a.length;b<f;b++)q(a[b])}}function s(a,b,c,d,e){for(var f=0,g=a.length;f<g;f++){var h=a[f],l=h.object,k=h.geometry,m=void 0===e?h.material:e,h=h.group;l.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l.normalMatrix.getNormalMatrix(l.modelViewMatrix);if(l instanceof THREE.ImmediateRenderObject){t(m);var n=v(b,c,d,m,l);sa="";l.render(function(a){da.renderBufferImmediate(a,n,m)})}else da.renderBufferDirect(b,c,d,k,m,l,h)}}function t(a){a.side!==THREE.DoubleSide?J.enable(r.CULL_FACE):
-J.disable(r.CULL_FACE);J.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?J.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):J.setBlending(THREE.NoBlending);J.setDepthFunc(a.depthFunc);J.setDepthTest(a.depthTest);J.setDepthWrite(a.depthWrite);J.setColorWrite(a.colorWrite);J.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function v(a,b,c,d,e){ya=0;var f=X.get(d);if(d.needsUpdate||!f.program){a:{var g=
-X.get(d),k=ua.getParameters(d,b,c,e),m=ua.getProgramCode(d,k),n=g.program,q=!0;if(void 0===n)d.addEventListener("dispose",h);else if(n.code!==m)l(d);else if(void 0!==k.shaderID)break a;else q=!1;q&&(k.shaderID?(n=THREE.ShaderLib[k.shaderID],g.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}):g.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader},d.__webglShader=
-g.__webglShader,n=ua.acquireProgram(d,k,m),g.program=n,d.program=n);k=n.getAttributes();if(d.morphTargets)for(m=d.numSupportedMorphTargets=0;m<da.maxMorphTargets;m++)0<=k["morphTarget"+m]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(m=d.numSupportedMorphNormals=0;m<da.maxMorphNormals;m++)0<=k["morphNormal"+m]&&d.numSupportedMorphNormals++;g.uniformsList=[];var k=g.program.getUniforms(),p;for(p in g.__webglShader.uniforms)(m=k[p])&&g.uniformsList.push([g.__webglShader.uniforms[p],m])}d.needsUpdate=
-!1}m=n=q=!1;g=f.program;p=g.getUniforms();k=f.__webglShader.uniforms;g.id!==za&&(r.useProgram(g.program),za=g.id,m=n=q=!0);d.id!==ta&&(-1===ta&&(m=!0),ta=d.id,n=!0);if(q||a!==ra)r.uniformMatrix4fv(p.projectionMatrix,!1,a.projectionMatrix.elements),ga.logarithmicDepthBuffer&&r.uniform1f(p.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ra&&(ra=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==p.cameraPosition&&(W.setFromMatrixPosition(a.matrixWorld),
-r.uniform3f(p.cameraPosition,W.x,W.y,W.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==p.viewMatrix&&r.uniformMatrix4fv(p.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&void 0!==p.bindMatrix&&r.uniformMatrix4fv(p.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==p.bindMatrixInverse&&r.uniformMatrix4fv(p.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
-ga.floatVertexTextures&&e.skeleton&&e.skeleton.useVertexTexture?(void 0!==p.boneTexture&&(q=u(),r.uniform1i(p.boneTexture,q),da.setTexture(e.skeleton.boneTexture,q)),void 0!==p.boneTextureWidth&&r.uniform1i(p.boneTextureWidth,e.skeleton.boneTextureWidth),void 0!==p.boneTextureHeight&&r.uniform1i(p.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&void 0!==p.boneGlobalMatrices&&r.uniformMatrix4fv(p.boneGlobalMatrices,!1,e.skeleton.boneMatrices));if(n){c&&d.fog&&
-(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){var m=!0,s,t=q=0,w=0,v,K,y,A=Ba,C=a.matrixWorldInverse,D=A.directional.colors,L=A.directional.positions,O=A.point.colors,G=A.point.positions,M=A.point.distances,H=A.point.decays,F=A.spot.colors,N=A.spot.positions,J=A.spot.distances,Q=A.spot.directions,
-ea=A.spot.anglesCos,T=A.spot.exponents,R=A.spot.decays,$=A.hemi.skyColors,ca=A.hemi.groundColors,S=A.hemi.positions,fa=0,U=0,ba=0,V=0,ma=0,ja=0,Y=0,ia=0,aa=s=0;c=y=aa=0;for(n=b.length;c<n;c++)s=b[c],s.onlyShadow||(v=s.color,K=s.intensity,y=s.distance,s instanceof THREE.AmbientLight?s.visible&&(q+=v.r,t+=v.g,w+=v.b):s instanceof THREE.DirectionalLight?(ma+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),W.setFromMatrixPosition(s.target.matrixWorld),Z.sub(W),Z.transformDirection(C),s=3*fa,L[s+
-0]=Z.x,L[s+1]=Z.y,L[s+2]=Z.z,B(D,s,v,K),fa+=1)):s instanceof THREE.PointLight?(ja+=1,s.visible&&(aa=3*U,B(O,aa,v,K),W.setFromMatrixPosition(s.matrixWorld),W.applyMatrix4(C),G[aa+0]=W.x,G[aa+1]=W.y,G[aa+2]=W.z,M[U]=y,H[U]=0===s.distance?0:s.decay,U+=1)):s instanceof THREE.SpotLight?(Y+=1,s.visible&&(aa=3*ba,B(F,aa,v,K),Z.setFromMatrixPosition(s.matrixWorld),W.copy(Z).applyMatrix4(C),N[aa+0]=W.x,N[aa+1]=W.y,N[aa+2]=W.z,J[ba]=y,W.setFromMatrixPosition(s.target.matrixWorld),Z.sub(W),Z.transformDirection(C),
-Q[aa+0]=Z.x,Q[aa+1]=Z.y,Q[aa+2]=Z.z,ea[ba]=Math.cos(s.angle),T[ba]=s.exponent,R[ba]=0===s.distance?0:s.decay,ba+=1)):s instanceof THREE.HemisphereLight&&(ia+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),Z.transformDirection(C),y=3*V,S[y+0]=Z.x,S[y+1]=Z.y,S[y+2]=Z.z,v=s.color,s=s.groundColor,B($,y,v,K),B(ca,y,s,K),V+=1)));c=3*fa;for(n=Math.max(D.length,3*ma);c<n;c++)D[c]=0;c=3*U;for(n=Math.max(O.length,3*ja);c<n;c++)O[c]=0;c=3*ba;for(n=Math.max(F.length,3*Y);c<n;c++)F[c]=0;c=3*V;for(n=Math.max($.length,
-3*ia);c<n;c++)$[c]=0;c=3*V;for(n=Math.max(ca.length,3*ia);c<n;c++)ca[c]=0;A.directional.length=fa;A.point.length=U;A.spot.length=ba;A.hemi.length=V;A.ambient[0]=q;A.ambient[1]=t;A.ambient[2]=w;wa=!1}m?(m=Ba,k.ambientLightColor.value=m.ambient,k.directionalLightColor.value=m.directional.colors,k.directionalLightDirection.value=m.directional.positions,k.pointLightColor.value=m.point.colors,k.pointLightPosition.value=m.point.positions,k.pointLightDistance.value=m.point.distances,k.pointLightDecay.value=
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){J.init();r.viewport(na,oa,pa,qa);b(W.r,W.g,W.b,U)}function d(){ra=za=null;sa="";ta=-1;wa=!0;J.reset()}function e(a){a.preventDefault();d();c();V.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=V.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}V.delete(a)}la.textures--}
+function f(a){a=a.target;a.removeEventListener("dispose",f);var b=V.get(a),c=V.get(a.texture);if(a&&void 0!==c.__webglTexture){r.deleteTexture(c.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);V.delete(a.texture);V.delete(a)}la.textures--}function h(a){a=a.target;a.removeEventListener("dispose",
+h);l(a);V.delete(a)}function l(a){var b=V.get(a).program;a.program=void 0;void 0!==b&&ua.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b,c,d,e){var f;c.transparent?
+(d=da,f=++$):(d=ea,f=++fa);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=X.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:X.z,group:e},d.push(f))}function q(a){if(!1!==a.visible){if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)ja.push(a);else if(a instanceof THREE.LensFlare)ca.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===aa.sortObjects&&(X.setFromMatrixPosition(a.matrixWorld),X.applyProjection(xa)),m(a,null,a.material,X.z,
+null);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===Aa.intersectsObject(a)){var b=a.material;if(!0===b.visible){!0===aa.sortObjects&&(X.setFromMatrixPosition(a.matrixWorld),X.applyProjection(xa));var c=va.update(a);if(b instanceof THREE.MeshFaceMaterial)for(var d=c.groups,e=b.materials,b=0,f=d.length;b<f;b++){var g=d[b],h=e[g.materialIndex];!0===h.visible&&m(a,c,h,X.z,g)}else m(a,
+c,b,X.z,null)}}a=a.children;b=0;for(f=a.length;b<f;b++)q(a[b])}}function s(a,b,c,d,e){for(var f=0,g=a.length;f<g;f++){var h=a[f],l=h.object,k=h.geometry,m=void 0===e?h.material:e,h=h.group;l.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l.normalMatrix.getNormalMatrix(l.modelViewMatrix);if(l instanceof THREE.ImmediateRenderObject){t(m);var n=v(b,c,d,m,l);sa="";l.render(function(a){aa.renderBufferImmediate(a,n,m)})}else aa.renderBufferDirect(b,c,d,k,m,l,h)}}function t(a){a.side!==
+THREE.DoubleSide?J.enable(r.CULL_FACE):J.disable(r.CULL_FACE);J.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?J.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):J.setBlending(THREE.NoBlending);J.setDepthFunc(a.depthFunc);J.setDepthTest(a.depthTest);J.setDepthWrite(a.depthWrite);J.setColorWrite(a.colorWrite);J.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function v(a,b,c,d,e){ya=0;var f=V.get(d);
+if(d.needsUpdate||!f.program){a:{var g=V.get(d),k=ua.getParameters(d,b,c,e),m=ua.getProgramCode(d,k),n=g.program,q=!0;if(void 0===n)d.addEventListener("dispose",h);else if(n.code!==m)l(d);else if(void 0!==k.shaderID)break a;else q=!1;q&&(k.shaderID?(n=THREE.ShaderLib[k.shaderID],g.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}):g.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader},
+d.__webglShader=g.__webglShader,n=ua.acquireProgram(d,k,m),g.program=n,d.program=n);k=n.getAttributes();if(d.morphTargets)for(m=d.numSupportedMorphTargets=0;m<aa.maxMorphTargets;m++)0<=k["morphTarget"+m]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(m=d.numSupportedMorphNormals=0;m<aa.maxMorphNormals;m++)0<=k["morphNormal"+m]&&d.numSupportedMorphNormals++;g.uniformsList=[];var k=g.program.getUniforms(),p;for(p in g.__webglShader.uniforms)(m=k[p])&&g.uniformsList.push([g.__webglShader.uniforms[p],
+m])}d.needsUpdate=!1}m=n=q=!1;g=f.program;p=g.getUniforms();k=f.__webglShader.uniforms;g.id!==za&&(r.useProgram(g.program),za=g.id,m=n=q=!0);d.id!==ta&&(-1===ta&&(m=!0),ta=d.id,n=!0);if(q||a!==ra)r.uniformMatrix4fv(p.projectionMatrix,!1,a.projectionMatrix.elements),ga.logarithmicDepthBuffer&&r.uniform1f(p.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ra&&(ra=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==p.cameraPosition&&(X.setFromMatrixPosition(a.matrixWorld),
+r.uniform3f(p.cameraPosition,X.x,X.y,X.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==p.viewMatrix&&r.uniformMatrix4fv(p.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&void 0!==p.bindMatrix&&r.uniformMatrix4fv(p.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==p.bindMatrixInverse&&r.uniformMatrix4fv(p.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
+ga.floatVertexTextures&&e.skeleton&&e.skeleton.useVertexTexture?(void 0!==p.boneTexture&&(q=u(),r.uniform1i(p.boneTexture,q),aa.setTexture(e.skeleton.boneTexture,q)),void 0!==p.boneTextureWidth&&r.uniform1i(p.boneTextureWidth,e.skeleton.boneTextureWidth),void 0!==p.boneTextureHeight&&r.uniform1i(p.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&void 0!==p.boneGlobalMatrices&&r.uniformMatrix4fv(p.boneGlobalMatrices,!1,e.skeleton.boneMatrices));if(n){c&&d.fog&&
+(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){var m=!0,s,t=q=0,w=0,v,K,y,A=Ba,C=a.matrixWorldInverse,D=A.directional.colors,L=A.directional.positions,P=A.point.colors,G=A.point.positions,M=A.point.distances,H=A.point.decays,F=A.spot.colors,O=A.spot.positions,J=A.spot.distances,Q=A.spot.directions,
+ea=A.spot.anglesCos,T=A.spot.exponents,R=A.spot.decays,$=A.hemi.skyColors,da=A.hemi.groundColors,S=A.hemi.positions,fa=0,U=0,ca=0,W=0,ma=0,ja=0,Y=0,ia=0,ba=s=0;c=y=ba=0;for(n=b.length;c<n;c++)s=b[c],s.onlyShadow||(v=s.color,K=s.intensity,y=s.distance,s instanceof THREE.AmbientLight?s.visible&&(q+=v.r,t+=v.g,w+=v.b):s instanceof THREE.DirectionalLight?(ma+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),X.setFromMatrixPosition(s.target.matrixWorld),Z.sub(X),Z.transformDirection(C),s=3*fa,L[s+
+0]=Z.x,L[s+1]=Z.y,L[s+2]=Z.z,B(D,s,v,K),fa+=1)):s instanceof THREE.PointLight?(ja+=1,s.visible&&(ba=3*U,B(P,ba,v,K),X.setFromMatrixPosition(s.matrixWorld),X.applyMatrix4(C),G[ba+0]=X.x,G[ba+1]=X.y,G[ba+2]=X.z,M[U]=y,H[U]=0===s.distance?0:s.decay,U+=1)):s instanceof THREE.SpotLight?(Y+=1,s.visible&&(ba=3*ca,B(F,ba,v,K),Z.setFromMatrixPosition(s.matrixWorld),X.copy(Z).applyMatrix4(C),O[ba+0]=X.x,O[ba+1]=X.y,O[ba+2]=X.z,J[ca]=y,X.setFromMatrixPosition(s.target.matrixWorld),Z.sub(X),Z.transformDirection(C),
+Q[ba+0]=Z.x,Q[ba+1]=Z.y,Q[ba+2]=Z.z,ea[ca]=Math.cos(s.angle),T[ca]=s.exponent,R[ca]=0===s.distance?0:s.decay,ca+=1)):s instanceof THREE.HemisphereLight&&(ia+=1,s.visible&&(Z.setFromMatrixPosition(s.matrixWorld),Z.transformDirection(C),y=3*W,S[y+0]=Z.x,S[y+1]=Z.y,S[y+2]=Z.z,v=s.color,s=s.groundColor,B($,y,v,K),B(da,y,s,K),W+=1)));c=3*fa;for(n=Math.max(D.length,3*ma);c<n;c++)D[c]=0;c=3*U;for(n=Math.max(P.length,3*ja);c<n;c++)P[c]=0;c=3*ca;for(n=Math.max(F.length,3*Y);c<n;c++)F[c]=0;c=3*W;for(n=Math.max($.length,
+3*ia);c<n;c++)$[c]=0;c=3*W;for(n=Math.max(da.length,3*ia);c<n;c++)da[c]=0;A.directional.length=fa;A.point.length=U;A.spot.length=ca;A.hemi.length=W;A.ambient[0]=q;A.ambient[1]=t;A.ambient[2]=w;wa=!1}m?(m=Ba,k.ambientLightColor.value=m.ambient,k.directionalLightColor.value=m.directional.colors,k.directionalLightDirection.value=m.directional.positions,k.pointLightColor.value=m.point.colors,k.pointLightPosition.value=m.point.positions,k.pointLightDistance.value=m.point.distances,k.pointLightDecay.value=
 m.point.decays,k.spotLightColor.value=m.spot.colors,k.spotLightPosition.value=m.spot.positions,k.spotLightDistance.value=m.spot.distances,k.spotLightDirection.value=m.spot.directions,k.spotLightAngleCos.value=m.spot.anglesCos,k.spotLightExponent.value=m.spot.exponents,k.spotLightDecay.value=m.spot.decays,k.hemisphereLightSkyColor.value=m.hemi.skyColors,k.hemisphereLightGroundColor.value=m.hemi.groundColors,k.hemisphereLightDirection.value=m.hemi.positions,x(k,!0)):x(k,!1)}if(d instanceof THREE.MeshBasicMaterial||
 m.point.decays,k.spotLightColor.value=m.spot.colors,k.spotLightPosition.value=m.spot.positions,k.spotLightDistance.value=m.spot.distances,k.spotLightDirection.value=m.spot.directions,k.spotLightAngleCos.value=m.spot.anglesCos,k.spotLightExponent.value=m.spot.exponents,k.spotLightDecay.value=m.spot.decays,k.hemisphereLightSkyColor.value=m.hemi.skyColors,k.hemisphereLightGroundColor.value=m.hemi.groundColors,k.hemisphereLightDirection.value=m.hemi.positions,x(k,!0)):x(k,!1)}if(d instanceof THREE.MeshBasicMaterial||
-d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var P;d.map?P=d.map:d.specularMap?P=d.specularMap:d.displacementMap?P=d.displacementMap:d.normalMap?P=d.normalMap:d.bumpMap?P=d.bumpMap:d.alphaMap?P=d.alphaMap:d.emissiveMap&&(P=
-d.emissiveMap);void 0!==P&&(m=P.offset,P=P.repeat,k.offsetRepeat.value.set(m.x,m.y,P.x,P.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+
-d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=I.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,P=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,P.x,P.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=d.shininess,d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),
-d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&
-k.shadowMatrix)for(a=d=0,P=b.length;a<P;a++)m=b[a],m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(k.shadowDarkness.value[d]=m instanceof THREE.PointLight?-m.shadowDarkness:m.shadowDarkness,k.shadowMatrix.value[d]=m.shadowMatrix,k.shadowMap.value[d]=m.shadowMap,k.shadowMapSize.value[d]=m.shadowMapSize,k.shadowBias.value[d]=m.shadowBias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(k=a.type,
-c=a.value,P=b[f][1],k){case "1i":r.uniform1i(P,c);break;case "1f":r.uniform1f(P,c);break;case "2f":r.uniform2f(P,c[0],c[1]);break;case "3f":r.uniform3f(P,c[0],c[1],c[2]);break;case "4f":r.uniform4f(P,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(P,c);break;case "3iv":r.uniform3iv(P,c);break;case "1fv":r.uniform1fv(P,c);break;case "2fv":r.uniform2fv(P,c);break;case "3fv":r.uniform3fv(P,c);break;case "4fv":r.uniform4fv(P,c);break;case "Matrix3fv":r.uniformMatrix3fv(P,!1,c);break;case "Matrix4fv":r.uniformMatrix4fv(P,
-!1,c);break;case "i":r.uniform1i(P,c);break;case "f":r.uniform1f(P,c);break;case "v2":r.uniform2f(P,c.x,c.y);break;case "v3":r.uniform3f(P,c.x,c.y,c.z);break;case "v4":r.uniform4f(P,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(P,c.r,c.g,c.b);break;case "iv1":r.uniform1iv(P,c);break;case "iv":r.uniform3iv(P,c);break;case "fv1":r.uniform1fv(P,c);break;case "fv":r.uniform3fv(P,c);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*c.length));n=k=0;for(m=c.length;k<m;k++,n+=2)a._array[n+0]=
-c[k].x,a._array[n+1]=c[k].y;r.uniform2fv(P,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*c.length));n=k=0;for(m=c.length;k<m;k++,n+=3)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z;r.uniform3fv(P,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*c.length));n=k=0;for(m=c.length;k<m;k++,n+=4)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z,a._array[n+3]=c[k].w;r.uniform4fv(P,a._array);break;case "m3":r.uniformMatrix3fv(P,
-!1,c.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,9*k);r.uniformMatrix3fv(P,!1,a._array);break;case "m4":r.uniformMatrix4fv(P,!1,c.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,16*k);r.uniformMatrix4fv(P,!1,a._array);break;case "t":n=u();r.uniform1i(P,n);if(!c)continue;c instanceof THREE.CubeTexture||
-Array.isArray(c.image)&&6===c.image.length?E(c,n):c instanceof THREE.WebGLRenderTargetCube?z(c,n):da.setTexture(c,n);break;case "tv":void 0===a._array&&(a._array=[]);k=0;for(m=a.value.length;k<m;k++)a._array[k]=u();r.uniform1iv(P,a._array);k=0;for(m=a.value.length;k<m;k++)c=a.value[k],n=a._array[k],c&&(c instanceof THREE.CubeTexture||c.image instanceof Array&&6===c.image.length?E(c,n):c instanceof THREE.WebGLRenderTargetCube?z(c,n):da.setTexture(c,n));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
-k)}}r.uniformMatrix4fv(p.modelViewMatrix,!1,e.modelViewMatrix.elements);p.normalMatrix&&r.uniformMatrix3fv(p.normalMatrix,!1,e.normalMatrix.elements);void 0!==p.modelMatrix&&r.uniformMatrix4fv(p.modelMatrix,!1,e.matrixWorld.elements);return g}function x(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=
-b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function u(){var a=ya;a>=ga.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ga.maxTextures);
-ya+=1;return a}function B(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,A(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,A(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,A(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,A(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
-b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,K(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,K(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&
-null===S.get("OES_texture_half_float_linear")||!(1<b.anisotropy||X.get(b).__currentAnisotropy)||(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,da.getMaxAnisotropy())),X.get(b).__currentAnisotropy=b.anisotropy)}function C(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+
-a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function E(a,b){var c=X.get(a);if(6===a.image.length)if(0<a.version&&c.__version!==a.version){c.__image__webglTextureCube||(a.addEventListener("dispose",g),c.__image__webglTextureCube=r.createTexture(),la.textures++);J.activeTexture(r.TEXTURE0+b);J.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var d=a instanceof THREE.CompressedTexture,e=a.image[0]instanceof
-THREE.DataTexture,f=[],h=0;6>h;h++)f[h]=!da.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:C(a.image[h],ga.maxCubemapSize);var h=f[0],k=THREE.Math.isPowerOfTwo(h.width)&&THREE.Math.isPowerOfTwo(h.height),l=A(a.format),m=A(a.type);w(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=f[h].mipmaps,p=0,s=q.length;p<s;p++)n=q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<J.getCompressedTextureFormats().indexOf(l)?J.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,
-n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,l,m,n.data);else e?J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,f[h].width,f[h].height,0,l,m,f[h].data):J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,l,m,f[h]);a.generateMipmaps&&k&&r.generateMipmap(r.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else J.activeTexture(r.TEXTURE0+
-b),J.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){J.activeTexture(r.TEXTURE0+b);J.bindTexture(r.TEXTURE_CUBE_MAP,X.get(a).__webglTexture)}function D(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,X.get(b).__webglTexture,0)}function G(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,
-r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function K(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function A(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;
-if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;
-if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=S.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;
-if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;
-if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=S.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=S.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
-if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=S.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var I=void 0!==a.canvas?a.canvas:document.createElement("canvas"),M=void 0!==a.context?a.context:null,N=I.width,H=I.height,y=1,L=void 0!==a.alpha?a.alpha:!1,O=void 0!==a.depth?a.depth:!0,T=void 0!==a.stencil?a.stencil:!0,Q=void 0!==
-a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,V=new THREE.Color(0),U=0,Y=[],ea=[],fa=-1,ca=[],$=-1,ma=new Float32Array(8),ja=[],ba=[];this.domElement=I;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var da=this,
-za=null,ia=null,ta=-1,sa="",ra=null,ya=0,na=0,oa=0,pa=I.width,qa=I.height,Ca=0,Da=0,Aa=new THREE.Frustum,xa=new THREE.Matrix4,W=new THREE.Vector3,Z=new THREE.Vector3,wa=!0,Ba={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},la={geometries:0,textures:0},ka={calls:0,
-vertices:0,faces:0,points:0};this.info={render:ka,memory:la,programs:null};var r;try{L={alpha:L,depth:O,stencil:T,antialias:Q,premultipliedAlpha:R,preserveDrawingBuffer:F};r=M||I.getContext("webgl",L)||I.getContext("experimental-webgl",L);if(null===r){if(null!==I.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}I.addEventListener("webglcontextlost",e,!1)}catch(Ea){console.error("THREE.WebGLRenderer: "+Ea)}var S=new THREE.WebGLExtensions(r);
-S.get("OES_texture_float");S.get("OES_texture_float_linear");S.get("OES_texture_half_float");S.get("OES_texture_half_float_linear");S.get("OES_standard_derivatives");S.get("ANGLE_instanced_arrays");S.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ga=new THREE.WebGLCapabilities(r,S,a),J=new THREE.WebGLState(r,S,A),X=new THREE.WebGLProperties,va=new THREE.WebGLObjects(r,X,this.info),ua=new THREE.WebGLPrograms(this,ga);this.info.programs=ua.programs;var Fa=new THREE.WebGLBufferRenderer(r,
-S,ka),Ga=new THREE.WebGLIndexedBufferRenderer(r,S,ka);c();this.context=r;this.capabilities=ga;this.extensions=S;this.state=J;var ha=new THREE.WebGLShadowMap(this,Y,va);this.shadowMap=ha;var Ha=new THREE.SpritePlugin(this,ja),Ia=new THREE.LensFlarePlugin(this,ba);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){S.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==
-a)return a;var b=S.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ga.precision};this.getPixelRatio=function(){return y};this.setPixelRatio=function(a){void 0!==a&&(y=a)};this.getSize=function(){return{width:N,height:H}};this.setSize=function(a,b,c){N=a;H=b;I.width=a*y;I.height=b*y;!1!==c&&(I.style.width=a+"px",I.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){na=a*
-y;oa=b*y;pa=c*y;qa=d*y;r.viewport(na,oa,pa,qa)};this.getViewport=function(a){a.x=na/y;a.y=oa/y;a.z=pa/y;a.w=qa/y};this.setScissor=function(a,b,c,d){r.scissor(a*y,b*y,c*y,d*y)};this.enableScissorTest=function(a){J.setScissorTest(a)};this.getClearColor=function(){return V};this.setClearColor=function(a,c){V.set(a);U=void 0!==c?c:1;b(V.r,V.g,V.b,U)};this.getClearAlpha=function(){return U};this.setClearAlpha=function(a){U=a;b(V.r,V.g,V.b,U)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;
-if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){I.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){J.initAttributes();var d=
-X.get(a);a.hasPositions&&!d.position&&(d.position=r.createBuffer());a.hasNormals&&!d.normal&&(d.normal=r.createBuffer());a.hasUvs&&!d.uv&&(d.uv=r.createBuffer());a.hasColors&&!d.color&&(d.color=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.position),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),J.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==
-c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);J.enableAttribute(b.normal);r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.uv),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),J.enableAttribute(b.uv),
-r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.color),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),J.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));J.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){t(e);var h=v(a,b,c,e,f),l=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==sa&&(sa=a,l=!0);a=f.morphTargetInfluences;if(void 0!==
-a){b=[];c=0;for(l=a.length;c<l;c++){var m=a[c];b.push([m,c])}b.sort(k);8<b.length&&(b.length=8);var n=d.morphAttributes;c=0;for(l=b.length;c<l;c++)m=b[c],ma[c]=m[0],0!==m[0]?(a=m[1],!0===e.morphTargets&&n.position&&d.addAttribute("morphTarget"+c,n.position[a]),!0===e.morphNormals&&n.normal&&d.addAttribute("morphNormal"+c,n.normal[a])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&
-r.uniform1fv(a.morphTargetInfluences,ma);l=!0}a=d.index;c=d.attributes.position;!0===e.wireframe&&(a=va.getWireframeAttribute(d));null!==a?(b=Ga,b.setIndex(a)):b=Fa;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=S.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);J.initAttributes();var m=d.attributes,
-h=h.getAttributes(),n=e.defaultAttributeValues,p;for(p in h){var s=h[p];if(0<=s){var u=m[p];if(void 0!==u){var x=u.itemSize,w=va.getAttributeBuffer(u);if(u instanceof THREE.InterleavedBufferAttribute){var B=u.data,K=B.stride,u=u.offset;B instanceof THREE.InstancedInterleavedBuffer?(J.enableAttributeAndDivisor(s,B.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):J.enableAttribute(s);r.bindBuffer(r.ARRAY_BUFFER,w);r.vertexAttribPointer(s,x,r.FLOAT,
-!1,K*B.array.BYTES_PER_ELEMENT,(l*K+u)*B.array.BYTES_PER_ELEMENT)}else u instanceof THREE.InstancedBufferAttribute?(J.enableAttributeAndDivisor(s,u.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=u.meshPerAttribute*u.count)):J.enableAttribute(s),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(s,x,r.FLOAT,!1,0,l*x*4)}else if(void 0!==n&&(x=n[p],void 0!==x))switch(x.length){case 2:r.vertexAttrib2fv(s,x);break;case 3:r.vertexAttrib3fv(s,x);break;case 4:r.vertexAttrib4fv(s,
-x);break;default:r.vertexAttrib1fv(s,x)}}}J.disableUnusedAttributes()}null!==a&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,va.getAttributeBuffer(a))}null===g&&(g=d.drawRange,g={start:g.start,count:Math.min(g.count,null!==a?a.array.length:c.count)});f instanceof THREE.Mesh?(!0===e.wireframe?(J.setLineWidth(e.wireframeLinewidth*y),b.setMode(r.LINES)):b.setMode(r.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&0<d.maxInstancedCount?b.renderInstances(d):b.render(g.start,g.count)):f instanceof THREE.Line?
-(d=e.linewidth,void 0===d&&(d=1),J.setLineWidth(d*y),f instanceof THREE.LineSegments?b.setMode(r.LINES):b.setMode(r.LINE_STRIP),b.render(g.start,g.count)):f instanceof THREE.Points&&(b.setMode(r.POINTS),b.render(g.start,g.count))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;sa="";ta=-1;ra=null;wa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();
-b.matrixWorldInverse.getInverse(b.matrixWorld);xa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Aa.setFromMatrix(xa);Y.length=0;$=fa=-1;ja.length=0;ba.length=0;q(a);ea.length=fa+1;ca.length=$+1;!0===da.sortObjects&&(ea.sort(n),ca.sort(p));ha.render(a);ka.calls=0;ka.vertices=0;ka.faces=0;ka.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,s(ea,b,Y,e,d),s(ca,b,Y,e,d)):
-(J.setBlending(THREE.NoBlending),s(ea,b,Y,e),s(ca,b,Y,e));Ha.render(a,b);Ia.render(a,b,Ca,Da);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=X.get(c).__webglTexture,J.bindTexture(a,c),r.generateMipmap(a),J.bindTexture(a,null));J.setDepthTest(!0);J.setDepthWrite(!0);J.setColorWrite(!0)}};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?J.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?
-r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),J.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=X.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===
-c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",g),c.__webglTexture=r.createTexture(),la.textures++);J.activeTexture(r.TEXTURE0+b);J.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=C(a.image,ga.maxTextureSize);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=A(a.format),
-h=A(a.type);w(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],J.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else J.texImage2D(r.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<J.getCompressedTextureFormats().indexOf(f)?J.compressedTexImage2D(r.TEXTURE_2D,
-l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):J.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],J.texImage2D(r.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else J.texImage2D(r.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else J.activeTexture(r.TEXTURE0+
-b),J.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===X.get(a).__webglFramebuffer){var c=X.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);c.__webglTexture=r.createTexture();la.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=A(a.format),g=A(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=
-[];J.bindTexture(r.TEXTURE_CUBE_MAP,c.__webglTexture);w(r.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=r.createFramebuffer(),c.__webglRenderbuffer[h]=r.createRenderbuffer(),J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,g,null),D(c.__webglFramebuffer[h],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+h),G(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?
-a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),J.bindTexture(r.TEXTURE_2D,c.__webglTexture),w(r.TEXTURE_2D,a,d),J.texImage2D(r.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),D(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):
-G(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);b?J.bindTexture(r.TEXTURE_CUBE_MAP,null):J.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=X.get(a),c=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,d=a.width,e=a.height,h=g=0):(c=null,d=pa,e=qa,g=na,h=oa);c!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,c),r.viewport(g,h,d,e),ia=c);b&&(c=X.get(a),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,
-r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,c.__webglTexture,0));Ca=d;Da=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(X.get(a).__webglFramebuffer){var g=!1;X.get(a).__webglFramebuffer!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,X.get(a).__webglFramebuffer),g=!0);a.format!==THREE.RGBAFormat&&A(a.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?
-console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):a.type!==THREE.UnsignedByteType&&A(a.type)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."):(r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,A(a.format),A(a.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),
-g&&r.bindFramebuffer(r.FRAMEBUFFER,ia))}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return S.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");
+d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var N;d.map?N=d.map:d.specularMap?N=d.specularMap:d.displacementMap?N=d.displacementMap:d.normalMap?N=d.normalMap:d.bumpMap?N=d.bumpMap:d.alphaMap?N=d.alphaMap:d.emissiveMap&&(N=
+d.emissiveMap);void 0!==N&&(N instanceof THREE.WebGLRenderTarget&&(N=N.texture),m=N.offset,N=N.repeat,k.offsetRepeat.value.set(m.x,m.y,N.x,N.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=
+d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=I.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,N=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,N.x,N.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=d.shininess,d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&&
+(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=
+d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,N=b.length;a<N;a++)m=b[a],m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(k.shadowDarkness.value[d]=m instanceof THREE.PointLight?-m.shadowDarkness:m.shadowDarkness,k.shadowMatrix.value[d]=m.shadowMatrix,k.shadowMap.value[d]=m.shadowMap,k.shadowMapSize.value[d]=m.shadowMapSize,k.shadowBias.value[d]=m.shadowBias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=
+b[f][0],!1!==a.needsUpdate)switch(k=a.type,c=a.value,N=b[f][1],k){case "1i":r.uniform1i(N,c);break;case "1f":r.uniform1f(N,c);break;case "2f":r.uniform2f(N,c[0],c[1]);break;case "3f":r.uniform3f(N,c[0],c[1],c[2]);break;case "4f":r.uniform4f(N,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(N,c);break;case "3iv":r.uniform3iv(N,c);break;case "1fv":r.uniform1fv(N,c);break;case "2fv":r.uniform2fv(N,c);break;case "3fv":r.uniform3fv(N,c);break;case "4fv":r.uniform4fv(N,c);break;case "Matrix3fv":r.uniformMatrix3fv(N,
+!1,c);break;case "Matrix4fv":r.uniformMatrix4fv(N,!1,c);break;case "i":r.uniform1i(N,c);break;case "f":r.uniform1f(N,c);break;case "v2":r.uniform2f(N,c.x,c.y);break;case "v3":r.uniform3f(N,c.x,c.y,c.z);break;case "v4":r.uniform4f(N,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(N,c.r,c.g,c.b);break;case "iv1":r.uniform1iv(N,c);break;case "iv":r.uniform3iv(N,c);break;case "fv1":r.uniform1fv(N,c);break;case "fv":r.uniform3fv(N,c);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*c.length));
+n=k=0;for(m=c.length;k<m;k++,n+=2)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y;r.uniform2fv(N,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*c.length));n=k=0;for(m=c.length;k<m;k++,n+=3)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z;r.uniform3fv(N,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*c.length));n=k=0;for(m=c.length;k<m;k++,n+=4)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z,a._array[n+3]=c[k].w;r.uniform4fv(N,
+a._array);break;case "m3":r.uniformMatrix3fv(N,!1,c.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,9*k);r.uniformMatrix3fv(N,!1,a._array);break;case "m4":r.uniformMatrix4fv(N,!1,c.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,16*k);r.uniformMatrix4fv(N,!1,a._array);break;case "t":n=u();r.uniform1i(N,
+n);if(!c)continue;c instanceof THREE.CubeTexture||Array.isArray(c.image)&&6===c.image.length?E(c,n):c instanceof THREE.WebGLRenderTargetCube?z(c.texture,n):c instanceof THREE.WebGLRenderTarget?aa.setTexture(c.texture,n):aa.setTexture(c,n);break;case "tv":void 0===a._array&&(a._array=[]);k=0;for(m=a.value.length;k<m;k++)a._array[k]=u();r.uniform1iv(N,a._array);k=0;for(m=a.value.length;k<m;k++)c=a.value[k],n=a._array[k],c&&(c instanceof THREE.CubeTexture||c.image instanceof Array&&6===c.image.length?
+E(c,n):c instanceof THREE.WebGLRenderTarget?aa.setTexture(c.texture,n):c instanceof THREE.WebGLRenderTargetCube?z(c.texture,n):aa.setTexture(c,n));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+k)}}r.uniformMatrix4fv(p.modelViewMatrix,!1,e.modelViewMatrix.elements);p.normalMatrix&&r.uniformMatrix3fv(p.normalMatrix,!1,e.normalMatrix.elements);void 0!==p.modelMatrix&&r.uniformMatrix4fv(p.modelMatrix,!1,e.matrixWorld.elements);return g}function x(a,b){a.ambientLightColor.needsUpdate=
+b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=
+b;a.hemisphereLightDirection.needsUpdate=b}function u(){var a=ya;a>=ga.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ga.maxTextures);ya+=1;return a}function B(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,A(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,A(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,A(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,A(b.minFilter))):(r.texParameteri(a,
+r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,K(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,K(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&
+console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===S.get("OES_texture_half_float_linear")||!(1<b.anisotropy||V.get(b).__currentAnisotropy)||(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,aa.getMaxAnisotropy())),V.get(b).__currentAnisotropy=
+b.anisotropy)}function C(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function E(a,b){var c=V.get(a);if(6===a.image.length)if(0<a.version&&c.__version!==a.version){c.__image__webglTextureCube||
+(a.addEventListener("dispose",g),c.__image__webglTextureCube=r.createTexture(),la.textures++);J.activeTexture(r.TEXTURE0+b);J.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var d=a instanceof THREE.CompressedTexture,e=a.image[0]instanceof THREE.DataTexture,f=[],h=0;6>h;h++)f[h]=!aa.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:C(a.image[h],ga.maxCubemapSize);var h=f[0],k=THREE.Math.isPowerOfTwo(h.width)&&THREE.Math.isPowerOfTwo(h.height),
+l=A(a.format),m=A(a.type);w(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=f[h].mipmaps,p=0,s=q.length;p<s;p++)n=q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<J.getCompressedTextureFormats().indexOf(l)?J.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,l,m,n.data);
+else e?J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,f[h].width,f[h].height,0,l,m,f[h].data):J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,l,m,f[h]);a.generateMipmaps&&k&&r.generateMipmap(r.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else J.activeTexture(r.TEXTURE0+b),J.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){J.activeTexture(r.TEXTURE0+b);J.bindTexture(r.TEXTURE_CUBE_MAP,V.get(a).__webglTexture)}function D(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,
+a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,V.get(b.texture).__webglTexture,0)}function G(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,
+r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function K(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function A(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;
+if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;
+if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=S.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;
+if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;
+if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=S.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=S.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=S.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;
+if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var I=void 0!==a.canvas?a.canvas:document.createElement("canvas"),M=void 0!==a.context?a.context:null,O=I.width,H=I.height,y=1,L=void 0!==a.alpha?a.alpha:!1,P=void 0!==a.depth?a.depth:!0,T=void 0!==a.stencil?a.stencil:!0,Q=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,W=new THREE.Color(0),
+U=0,Y=[],ea=[],fa=-1,da=[],$=-1,ma=new Float32Array(8),ja=[],ca=[];this.domElement=I;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var aa=this,za=null,ia=null,ta=-1,sa="",ra=null,ya=0,na=0,oa=0,pa=I.width,qa=I.height,Ca=0,Da=0,Aa=new THREE.Frustum,xa=new THREE.Matrix4,X=new THREE.Vector3,Z=new THREE.Vector3,
+wa=!0,Ba={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},la={geometries:0,textures:0},ka={calls:0,vertices:0,faces:0,points:0};this.info={render:ka,memory:la,programs:null};var r;try{L={alpha:L,depth:P,stencil:T,antialias:Q,premultipliedAlpha:R,preserveDrawingBuffer:F};
+r=M||I.getContext("webgl",L)||I.getContext("experimental-webgl",L);if(null===r){if(null!==I.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}I.addEventListener("webglcontextlost",e,!1)}catch(Ea){console.error("THREE.WebGLRenderer: "+Ea)}var S=new THREE.WebGLExtensions(r);S.get("OES_texture_float");S.get("OES_texture_float_linear");S.get("OES_texture_half_float");S.get("OES_texture_half_float_linear");S.get("OES_standard_derivatives");
+S.get("ANGLE_instanced_arrays");S.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ga=new THREE.WebGLCapabilities(r,S,a),J=new THREE.WebGLState(r,S,A),V=new THREE.WebGLProperties,va=new THREE.WebGLObjects(r,V,this.info),ua=new THREE.WebGLPrograms(this,ga);this.info.programs=ua.programs;var Fa=new THREE.WebGLBufferRenderer(r,S,ka),Ga=new THREE.WebGLIndexedBufferRenderer(r,S,ka);c();this.context=r;this.capabilities=ga;this.extensions=S;this.state=J;var ha=new THREE.WebGLShadowMap(this,
+Y,va);this.shadowMap=ha;var Ha=new THREE.SpritePlugin(this,ja),Ia=new THREE.LensFlarePlugin(this,ca);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){S.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=S.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=
+function(){return ga.precision};this.getPixelRatio=function(){return y};this.setPixelRatio=function(a){void 0!==a&&(y=a)};this.getSize=function(){return{width:O,height:H}};this.setSize=function(a,b,c){O=a;H=b;I.width=a*y;I.height=b*y;!1!==c&&(I.style.width=a+"px",I.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){na=a*y;oa=b*y;pa=c*y;qa=d*y;r.viewport(na,oa,pa,qa)};this.getViewport=function(a){a.x=na/y;a.y=oa/y;a.z=pa/y;a.w=qa/y};this.setScissor=function(a,b,c,d){r.scissor(a*
+y,b*y,c*y,d*y)};this.enableScissorTest=function(a){J.setScissorTest(a)};this.getClearColor=function(){return W};this.setClearColor=function(a,c){W.set(a);U=void 0!==c?c:1;b(W.r,W.g,W.b,U)};this.getClearAlpha=function(){return U};this.setClearAlpha=function(a){U=a;b(W.r,W.g,W.b,U)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};
+this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){I.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){J.initAttributes();var d=V.get(a);a.hasPositions&&!d.position&&(d.position=r.createBuffer());a.hasNormals&&!d.normal&&(d.normal=r.createBuffer());a.hasUvs&&!d.uv&&(d.uv=r.createBuffer());
+a.hasColors&&!d.color&&(d.color=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.position),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),J.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+
+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);J.enableAttribute(b.normal);r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.uv),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),J.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.color),r.bufferData(r.ARRAY_BUFFER,
+a.colorArray,r.DYNAMIC_DRAW),J.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));J.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){t(e);var h=v(a,b,c,e,f),l=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==sa&&(sa=a,l=!0);a=f.morphTargetInfluences;if(void 0!==a){b=[];c=0;for(l=a.length;c<l;c++){var m=a[c];b.push([m,c])}b.sort(k);8<b.length&&(b.length=8);var n=d.morphAttributes;c=0;for(l=b.length;c<l;c++)m=b[c],
+ma[c]=m[0],0!==m[0]?(a=m[1],!0===e.morphTargets&&n.position&&d.addAttribute("morphTarget"+c,n.position[a]),!0===e.morphNormals&&n.normal&&d.addAttribute("morphNormal"+c,n.normal[a])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&r.uniform1fv(a.morphTargetInfluences,ma);l=!0}a=d.index;c=d.attributes.position;!0===e.wireframe&&(a=va.getWireframeAttribute(d));null!==a?(b=Ga,b.setIndex(a)):
+b=Fa;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=S.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);J.initAttributes();var m=d.attributes,h=h.getAttributes(),n=e.defaultAttributeValues,p;for(p in h){var s=h[p];if(0<=s){var u=m[p];if(void 0!==u){var x=u.itemSize,w=va.getAttributeBuffer(u);if(u instanceof
+THREE.InterleavedBufferAttribute){var B=u.data,K=B.stride,u=u.offset;B instanceof THREE.InstancedInterleavedBuffer?(J.enableAttributeAndDivisor(s,B.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):J.enableAttribute(s);r.bindBuffer(r.ARRAY_BUFFER,w);r.vertexAttribPointer(s,x,r.FLOAT,!1,K*B.array.BYTES_PER_ELEMENT,(l*K+u)*B.array.BYTES_PER_ELEMENT)}else u instanceof THREE.InstancedBufferAttribute?(J.enableAttributeAndDivisor(s,u.meshPerAttribute,q),
+void 0===d.maxInstancedCount&&(d.maxInstancedCount=u.meshPerAttribute*u.count)):J.enableAttribute(s),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(s,x,r.FLOAT,!1,0,l*x*4)}else if(void 0!==n&&(x=n[p],void 0!==x))switch(x.length){case 2:r.vertexAttrib2fv(s,x);break;case 3:r.vertexAttrib3fv(s,x);break;case 4:r.vertexAttrib4fv(s,x);break;default:r.vertexAttrib1fv(s,x)}}}J.disableUnusedAttributes()}null!==a&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,va.getAttributeBuffer(a))}null===g&&(g=d.drawRange,
+g={start:g.start,count:Math.min(g.count,null!==a?a.array.length:c.count)});f instanceof THREE.Mesh?(!0===e.wireframe?(J.setLineWidth(e.wireframeLinewidth*y),b.setMode(r.LINES)):b.setMode(r.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&0<d.maxInstancedCount?b.renderInstances(d):b.render(g.start,g.count)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),J.setLineWidth(d*y),f instanceof THREE.LineSegments?b.setMode(r.LINES):b.setMode(r.LINE_STRIP),b.render(g.start,g.count)):f instanceof
+THREE.Points&&(b.setMode(r.POINTS),b.render(g.start,g.count))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;sa="";ta=-1;ra=null;wa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);xa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Aa.setFromMatrix(xa);Y.length=0;$=fa=-1;ja.length=0;ca.length=
+0;q(a);ea.length=fa+1;da.length=$+1;!0===aa.sortObjects&&(ea.sort(n),da.sort(p));ha.render(a);ka.calls=0;ka.vertices=0;ka.faces=0;ka.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,s(ea,b,Y,e,d),s(da,b,Y,e,d)):(J.setBlending(THREE.NoBlending),s(ea,b,Y,e),s(da,b,Y,e));Ha.render(a,b);Ia.render(a,b,Ca,Da);c&&(a=c.texture,b=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),
+a.generateMipmaps&&b&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=V.get(c.texture).__webglTexture,J.bindTexture(a,c),r.generateMipmap(a),J.bindTexture(a,null)));J.setDepthTest(!0);J.setDepthWrite(!0);J.setColorWrite(!0)}};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?J.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):
+a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),J.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=V.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",
+g),c.__webglTexture=r.createTexture(),la.textures++);J.activeTexture(r.TEXTURE0+b);J.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=C(a.image,ga.maxTextureSize);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=A(a.format),h=A(a.type);w(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<
+k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],J.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else J.texImage2D(r.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<J.getCompressedTextureFormats().indexOf(f)?J.compressedTexImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):
+J.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],J.texImage2D(r.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else J.texImage2D(r.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else J.activeTexture(r.TEXTURE0+b),J.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===
+V.get(a).__webglFramebuffer){var c=V.get(a),d=V.get(a.texture);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);d.__webglTexture=r.createTexture();la.textures++;var e=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),g=A(a.texture.format),h=A(a.texture.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];J.bindTexture(r.TEXTURE_CUBE_MAP,d.__webglTexture);w(r.TEXTURE_CUBE_MAP,a.texture,e);for(d=0;6>d;d++)c.__webglFramebuffer[d]=
+r.createFramebuffer(),c.__webglRenderbuffer[d]=r.createRenderbuffer(),J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,g,a.width,a.height,0,g,h,null),D(c.__webglFramebuffer[d],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+d),G(c.__webglRenderbuffer[d],a);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),J.bindTexture(r.TEXTURE_2D,d.__webglTexture),w(r.TEXTURE_2D,
+a.texture,e),J.texImage2D(r.TEXTURE_2D,0,g,a.width,a.height,0,g,h,null),D(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):G(c.__webglRenderbuffer,a),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D);b?J.bindTexture(r.TEXTURE_CUBE_MAP,
+null):J.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=V.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=g=0):(d=null,c=pa,e=qa,g=na,h=oa);d!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,d),r.viewport(g,h,c,e),ia=d);b&&(d=V.get(a.texture),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));Ca=c;Da=e};this.readRenderTargetPixels=
+function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(V.get(a).__webglFramebuffer){var g=!1;V.get(a).__webglFramebuffer!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,V.get(a).__webglFramebuffer),g=!0);a.texture.format!==THREE.RGBAFormat&&A(a.texture.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):
+a.texture.type!==THREE.UnsignedByteType&&A(a.texture.type)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."):(r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,A(a.texture.format),A(a.texture.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),g&&r.bindFramebuffer(r.FRAMEBUFFER,
+ia))}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return S.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");
 return S.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return S.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return S.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=
 return S.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return S.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return S.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=
 function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return S.get("EXT_blend_minmax")};this.supportsVertexTextures=function(){return ga.vertexTextures};this.supportsInstancedArrays=function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return S.get("ANGLE_instanced_arrays")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
 function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return S.get("EXT_blend_minmax")};this.supportsVertexTextures=function(){return ga.vertexTextures};this.supportsInstancedArrays=function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return S.get("ANGLE_instanced_arrays")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
 this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ha.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ha.enabled=
 this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ha.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ha.enabled=
 a}},shadowMapType:{get:function(){return ha.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ha.type=a}},shadowMapCullFace:{get:function(){return ha.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ha.cullFace=a}},shadowMapDebug:{get:function(){return ha.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ha.debug=a}}})};
 a}},shadowMapType:{get:function(){return ha.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ha.type=a}},shadowMapCullFace:{get:function(){return ha.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ha.cullFace=a}},shadowMapDebug:{get:function(){return ha.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ha.debug=a}}})};
-THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,
-1);this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
-THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.format=a.format;this.type=a.type;this.depthBuffer=
-a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.generateMipmaps=a.generateMipmaps;this.shareDepthFrom=a.shareDepthFrom;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);
-THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
+THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};void 0===c.minFilter&&(c.minFilter=THREE.LinearFilter);this.texture=new THREE.Texture(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy);this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
+THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,get wrapS(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");return this.texture.wrapS},set wrapS(a){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=a},get wrapT(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set wrapT(a){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=a},
+get magFilter(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");return this.texture.magFilter},set magFilter(a){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=a},get minFilter(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set minFilter(a){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=a},get anisotropy(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");
+return this.texture.anisotropy},set anisotropy(a){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=a},get offset(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set offset(a){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=a},get repeat(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat},set repeat(a){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");
+this.texture.repeat=a},get format(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");return this.texture.format},set format(a){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=a},get type(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set type(a){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=a},get generateMipmaps(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");
+return this.texture.generateMipmaps},set generateMipmaps(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a},setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.shareDepthFrom=
+a.shareDepthFrom;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
 THREE.WebGLBufferRenderer=function(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,g){a.drawArrays(d,b,g);c.calls++;c.vertices+=g;d===a.TRIANGLES&&(c.faces+=g/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");if(null===c)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var f=a.attributes.position;f instanceof THREE.InterleavedBufferAttribute?c.drawArraysInstancedANGLE(d,
 THREE.WebGLBufferRenderer=function(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,g){a.drawArrays(d,b,g);c.calls++;c.vertices+=g;d===a.TRIANGLES&&(c.faces+=g/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");if(null===c)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var f=a.attributes.position;f instanceof THREE.InterleavedBufferAttribute?c.drawArraysInstancedANGLE(d,
 0,f.data.count,a.maxInstancedCount):c.drawArraysInstancedANGLE(d,0,f.count,a.maxInstancedCount)}}};
 0,f.data.count,a.maxInstancedCount):c.drawArraysInstancedANGLE(d,0,f.count,a.maxInstancedCount)}}};
 THREE.WebGLIndexedBufferRenderer=function(a,b,c){var d,e,g;this.setMode=function(a){d=a};this.setIndex=function(c){c.array instanceof Uint32Array&&b.get("OES_element_index_uint")?(e=a.UNSIGNED_INT,g=4):(e=a.UNSIGNED_SHORT,g=2)};this.render=function(b,h){a.drawElements(d,h,e,b*g);c.calls++;c.vertices+=h;d===a.TRIANGLES&&(c.faces+=h/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):
 THREE.WebGLIndexedBufferRenderer=function(a,b,c){var d,e,g;this.setMode=function(a){d=a};this.setIndex=function(c){c.array instanceof Uint32Array&&b.get("OES_element_index_uint")?(e=a.UNSIGNED_INT,g=4):(e=a.UNSIGNED_SHORT,g=2)};this.render=function(b,h){a.drawElements(d,h,e,b*g);c.calls++;c.vertices+=h;d===a.TRIANGLES&&(c.faces+=h/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):
@@ -661,8 +664,8 @@ u;if(!1!==K.enabled&&(!1!==K.autoUpdate||!1!==K.needsUpdate)){g.clearColor(1,1,1
 1,u=!1;if(y.castShadow){y.shadowMap||(z=THREE.LinearFilter,K.type===THREE.PCFSoftShadowMap&&(z=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:z,magFilter:z,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);y.shadowCamera||(y.shadowCamera=y instanceof THREE.SpotLight?new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,
 1,u=!1;if(y.castShadow){y.shadowMap||(z=THREE.LinearFilter,K.type===THREE.PCFSoftShadowMap&&(z=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:z,magFilter:z,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);y.shadowCamera||(y.shadowCamera=y instanceof THREE.SpotLight?new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,
 y.shadowCameraFar):y instanceof THREE.DirectionalLight?new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar):new THREE.PerspectiveCamera(y.shadowCameraFov,1,y.shadowCameraNear,y.shadowCameraFar),m.add(y.shadowCamera),!0===m.autoUpdate&&m.updateMatrixWorld());y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),m.add(y.cameraHelper));var D=y.shadowMap,z=y.shadowMatrix,
 y.shadowCameraFar):y instanceof THREE.DirectionalLight?new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar):new THREE.PerspectiveCamera(y.shadowCameraFov,1,y.shadowCameraNear,y.shadowCameraFar),m.add(y.shadowCamera),!0===m.autoUpdate&&m.updateMatrixWorld());y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),m.add(y.cameraHelper));var D=y.shadowMap,z=y.shadowMatrix,
 C=y.shadowCamera;n.setFromMatrixPosition(y.matrixWorld);C.position.copy(n);a.setRenderTarget(D);a.clear();for(D=0;D<q;D++){if(u){k.copy(C.position);k.add(s[D]);C.up.copy(t[D]);C.lookAt(k);var E=v[D];a.setViewport(E.x,E.y,E.z,E.w)}else k.setFromMatrixPosition(y.target.matrixWorld),C.lookAt(k);C.updateMatrixWorld();C.matrixWorldInverse.getInverse(C.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();z.set(.5,0,0,.5,0,.5,0,.5,0,0,
 C=y.shadowCamera;n.setFromMatrixPosition(y.matrixWorld);C.position.copy(n);a.setRenderTarget(D);a.clear();for(D=0;D<q;D++){if(u){k.copy(C.position);k.add(s[D]);C.up.copy(t[D]);C.lookAt(k);var E=v[D];a.setViewport(E.x,E.y,E.z,E.w)}else k.setFromMatrixPosition(y.target.matrixWorld),C.lookAt(k);C.updateMatrixWorld();C.matrixWorldInverse.getInverse(C.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();z.set(.5,0,0,.5,0,.5,0,.5,0,0,
-.5,.5,0,0,0,1);z.multiply(C.projectionMatrix);z.multiply(C.matrixWorldInverse);l.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse);h.setFromMatrix(l);p.length=0;e(m,C);for(var E=0,G=p.length;E<G;E++){var F=p[E],V=c.update(F),U=F.material;if(U instanceof THREE.MeshFaceMaterial)for(var Y=V.groups,U=U.materials,ea=0,fa=Y.length;ea<fa;ea++){var ca=Y[ea],$=U[ca.materialIndex];!0===$.visible&&($=d(F,$,u,n),a.renderBufferDirect(C,b,null,V,$,F,ca))}else $=d(F,U,u,n),a.renderBufferDirect(C,b,null,
-V,$,F,null)}}a.setViewport(x.x,x.y,x.z,x.w)}}m=a.getClearColor();q=a.getClearAlpha();a.setClearColor(m,q);f.enable(g.BLEND);K.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();K.needsUpdate=!1}}};
+.5,.5,0,0,0,1);z.multiply(C.projectionMatrix);z.multiply(C.matrixWorldInverse);l.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse);h.setFromMatrix(l);p.length=0;e(m,C);for(var E=0,G=p.length;E<G;E++){var F=p[E],W=c.update(F),U=F.material;if(U instanceof THREE.MeshFaceMaterial)for(var Y=W.groups,U=U.materials,ea=0,fa=Y.length;ea<fa;ea++){var da=Y[ea],$=U[da.materialIndex];!0===$.visible&&($=d(F,$,u,n),a.renderBufferDirect(C,b,null,W,$,F,da))}else $=d(F,U,u,n),a.renderBufferDirect(C,b,null,
+W,$,F,null)}}a.setViewport(x.x,x.y,x.z,x.w)}}m=a.getClearColor();q=a.getClearAlpha();a.setClearColor(m,q);f.enable(g.BLEND);K.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();K.needsUpdate=!1}}};
 THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f=new Uint8Array(16),h={},l=null,k=null,n=null,p=null,m=null,q=null,s=null,t=null,v=null,x=null,u=null,B=null,w=null,C=null,E=null,z=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),D=void 0,G={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
 THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f=new Uint8Array(16),h={},l=null,k=null,n=null,p=null,m=null,q=null,s=null,t=null,v=null,x=null,u=null,B=null,w=null,C=null,E=null,z=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),D=void 0,G={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
 a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===g[c]&&(a.enableVertexAttribArray(c),g[c]=1);0!==f[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),f[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1);f[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),f[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<
 a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===g[c]&&(a.enableVertexAttribArray(c),g[c]=1);0!==f[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),f[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1);f[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),f[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<
 c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===l&&(l=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)l.push(c[d]);return l};this.setBlending=function(b,d,e,f,g,h,l){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):
 c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===l&&(l=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)l.push(c[d]);return l};this.setBlending=function(b,d,e,f,g,h,l){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):
@@ -671,23 +674,23 @@ a.ONE,a.ONE_MINUS_SRC_ALPHA)),k=b);if(b===THREE.CustomBlending){g=g||d;h=h||e;l=
 break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);v=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){x!==b&&(a.depthMask(b),x=b)};this.setColorWrite=function(b){u!==b&&(a.colorMask(b,b,b,b),u=b)};this.setFlipSided=
 break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);v=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){x!==b&&(a.depthMask(b),x=b)};this.setColorWrite=function(b){u!==b&&(a.colorMask(b,b,b,b),u=b)};this.setFlipSided=
 function(b){B!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),B=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||C===c&&E===d||(a.polygonOffset(c,d),C=c,E=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+z-1);D!==b&&(a.activeTexture(b),D=b)};this.bindTexture=function(b,c){void 0===
 function(b){B!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),B=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||C===c&&E===d||(a.polygonOffset(c,d),C=c,E=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+z-1);D!==b&&(a.activeTexture(b),D=b)};this.bindTexture=function(b,c){void 0===
 D&&d.activeTexture();var e=G[D];void 0===e&&(e={type:void 0,texture:void 0},G[D]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);h={};B=u=x=k=l=null}};
 D&&d.activeTexture();var e=G[D];void 0===e&&(e={type:void 0,texture:void 0},G[D]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);h={};B=u=x=k=l=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m=a.context,q=a.state,s,t,v,x,u,B;this.render=function(w,C,E,z){if(0!==b.length){w=new THREE.Vector3;var D=z/E,G=.5*E,K=.5*z,A=16/z,I=new THREE.Vector2(A*D,A),M=new THREE.Vector3(1,1,0),N=new THREE.Vector2(1,1);if(void 0===v){var A=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),H=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,A,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m=a.context,q=a.state,s,t,v,x,u,B;this.render=function(w,C,E,z){if(0!==b.length){w=new THREE.Vector3;var D=z/E,G=.5*E,K=.5*z,A=16/z,I=new THREE.Vector2(A*D,A),M=new THREE.Vector3(1,1,0),O=new THREE.Vector2(1,1);if(void 0===v){var A=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),H=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,A,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
 t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,H,m.STATIC_DRAW);u=m.createTexture();B=m.createTexture();q.bindTexture(m.TEXTURE_2D,u);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,B);m.texImage2D(m.TEXTURE_2D,0,
 t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,H,m.STATIC_DRAW);u=m.createTexture();B=m.createTexture();q.bindTexture(m.TEXTURE_2D,u);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,B);m.texImage2D(m.TEXTURE_2D,0,
 m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var A=(x=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var A=(x=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
-H=m.createProgram(),y=m.createShader(m.FRAGMENT_SHADER),L=m.createShader(m.VERTEX_SHADER),O="precision "+a.getPrecision()+" float;\n";m.shaderSource(y,O+A.fragmentShader);m.shaderSource(L,O+A.vertexShader);m.compileShader(y);m.compileShader(L);m.attachShader(H,y);m.attachShader(H,L);m.linkProgram(H);v=H;n=m.getAttribLocation(v,"position");p=m.getAttribLocation(v,"uv");c=m.getUniformLocation(v,"renderType");d=m.getUniformLocation(v,"map");e=m.getUniformLocation(v,"occlusionMap");g=m.getUniformLocation(v,
+H=m.createProgram(),y=m.createShader(m.FRAGMENT_SHADER),L=m.createShader(m.VERTEX_SHADER),P="precision "+a.getPrecision()+" float;\n";m.shaderSource(y,P+A.fragmentShader);m.shaderSource(L,P+A.vertexShader);m.compileShader(y);m.compileShader(L);m.attachShader(H,y);m.attachShader(H,L);m.linkProgram(H);v=H;n=m.getAttribLocation(v,"position");p=m.getAttribLocation(v,"uv");c=m.getUniformLocation(v,"renderType");d=m.getUniformLocation(v,"map");e=m.getUniformLocation(v,"occlusionMap");g=m.getUniformLocation(v,
 "opacity");f=m.getUniformLocation(v,"color");h=m.getUniformLocation(v,"scale");l=m.getUniformLocation(v,"rotation");k=m.getUniformLocation(v,"screenPosition")}m.useProgram(v);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);q.disable(m.CULL_FACE);m.depthMask(!1);H=0;for(y=
 "opacity");f=m.getUniformLocation(v,"color");h=m.getUniformLocation(v,"scale");l=m.getUniformLocation(v,"rotation");k=m.getUniformLocation(v,"screenPosition")}m.useProgram(v);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);q.disable(m.CULL_FACE);m.depthMask(!1);H=0;for(y=
-b.length;H<y;H++)if(A=16/z,I.set(A*D,A),L=b[H],w.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),w.applyMatrix4(C.matrixWorldInverse),w.applyProjection(C.projectionMatrix),M.copy(w),N.x=M.x*G+G,N.y=M.y*K+K,x||0<N.x&&N.x<E&&0<N.y&&N.y<z){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,u);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,N.x-8,N.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,I.x,I.y);m.uniform3f(k,
-M.x,M.y,M.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,B);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,N.x-8,N.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,u);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);L.positionScreen.copy(M);L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var O=
-0,T=L.lensFlares.length;O<T;O++){var Q=L.lensFlares[O];.001<Q.opacity&&.001<Q.scale&&(M.x=Q.x,M.y=Q.y,M.z=Q.z,A=Q.size*Q.scale/z,I.x=A*D,I.y=A,m.uniform3f(k,M.x,M.y,M.z),m.uniform2f(h,I.x,I.y),m.uniform1f(l,Q.rotation),m.uniform1f(g,Q.opacity),m.uniform3f(f,Q.color.r,Q.color.g,Q.color.b),q.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),a.setTexture(Q.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m,q,s,t,v,x,u;function B(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,C=a.state,E,z,D,G,K=new THREE.Vector3,A=new THREE.Quaternion,I=new THREE.Vector3;this.render=function(M,N){if(0!==b.length){if(void 0===D){var H=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),y=new Uint16Array([0,1,2,0,2,3]);E=w.createBuffer();z=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,E);w.bufferData(w.ARRAY_BUFFER,H,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+b.length;H<y;H++)if(A=16/z,I.set(A*D,A),L=b[H],w.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),w.applyMatrix4(C.matrixWorldInverse),w.applyProjection(C.projectionMatrix),M.copy(w),O.x=M.x*G+G,O.y=M.y*K+K,x||0<O.x&&O.x<E&&0<O.y&&O.y<z){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,u);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,O.x-8,O.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,I.x,I.y);m.uniform3f(k,
+M.x,M.y,M.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,B);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,O.x-8,O.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,u);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);L.positionScreen.copy(M);L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var P=
+0,T=L.lensFlares.length;P<T;P++){var Q=L.lensFlares[P];.001<Q.opacity&&.001<Q.scale&&(M.x=Q.x,M.y=Q.y,M.z=Q.z,A=Q.size*Q.scale/z,I.x=A*D,I.y=A,m.uniform3f(k,M.x,M.y,M.z),m.uniform2f(h,I.x,I.y),m.uniform1f(l,Q.rotation),m.uniform1f(g,Q.opacity),m.uniform3f(f,Q.color.r,Q.color.g,Q.color.b),q.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),a.setTexture(Q.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,l,k,n,p,m,q,s,t,v,x,u;function B(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,C=a.state,E,z,D,G,K=new THREE.Vector3,A=new THREE.Quaternion,I=new THREE.Vector3;this.render=function(M,O){if(0!==b.length){if(void 0===D){var H=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),y=new Uint16Array([0,1,2,0,2,3]);E=w.createBuffer();z=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,E);w.bufferData(w.ARRAY_BUFFER,H,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
 z);w.bufferData(w.ELEMENT_ARRAY_BUFFER,y,w.STATIC_DRAW);var H=w.createProgram(),y=w.createShader(w.VERTEX_SHADER),L=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(y,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 z);w.bufferData(w.ELEMENT_ARRAY_BUFFER,y,w.STATIC_DRAW);var H=w.createProgram(),y=w.createShader(w.VERTEX_SHADER),L=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(y,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 w.shaderSource(L,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
 w.shaderSource(L,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
 w.compileShader(y);w.compileShader(L);w.attachShader(H,y);w.attachShader(H,L);w.linkProgram(H);D=H;x=w.getAttribLocation(D,"position");u=w.getAttribLocation(D,"uv");c=w.getUniformLocation(D,"uvOffset");d=w.getUniformLocation(D,"uvScale");e=w.getUniformLocation(D,"rotation");g=w.getUniformLocation(D,"scale");f=w.getUniformLocation(D,"color");h=w.getUniformLocation(D,"map");l=w.getUniformLocation(D,"opacity");k=w.getUniformLocation(D,"modelViewMatrix");n=w.getUniformLocation(D,"projectionMatrix");p=
 w.compileShader(y);w.compileShader(L);w.attachShader(H,y);w.attachShader(H,L);w.linkProgram(H);D=H;x=w.getAttribLocation(D,"position");u=w.getAttribLocation(D,"uv");c=w.getUniformLocation(D,"uvOffset");d=w.getUniformLocation(D,"uvScale");e=w.getUniformLocation(D,"rotation");g=w.getUniformLocation(D,"scale");f=w.getUniformLocation(D,"color");h=w.getUniformLocation(D,"map");l=w.getUniformLocation(D,"opacity");k=w.getUniformLocation(D,"modelViewMatrix");n=w.getUniformLocation(D,"projectionMatrix");p=
 w.getUniformLocation(D,"fogType");m=w.getUniformLocation(D,"fogDensity");q=w.getUniformLocation(D,"fogNear");s=w.getUniformLocation(D,"fogFar");t=w.getUniformLocation(D,"fogColor");v=w.getUniformLocation(D,"alphaTest");H=document.createElement("canvas");H.width=8;H.height=8;y=H.getContext("2d");y.fillStyle="white";y.fillRect(0,0,8,8);G=new THREE.Texture(H);G.needsUpdate=!0}w.useProgram(D);C.initAttributes();C.enableAttribute(x);C.enableAttribute(u);C.disableUnusedAttributes();C.disable(w.CULL_FACE);
 w.getUniformLocation(D,"fogType");m=w.getUniformLocation(D,"fogDensity");q=w.getUniformLocation(D,"fogNear");s=w.getUniformLocation(D,"fogFar");t=w.getUniformLocation(D,"fogColor");v=w.getUniformLocation(D,"alphaTest");H=document.createElement("canvas");H.width=8;H.height=8;y=H.getContext("2d");y.fillStyle="white";y.fillRect(0,0,8,8);G=new THREE.Texture(H);G.needsUpdate=!0}w.useProgram(D);C.initAttributes();C.enableAttribute(x);C.enableAttribute(u);C.disableUnusedAttributes();C.disable(w.CULL_FACE);
-C.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,E);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(u,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,z);w.uniformMatrix4fv(n,!1,N.projectionMatrix.elements);C.activeTexture(w.TEXTURE0);w.uniform1i(h,0);y=H=0;(L=M.fog)?(w.uniform3f(t,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(w.uniform1f(q,L.near),w.uniform1f(s,L.far),w.uniform1i(p,1),y=H=1):L instanceof THREE.FogExp2&&(w.uniform1f(m,L.density),w.uniform1i(p,2),y=H=2)):
-(w.uniform1i(p,0),y=H=0);for(var L=0,O=b.length;L<O;L++){var T=b[L];T.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,T.matrixWorld);T.z=-T.modelViewMatrix.elements[14]}b.sort(B);for(var Q=[],L=0,O=b.length;L<O;L++){var T=b[L],R=T.material;w.uniform1f(v,R.alphaTest);w.uniformMatrix4fv(k,!1,T.modelViewMatrix.elements);T.matrixWorld.decompose(K,A,I);Q[0]=I.x;Q[1]=I.y;T=0;M.fog&&R.fog&&(T=y);H!==T&&(w.uniform1i(p,T),H=T);null!==R.map?(w.uniform2f(c,R.map.offset.x,R.map.offset.y),w.uniform2f(d,
+C.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,E);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(u,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,z);w.uniformMatrix4fv(n,!1,O.projectionMatrix.elements);C.activeTexture(w.TEXTURE0);w.uniform1i(h,0);y=H=0;(L=M.fog)?(w.uniform3f(t,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(w.uniform1f(q,L.near),w.uniform1f(s,L.far),w.uniform1i(p,1),y=H=1):L instanceof THREE.FogExp2&&(w.uniform1f(m,L.density),w.uniform1i(p,2),y=H=2)):
+(w.uniform1i(p,0),y=H=0);for(var L=0,P=b.length;L<P;L++){var T=b[L];T.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,T.matrixWorld);T.z=-T.modelViewMatrix.elements[14]}b.sort(B);for(var Q=[],L=0,P=b.length;L<P;L++){var T=b[L],R=T.material;w.uniform1f(v,R.alphaTest);w.uniformMatrix4fv(k,!1,T.modelViewMatrix.elements);T.matrixWorld.decompose(K,A,I);Q[0]=I.x;Q[1]=I.y;T=0;M.fog&&R.fog&&(T=y);H!==T&&(w.uniform1i(p,T),H=T);null!==R.map?(w.uniform2f(c,R.map.offset.x,R.map.offset.y),w.uniform2f(d,
 R.map.repeat.x,R.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(l,R.opacity);w.uniform3f(f,R.color.r,R.color.g,R.color.b);w.uniform1f(e,R.rotation);w.uniform2fv(g,Q);C.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst);C.setDepthTest(R.depthTest);C.setDepthWrite(R.depthWrite);R.map&&R.map.image&&R.map.image.width?a.setTexture(R.map,0):a.setTexture(G,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}C.enable(w.CULL_FACE);a.resetGLState()}}};
 R.map.repeat.x,R.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(l,R.opacity);w.uniform3f(f,R.color.r,R.color.g,R.color.b);w.uniform1f(e,R.rotation);w.uniform2fv(g,Q);C.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst);C.setDepthTest(R.depthTest);C.setDepthWrite(R.depthWrite);R.map&&R.map.image&&R.map.image.width?a.setTexture(R.map,0):a.setTexture(G,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}C.enable(w.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
@@ -702,7 +705,7 @@ break;case "l":l=b[a++]*c+d;n=b[a++]*c;e.lineTo(l,n);break;case "q":l=b[a++]*c+d
 m,s,v,n)}return{offset:x.ha*c,path:e}}}};
 m,s,v,n)}return{offset:x.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],l,k,n;if(0<b(a))for(k=0;k<e;k++)f[k]=k;else for(k=0;k<e;k++)f[k]=e-1-k;var p=2*e;for(k=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}l=k;e<=l&&(l=0);k=l+1;e<=k&&(k=0);n=k+1;e<=n&&(n=0);var m;a:{var q=m=void 0,s=void 0,t=void 0,
 (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],l,k,n;if(0<b(a))for(k=0;k<e;k++)f[k]=k;else for(k=0;k<e;k++)f[k]=e-1-k;var p=2*e;for(k=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}l=k;e<=l&&(l=0);k=l+1;e<=k&&(k=0);n=k+1;e<=n&&(n=0);var m;a:{var q=m=void 0,s=void 0,t=void 0,
-v=void 0,x=void 0,u=void 0,B=void 0,w=void 0,q=a[f[l]].x,s=a[f[l]].y,t=a[f[k]].x,v=a[f[k]].y,x=a[f[n]].x,u=a[f[n]].y;if(1E-10>(t-q)*(u-s)-(v-s)*(x-q))m=!1;else{var C=void 0,E=void 0,z=void 0,D=void 0,G=void 0,K=void 0,A=void 0,I=void 0,M=void 0,N=void 0,M=I=A=w=B=void 0,C=x-t,E=u-v,z=q-x,D=s-u,G=t-q,K=v-s;for(m=0;m<e;m++)if(B=a[f[m]].x,w=a[f[m]].y,!(B===q&&w===s||B===t&&w===v||B===x&&w===u)&&(A=B-q,I=w-s,M=B-t,N=w-v,B-=x,w-=u,M=C*N-E*M,A=G*I-K*A,I=z*w-D*B,-1E-10<=M&&-1E-10<=I&&-1E-10<=A)){m=!1;break a}m=
+v=void 0,x=void 0,u=void 0,B=void 0,w=void 0,q=a[f[l]].x,s=a[f[l]].y,t=a[f[k]].x,v=a[f[k]].y,x=a[f[n]].x,u=a[f[n]].y;if(1E-10>(t-q)*(u-s)-(v-s)*(x-q))m=!1;else{var C=void 0,E=void 0,z=void 0,D=void 0,G=void 0,K=void 0,A=void 0,I=void 0,M=void 0,O=void 0,M=I=A=w=B=void 0,C=x-t,E=u-v,z=q-x,D=s-u,G=t-q,K=v-s;for(m=0;m<e;m++)if(B=a[f[m]].x,w=a[f[m]].y,!(B===q&&w===s||B===t&&w===v||B===x&&w===u)&&(A=B-q,I=w-s,M=B-t,O=w-v,B-=x,w-=u,M=C*O-E*M,A=G*I-K*A,I=z*w-D*B,-1E-10<=M&&-1E-10<=I&&-1E-10<=A)){m=!1;break a}m=
 !0}}if(m){g.push([a[f[l]],a[f[k]],a[f[n]]]);h.push([f[l],f[k],f[n]]);l=k;for(n=k+1;n<e;l++,n++)f[l]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 !0}}if(m){g.push([a[f[l]],a[f[k]],a[f[n]]]);h.push([f[l],f[k],f[n]]);l=k;for(n=k+1;n<e;l++,n++)f[l]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
@@ -745,8 +748,8 @@ THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransfor
 THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*l,D=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>D||D>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0<D||D<z)return[];k=l*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==D&&D!==z?[a]:[];if(k===z)return!f||0!==D&&D!==z?[b]:[];if(0===
 THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*l,D=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>D||D>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0<D||D<z)return[];k=l*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==D&&D!==z?[a]:[];if(k===z)return!f||0!==D&&D!==z?[b]:[];if(0===
 D)return[d];if(D===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==D||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 D)return[d];if(D===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==D||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,l,k,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)k=h[g].x+":"+h[g].y,void 0!==n[k]&&console.warn("THREE.Shape: Duplicate point",k),n[k]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
 k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,l,k,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)k=h[g].x+":"+h[g].y,void 0!==n[k]&&console.warn("THREE.Shape: Duplicate point",k),n[k]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,E,z,D,G=[],K,A,I,M=0;for(n=b.length;M<n;M++)l.push(M);K=0;for(var N=2*
-l.length;0<l.length;){N--;if(0>N){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=K;p<h.length;p++){E=h[p];n=-1;for(M=0;M<l.length;M++)if(z=l[M],D=E.x+":"+E.y+":"+z,void 0===G[D]){k=b[z];for(A=0;A<k.length;A++)if(z=k[A],c(p,A)&&!f(E,z)&&!g(E,z)){n=A;l.splice(M,1);K=h.slice(0,p+1);z=h.slice(p);A=k.slice(n);I=k.slice(0,n+1);h=K.concat(A).concat(I).concat(z);K=p;break}if(0<=n)break;G[D]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,E,z,D,G=[],K,A,I,M=0;for(n=b.length;M<n;M++)l.push(M);K=0;for(var O=2*
+l.length;0<l.length;){O--;if(0>O){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=K;p<h.length;p++){E=h[p];n=-1;for(M=0;M<l.length;M++)if(z=l[M],D=E.x+":"+E.y+":"+z,void 0===G[D]){k=b[z];for(A=0;A<k.length;A++)if(z=k[A],c(p,A)&&!f(E,z)&&!g(E,z)){n=A;l.splice(M,1);K=h.slice(0,p+1);z=h.slice(p);A=k.slice(n);I=k.slice(0,n+1);h=K.concat(A).concat(I).concat(z);K=p;break}if(0<=n)break;G[D]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
 !1);g=0;for(f=p.length;g<f;g++)for(l=p[g],h=0;3>h;h++)k=l[h].x+":"+l[h].y,k=n[k],void 0!==k&&(l[h]=k);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 !1);g=0;for(f=p.length;g<f;g++)for(l=p[g],h=0;3>h;h++)k=l[h].x+":"+l[h].y,k=n[k],void 0!==k&&(l[h]=k);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
@@ -787,9 +790,9 @@ THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||cons
 !0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+K,g=g+K,l=l+K,h=h+K;G.faces.push(new THREE.Face3(k,g,h));G.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(G,k,g,l,h);G.faceVertexUvs[0].push([k[0],k[1],k[3]]);G.faceVertexUvs[0].push([k[1],
 !0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+K,g=g+K,l=l+K,h=h+K;G.faces.push(new THREE.Face3(k,g,h));G.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(G,k,g,l,h);G.faceVertexUvs[0].push([k[0],k[1],k[3]]);G.faceVertexUvs[0].push([k[1],
 k[2],k[3]])}}}function g(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=K;b+=K;c+=K;G.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(G,a,b,c);G.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,l=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:l-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
 k[2],k[3]])}}}function g(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=K;b+=K;c+=K;G.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(G,a,b,c);G.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,l=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:l-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
 t,v=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,u,B,w,C;s&&(t=s.getSpacedPoints(q),v=!0,p=!1,u=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),B=new THREE.Vector3,w=new THREE.Vector3,C=new THREE.Vector3);p||(k=l=n=0);var E,z,D,G=this,K=this.vertices.length,s=a.extractPoints(m),m=s.shape,A=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();z=0;for(D=A.length;z<D;z++)E=A[z],THREE.Shape.Utils.isClockWise(E)&&(A[z]=E.reverse());s=
 t,v=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,u,B,w,C;s&&(t=s.getSpacedPoints(q),v=!0,p=!1,u=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),B=new THREE.Vector3,w=new THREE.Vector3,C=new THREE.Vector3);p||(k=l=n=0);var E,z,D,G=this,K=this.vertices.length,s=a.extractPoints(m),m=s.shape,A=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();z=0;for(D=A.length;z<D;z++)E=A[z],THREE.Shape.Utils.isClockWise(E)&&(A[z]=E.reverse());s=
-!1}var I=THREE.Shape.Utils.triangulateShape(m,A),M=m;z=0;for(D=A.length;z<D;z++)E=A[z],m=m.concat(E);var N,H,y,L,O,T=m.length,Q,R=I.length,s=[],F=0;y=M.length;N=y-1;for(H=F+1;F<y;F++,N++,H++)N===y&&(N=0),H===y&&(H=0),s[F]=d(M[F],M[N],M[H]);var V=[],U,Y=s.concat();z=0;for(D=A.length;z<D;z++){E=A[z];U=[];F=0;y=E.length;N=y-1;for(H=F+1;F<y;F++,N++,H++)N===y&&(N=0),H===y&&(H=0),U[F]=d(E[F],E[N],E[H]);V.push(U);Y=Y.concat(U)}for(N=0;N<n;N++){y=N/n;L=l*(1-y);H=k*Math.sin(y*Math.PI/2);F=0;for(y=M.length;F<
-y;F++)O=c(M[F],s[F],H),g(O.x,O.y,-L);z=0;for(D=A.length;z<D;z++)for(E=A[z],U=V[z],F=0,y=E.length;F<y;F++)O=c(E[F],U[F],H),g(O.x,O.y,-L)}H=k;for(F=0;F<T;F++)O=p?c(m[F],Y[F],H):m[F],v?(w.copy(u.normals[0]).multiplyScalar(O.x),B.copy(u.binormals[0]).multiplyScalar(O.y),C.copy(t[0]).add(w).add(B),g(C.x,C.y,C.z)):g(O.x,O.y,0);for(y=1;y<=q;y++)for(F=0;F<T;F++)O=p?c(m[F],Y[F],H):m[F],v?(w.copy(u.normals[y]).multiplyScalar(O.x),B.copy(u.binormals[y]).multiplyScalar(O.y),C.copy(t[y]).add(w).add(B),g(C.x,C.y,
-C.z)):g(O.x,O.y,h/q*y);for(N=n-1;0<=N;N--){y=N/n;L=l*(1-y);H=k*Math.sin(y*Math.PI/2);F=0;for(y=M.length;F<y;F++)O=c(M[F],s[F],H),g(O.x,O.y,h+L);z=0;for(D=A.length;z<D;z++)for(E=A[z],U=V[z],F=0,y=E.length;F<y;F++)O=c(E[F],U[F],H),v?g(O.x,O.y+t[q-1].y,t[q-1].x+L):g(O.x,O.y,h+L)}(function(){if(p){var a;a=0*T;for(F=0;F<R;F++)Q=I[F],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*n;a*=T;for(F=0;F<R;F++)Q=I[F],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(F=0;F<R;F++)Q=I[F],f(Q[2],Q[1],Q[0]);for(F=0;F<R;F++)Q=I[F],f(Q[0]+T*q,Q[1]+T*
+!1}var I=THREE.Shape.Utils.triangulateShape(m,A),M=m;z=0;for(D=A.length;z<D;z++)E=A[z],m=m.concat(E);var O,H,y,L,P,T=m.length,Q,R=I.length,s=[],F=0;y=M.length;O=y-1;for(H=F+1;F<y;F++,O++,H++)O===y&&(O=0),H===y&&(H=0),s[F]=d(M[F],M[O],M[H]);var W=[],U,Y=s.concat();z=0;for(D=A.length;z<D;z++){E=A[z];U=[];F=0;y=E.length;O=y-1;for(H=F+1;F<y;F++,O++,H++)O===y&&(O=0),H===y&&(H=0),U[F]=d(E[F],E[O],E[H]);W.push(U);Y=Y.concat(U)}for(O=0;O<n;O++){y=O/n;L=l*(1-y);H=k*Math.sin(y*Math.PI/2);F=0;for(y=M.length;F<
+y;F++)P=c(M[F],s[F],H),g(P.x,P.y,-L);z=0;for(D=A.length;z<D;z++)for(E=A[z],U=W[z],F=0,y=E.length;F<y;F++)P=c(E[F],U[F],H),g(P.x,P.y,-L)}H=k;for(F=0;F<T;F++)P=p?c(m[F],Y[F],H):m[F],v?(w.copy(u.normals[0]).multiplyScalar(P.x),B.copy(u.binormals[0]).multiplyScalar(P.y),C.copy(t[0]).add(w).add(B),g(C.x,C.y,C.z)):g(P.x,P.y,0);for(y=1;y<=q;y++)for(F=0;F<T;F++)P=p?c(m[F],Y[F],H):m[F],v?(w.copy(u.normals[y]).multiplyScalar(P.x),B.copy(u.binormals[y]).multiplyScalar(P.y),C.copy(t[y]).add(w).add(B),g(C.x,C.y,
+C.z)):g(P.x,P.y,h/q*y);for(O=n-1;0<=O;O--){y=O/n;L=l*(1-y);H=k*Math.sin(y*Math.PI/2);F=0;for(y=M.length;F<y;F++)P=c(M[F],s[F],H),g(P.x,P.y,h+L);z=0;for(D=A.length;z<D;z++)for(E=A[z],U=W[z],F=0,y=E.length;F<y;F++)P=c(E[F],U[F],H),v?g(P.x,P.y+t[q-1].y,t[q-1].x+L):g(P.x,P.y,h+L)}(function(){if(p){var a;a=0*T;for(F=0;F<R;F++)Q=I[F],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*n;a*=T;for(F=0;F<R;F++)Q=I[F],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(F=0;F<R;F++)Q=I[F],f(Q[2],Q[1],Q[0]);for(F=0;F<R;F++)Q=I[F],f(Q[0]+T*q,Q[1]+T*
 q,Q[2]+T*q)}})();(function(){var a=0;e(M,a);a+=M.length;z=0;for(D=A.length;z<D;z++)E=A[z],e(E,a),a+=E.length})()};
 q,Q[2]+T*q)}})();(function(){var a=0;e(M,a);a+=M.length;z=0;for(D=A.length;z<D;z++)E=A[z],e(E,a),a+=E.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};