瀏覽代碼

Updated builds.

Mr.doob 9 年之前
父節點
當前提交
965194c235
共有 2 個文件被更改,包括 123 次插入93 次删除
  1. 80 50
      build/three.js
  2. 43 43
      build/three.min.js

+ 80 - 50
build/three.js

@@ -4535,7 +4535,7 @@ THREE.Matrix3.prototype = {
 
 	},
 
-	getInverse: function ( matrix, throwOnInvertible ) {
+	getInverse: function ( matrix, throwOnDegenerate ) {
 
 		// input: THREE.Matrix4
 		// ( based on http://code.google.com/p/webgl-mjs/ )
@@ -4561,7 +4561,7 @@ THREE.Matrix3.prototype = {
 
 			var msg = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
 
-			if ( throwOnInvertible || false ) {
+			if ( throwOnDegenerate || false ) {
 
 				throw new Error( msg );
 
@@ -9887,7 +9887,7 @@ THREE.Geometry.prototype = {
 		var tempUVs = [];
 		var tempUVs2 = [];
 
-		for ( var i = 0, j = 0, k = 0; i < vertices.length; i += 3, j += 2, k += 4 ) {
+		for ( var i = 0, j = 0; i < vertices.length; i += 3, j += 2 ) {
 
 			scope.vertices.push( new THREE.Vector3( vertices[ i ], vertices[ i + 1 ], vertices[ i + 2 ] ) );
 
@@ -11588,16 +11588,16 @@ THREE.BufferGeometry.prototype = {
 
 		if ( geometry.uvsNeedUpdate ) {
 
-				var attribute = this.attributes.uv;
+			var attribute = this.attributes.uv;
 
-				if ( attribute !== undefined ) {
+			if ( attribute !== undefined ) {
 
-						attribute.copyVector2sArray( geometry.uvs );
-						attribute.needsUpdate = true;
+				attribute.copyVector2sArray( geometry.uvs );
+				attribute.needsUpdate = true;
 
-				}
+			}
 
-				geometry.uvsNeedUpdate = false;
+			geometry.uvsNeedUpdate = false;
 
 		}
 
@@ -11862,11 +11862,11 @@ THREE.BufferGeometry.prototype = {
 
 				// reset existing normals to zero
 
-				var normals = attributes.normal.array;
+				var array = attributes.normal.array;
 
-				for ( var i = 0, il = normals.length; i < il; i ++ ) {
+				for ( var i = 0, il = array.length; i < il; i ++ ) {
 
-					normals[ i ] = 0;
+					array[ i ] = 0;
 
 				}
 
@@ -11978,7 +11978,7 @@ THREE.BufferGeometry.prototype = {
 
 	computeOffsets: function ( size ) {
 
-		console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.');
+		console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
 
 	},
 
@@ -16185,11 +16185,13 @@ THREE.Audio.prototype.setBuffer = function ( audioBuffer ) {
 
 	var scope = this;
 
-	audioBuffer.onReady(function(buffer) {
+	audioBuffer.onReady( function( buffer ) {
+
 		scope.source.buffer = buffer;
 		scope.sourceType = 'buffer';
 		if ( scope.autoplay ) scope.play();
-	});
+
+	} );
 
 	return this;
 
@@ -16439,7 +16441,7 @@ THREE.AudioBuffer.prototype.load = function ( file ) {
 
 			for ( var i = 0; i < scope.readyCallbacks.length; i ++ ) {
 
-				scope.readyCallbacks[i](scope.buffer);
+				scope.readyCallbacks[ i ]( scope.buffer );
 
 			}
 
@@ -16492,7 +16494,6 @@ THREE.PositionalAudio.prototype.getOutput = function () {
 
 };
 
-
 THREE.PositionalAudio.prototype.setRefDistance = function ( value ) {
 
 	this.panner.refDistance = value;
@@ -16541,7 +16542,6 @@ THREE.PositionalAudio.prototype.getMaxDistance = function () {
 
 };
 
-
 THREE.PositionalAudio.prototype.updateMatrixWorld = ( function () {
 
 	var position = new THREE.Vector3();
@@ -16599,7 +16599,7 @@ THREE.AudioListener.prototype.removeFilter = function ( ) {
 
 	}
 
-}
+};
 
 THREE.AudioListener.prototype.setFilter = function ( value ) {
 
@@ -16864,20 +16864,20 @@ THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () {
 };
 
 THREE.OrthographicCamera.prototype.copy = function ( source ) {
-	
+
 	THREE.Camera.prototype.copy.call( this, source );
-	
+
 	this.left = source.left;
 	this.right = source.right;
 	this.top = source.top;
 	this.bottom = source.bottom;
 	this.near = source.near;
 	this.far = source.far;
-	
+
 	this.zoom = source.zoom;
-	
+
 	return this;
-		
+
 };
 
 THREE.OrthographicCamera.prototype.toJSON = function ( meta ) {
@@ -17023,18 +17023,18 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
 };
 
 THREE.PerspectiveCamera.prototype.copy = function ( source ) {
-	
+
 	THREE.Camera.prototype.copy.call( this, source );
-	
+
 	this.fov = source.fov;
 	this.aspect = source.aspect;
 	this.near = source.near;
 	this.far = source.far;
-	
+
 	this.zoom = source.zoom;
-	
+
 	return this;
-		
+
 };
 
 THREE.PerspectiveCamera.prototype.toJSON = function ( meta ) {
@@ -26630,6 +26630,14 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			uvScaleMap = material.bumpMap;
 
+		} else if ( material.roughnessMap ) {
+
+			uvScaleMap = material.roughnessMap;
+
+		} else if ( material.metalnessMap ) {
+
+			uvScaleMap = material.metalnessMap;
+
 		} else if ( material.alphaMap ) {
 
 			uvScaleMap = material.alphaMap;
@@ -26642,7 +26650,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		if ( uvScaleMap !== undefined ) {
 
-			if ( uvScaleMap instanceof THREE.WebGLRenderTarget ) uvScaleMap = uvScaleMap.texture;
+			if ( uvScaleMap instanceof THREE.WebGLRenderTarget ) {
+
+				uvScaleMap = uvScaleMap.texture;
+
+			}
+
 			var offset = uvScaleMap.offset;
 			var repeat = uvScaleMap.repeat;
 
@@ -27050,9 +27063,9 @@ THREE.WebGLRenderer = function ( parameters ) {
 				case 'sa':
 
 					// TODO: Optimize this.
-					for( var i = 0; i < value.length; i ++ ) {
+					for ( var i = 0; i < value.length; i ++ ) {
 
-						for( var propertyName in uniform.properties ) {
+						for ( var propertyName in uniform.properties ) {
 
 							var property = uniform.properties[ propertyName ];
 							var locationProperty =  location[ i ][ propertyName ];
@@ -27385,7 +27398,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				} else {
 
-					uniforms.shadow = -1;
+					uniforms.shadow = - 1;
 
 				}
 
@@ -27411,7 +27424,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				} else {
 
-					uniforms.shadow = -1;
+					uniforms.shadow = - 1;
 
 				}
 
@@ -27444,7 +27457,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				} else {
 
-					uniforms.shadow = -1;
+					uniforms.shadow = - 1;
 
 				}
 
@@ -29141,49 +29154,66 @@ THREE.WebGLProgram = ( function () {
 
 			//console.log("THREE.WebGLProgram: ACTIVE UNIFORM:", name);
 
-			var matches = structRe.exec(name);
-			if( matches ) {
+			var matches = structRe.exec( name );
+			if ( matches ) {
 
-				var structName = matches[1];
-				var structProperty = matches[2];
+				var structName = matches[ 1 ];
+				var structProperty = matches[ 2 ];
 
 				var uniformsStruct = uniforms[ structName ];
-				if( ! uniformsStruct ) {
+
+				if ( ! uniformsStruct ) {
+
 					uniformsStruct = uniforms[ structName ] = {};
+
 				}
+
 				uniformsStruct[ structProperty ] = location;
 
 				continue;
+
 			}
 
-			matches = arrayStructRe.exec(name);
-			if( matches ) {
+			matches = arrayStructRe.exec( name );
 
-				var arrayName = matches[1];
-				var arrayIndex = matches[2];
-				var arrayProperty = matches[3];
+			if ( matches ) {
+
+				var arrayName = matches[ 1 ];
+				var arrayIndex = matches[ 2 ];
+				var arrayProperty = matches[ 3 ];
 
 				var uniformsArray = uniforms[ arrayName ];
-				if( ! uniformsArray ) {
+
+				if ( ! uniformsArray ) {
+
 					uniformsArray = uniforms[ arrayName ] = [];
+
 				}
+
 				var uniformsArrayIndex = uniformsArray[ arrayIndex ];
-				if( ! uniformsArrayIndex ) {
+
+				if ( ! uniformsArrayIndex ) {
+
 					uniformsArrayIndex = uniformsArray[ arrayIndex ] = {};
+
 				}
+
 				uniformsArrayIndex[ arrayProperty ] = location;
 
 				continue;
+
 			}
 
-			matches = arrayRe.exec(name)
-			if( matches ) {
+			matches = arrayRe.exec( name );
+
+			if ( matches ) {
 
-				var arrayName = matches[1];
+				var arrayName = matches[ 1 ];
 
 				uniforms[ arrayName ] = location;
 
 				continue;
+
 			}
 
 			uniforms[ name ] = location;

+ 43 - 43
build/three.min.js

@@ -603,49 +603,49 @@ c instanceof THREE.MeshStandardMaterial||c.envMap)&&void 0!==q.cameraPosition&&(
 r.uniformMatrix4fv(q.bindMatrix,!1,d.bindMatrix.elements),d.bindMatrixInverse&&void 0!==q.bindMatrixInverse&&r.uniformMatrix4fv(q.bindMatrixInverse,!1,d.bindMatrixInverse.elements),ca.floatVertexTextures&&d.skeleton&&d.skeleton.useVertexTexture?(void 0!==q.boneTexture&&(m=t(),r.uniform1i(q.boneTexture,m),Z.setTexture(d.skeleton.boneTexture,m)),void 0!==q.boneTextureWidth&&r.uniform1i(q.boneTextureWidth,d.skeleton.boneTextureWidth),void 0!==q.boneTextureHeight&&r.uniform1i(q.boneTextureHeight,d.skeleton.boneTextureHeight)):
 d.skeleton&&d.skeleton.boneMatrices&&void 0!==q.boneGlobalMatrices&&r.uniformMatrix4fv(q.boneGlobalMatrices,!1,d.skeleton.boneMatrices));if(l){if(c instanceof THREE.MeshPhongMaterial||c instanceof THREE.MeshLambertMaterial||c instanceof THREE.MeshStandardMaterial||c.lights)l=n,g.ambientLightColor.needsUpdate=l,g.directionalLights.needsUpdate=l,g.pointLights.needsUpdate=l,g.spotLights.needsUpdate=l,g.hemisphereLights.needsUpdate=l;b&&c.fog&&(g.fogColor.value=b.color,b instanceof THREE.Fog?(g.fogNear.value=
 b.near,g.fogFar.value=b.far):b instanceof THREE.FogExp2&&(g.fogDensity.value=b.density));if(c instanceof THREE.MeshBasicMaterial||c instanceof THREE.MeshLambertMaterial||c instanceof THREE.MeshPhongMaterial||c instanceof THREE.MeshStandardMaterial){g.opacity.value=c.opacity;g.diffuse.value=c.color;c.emissive&&(g.emissive.value=c.emissive);g.map.value=c.map;g.specularMap.value=c.specularMap;g.alphaMap.value=c.alphaMap;c.aoMap&&(g.aoMap.value=c.aoMap,g.aoMapIntensity.value=c.aoMapIntensity);var p;c.map?
-p=c.map:c.specularMap?p=c.specularMap:c.displacementMap?p=c.displacementMap:c.normalMap?p=c.normalMap:c.bumpMap?p=c.bumpMap:c.alphaMap?p=c.alphaMap:c.emissiveMap&&(p=c.emissiveMap);void 0!==p&&(p instanceof THREE.WebGLRenderTarget&&(p=p.texture),b=p.offset,p=p.repeat,g.offsetRepeat.value.set(b.x,b.y,p.x,p.y));g.envMap.value=c.envMap;g.flipEnvMap.value=c.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;g.reflectivity.value=c.reflectivity;g.refractionRatio.value=c.refractionRatio}c instanceof THREE.LineBasicMaterial?
-(g.diffuse.value=c.color,g.opacity.value=c.opacity):c instanceof THREE.LineDashedMaterial?(g.diffuse.value=c.color,g.opacity.value=c.opacity,g.dashSize.value=c.dashSize,g.totalSize.value=c.dashSize+c.gapSize,g.scale.value=c.scale):c instanceof THREE.PointsMaterial?(g.psColor.value=c.color,g.opacity.value=c.opacity,g.size.value=c.size*E,g.scale.value=M.height/2,g.map.value=c.map,null!==c.map&&(p=c.map.offset,b=c.map.repeat,g.offsetRepeat.value.set(p.x,p.y,b.x,b.y))):c instanceof THREE.MeshPhongMaterial?
-(g.specular.value=c.specular,g.shininess.value=Math.max(c.shininess,1E-4),c.lightMap&&(g.lightMap.value=c.lightMap,g.lightMapIntensity.value=c.lightMapIntensity),c.emissiveMap&&(g.emissiveMap.value=c.emissiveMap),c.bumpMap&&(g.bumpMap.value=c.bumpMap,g.bumpScale.value=c.bumpScale),c.normalMap&&(g.normalMap.value=c.normalMap,g.normalScale.value.copy(c.normalScale)),c.displacementMap&&(g.displacementMap.value=c.displacementMap,g.displacementScale.value=c.displacementScale,g.displacementBias.value=c.displacementBias)):
-c instanceof THREE.MeshStandardMaterial?(g.roughness.value=c.roughness,g.metalness.value=c.metalness,c.roughnessMap&&(g.roughnessMap.value=c.roughnessMap),c.metalnessMap&&(g.metalnessMap.value=c.metalnessMap),c.lightMap&&(g.lightMap.value=c.lightMap,g.lightMapIntensity.value=c.lightMapIntensity),c.emissiveMap&&(g.emissiveMap.value=c.emissiveMap),c.bumpMap&&(g.bumpMap.value=c.bumpMap,g.bumpScale.value=c.bumpScale),c.normalMap&&(g.normalMap.value=c.normalMap,g.normalScale.value.copy(c.normalScale)),
-c.displacementMap&&(g.displacementMap.value=c.displacementMap,g.displacementScale.value=c.displacementScale,g.displacementBias.value=c.displacementBias),c.envMap&&(g.envMapIntensity.value=c.envMapIntensity)):c instanceof THREE.MeshDepthMaterial?(g.mNear.value=a.near,g.mFar.value=a.far,g.opacity.value=c.opacity):c instanceof THREE.MeshNormalMaterial&&(g.opacity.value=c.opacity);if(ya.enabled&&d.receiveShadow&&!c._shadowPass&&g.shadowMatrix)for(c=U.shadows,p=0,b=c.length;p<b;p++)l=c[p],n=l.shadow,l instanceof
-THREE.PointLight?(X.setFromMatrixPosition(l.matrixWorld).negate(),n.matrix.identity().setPosition(X),g.shadowDarkness.value[p]=-n.darkness):g.shadowDarkness.value[p]=n.darkness,g.shadowBias.value[p]=n.bias,g.shadowMap.value[p]=n.map,g.shadowMapSize.value[p]=n.mapSize,g.shadowMatrix.value[p]=n.matrix;v(e.uniformsList)}r.uniformMatrix4fv(q.modelViewMatrix,!1,d.modelViewMatrix.elements);q.normalMatrix&&r.uniformMatrix3fv(q.normalMatrix,!1,d.normalMatrix.elements);void 0!==q.modelMatrix&&r.uniformMatrix4fv(q.modelMatrix,
-!1,d.matrixWorld.elements);if(!0===e.hasDynamicUniforms){e=e.uniformsList;c=[];p=0;for(b=e.length;p<b;p++)q=e[p][0],g=q.onUpdateCallback,void 0!==g&&(g.bind(q)(d,a),c.push(e[p]));v(c)}return f}function t(){var a=sa;a>=ca.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ca.maxTextures);sa+=1;return a}function v(a){for(var b,c,d=0,e=a.length;d<e;d++){var f=a[d][0];if(!1!==f.needsUpdate){var g=f.type;b=f.value;var h=a[d][1];switch(g){case "1i":r.uniform1i(h,
-b);break;case "1f":r.uniform1f(h,b);break;case "2f":r.uniform2f(h,b[0],b[1]);break;case "3f":r.uniform3f(h,b[0],b[1],b[2]);break;case "4f":r.uniform4f(h,b[0],b[1],b[2],b[3]);break;case "1iv":r.uniform1iv(h,b);break;case "3iv":r.uniform3iv(h,b);break;case "1fv":r.uniform1fv(h,b);break;case "2fv":r.uniform2fv(h,b);break;case "3fv":r.uniform3fv(h,b);break;case "4fv":r.uniform4fv(h,b);break;case "Matrix2fv":r.uniformMatrix2fv(h,!1,b);break;case "Matrix3fv":r.uniformMatrix3fv(h,!1,b);break;case "Matrix4fv":r.uniformMatrix4fv(h,
-!1,b);break;case "i":r.uniform1i(h,b);break;case "f":r.uniform1f(h,b);break;case "v2":r.uniform2f(h,b.x,b.y);break;case "v3":r.uniform3f(h,b.x,b.y,b.z);break;case "v4":r.uniform4f(h,b.x,b.y,b.z,b.w);break;case "c":r.uniform3f(h,b.r,b.g,b.b);break;case "sa":for(g=0;g<b.length;g++)for(var k in f.properties){var l=h[g][k];c=b[g][k];switch(f.properties[k].type){case "i":r.uniform1i(l,c);break;case "f":r.uniform1f(l,c);break;case "v2":r.uniform2f(l,c.x,c.y);break;case "v3":r.uniform3f(l,c.x,c.y,c.z);break;
-case "v4":r.uniform4f(l,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(l,c.r,c.g,c.b)}}break;case "iv1":r.uniform1iv(h,b);break;case "iv":r.uniform3iv(h,b);break;case "fv1":r.uniform1fv(h,b);break;case "fv":r.uniform3fv(h,b);break;case "v2v":void 0===f._array&&(f._array=new Float32Array(2*b.length));c=g=0;for(l=b.length;g<l;g++,c+=2)f._array[c+0]=b[g].x,f._array[c+1]=b[g].y;r.uniform2fv(h,f._array);break;case "v3v":void 0===f._array&&(f._array=new Float32Array(3*b.length));c=g=0;for(l=b.length;g<l;g++,
-c+=3)f._array[c+0]=b[g].x,f._array[c+1]=b[g].y,f._array[c+2]=b[g].z;r.uniform3fv(h,f._array);break;case "v4v":void 0===f._array&&(f._array=new Float32Array(4*b.length));c=g=0;for(l=b.length;g<l;g++,c+=4)f._array[c+0]=b[g].x,f._array[c+1]=b[g].y,f._array[c+2]=b[g].z,f._array[c+3]=b[g].w;r.uniform4fv(h,f._array);break;case "m2":r.uniformMatrix2fv(h,!1,b.elements);break;case "m3":r.uniformMatrix3fv(h,!1,b.elements);break;case "m3v":void 0===f._array&&(f._array=new Float32Array(9*b.length));g=0;for(l=
-b.length;g<l;g++)b[g].flattenToArrayOffset(f._array,9*g);r.uniformMatrix3fv(h,!1,f._array);break;case "m4":r.uniformMatrix4fv(h,!1,b.elements);break;case "m4v":void 0===f._array&&(f._array=new Float32Array(16*b.length));g=0;for(l=b.length;g<l;g++)b[g].flattenToArrayOffset(f._array,16*g);r.uniformMatrix4fv(h,!1,f._array);break;case "t":c=t();r.uniform1i(h,c);if(!b)continue;b instanceof THREE.CubeTexture||Array.isArray(b.image)&&6===b.image.length?A(b,c):b instanceof THREE.WebGLRenderTargetCube?z(b.texture,
-c):b instanceof THREE.WebGLRenderTarget?Z.setTexture(b.texture,c):Z.setTexture(b,c);break;case "tv":void 0===f._array&&(f._array=[]);g=0;for(l=f.value.length;g<l;g++)f._array[g]=t();r.uniform1iv(h,f._array);g=0;for(l=f.value.length;g<l;g++)b=f.value[g],c=f._array[g],b&&(b instanceof THREE.CubeTexture||b.image instanceof Array&&6===b.image.length?A(b,c):b instanceof THREE.WebGLRenderTarget?Z.setTexture(b.texture,c):b instanceof THREE.WebGLRenderTargetCube?z(b.texture,c):Z.setTexture(b,c));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
-g)}}}}function D(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,B(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,B(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,B(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,B(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),r.texParameteri(a,r.TEXTURE_MAG_FILTER,G(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,G(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));!(c=W.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===W.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===W.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,Z.getMaxAnisotropy())),V.get(b).__currentAnisotropy=b.anisotropy)}function w(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 C(a){return THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height)}function A(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",f),c.__image__webglTextureCube=r.createTexture(),ga.textures++);I.activeTexture(r.TEXTURE0+b);I.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,g=[],h=0;6>h;h++)g[h]=!Z.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:w(a.image[h],ca.maxCubemapSize);var k=C(g[0]),l=B(a.format),n=B(a.type);D(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var m,q=g[h].mipmaps,p=0,s=q.length;p<s;p++)m=q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(l)?I.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,
-m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,m.width,m.height,0,l,n,m.data);else e?I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,g[h].width,g[h].height,0,l,n,g[h].data):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,l,n,g[h]);a.generateMipmaps&&k&&r.generateMipmap(r.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else I.activeTexture(r.TEXTURE0+
-b),I.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_CUBE_MAP,V.get(a).__webglTexture)}function y(a,b,c,d){var e=B(b.texture.format),f=B(b.texture.type);I.texImage2D(d,0,e,b.width,b.height,0,e,f,null);r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,c,d,V.get(b.texture).__webglTexture,0);r.bindFramebuffer(r.FRAMEBUFFER,null)}function H(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);r.bindRenderbuffer(r.RENDERBUFFER,null)}function G(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
-a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function B(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=W.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=W.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=W.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=W.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 M=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==
-a.context?a.context:null,O=M.width,J=M.height,E=1,K=void 0!==a.alpha?a.alpha:!1,P=void 0!==a.depth?a.depth:!0,S=void 0!==a.stencil?a.stencil:!0,Q=void 0!==a.antialias?a.antialias:!1,L=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,R=new THREE.Color(0),T=0,Y=[],aa=[],ba=-1,da=[],ea=-1,ta=new Float32Array(8),ha=[],$=[];this.domElement=M;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 Z=this,wa=null,ua=null,qa=-1,na="",ma=null,sa=0,ia=0,ja=0,ka=M.width,la=M.height,za=0,Aa=0,xa=new THREE.Frustum,ra=new THREE.Matrix4,X=new THREE.Vector3,U={hash:"",ambient:[0,0,0],directional:[],point:[],spot:[],hemi:[],shadows:[],shadowsPointLight:0},ga={geometries:0,textures:0},fa={calls:0,vertices:0,faces:0,points:0};this.info={render:fa,memory:ga,
-programs:null};var r;try{K={alpha:K,depth:P,stencil:S,antialias:Q,premultipliedAlpha:L,preserveDrawingBuffer:F};r=N||M.getContext("webgl",K)||M.getContext("experimental-webgl",K);if(null===r){if(null!==M.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}M.addEventListener("webglcontextlost",e,!1)}catch(Ba){console.error("THREE.WebGLRenderer: "+Ba)}var W=new THREE.WebGLExtensions(r);W.get("OES_texture_float");W.get("OES_texture_float_linear");
-W.get("OES_texture_half_float");W.get("OES_texture_half_float_linear");W.get("OES_standard_derivatives");W.get("ANGLE_instanced_arrays");W.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ca=new THREE.WebGLCapabilities(r,W,a),I=new THREE.WebGLState(r,W,B),V=new THREE.WebGLProperties,pa=new THREE.WebGLObjects(r,V,this.info),oa=new THREE.WebGLPrograms(this,ca),va=new THREE.WebGLLights;this.info.programs=oa.programs;var Ca=new THREE.WebGLBufferRenderer(r,W,fa),Da=new THREE.WebGLIndexedBufferRenderer(r,
-W,fa);c();this.context=r;this.capabilities=ca;this.extensions=W;this.state=I;var ya=new THREE.WebGLShadowMap(this,U,pa);this.shadowMap=ya;var Ea=new THREE.SpritePlugin(this,ha),Fa=new THREE.LensFlarePlugin(this,$);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");
-return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ca.precision};this.getPixelRatio=function(){return E};this.setPixelRatio=function(a){void 0!==a&&(E=a)};this.getSize=function(){return{width:O,height:J}};this.setSize=function(a,b,c){O=a;J=b;M.width=a*E;M.height=b*E;!1!==c&&(M.style.width=a+"px",M.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ia=a*E;ja=b*E;ka=c*E;la=d*E;r.viewport(ia,ja,ka,la)};this.getViewport=
-function(a){a.x=ia/E;a.y=ja/E;a.z=ka/E;a.w=la/E};this.setScissor=function(a,b,c,d){r.scissor(a*E,b*E,c*E,d*E)};this.enableScissorTest=function(a){I.setScissorTest(a)};this.getClearColor=function(){return R};this.setClearColor=function(a,c){R.set(a);T=void 0!==c?c:1;b(R.r,R.g,R.b,T)};this.getClearAlpha=function(){return T};this.setClearAlpha=function(a){T=a;b(R.r,R.g,R.b,T)};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(){M.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){I.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),I.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&&"MeshStandardMaterial"!==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);I.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),I.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),I.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));I.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,g){u(d);var f=x(a,b,d,e),h=!1;a=c.id+"_"+f.id+"_"+d.wireframe;a!==na&&(na=a,h=!0);b=e.morphTargetInfluences;if(void 0!==
-b){a=[];for(var k=0,h=b.length;k<h;k++){var n=b[k];a.push([n,k])}a.sort(l);8<a.length&&(a.length=8);for(var m=c.morphAttributes,k=0,h=a.length;k<h;k++)n=a[k],ta[k]=n[0],0!==n[0]?(b=n[1],!0===d.morphTargets&&m.position&&c.addAttribute("morphTarget"+k,m.position[b]),!0===d.morphNormals&&m.normal&&c.addAttribute("morphNormal"+k,m.normal[b])):(!0===d.morphTargets&&c.removeAttribute("morphTarget"+k),!0===d.morphNormals&&c.removeAttribute("morphNormal"+k));a=f.getUniforms();null!==a.morphTargetInfluences&&
-r.uniform1fv(a.morphTargetInfluences,ta);h=!0}b=c.index;k=c.attributes.position;!0===d.wireframe&&(b=pa.getWireframeAttribute(c));null!==b?(a=Da,a.setIndex(b)):a=Ca;if(h){a:{var h=void 0,q;if(c instanceof THREE.InstancedBufferGeometry&&(q=W.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===h&&(h=0);I.initAttributes();var n=c.attributes,
-f=f.getAttributes(),m=d.defaultAttributeValues,p;for(p in f){var s=f[p];if(0<=s){var t=n[p];if(void 0!==t){var v=t.itemSize,w=pa.getAttributeBuffer(t);if(t instanceof THREE.InterleavedBufferAttribute){var B=t.data,D=B.stride,t=t.offset;B instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(s,B.meshPerAttribute,q),void 0===c.maxInstancedCount&&(c.maxInstancedCount=B.meshPerAttribute*B.count)):I.enableAttribute(s);r.bindBuffer(r.ARRAY_BUFFER,w);r.vertexAttribPointer(s,v,r.FLOAT,
-!1,D*B.array.BYTES_PER_ELEMENT,(h*D+t)*B.array.BYTES_PER_ELEMENT)}else t instanceof THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(s,t.meshPerAttribute,q),void 0===c.maxInstancedCount&&(c.maxInstancedCount=t.meshPerAttribute*t.count)):I.enableAttribute(s),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(s,v,r.FLOAT,!1,0,h*v*4)}else if(void 0!==m&&(v=m[p],void 0!==v))switch(v.length){case 2:r.vertexAttrib2fv(s,v);break;case 3:r.vertexAttrib3fv(s,v);break;case 4:r.vertexAttrib4fv(s,
-v);break;default:r.vertexAttrib1fv(s,v)}}}I.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,pa.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==k&&(q=k.count);p=c.drawRange.start;b=c.drawRange.count;k=null!==g?g.start:0;h=null!==g?g.count:Infinity;g=Math.max(0,p,k);q=Math.min(0+q,p+b,k+h)-1;q=Math.max(0,q-g+1);if(e instanceof THREE.Mesh)if(!0===d.wireframe)I.setLineWidth(d.wireframeLinewidth*E),a.setMode(r.LINES);else switch(e.drawMode){case THREE.TrianglesDrawMode:a.setMode(r.TRIANGLES);
+p=c.map:c.specularMap?p=c.specularMap:c.displacementMap?p=c.displacementMap:c.normalMap?p=c.normalMap:c.bumpMap?p=c.bumpMap:c.roughnessMap?p=c.roughnessMap:c.metalnessMap?p=c.metalnessMap:c.alphaMap?p=c.alphaMap:c.emissiveMap&&(p=c.emissiveMap);void 0!==p&&(p instanceof THREE.WebGLRenderTarget&&(p=p.texture),b=p.offset,p=p.repeat,g.offsetRepeat.value.set(b.x,b.y,p.x,p.y));g.envMap.value=c.envMap;g.flipEnvMap.value=c.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;g.reflectivity.value=c.reflectivity;
+g.refractionRatio.value=c.refractionRatio}c instanceof THREE.LineBasicMaterial?(g.diffuse.value=c.color,g.opacity.value=c.opacity):c instanceof THREE.LineDashedMaterial?(g.diffuse.value=c.color,g.opacity.value=c.opacity,g.dashSize.value=c.dashSize,g.totalSize.value=c.dashSize+c.gapSize,g.scale.value=c.scale):c instanceof THREE.PointsMaterial?(g.psColor.value=c.color,g.opacity.value=c.opacity,g.size.value=c.size*E,g.scale.value=M.height/2,g.map.value=c.map,null!==c.map&&(p=c.map.offset,b=c.map.repeat,
+g.offsetRepeat.value.set(p.x,p.y,b.x,b.y))):c instanceof THREE.MeshPhongMaterial?(g.specular.value=c.specular,g.shininess.value=Math.max(c.shininess,1E-4),c.lightMap&&(g.lightMap.value=c.lightMap,g.lightMapIntensity.value=c.lightMapIntensity),c.emissiveMap&&(g.emissiveMap.value=c.emissiveMap),c.bumpMap&&(g.bumpMap.value=c.bumpMap,g.bumpScale.value=c.bumpScale),c.normalMap&&(g.normalMap.value=c.normalMap,g.normalScale.value.copy(c.normalScale)),c.displacementMap&&(g.displacementMap.value=c.displacementMap,
+g.displacementScale.value=c.displacementScale,g.displacementBias.value=c.displacementBias)):c instanceof THREE.MeshStandardMaterial?(g.roughness.value=c.roughness,g.metalness.value=c.metalness,c.roughnessMap&&(g.roughnessMap.value=c.roughnessMap),c.metalnessMap&&(g.metalnessMap.value=c.metalnessMap),c.lightMap&&(g.lightMap.value=c.lightMap,g.lightMapIntensity.value=c.lightMapIntensity),c.emissiveMap&&(g.emissiveMap.value=c.emissiveMap),c.bumpMap&&(g.bumpMap.value=c.bumpMap,g.bumpScale.value=c.bumpScale),
+c.normalMap&&(g.normalMap.value=c.normalMap,g.normalScale.value.copy(c.normalScale)),c.displacementMap&&(g.displacementMap.value=c.displacementMap,g.displacementScale.value=c.displacementScale,g.displacementBias.value=c.displacementBias),c.envMap&&(g.envMapIntensity.value=c.envMapIntensity)):c instanceof THREE.MeshDepthMaterial?(g.mNear.value=a.near,g.mFar.value=a.far,g.opacity.value=c.opacity):c instanceof THREE.MeshNormalMaterial&&(g.opacity.value=c.opacity);if(ya.enabled&&d.receiveShadow&&!c._shadowPass&&
+g.shadowMatrix)for(c=U.shadows,p=0,b=c.length;p<b;p++)l=c[p],n=l.shadow,l instanceof THREE.PointLight?(X.setFromMatrixPosition(l.matrixWorld).negate(),n.matrix.identity().setPosition(X),g.shadowDarkness.value[p]=-n.darkness):g.shadowDarkness.value[p]=n.darkness,g.shadowBias.value[p]=n.bias,g.shadowMap.value[p]=n.map,g.shadowMapSize.value[p]=n.mapSize,g.shadowMatrix.value[p]=n.matrix;v(e.uniformsList)}r.uniformMatrix4fv(q.modelViewMatrix,!1,d.modelViewMatrix.elements);q.normalMatrix&&r.uniformMatrix3fv(q.normalMatrix,
+!1,d.normalMatrix.elements);void 0!==q.modelMatrix&&r.uniformMatrix4fv(q.modelMatrix,!1,d.matrixWorld.elements);if(!0===e.hasDynamicUniforms){e=e.uniformsList;c=[];p=0;for(b=e.length;p<b;p++)q=e[p][0],g=q.onUpdateCallback,void 0!==g&&(g.bind(q)(d,a),c.push(e[p]));v(c)}return f}function t(){var a=sa;a>=ca.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ca.maxTextures);sa+=1;return a}function v(a){for(var b,c,d=0,e=a.length;d<e;d++){var f=a[d][0];
+if(!1!==f.needsUpdate){var g=f.type;b=f.value;var h=a[d][1];switch(g){case "1i":r.uniform1i(h,b);break;case "1f":r.uniform1f(h,b);break;case "2f":r.uniform2f(h,b[0],b[1]);break;case "3f":r.uniform3f(h,b[0],b[1],b[2]);break;case "4f":r.uniform4f(h,b[0],b[1],b[2],b[3]);break;case "1iv":r.uniform1iv(h,b);break;case "3iv":r.uniform3iv(h,b);break;case "1fv":r.uniform1fv(h,b);break;case "2fv":r.uniform2fv(h,b);break;case "3fv":r.uniform3fv(h,b);break;case "4fv":r.uniform4fv(h,b);break;case "Matrix2fv":r.uniformMatrix2fv(h,
+!1,b);break;case "Matrix3fv":r.uniformMatrix3fv(h,!1,b);break;case "Matrix4fv":r.uniformMatrix4fv(h,!1,b);break;case "i":r.uniform1i(h,b);break;case "f":r.uniform1f(h,b);break;case "v2":r.uniform2f(h,b.x,b.y);break;case "v3":r.uniform3f(h,b.x,b.y,b.z);break;case "v4":r.uniform4f(h,b.x,b.y,b.z,b.w);break;case "c":r.uniform3f(h,b.r,b.g,b.b);break;case "sa":for(g=0;g<b.length;g++)for(var k in f.properties){var l=h[g][k];c=b[g][k];switch(f.properties[k].type){case "i":r.uniform1i(l,c);break;case "f":r.uniform1f(l,
+c);break;case "v2":r.uniform2f(l,c.x,c.y);break;case "v3":r.uniform3f(l,c.x,c.y,c.z);break;case "v4":r.uniform4f(l,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(l,c.r,c.g,c.b)}}break;case "iv1":r.uniform1iv(h,b);break;case "iv":r.uniform3iv(h,b);break;case "fv1":r.uniform1fv(h,b);break;case "fv":r.uniform3fv(h,b);break;case "v2v":void 0===f._array&&(f._array=new Float32Array(2*b.length));c=g=0;for(l=b.length;g<l;g++,c+=2)f._array[c+0]=b[g].x,f._array[c+1]=b[g].y;r.uniform2fv(h,f._array);break;case "v3v":void 0===
+f._array&&(f._array=new Float32Array(3*b.length));c=g=0;for(l=b.length;g<l;g++,c+=3)f._array[c+0]=b[g].x,f._array[c+1]=b[g].y,f._array[c+2]=b[g].z;r.uniform3fv(h,f._array);break;case "v4v":void 0===f._array&&(f._array=new Float32Array(4*b.length));c=g=0;for(l=b.length;g<l;g++,c+=4)f._array[c+0]=b[g].x,f._array[c+1]=b[g].y,f._array[c+2]=b[g].z,f._array[c+3]=b[g].w;r.uniform4fv(h,f._array);break;case "m2":r.uniformMatrix2fv(h,!1,b.elements);break;case "m3":r.uniformMatrix3fv(h,!1,b.elements);break;
+case "m3v":void 0===f._array&&(f._array=new Float32Array(9*b.length));g=0;for(l=b.length;g<l;g++)b[g].flattenToArrayOffset(f._array,9*g);r.uniformMatrix3fv(h,!1,f._array);break;case "m4":r.uniformMatrix4fv(h,!1,b.elements);break;case "m4v":void 0===f._array&&(f._array=new Float32Array(16*b.length));g=0;for(l=b.length;g<l;g++)b[g].flattenToArrayOffset(f._array,16*g);r.uniformMatrix4fv(h,!1,f._array);break;case "t":c=t();r.uniform1i(h,c);if(!b)continue;b instanceof THREE.CubeTexture||Array.isArray(b.image)&&
+6===b.image.length?A(b,c):b instanceof THREE.WebGLRenderTargetCube?z(b.texture,c):b instanceof THREE.WebGLRenderTarget?Z.setTexture(b.texture,c):Z.setTexture(b,c);break;case "tv":void 0===f._array&&(f._array=[]);g=0;for(l=f.value.length;g<l;g++)f._array[g]=t();r.uniform1iv(h,f._array);g=0;for(l=f.value.length;g<l;g++)b=f.value[g],c=f._array[g],b&&(b instanceof THREE.CubeTexture||b.image instanceof Array&&6===b.image.length?A(b,c):b instanceof THREE.WebGLRenderTarget?Z.setTexture(b.texture,c):b instanceof
+THREE.WebGLRenderTargetCube?z(b.texture,c):Z.setTexture(b,c));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+g)}}}}function D(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,B(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,B(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,B(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,B(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),r.texParameteri(a,r.TEXTURE_MAG_FILTER,G(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,G(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));!(c=W.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===W.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===W.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,Z.getMaxAnisotropy())),V.get(b).__currentAnisotropy=b.anisotropy)}function w(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 C(a){return THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height)}function A(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",f),c.__image__webglTextureCube=
+r.createTexture(),ga.textures++);I.activeTexture(r.TEXTURE0+b);I.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,g=[],h=0;6>h;h++)g[h]=!Z.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:w(a.image[h],ca.maxCubemapSize);var k=C(g[0]),l=B(a.format),n=B(a.type);D(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var m,q=g[h].mipmaps,p=0,s=q.length;p<s;p++)m=
+q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(l)?I.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,m.width,m.height,0,l,n,m.data);else e?I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,g[h].width,g[h].height,0,l,n,g[h].data):I.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+
+h,0,l,l,n,g[h]);a.generateMipmaps&&k&&r.generateMipmap(r.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else I.activeTexture(r.TEXTURE0+b),I.bindTexture(r.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){I.activeTexture(r.TEXTURE0+b);I.bindTexture(r.TEXTURE_CUBE_MAP,V.get(a).__webglTexture)}function y(a,b,c,d){var e=B(b.texture.format),f=B(b.texture.type);I.texImage2D(d,0,e,b.width,b.height,0,e,f,null);r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,
+c,d,V.get(b.texture).__webglTexture,0);r.bindFramebuffer(r.FRAMEBUFFER,null)}function H(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);r.bindRenderbuffer(r.RENDERBUFFER,null)}function G(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function B(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=W.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=W.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=W.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=W.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 M=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==a.context?a.context:null,O=M.width,J=M.height,E=1,K=void 0!==a.alpha?a.alpha:!1,P=void 0!==a.depth?a.depth:!0,S=void 0!==a.stencil?a.stencil:!0,Q=void 0!==a.antialias?a.antialias:!1,L=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,R=new THREE.Color(0),
+T=0,Y=[],aa=[],ba=-1,da=[],ea=-1,ta=new Float32Array(8),ha=[],$=[];this.domElement=M;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 Z=this,wa=null,ua=null,qa=-1,na="",ma=null,sa=0,ia=0,ja=0,ka=M.width,la=M.height,za=0,Aa=0,xa=new THREE.Frustum,ra=new THREE.Matrix4,X=new THREE.Vector3,U={hash:"",ambient:[0,
+0,0],directional:[],point:[],spot:[],hemi:[],shadows:[],shadowsPointLight:0},ga={geometries:0,textures:0},fa={calls:0,vertices:0,faces:0,points:0};this.info={render:fa,memory:ga,programs:null};var r;try{K={alpha:K,depth:P,stencil:S,antialias:Q,premultipliedAlpha:L,preserveDrawingBuffer:F};r=N||M.getContext("webgl",K)||M.getContext("experimental-webgl",K);if(null===r){if(null!==M.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";
+}M.addEventListener("webglcontextlost",e,!1)}catch(Ba){console.error("THREE.WebGLRenderer: "+Ba)}var W=new THREE.WebGLExtensions(r);W.get("OES_texture_float");W.get("OES_texture_float_linear");W.get("OES_texture_half_float");W.get("OES_texture_half_float_linear");W.get("OES_standard_derivatives");W.get("ANGLE_instanced_arrays");W.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ca=new THREE.WebGLCapabilities(r,W,a),I=new THREE.WebGLState(r,W,B),V=new THREE.WebGLProperties,
+pa=new THREE.WebGLObjects(r,V,this.info),oa=new THREE.WebGLPrograms(this,ca),va=new THREE.WebGLLights;this.info.programs=oa.programs;var Ca=new THREE.WebGLBufferRenderer(r,W,fa),Da=new THREE.WebGLIndexedBufferRenderer(r,W,fa);c();this.context=r;this.capabilities=ca;this.extensions=W;this.state=I;var ya=new THREE.WebGLShadowMap(this,U,pa);this.shadowMap=ya;var Ea=new THREE.SpritePlugin(this,ha),Fa=new THREE.LensFlarePlugin(this,$);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};
+this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ca.precision};this.getPixelRatio=function(){return E};this.setPixelRatio=function(a){void 0!==a&&(E=a)};this.getSize=function(){return{width:O,height:J}};this.setSize=function(a,b,c){O=a;J=b;
+M.width=a*E;M.height=b*E;!1!==c&&(M.style.width=a+"px",M.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ia=a*E;ja=b*E;ka=c*E;la=d*E;r.viewport(ia,ja,ka,la)};this.getViewport=function(a){a.x=ia/E;a.y=ja/E;a.z=ka/E;a.w=la/E};this.setScissor=function(a,b,c,d){r.scissor(a*E,b*E,c*E,d*E)};this.enableScissorTest=function(a){I.setScissorTest(a)};this.getClearColor=function(){return R};this.setClearColor=function(a,c){R.set(a);T=void 0!==c?c:1;b(R.r,R.g,R.b,T)};this.getClearAlpha=
+function(){return T};this.setClearAlpha=function(a){T=a;b(R.r,R.g,R.b,T)};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(){M.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){I.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),I.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&&"MeshStandardMaterial"!==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);I.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),I.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),I.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));I.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);
+a.count=0};this.renderBufferDirect=function(a,b,c,d,e,g){u(d);var f=x(a,b,d,e),h=!1;a=c.id+"_"+f.id+"_"+d.wireframe;a!==na&&(na=a,h=!0);b=e.morphTargetInfluences;if(void 0!==b){a=[];for(var k=0,h=b.length;k<h;k++){var n=b[k];a.push([n,k])}a.sort(l);8<a.length&&(a.length=8);for(var m=c.morphAttributes,k=0,h=a.length;k<h;k++)n=a[k],ta[k]=n[0],0!==n[0]?(b=n[1],!0===d.morphTargets&&m.position&&c.addAttribute("morphTarget"+k,m.position[b]),!0===d.morphNormals&&m.normal&&c.addAttribute("morphNormal"+k,
+m.normal[b])):(!0===d.morphTargets&&c.removeAttribute("morphTarget"+k),!0===d.morphNormals&&c.removeAttribute("morphNormal"+k));a=f.getUniforms();null!==a.morphTargetInfluences&&r.uniform1fv(a.morphTargetInfluences,ta);h=!0}b=c.index;k=c.attributes.position;!0===d.wireframe&&(b=pa.getWireframeAttribute(c));null!==b?(a=Da,a.setIndex(b)):a=Ca;if(h){a:{var h=void 0,q;if(c instanceof THREE.InstancedBufferGeometry&&(q=W.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===h&&(h=0);I.initAttributes();var n=c.attributes,f=f.getAttributes(),m=d.defaultAttributeValues,p;for(p in f){var s=f[p];if(0<=s){var t=n[p];if(void 0!==t){var v=t.itemSize,w=pa.getAttributeBuffer(t);if(t instanceof THREE.InterleavedBufferAttribute){var B=t.data,D=B.stride,t=t.offset;B instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(s,B.meshPerAttribute,q),void 0===c.maxInstancedCount&&(c.maxInstancedCount=B.meshPerAttribute*B.count)):I.enableAttribute(s);r.bindBuffer(r.ARRAY_BUFFER,
+w);r.vertexAttribPointer(s,v,r.FLOAT,!1,D*B.array.BYTES_PER_ELEMENT,(h*D+t)*B.array.BYTES_PER_ELEMENT)}else t instanceof THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(s,t.meshPerAttribute,q),void 0===c.maxInstancedCount&&(c.maxInstancedCount=t.meshPerAttribute*t.count)):I.enableAttribute(s),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(s,v,r.FLOAT,!1,0,h*v*4)}else if(void 0!==m&&(v=m[p],void 0!==v))switch(v.length){case 2:r.vertexAttrib2fv(s,v);break;case 3:r.vertexAttrib3fv(s,
+v);break;case 4:r.vertexAttrib4fv(s,v);break;default:r.vertexAttrib1fv(s,v)}}}I.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,pa.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==k&&(q=k.count);p=c.drawRange.start;b=c.drawRange.count;k=null!==g?g.start:0;h=null!==g?g.count:Infinity;g=Math.max(0,p,k);q=Math.min(0+q,p+b,k+h)-1;q=Math.max(0,q-g+1);if(e instanceof THREE.Mesh)if(!0===d.wireframe)I.setLineWidth(d.wireframeLinewidth*E),a.setMode(r.LINES);else switch(e.drawMode){case THREE.TrianglesDrawMode:a.setMode(r.TRIANGLES);
 break;case THREE.TriangleStripDrawMode:a.setMode(r.TRIANGLE_STRIP);break;case THREE.TriangleFanDrawMode:a.setMode(r.TRIANGLE_FAN)}else e instanceof THREE.Line?(d=d.linewidth,void 0===d&&(d=1),I.setLineWidth(d*E),e instanceof THREE.LineSegments?a.setMode(r.LINES):a.setMode(r.LINE_STRIP)):e instanceof THREE.Points&&a.setMode(r.POINTS);c instanceof THREE.InstancedBufferGeometry&&0<c.maxInstancedCount?a.renderInstances(c,g,q):a.render(g,q)};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;na="";qa=-1;ma=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);xa.setFromMatrix(ra);Y.length=0;ea=ba=-1;ha.length=0;$.length=0;q(a,b);aa.length=ba+1;da.length=ea+1;!0===Z.sortObjects&&(aa.sort(m),da.sort(p));var g=Y,f,h,k,l=0,n=0,t=0,v,u,B,w=b.matrixWorldInverse,x=0,D=0,z=0,A=0,E=0;f=U.shadowsPointLight=0;for(h=g.length;f<h;f++)if(k=g[f],
 v=k.color,u=k.intensity,B=k.distance,k instanceof THREE.AmbientLight)l+=v.r,n+=v.g,t+=v.b;else if(k instanceof THREE.DirectionalLight){var y=va.get(k);y.direction.setFromMatrixPosition(k.matrixWorld);X.setFromMatrixPosition(k.target.matrixWorld);y.direction.sub(X);y.direction.transformDirection(w);y.color.copy(k.color).multiplyScalar(k.intensity);k.castShadow?(y.shadow=E,U.shadows[E++]=k):y.shadow=-1;U.directional[x++]=y}else k instanceof THREE.PointLight?(y=va.get(k),y.position.setFromMatrixPosition(k.matrixWorld),