Browse Source

Merge changes from mrdoob/dev into dev

Conflicts:
	build/three.js
	build/three.min.js
	src/core/Object3D.js
Daniel 9 years ago
parent
commit
8597c9a37b

+ 15 - 4
build/three.js

@@ -14929,9 +14929,11 @@ THREE.XHRLoader.prototype = {
 
 		request.addEventListener( 'load', function ( event ) {
 
-			THREE.Cache.add( url, this.response );
+			var response = event.target.response;
 
-			if ( onLoad ) onLoad( this.response );
+			THREE.Cache.add( url, response );
+
+			if ( onLoad ) onLoad( response );
 
 			scope.manager.itemEnd( url );
 
@@ -23340,7 +23342,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 	function refreshUniformsPhong ( uniforms, material ) {
 
 		uniforms.specular.value = material.specular;
-		uniforms.shininess.value = material.shininess;
+		uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )
 
 		if ( material.lightMap ) {
 
@@ -34580,7 +34582,8 @@ THREE.TubeGeometry = function ( path, segments, radius, radialSegments, closed,
 		segments: segments,
 		radius: radius,
 		radialSegments: radialSegments,
-		closed: closed
+		closed: closed,
+		taper: taper
 	};
 
 	segments = segments || 64;
@@ -34695,6 +34698,14 @@ THREE.TubeGeometry = function ( path, segments, radius, radialSegments, closed,
 
 THREE.TubeGeometry.prototype = Object.create( THREE.Geometry.prototype );
 THREE.TubeGeometry.prototype.constructor = THREE.TubeGeometry;
+THREE.TubeGeometry.prototype.clone = function() {
+
+	return new this.constructor( this.parameters.path,
+		this.parameters.segments, this.parameters.radius, this.parameters.radialSegments,
+		this.parameters.closed, this.parameters.taper
+	);
+
+};
 
 THREE.TubeGeometry.NoTaper = function ( u ) {
 

+ 66 - 64
build/three.min.js

@@ -331,7 +331,7 @@ b.colorDiffuse?l.color=f(b.colorDiffuse):b.DbgColor&&(l.color=b.DbgColor);b.colo
 b.mapDiffuseAnisotropy),b.mapLight&&g(l,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap,b.mapLightAnisotropy),b.mapAO&&g(l,"aoMap",b.mapAO,b.mapAORepeat,b.mapAOOffset,b.mapAOWrap,b.mapAOAnisotropy),b.mapBump&&g(l,"bumpMap",b.mapBump,b.mapBumpRepeat,b.mapBumpOffset,b.mapBumpWrap,b.mapBumpAnisotropy),b.mapNormal&&g(l,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap,b.mapNormalAnisotropy),b.mapSpecular&&g(l,"specularMap",b.mapSpecular,b.mapSpecularRepeat,
 b.mapSpecularOffset,b.mapSpecularWrap,b.mapSpecularAnisotropy),b.mapAlpha&&g(l,"alphaMap",b.mapAlpha,b.mapAlphaRepeat,b.mapAlphaOffset,b.mapAlphaWrap,b.mapAlphaAnisotropy));b.mapBumpScale&&(l.bumpScale=b.mapBumpScale);b.mapNormalFactor&&(l.normalScale=new THREE.Vector2(b.mapNormalFactor,b.mapNormalFactor));h=new THREE[h](l);void 0!==b.DbgName&&(h.name=b.DbgName);return h}}()};
 THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;b<c;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}};THREE.XHRLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
-THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return b&&setTimeout(function(){b(g)},0),g;var f=new XMLHttpRequest;f.open("GET",a,!0);f.addEventListener("load",function(c){THREE.Cache.add(a,this.response);b&&b(this.response);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);f.addEventListener("error",function(b){d&&d(b);e.manager.itemError(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=
+THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return b&&setTimeout(function(){b(g)},0),g;var f=new XMLHttpRequest;f.open("GET",a,!0);f.addEventListener("load",function(c){c=c.target.response;THREE.Cache.add(a,c);b&&b(c);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);f.addEventListener("error",function(b){d&&d(b);e.manager.itemError(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=
 this.crossOrigin);void 0!==this.responseType&&(f.responseType=this.responseType);void 0!==this.withCredentials&&(f.withCredentials=this.withCredentials);f.send(null);e.manager.itemStart(a);return f},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a},setWithCredentials:function(a){this.withCredentials=a}};THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return e.manager.itemStart(a),b?setTimeout(function(){b(g);e.manager.itemEnd(a)},0):e.manager.itemEnd(a),g;var f=document.createElement("img");f.addEventListener("load",function(c){THREE.Cache.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);f.addEventListener("error",function(b){d&&d(b);e.manager.itemError(a)},
 !1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);e.manager.itemStart(a);f.src=a;return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){"boolean"===typeof a&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),a=void 0);this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
@@ -552,66 +552,67 @@ 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[
 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 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)&&(m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),m.shadowMatrix.identity().setPosition(V),k.shadowDarkness.value[d]=-m.shadowDarkness):k.shadowDarkness.value[d]=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||X.get(b).__currentAnisotropy)||(r.texParameterf(a,
-c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,aa.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]=!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,
-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.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,V=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),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,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=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;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=X.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=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),d=X.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=X.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=X.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(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=X.get(a).__webglFramebuffer;if(g){var h=!1;g!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&A(k.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?
-console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||A(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&S.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&S.get("EXT_color_buffer_half_float")?r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,A(k.format),A(k.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):
-console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&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=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=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||{};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};
+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=Math.max(d.shininess,1E-4),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)&&(m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),m.shadowMatrix.identity().setPosition(V),k.shadowDarkness.value[d]=-m.shadowDarkness):k.shadowDarkness.value[d]=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||X.get(b).__currentAnisotropy)||(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,aa.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]=!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,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.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,V=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),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,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=
+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;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=X.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=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),d=X.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=X.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=X.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(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=X.get(a).__webglFramebuffer;if(g){var h=!1;g!==ia&&
+(r.bindFramebuffer(r.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&A(k.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||A(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&S.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&S.get("EXT_color_buffer_half_float")?
+r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,A(k.format),A(k.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&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=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=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||{};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.");
@@ -822,9 +823,10 @@ THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){function h(a,b,c,d,e){var f=Math
 Array(d);var q=m/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);k.subVectors(q,s);n.addVectors(q,s);p.crossVectors(k,n);n.crossVectors(p,k);p.normalize();n.normalize();for(q=0;q<d;++q){var t=q/d*2*Math.PI,v=-b*Math.cos(t),t=b*Math.sin(t),x=new THREE.Vector3;x.x=s.x+v*n.x+t*p.x;x.y=s.y+v*n.y+t*p.y;x.z=s.z+v*n.z+t*p.z;l[m][q]=this.vertices.push(x)-1}}for(m=0;m<c;++m)for(q=0;q<d;++q)e=(m+1)%c,g=(q+1)%d,a=l[m][q],b=l[e][q],e=l[e][g],g=l[m][g],f=new THREE.Vector2(m/c,q/d),k=new THREE.Vector2((m+1)/c,
 q/d),n=new THREE.Vector2((m+1)/c,(q+1)/d),p=new THREE.Vector2(m/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,k,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([k.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 THREE.TorusKnotGeometry.prototype.clone=function(){return new THREE.TorusKnotGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.p,this.parameters.q,this.parameters.heightScale)};
-THREE.TubeGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,l,k=b+1,n,p,m,q,s,t=new THREE.Vector3,v,x,u;v=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=v.normals;u=v.binormals;this.tangents=v.tangents;this.normals=x;this.binormals=u;for(v=0;v<k;v++)for(f[v]=[],n=v/(k-1),s=a.getPointAt(n),h=x[v],l=u[v],m=c*g(n),n=0;n<d;n++)p=
-n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),t.copy(s),t.x+=q*h.x+p*l.x,t.y+=q*h.y+p*l.y,t.z+=q*h.z+p*l.z,f[v][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(v=0;v<b;v++)for(n=0;n<d;n++)g=e?(v+1)%b:v+1,k=(n+1)%d,a=f[v][n],c=f[g][n],g=f[g][k],k=f[v][k],t=new THREE.Vector2(v/b,n/d),x=new THREE.Vector2((v+1)/b,n/d),u=new THREE.Vector2((v+1)/b,(n+1)/d),h=new THREE.Vector2(v/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,k)),this.faceVertexUvs[0].push([t,x,h]),this.faces.push(new THREE.Face3(c,
-g,k)),this.faceVertexUvs[0].push([x.clone(),u,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
+THREE.TubeGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e,taper:g};b=b||64;c=c||1;d=d||8;e=e||!1;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,l,k=b+1,n,p,m,q,s,t=new THREE.Vector3,v,x,u;v=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=v.normals;u=v.binormals;this.tangents=v.tangents;this.normals=x;this.binormals=u;for(v=0;v<k;v++)for(f[v]=[],n=v/(k-1),s=a.getPointAt(n),h=x[v],l=u[v],m=c*g(n),n=0;n<
+d;n++)p=n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),t.copy(s),t.x+=q*h.x+p*l.x,t.y+=q*h.y+p*l.y,t.z+=q*h.z+p*l.z,f[v][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(v=0;v<b;v++)for(n=0;n<d;n++)g=e?(v+1)%b:v+1,k=(n+1)%d,a=f[v][n],c=f[g][n],g=f[g][k],k=f[v][k],t=new THREE.Vector2(v/b,n/d),x=new THREE.Vector2((v+1)/b,n/d),u=new THREE.Vector2((v+1)/b,(n+1)/d),h=new THREE.Vector2(v/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,k)),this.faceVertexUvs[0].push([t,x,h]),this.faces.push(new THREE.Face3(c,
+g,k)),this.faceVertexUvs[0].push([x.clone(),u,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.prototype.clone=function(){return new this.constructor(this.parameters.path,this.parameters.segments,this.parameters.radius,this.parameters.radialSegments,this.parameters.closed,this.parameters.taper)};THREE.TubeGeometry.NoTaper=function(a){return 1};
+THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,l=new THREE.Matrix4;b+=1;var k,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(k=0;k<b;k++)n=k/(b-1),e[k]=a.getTangentAt(n),e[k].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;k=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);k<=a&&(a=k,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0],
 h);f[0].crossVectors(e[0],g[0]);for(k=1;k<b;k++)g[k]=g[k-1].clone(),f[k]=f[k-1].clone(),h.crossVectors(e[k-1],e[k]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),g[k].applyMatrix4(l.makeRotationAxis(h,d))),f[k].crossVectors(e[k],g[k]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),k=1;k<b;k++)g[k].applyMatrix4(l.makeRotationAxis(e[k],d*k)),f[k].crossVectors(e[k],g[k])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=l.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function g(a,b,c,d){d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()],void 0,d);l.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);l.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function f(a,

+ 1 - 1
docs/api/materials/MeshPhongMaterial.html

@@ -68,7 +68,7 @@
 		</div>
 
 		<h3>[property:Float shininess]</h3>
-		<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*. It should not be set to 0.</div>
+		<div>How shiny the specular highlight is; a higher value gives a sharper highlight. Default is *30*.</div>
 
 		<h3>[property:boolean metal]</h3>
 		<div>

+ 10 - 2
editor/js/Sidebar.Object3D.js

@@ -93,6 +93,7 @@ Sidebar.Object3D = function ( editor ) {
 
 	container.add( objectNameRow );
 
+	/*
 	// parent
 
 	var objectParentRow = new UI.Panel();
@@ -102,6 +103,7 @@ Sidebar.Object3D = function ( editor ) {
 	objectParentRow.add( objectParent );
 
 	container.add( objectParentRow );
+	*/
 
 	// position
 
@@ -340,7 +342,8 @@ Sidebar.Object3D = function ( editor ) {
 
 		if ( object !== null ) {
 
-			if ( object.parent !== undefined ) {
+			/*
+			if ( object.parent !== null ) {
 
 				var newParentId = parseInt( objectParent.getValue() );
 
@@ -351,6 +354,7 @@ Sidebar.Object3D = function ( editor ) {
 				}
 
 			}
+			*/
 
 			var newPosition = new THREE.Vector3( objectPositionX.getValue(), objectPositionY.getValue(), objectPositionZ.getValue() );
 			if ( object.position.distanceTo( newPosition ) >= 0.01 ) {
@@ -462,7 +466,7 @@ Sidebar.Object3D = function ( editor ) {
 	function updateRows( object ) {
 
 		var properties = {
-			'parent': objectParentRow,
+			// 'parent': objectParentRow,
 			'fov': objectFovRow,
 			'near': objectNearRow,
 			'far': objectFarRow,
@@ -519,6 +523,7 @@ Sidebar.Object3D = function ( editor ) {
 
 	} );
 
+	/*
 	signals.sceneGraphChanged.add( function () {
 
 		var scene = editor.scene;
@@ -533,6 +538,7 @@ Sidebar.Object3D = function ( editor ) {
 		objectParent.setOptions( options );
 
 	} );
+	*/
 
 	signals.objectChanged.add( function ( object ) {
 
@@ -557,11 +563,13 @@ Sidebar.Object3D = function ( editor ) {
 		objectUUID.setValue( object.uuid );
 		objectName.setValue( object.name );
 
+		/*
 		if ( object.parent !== null ) {
 
 			objectParent.setValue( object.parent.id );
 
 		}
+		*/
 
 		objectPositionX.setValue( object.position.x );
 		objectPositionY.setValue( object.position.y );

+ 38 - 18
examples/js/loaders/ColladaLoader2.js

@@ -569,11 +569,11 @@ THREE.ColladaLoader.prototype = {
 			var data = {
 				name: xml.getAttribute( 'name' ),
 				matrix: new THREE.Matrix4(),
+				nodes: [],
 				instanceCameras: [],
 				instanceLights: [],
 				instanceGeometries: [],
-				instanceNodes: [],
-				nodes: []
+				instanceNodes: []
 			};
 
 			for ( var i = 0; i < xml.childNodes.length; i ++ ) {
@@ -584,6 +584,11 @@ THREE.ColladaLoader.prototype = {
 
 				switch ( child.nodeName ) {
 
+					case 'node':
+						parseNode( child );
+						data.nodes.push( child.getAttribute( 'id' ) );
+						break;
+
 					case 'instance_camera':
 						data.instanceCameras.push( parseId( child.getAttribute( 'url' ) ) );
 						break;
@@ -605,11 +610,6 @@ THREE.ColladaLoader.prototype = {
 						data.matrix.multiply( matrix.fromArray( array ).transpose() ); // .transpose() when Z_UP?
 						break;
 
-					case 'node':
-						parseNode( child );
-						data.nodes.push( child.getAttribute( 'id' ) );
-						break;
-
 					case 'translate':
 						var array = parseFloats( child.textContent );
 						vector.fromArray( array );
@@ -650,47 +650,67 @@ THREE.ColladaLoader.prototype = {
 
 		function buildNode( data ) {
 
-			var group = new THREE.Group();
-			group.name = data.name;
-			data.matrix.decompose( group.position, group.quaternion, group.scale );
+			var objects = [];
 
+			var matrix = data.matrix;
+			var nodes = data.nodes;
 			var instanceCameras = data.instanceCameras;
 			var instanceLights = data.instanceLights;
 			var instanceGeometries = data.instanceGeometries;
 			var instanceNodes = data.instanceNodes;
-			var nodes = data.nodes;
+
+			for ( var i = 0, l = nodes.length; i < l; i ++ ) {
+
+				objects.push( getNode( nodes[ i ] ).clone() );
+
+			}
 
 			for ( var i = 0, l = instanceCameras.length; i < l; i ++ ) {
 
-				group.add( getCamera( instanceCameras[ i ] ).clone() );
+				objects.push( getCamera( instanceCameras[ i ] ).clone() );
 
 			}
 
 			for ( var i = 0, l = instanceLights.length; i < l; i ++ ) {
 
-				group.add( getLight( instanceLights[ i ] ).clone() );
+				objects.push( getLight( instanceLights[ i ] ).clone() );
 
 			}
 
 			for ( var i = 0, l = instanceGeometries.length; i < l; i ++ ) {
 
-				group.add( getGeometry( instanceGeometries[ i ] ).clone() );
+				objects.push( getGeometry( instanceGeometries[ i ] ).clone() );
 
 			}
 
 			for ( var i = 0, l = instanceNodes.length; i < l; i ++ ) {
 
-				group.add( getNode( instanceNodes[ i ] ).clone() );
+				objects.push( getNode( instanceNodes[ i ] ).clone() );
 
 			}
 
-			for ( var i = 0, l = nodes.length; i < l; i ++ ) {
+			var object;
+
+			if ( objects.length === 1 ) {
+
+				object = objects[ 0 ];
 
-				group.add( getNode( nodes[ i ] ).clone() );
+			} else {
+
+				object = new THREE.Group();
+
+				for ( var i = 0; i < objects.length; i ++ ) {
+
+					object.add( objects[ i ] );
+
+				}
 
 			}
 
-			return group;
+			object.name = data.name;
+			matrix.decompose( object.position, object.quaternion, object.scale );
+
+			return object;
 
 		}
 

+ 1 - 1
examples/js/loaders/MTLLoader.js

@@ -351,7 +351,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
 					// The specular exponent (defines the focus of the specular highlight)
 					// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.
 
-					params[ 'shininess' ] = value;
+					params[ 'shininess' ] = parseFloat( value );
 
 					break;
 

+ 2 - 2
examples/webgl_loader_amf.html

@@ -40,8 +40,8 @@
 		<div id="info">
 			<a href="http://threejs.org" target="_blank">three.js</a>
 			<a href="http://amf.wikispaces.com" target="_blank">AMF File format</a>
-			<div>AMF loader test by <a href="https://github.com/tamarintech">tamarintech</a></div>
-			<div>Rook manufacturing file from <a href="http://amf.wikispaces.com/AMF+test+files">AMF test files</a></div>
+			<div>AMF loader test by <a href="https://github.com/tamarintech" target="_blank">tamarintech</a></div>
+			<div>Rook manufacturing file from <a href="http://amf.wikispaces.com/AMF+test+files" target="_blank">AMF test files</a></div>
 		</div>
 
 		<script src="../build/three.min.js"></script>

+ 1 - 0
examples/webgl_loader_sea3d.html

@@ -158,6 +158,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				composer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}

+ 1 - 0
examples/webgl_loader_sea3d_hierarchy.html

@@ -161,6 +161,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				composer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}

+ 1 - 0
examples/webgl_loader_sea3d_keyframe.html

@@ -200,6 +200,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				composer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}

+ 1 - 0
examples/webgl_loader_sea3d_morph.html

@@ -174,6 +174,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				composer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}

+ 1 - 0
examples/webgl_loader_sea3d_skinning.html

@@ -191,6 +191,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				composer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}

+ 4 - 3
examples/webgl_loader_sea3d_sound.html

@@ -252,7 +252,7 @@
 
 			function initKeyDown() {
 
-				var onKeyDown = function ( event ) {
+				function onKeyDown( event ) {
 
 					switch ( event.keyCode ) {
 
@@ -280,9 +280,9 @@
 
 				};
 
-				var onKeyUp = function ( event ) {
+				function onKeyUp( event ) {
 
-					switch( event.keyCode ) {
+					switch ( event.keyCode ) {
 
 						case 38: // up
 						case 87: // w
@@ -376,6 +376,7 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				composer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}

+ 10 - 1
src/extras/geometries/TubeGeometry.js

@@ -23,7 +23,8 @@ THREE.TubeGeometry = function ( path, segments, radius, radialSegments, closed,
 		segments: segments,
 		radius: radius,
 		radialSegments: radialSegments,
-		closed: closed
+		closed: closed,
+		taper: taper
 	};
 
 	segments = segments || 64;
@@ -138,6 +139,14 @@ THREE.TubeGeometry = function ( path, segments, radius, radialSegments, closed,
 
 THREE.TubeGeometry.prototype = Object.create( THREE.Geometry.prototype );
 THREE.TubeGeometry.prototype.constructor = THREE.TubeGeometry;
+THREE.TubeGeometry.prototype.clone = function() {
+
+	return new this.constructor( this.parameters.path,
+		this.parameters.segments, this.parameters.radius, this.parameters.radialSegments,
+		this.parameters.closed, this.parameters.taper
+	);
+
+};
 
 THREE.TubeGeometry.NoTaper = function ( u ) {
 

+ 4 - 2
src/loaders/XHRLoader.js

@@ -39,9 +39,11 @@ THREE.XHRLoader.prototype = {
 
 		request.addEventListener( 'load', function ( event ) {
 
-			THREE.Cache.add( url, this.response );
+			var response = event.target.response;
 
-			if ( onLoad ) onLoad( this.response );
+			THREE.Cache.add( url, response );
+
+			if ( onLoad ) onLoad( response );
 
 			scope.manager.itemEnd( url );
 

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -1880,7 +1880,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 	function refreshUniformsPhong ( uniforms, material ) {
 
 		uniforms.specular.value = material.specular;
-		uniforms.shininess.value = material.shininess;
+		uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )
 
 		if ( material.lightMap ) {