Bläddra i källkod

Updated builds.

Mr.doob 12 år sedan
förälder
incheckning
fc00a6746b
2 ändrade filer med 78 tillägg och 75 borttagningar
  1. 5 2
      build/three.js
  2. 73 73
      build/three.min.js

+ 5 - 2
build/three.js

@@ -32324,11 +32324,14 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 		c += shapesOffset;
 		d += shapesOffset;
 
- 		scope.faces.push( new THREE.Face4( a, b, c, d, null, null, extrudeMaterial ) );
+ 		scope.faces.push( new THREE.Face3( a, b, d, null, null, extrudeMaterial ) );
+ 		scope.faces.push( new THREE.Face3( b, c, d, null, null, extrudeMaterial ) );
 
  		var uvs = uvgen.generateSideWallUV( scope, shape, wallContour, options, a, b, c, d,
  		                                    stepIndex, stepsLength, contourIndex1, contourIndex2 );
- 		scope.faceVertexUvs[ 0 ].push( uvs );
+
+ 		scope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] );
+ 		scope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] );
 
 	}
 

+ 73 - 73
build/three.min.js

@@ -158,14 +158,14 @@ return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE
 0,g,i,k=[],l=0,m,n,r=[],t=0,p,s,q=[],u=0,w,v,C=[],z=0,y={objects:[],sprites:[],lights:[],elements:[]},F=new THREE.Vector3,x=new THREE.Vector4,O=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),B=new THREE.Box3,E=Array(3),I=new THREE.Matrix4,D=new THREE.Matrix4,A,G=new THREE.Matrix4,R=new THREE.Matrix3,J=new THREE.Matrix3,ba=new THREE.Vector3,qa=new THREE.Frustum,ra=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
 D.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(D)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);D.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(D)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var M=function(a){if(e===h){var b=new THREE.RenderableObject;
 f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(F.getPositionFromMatrix(a.matrixWorld),F.applyProjection(D),d.z=F.z);return d},Q=function(a){if(!1!==a.visible){a instanceof THREE.Light?y.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===qa.intersectsObject(a))&&y.objects.push(M(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&y.sprites.push(M(a));for(var b=0,c=a.children.length;b<c;b++)Q(a.children[b])}};
-this.projectScene=function(d,f,h,l){var ea=!1,F,M,fa,V,aa,P,T,ma,va,ja,Pa,Ja;v=s=n=0;y.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();I.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));D.multiplyMatrices(f.projectionMatrix,I);J.getNormalMatrix(I);qa.setFromMatrix(D);e=0;y.objects.length=0;y.sprites.length=0;y.lights.length=0;Q(d);!0===h&&y.objects.sort(b);d=0;for(h=y.objects.length;d<h;d++)if(T=y.objects[d].object,A=T.matrixWorld,i=0,T instanceof
+this.projectScene=function(d,f,h,l){var ea=!1,F,M,fa,V,P,Z,T,ma,va,ja,Pa,Ja;v=s=n=0;y.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();I.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));D.multiplyMatrices(f.projectionMatrix,I);J.getNormalMatrix(I);qa.setFromMatrix(D);e=0;y.objects.length=0;y.sprites.length=0;y.lights.length=0;Q(d);!0===h&&y.objects.sort(b);d=0;for(h=y.objects.length;d<h;d++)if(T=y.objects[d].object,A=T.matrixWorld,i=0,T instanceof
 THREE.Mesh){ma=T.geometry;fa=ma.vertices;va=ma.faces;ma=ma.faceVertexUvs;R.getNormalMatrix(A);Pa=T.material instanceof THREE.MeshFaceMaterial;Ja=!0===Pa?T.material:null;F=0;for(M=fa.length;F<M;F++){g=a();g.positionWorld.copy(fa[F]).applyMatrix4(A);g.positionScreen.copy(g.positionWorld).applyMatrix4(D);var ga=1/g.positionScreen.w;g.positionScreen.x*=ga;g.positionScreen.y*=ga;g.positionScreen.z*=ga;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||1<g.positionScreen.y||
--1>g.positionScreen.z||1<g.positionScreen.z)}fa=0;for(F=va.length;fa<F;fa++)if(M=va[fa],ga=!0===Pa?Ja.materials[M.materialIndex]:T.material,void 0!==ga&&(P=ga.side,V=k[M.a],aa=k[M.b],ja=k[M.c],E[0]=V.positionScreen,E[1]=aa.positionScreen,E[2]=ja.positionScreen,!0===V.visible||!0===aa.visible||!0===ja.visible||O.isIntersectionBox(B.setFromPoints(E))))if(ea=0>(ja.positionScreen.x-V.positionScreen.x)*(aa.positionScreen.y-V.positionScreen.y)-(ja.positionScreen.y-V.positionScreen.y)*(aa.positionScreen.x-
-V.positionScreen.x),P===THREE.DoubleSide||ea===(P===THREE.FrontSide)){if(n===t){var Ha=new THREE.RenderableFace3;r.push(Ha);t++;n++;m=Ha}else m=r[n++];m.id=T.id;m.v1.copy(V);m.v2.copy(aa);m.v3.copy(ja);m.normalModel.copy(M.normal);!1===ea&&(P===THREE.BackSide||P===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(R).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(J);m.centroidModel.copy(M.centroid).applyMatrix4(A);ja=M.vertexNormals;V=0;for(aa=Math.min(ja.length,
-3);V<aa;V++)Ha=m.vertexNormalsModel[V],Ha.copy(ja[V]),!1===ea&&(P===THREE.BackSide||P===THREE.DoubleSide)&&Ha.negate(),Ha.applyMatrix3(R).normalize(),m.vertexNormalsModelView[V].copy(Ha).applyMatrix3(J);m.vertexNormalsLength=ja.length;ea=0;for(V=Math.min(ma.length,3);ea<V;ea++)if(ja=ma[ea][fa],void 0!==ja){aa=0;for(P=ja.length;aa<P;aa++)m.uvs[ea][aa]=ja[aa]}m.color=M.color;m.material=ga;ba.copy(m.centroidModel).applyProjection(D);m.z=ba.z;y.elements.push(m)}}else if(T instanceof THREE.Line){G.multiplyMatrices(D,
-A);fa=T.geometry.vertices;V=a();V.positionScreen.copy(fa[0]).applyMatrix4(G);va=T.type===THREE.LinePieces?2:1;F=1;for(M=fa.length;F<M;F++)V=a(),V.positionScreen.copy(fa[F]).applyMatrix4(G),0<(F+1)%va||(aa=k[i-2],ra.copy(V.positionScreen),N.copy(aa.positionScreen),!0===c(ra,N)&&(ra.multiplyScalar(1/ra.w),N.multiplyScalar(1/N.w),s===u?(ma=new THREE.RenderableLine,q.push(ma),u++,s++,p=ma):p=q[s++],p.id=T.id,p.v1.positionScreen.copy(ra),p.v2.positionScreen.copy(N),p.z=Math.max(ra.z,N.z),p.material=T.material,
-T.material.vertexColors===THREE.VertexColors&&(p.vertexColors[0].copy(T.geometry.colors[F]),p.vertexColors[1].copy(T.geometry.colors[F-1])),y.elements.push(p)))}d=0;for(h=y.sprites.length;d<h;d++)T=y.sprites[d].object,A=T.matrixWorld,T instanceof THREE.Particle&&(x.set(A.elements[12],A.elements[13],A.elements[14],1),x.applyMatrix4(D),ga=1/x.w,x.z*=ga,0<x.z&&1>x.z&&(v===z?(va=new THREE.RenderableParticle,C.push(va),z++,v++,w=va):w=C[v++],w.id=T.id,w.x=x.x*ga,w.y=x.y*ga,w.z=x.z,w.object=T,w.rotation=
-T.rotation.z,w.scale.x=T.scale.x*Math.abs(w.x-(x.x+f.projectionMatrix.elements[0])/(x.w+f.projectionMatrix.elements[12])),w.scale.y=T.scale.y*Math.abs(w.y-(x.y+f.projectionMatrix.elements[5])/(x.w+f.projectionMatrix.elements[13])),w.material=T.material,y.elements.push(w)));!0===l&&y.elements.sort(b);return y}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
+-1>g.positionScreen.z||1<g.positionScreen.z)}fa=0;for(F=va.length;fa<F;fa++)if(M=va[fa],ga=!0===Pa?Ja.materials[M.materialIndex]:T.material,void 0!==ga&&(Z=ga.side,V=k[M.a],P=k[M.b],ja=k[M.c],E[0]=V.positionScreen,E[1]=P.positionScreen,E[2]=ja.positionScreen,!0===V.visible||!0===P.visible||!0===ja.visible||O.isIntersectionBox(B.setFromPoints(E))))if(ea=0>(ja.positionScreen.x-V.positionScreen.x)*(P.positionScreen.y-V.positionScreen.y)-(ja.positionScreen.y-V.positionScreen.y)*(P.positionScreen.x-V.positionScreen.x),
+Z===THREE.DoubleSide||ea===(Z===THREE.FrontSide)){if(n===t){var Ga=new THREE.RenderableFace3;r.push(Ga);t++;n++;m=Ga}else m=r[n++];m.id=T.id;m.v1.copy(V);m.v2.copy(P);m.v3.copy(ja);m.normalModel.copy(M.normal);!1===ea&&(Z===THREE.BackSide||Z===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(R).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(J);m.centroidModel.copy(M.centroid).applyMatrix4(A);ja=M.vertexNormals;V=0;for(P=Math.min(ja.length,3);V<P;V++)Ga=m.vertexNormalsModel[V],
+Ga.copy(ja[V]),!1===ea&&(Z===THREE.BackSide||Z===THREE.DoubleSide)&&Ga.negate(),Ga.applyMatrix3(R).normalize(),m.vertexNormalsModelView[V].copy(Ga).applyMatrix3(J);m.vertexNormalsLength=ja.length;ea=0;for(V=Math.min(ma.length,3);ea<V;ea++)if(ja=ma[ea][fa],void 0!==ja){P=0;for(Z=ja.length;P<Z;P++)m.uvs[ea][P]=ja[P]}m.color=M.color;m.material=ga;ba.copy(m.centroidModel).applyProjection(D);m.z=ba.z;y.elements.push(m)}}else if(T instanceof THREE.Line){G.multiplyMatrices(D,A);fa=T.geometry.vertices;V=
+a();V.positionScreen.copy(fa[0]).applyMatrix4(G);va=T.type===THREE.LinePieces?2:1;F=1;for(M=fa.length;F<M;F++)V=a(),V.positionScreen.copy(fa[F]).applyMatrix4(G),0<(F+1)%va||(P=k[i-2],ra.copy(V.positionScreen),N.copy(P.positionScreen),!0===c(ra,N)&&(ra.multiplyScalar(1/ra.w),N.multiplyScalar(1/N.w),s===u?(ma=new THREE.RenderableLine,q.push(ma),u++,s++,p=ma):p=q[s++],p.id=T.id,p.v1.positionScreen.copy(ra),p.v2.positionScreen.copy(N),p.z=Math.max(ra.z,N.z),p.material=T.material,T.material.vertexColors===
+THREE.VertexColors&&(p.vertexColors[0].copy(T.geometry.colors[F]),p.vertexColors[1].copy(T.geometry.colors[F-1])),y.elements.push(p)))}d=0;for(h=y.sprites.length;d<h;d++)T=y.sprites[d].object,A=T.matrixWorld,T instanceof THREE.Particle&&(x.set(A.elements[12],A.elements[13],A.elements[14],1),x.applyMatrix4(D),ga=1/x.w,x.z*=ga,0<x.z&&1>x.z&&(v===z?(va=new THREE.RenderableParticle,C.push(va),z++,v++,w=va):w=C[v++],w.id=T.id,w.x=x.x*ga,w.y=x.y*ga,w.z=x.z,w.object=T,w.rotation=T.rotation.z,w.scale.x=T.scale.x*
+Math.abs(w.x-(x.x+f.projectionMatrix.elements[0])/(x.w+f.projectionMatrix.elements[12])),w.scale.y=T.scale.y*Math.abs(w.y-(x.y+f.projectionMatrix.elements[5])/(x.w+f.projectionMatrix.elements[13])),w.material=T.material,y.elements.push(w)));!0===l&&y.elements.sort(b);return y}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
 return a}};THREE.Face4=function(a,b,c,d,e,f,h){return new THREE.Face3(a,b,c,e,f,h)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.normals=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=
 this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
@@ -293,10 +293,10 @@ THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Ob
 function c(a,b,c,d){l(b);m(c);n(d);r(a.getStyle());B.stroke();ta.expandByScalar(2*b)}function d(a){t(a.getStyle());B.fill()}function e(a,b,c,e,f,h,g,j,i,k,m,l,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,r=n.wrapT==THREE.RepeatWrapping;Ja[n.id]=B.createPattern(n.image,!0===p&&!0===r?"repeat":!0===p&&!1===r?"repeat-x":!1===p&&!0===r?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ja[n.id]?t("rgba(0,0,0,1)"):
 t(Ja[n.id]);var p=n.offset.x/n.repeat.x,r=n.offset.y/n.repeat.y,s=n.image.width*n.repeat.x,q=n.image.height*n.repeat.y,g=(g+p)*s,j=(1-j+r)*q,c=c-a,e=e-b,f=f-a,h=h-b,i=(i+p)*s-g,k=(1-k+r)*q-j,m=(m+p)*s-g,l=(1-l+r)*q-j,p=i*l-m*k;0===p?(void 0===ga[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),ga[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=ga[n.id],g=4*(Math.floor(g)+Math.floor(j)*n.image.width),
 V.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),d(V)):(p=1/p,n=(l*c-k*f)*p,k=(l*e-k*h)*p,c=(i*f-m*c)*p,e=(i*h-m*e)*p,a=a-n*g-c*j,g=b-k*g-e*j,B.save(),B.transform(n,k,c,e,a,g),B.fill(),B.restore())}}function f(a,b,c,d,e,f,h,g,j,i,k,m,l){var n,p;n=l.width-1;p=l.height-1;h*=n;g*=p;c-=a;d-=b;e-=a;f-=b;j=j*n-h;i=i*p-g;k=k*n-h;m=m*p-g;p=1/(j*m-k*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-k*c)*p;d=(j*f-k*d)*p;a=a-n*h-c*g;b=b-i*h-d*g;B.save();B.transform(n,i,c,d,a,b);B.clip();B.drawImage(l,0,0);B.restore()}function h(a,
-b,c,d){xa[0]=255*a.r|0;xa[1]=255*a.g|0;xa[2]=255*a.b|0;xa[4]=255*b.r|0;xa[5]=255*b.g|0;xa[6]=255*b.b|0;xa[8]=255*c.r|0;xa[9]=255*c.g|0;xa[10]=255*c.b|0;xa[12]=255*d.r|0;xa[13]=255*d.g|0;xa[14]=255*d.b|0;j.putImageData(Wa,0,0);Ia.drawImage(Ra,0,0);return ya}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function i(a){D!==a&&(D=B.globalAlpha=a)}function k(a){A!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":
+b,c,d){xa[0]=255*a.r|0;xa[1]=255*a.g|0;xa[2]=255*a.b|0;xa[4]=255*b.r|0;xa[5]=255*b.g|0;xa[6]=255*b.b|0;xa[8]=255*c.r|0;xa[9]=255*c.g|0;xa[10]=255*c.b|0;xa[12]=255*d.r|0;xa[13]=255*d.g|0;xa[14]=255*d.b|0;j.putImageData(Wa,0,0);Ha.drawImage(Ra,0,0);return ya}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function i(a){D!==a&&(D=B.globalAlpha=a)}function k(a){A!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":
 a===THREE.AdditiveBlending?B.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(B.globalCompositeOperation="darker"),A=a)}function l(a){J!==a&&(J=B.lineWidth=a)}function m(a){ba!==a&&(ba=B.lineCap=a)}function n(a){qa!==a&&(qa=B.lineJoin=a)}function r(a){G!==a&&(G=B.strokeStyle=a)}function t(a){R!==a&&(R=B.fillStyle=a)}function p(a,b){if(ra!==a||N!==b)B.setLineDash([a,b]),ra=a,N=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var s=THREE.Math.smoothstep,a=a||{},q=this,u,w,v,C=
-new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y,F,x,O,B=z.getContext("2d"),E=new THREE.Color(0),I=0,D=1,A=0,G=null,R=null,J=null,ba=null,qa=null,ra=null,N=0,M,Q,K,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var za,Fa,ea,Ea,Z,fa,V=new THREE.Color,aa=new THREE.Color,P=new THREE.Color,T=new THREE.Color,ma=new THREE.Color,va=new THREE.Color,ja=new THREE.Color,Pa=new THREE.Color,Ja={},ga={},Ha,Xa,Sa,Aa,hb,ib,tb,ub,vb,jb,Ka=new THREE.Box2,na=new THREE.Box2,
-ta=new THREE.Box2,kb=new THREE.Color,ua=new THREE.Color,ha=new THREE.Color,wa=new THREE.Vector3,Ra,j,Wa,xa,ya,Ia,Ta=16;Ra=document.createElement("canvas");Ra.width=Ra.height=2;j=Ra.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);Wa=j.getImageData(0,0,2,2);xa=Wa.data;ya=document.createElement("canvas");ya.width=ya.height=Ta;Ia=ya.getContext("2d");Ia.translate(-Ta/2,-Ta/2);Ia.scale(Ta,Ta);Ta--;void 0===B.setLineDash&&(B.setLineDash=void 0!==B.mozDash?function(a){B.mozDash=null!==a[0]?
+new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y,F,x,O,B=z.getContext("2d"),E=new THREE.Color(0),I=0,D=1,A=0,G=null,R=null,J=null,ba=null,qa=null,ra=null,N=0,M,Q,K,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var Ia,Ea,ea,Da,$,fa,V=new THREE.Color,P=new THREE.Color,Z=new THREE.Color,T=new THREE.Color,ma=new THREE.Color,va=new THREE.Color,ja=new THREE.Color,Pa=new THREE.Color,Ja={},ga={},Ga,Xa,Sa,za,hb,ib,tb,ub,vb,jb,Ka=new THREE.Box2,na=new THREE.Box2,
+ta=new THREE.Box2,kb=new THREE.Color,ua=new THREE.Color,ha=new THREE.Color,wa=new THREE.Vector3,Ra,j,Wa,xa,ya,Ha,Ta=16;Ra=document.createElement("canvas");Ra.width=Ra.height=2;j=Ra.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);Wa=j.getImageData(0,0,2,2);xa=Wa.data;ya=document.createElement("canvas");ya.width=ya.height=Ta;Ha=ya.getContext("2d");Ha.translate(-Ta/2,-Ta/2);Ha.scale(Ta,Ta);Ta--;void 0===B.setLineDash&&(B.setLineDash=void 0!==B.mozDash?function(a){B.mozDash=null!==a[0]?
 a:null}:function(){});this.domElement=z;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){y=a*this.devicePixelRatio;F=b*this.devicePixelRatio;x=Math.floor(y/2);O=Math.floor(F/2);z.width=y;z.height=F;1!==this.devicePixelRatio&&!1!==
 c&&(z.style.width=a+"px",z.style.height=b+"px");Ka.set(new THREE.Vector2(-x,-O),new THREE.Vector2(x,O));na.set(new THREE.Vector2(-x,-O),new THREE.Vector2(x,O));D=1;A=0;qa=ba=J=R=G=null};this.setClearColor=function(a,b){E.set(a);I=void 0!==b?b:1;na.set(new THREE.Vector2(-x,-O),new THREE.Vector2(x,O))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};
 this.clear=function(){B.setTransform(1,0,0,-1,x,O);!1===na.empty()&&(na.intersect(Ka),na.expandByScalar(2),1>I&&B.clearRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0),0<I&&(k(THREE.NormalBlending),i(1),t("rgba("+Math.floor(255*E.r)+","+Math.floor(255*E.g)+","+Math.floor(255*E.b)+","+I+")"),B.fillRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0)),na.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
@@ -306,13 +306,13 @@ else{!0===this.autoClear&&this.clear();B.setTransform(1,0,0,-1,x,O);q.info.rende
 t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-D.rotation),B.scale(z,A),J.program(B),B.restore()))}else if(z instanceof THREE.RenderableLine){if(Q=z.v1,K=z.v2,Q.positionScreen.x*=x,Q.positionScreen.y*=O,K.positionScreen.x*=x,K.positionScreen.y*=O,ta.setFromPoints([Q.positionScreen,K.positionScreen]),!0===Ka.isIntersectionBox(ta))if(y=Q,D=K,J=z,z=A,i(z.opacity),k(z.blending),B.beginPath(),B.moveTo(y.positionScreen.x,y.positionScreen.y),B.lineTo(D.positionScreen.x,D.positionScreen.y),
 z instanceof THREE.LineBasicMaterial){l(z.linewidth);m(z.linecap);n(z.linejoin);if(z.vertexColors!==THREE.VertexColors)r(z.color.getStyle());else if(A=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),A===J)r(A);else{try{var ga=B.createLinearGradient(y.positionScreen.x,y.positionScreen.y,D.positionScreen.x,D.positionScreen.y);ga.addColorStop(0,A);ga.addColorStop(1,J)}catch(qa){ga=A}r(ga)}B.stroke();ta.expandByScalar(2*z.linewidth)}else z instanceof THREE.LineDashedMaterial&&(l(z.linewidth),
 m(z.linecap),n(z.linejoin),r(z.color.getStyle()),p(z.dashSize,z.gapSize),B.stroke(),ta.expandByScalar(2*z.linewidth),p(null,null))}else if(z instanceof THREE.RenderableFace3){Q=z.v1;K=z.v2;da=z.v3;if(-1>Q.positionScreen.z||1<Q.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;Q.positionScreen.x*=x;Q.positionScreen.y*=O;K.positionScreen.x*=x;K.positionScreen.y*=O;da.positionScreen.x*=x;da.positionScreen.y*=O;
-0<A.overdraw&&(g(Q.positionScreen,K.positionScreen,A.overdraw),g(K.positionScreen,da.positionScreen,A.overdraw),g(da.positionScreen,Q.positionScreen,A.overdraw));ta.setFromPoints([Q.positionScreen,K.positionScreen,da.positionScreen]);if(!0===Ka.isIntersectionBox(ta)){y=Q;D=K;J=da;q.info.render.vertices+=3;q.info.render.faces++;i(A.opacity);k(A.blending);za=y.positionScreen.x;Fa=y.positionScreen.y;ea=D.positionScreen.x;Ea=D.positionScreen.y;Z=J.positionScreen.x;fa=J.positionScreen.y;var N=za,E=Fa,
-I=ea,R=Ea,ba=Z,ra=fa;B.beginPath();B.moveTo(N,E);B.lineTo(I,R);B.lineTo(ba,ra);B.closePath();(A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial)&&null===A.map?(va.copy(A.color),ja.copy(A.emissive),A.vertexColors===THREE.FaceColors&&va.multiply(z.color),!1===A.wireframe&&A.shading==THREE.SmoothShading&&3==z.vertexNormalsLength?(aa.copy(kb),P.copy(kb),T.copy(kb),b(z.v1.positionWorld,z.vertexNormalsModel[0],aa),b(z.v2.positionWorld,z.vertexNormalsModel[1],P),b(z.v3.positionWorld,
-z.vertexNormalsModel[2],T),aa.multiply(va).add(ja),P.multiply(va).add(ja),T.multiply(va).add(ja),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,ea,Ea,Z,fa,0,0,1,0,0,1,Sa)):(V.copy(kb),b(z.centroidModel,z.normalModel,V),V.multiply(va).add(ja),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V))):A instanceof THREE.MeshBasicMaterial||A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial?null!==A.map?A.map.mapping instanceof THREE.UVMapping&&
-(Aa=z.uvs[0],e(za,Fa,ea,Ea,Z,fa,Aa[0].x,Aa[0].y,Aa[1].x,Aa[1].y,Aa[2].x,Aa[2].y,A.map)):null!==A.envMap?A.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(wa.copy(z.vertexNormalsModelView[0]),hb=0.5*wa.x+0.5,ib=0.5*wa.y+0.5,wa.copy(z.vertexNormalsModelView[1]),tb=0.5*wa.x+0.5,ub=0.5*wa.y+0.5,wa.copy(z.vertexNormalsModelView[2]),vb=0.5*wa.x+0.5,jb=0.5*wa.y+0.5,e(za,Fa,ea,Ea,Z,fa,hb,ib,tb,ub,vb,jb,A.envMap)):(V.copy(A.color),A.vertexColors===THREE.FaceColors&&V.multiply(z.color),!0===A.wireframe?
-c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A instanceof THREE.MeshDepthMaterial?(Ha=M.near,Xa=M.far,aa.r=aa.g=aa.b=1-s(y.positionScreen.z*y.positionScreen.w,Ha,Xa),P.r=P.g=P.b=1-s(D.positionScreen.z*D.positionScreen.w,Ha,Xa),T.r=T.g=T.b=1-s(J.positionScreen.z*J.positionScreen.w,Ha,Xa),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,ea,Ea,Z,fa,0,0,1,0,0,1,Sa)):A instanceof THREE.MeshNormalMaterial&&(y=void 0,A.shading==THREE.FlatShading?(y=z.normalModelView,
-V.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A.shading==THREE.SmoothShading&&(y=z.vertexNormalsModelView[0],aa.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=z.vertexNormalsModelView[1],P.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=z.vertexNormalsModelView[2],T.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,
-ea,Ea,Z,fa,0,0,1,0,0,1,Sa)))}}na.union(ta)}}B.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
+0<A.overdraw&&(g(Q.positionScreen,K.positionScreen,A.overdraw),g(K.positionScreen,da.positionScreen,A.overdraw),g(da.positionScreen,Q.positionScreen,A.overdraw));ta.setFromPoints([Q.positionScreen,K.positionScreen,da.positionScreen]);if(!0===Ka.isIntersectionBox(ta)){y=Q;D=K;J=da;q.info.render.vertices+=3;q.info.render.faces++;i(A.opacity);k(A.blending);Ia=y.positionScreen.x;Ea=y.positionScreen.y;ea=D.positionScreen.x;Da=D.positionScreen.y;$=J.positionScreen.x;fa=J.positionScreen.y;var N=Ia,E=Ea,
+I=ea,R=Da,ba=$,ra=fa;B.beginPath();B.moveTo(N,E);B.lineTo(I,R);B.lineTo(ba,ra);B.closePath();(A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial)&&null===A.map?(va.copy(A.color),ja.copy(A.emissive),A.vertexColors===THREE.FaceColors&&va.multiply(z.color),!1===A.wireframe&&A.shading==THREE.SmoothShading&&3==z.vertexNormalsLength?(P.copy(kb),Z.copy(kb),T.copy(kb),b(z.v1.positionWorld,z.vertexNormalsModel[0],P),b(z.v2.positionWorld,z.vertexNormalsModel[1],Z),b(z.v3.positionWorld,
+z.vertexNormalsModel[2],T),P.multiply(va).add(ja),Z.multiply(va).add(ja),T.multiply(va).add(ja),ma.addColors(Z,T).multiplyScalar(0.5),Sa=h(P,Z,T,ma),f(Ia,Ea,ea,Da,$,fa,0,0,1,0,0,1,Sa)):(V.copy(kb),b(z.centroidModel,z.normalModel,V),V.multiply(va).add(ja),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V))):A instanceof THREE.MeshBasicMaterial||A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial?null!==A.map?A.map.mapping instanceof THREE.UVMapping&&
+(za=z.uvs[0],e(Ia,Ea,ea,Da,$,fa,za[0].x,za[0].y,za[1].x,za[1].y,za[2].x,za[2].y,A.map)):null!==A.envMap?A.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(wa.copy(z.vertexNormalsModelView[0]),hb=0.5*wa.x+0.5,ib=0.5*wa.y+0.5,wa.copy(z.vertexNormalsModelView[1]),tb=0.5*wa.x+0.5,ub=0.5*wa.y+0.5,wa.copy(z.vertexNormalsModelView[2]),vb=0.5*wa.x+0.5,jb=0.5*wa.y+0.5,e(Ia,Ea,ea,Da,$,fa,hb,ib,tb,ub,vb,jb,A.envMap)):(V.copy(A.color),A.vertexColors===THREE.FaceColors&&V.multiply(z.color),!0===A.wireframe?
+c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A instanceof THREE.MeshDepthMaterial?(Ga=M.near,Xa=M.far,P.r=P.g=P.b=1-s(y.positionScreen.z*y.positionScreen.w,Ga,Xa),Z.r=Z.g=Z.b=1-s(D.positionScreen.z*D.positionScreen.w,Ga,Xa),T.r=T.g=T.b=1-s(J.positionScreen.z*J.positionScreen.w,Ga,Xa),ma.addColors(Z,T).multiplyScalar(0.5),Sa=h(P,Z,T,ma),f(Ia,Ea,ea,Da,$,fa,0,0,1,0,0,1,Sa)):A instanceof THREE.MeshNormalMaterial&&(y=void 0,A.shading==THREE.FlatShading?(y=z.normalModelView,V.setRGB(y.x,
+y.y,y.z).multiplyScalar(0.5).addScalar(0.5),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A.shading==THREE.SmoothShading&&(y=z.vertexNormalsModelView[0],P.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=z.vertexNormalsModelView[1],Z.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=z.vertexNormalsModelView[2],T.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),ma.addColors(Z,T).multiplyScalar(0.5),Sa=h(P,Z,T,ma),f(Ia,Ea,ea,Da,$,fa,0,0,
+1,0,0,1,Sa)))}}na.union(ta)}}B.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
 envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\nworldNormal = normalize( worldNormal );\nvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\nif ( useRefract ) {\nvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n} else {\nvReflect = reflect( cameraToVertex, worldNormal );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
@@ -367,7 +367,7 @@ function c(a,b){var c=b.geometry,h=a.faces3,g=3*h.length,i=1*h.length,k=3*h.leng
 (a.__skinIndexArray=new Float32Array(4*g),a.__skinWeightArray=new Float32Array(4*g));a.__faceArray=new Uint16Array(3*i);a.__lineArray=new Uint16Array(2*k);if(a.numMorphTargets){a.__morphTargetsArrays=[];c=0;for(m=a.numMorphTargets;c<m;c++)a.__morphTargetsArrays.push(new Float32Array(3*g))}if(a.numMorphNormals){a.__morphNormalsArrays=[];c=0;for(m=a.numMorphNormals;c<m;c++)a.__morphNormalsArrays.push(new Float32Array(3*g))}a.__webglFaceCount=3*i;a.__webglLineCount=2*k;if(h.attributes){void 0===a.__webglCustomAttributesList&&
 (a.__webglCustomAttributesList=[]);for(var p in h.attributes){var i=h.attributes[p],k={},r;for(r in i)k[r]=i[r];if(!k.__webglInitialized||k.createUniqueBuffers)k.__webglInitialized=!0,c=1,"v2"===k.type?c=2:"v3"===k.type?c=3:"v4"===k.type?c=4:"c"===k.type&&(c=3),k.size=c,k.array=new Float32Array(g*c),k.buffer=j.createBuffer(),k.buffer.belongsToAttribute=p,i.needsUpdate=!0,k.__original=i;a.__webglCustomAttributesList.push(k)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?
 a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function h(a){Ka[a]||(j.enableVertexAttribArray(a),Ka[a]=!0)}function g(){for(var a in Ka)Ka[a]&&(j.disableVertexAttribArray(a),Ka[a]=
-!1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function l(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)fa=Fa=null,Ea=Z=T=P=ga=Ja=ma=-1,wa=!0,a[d].render(b,c,vb,jb),fa=Fa=null,Ea=Z=T=P=ga=Ja=ma=-1,wa=!0}function m(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;h&&K.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);
+!1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function l(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)fa=Ea=null,Da=$=T=Z=ga=Ja=ma=-1,wa=!0,a[d].render(b,c,vb,jb),fa=Ea=null,Da=$=T=Z=ga=Ja=ma=-1,wa=!0}function m(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;h&&K.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);
 K.setDepthTest(j.depthTest);K.setDepthWrite(j.depthWrite);x(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}K.setMaterialFaces(j);k instanceof THREE.BufferGeometry?K.renderBufferDirect(d,e,f,j,k,i):K.renderBuffer(d,e,f,j,k,i)}}function n(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&K.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);K.setDepthTest(g.depthTest);K.setDepthWrite(g.depthWrite);x(g.polygonOffset,
 g.polygonOffsetFactor,g.polygonOffsetUnits)}K.renderImmediateObject(c,d,e,g,j)}}function r(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Jb)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k="index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],
 void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,n;k={};var p=i.morphTargets.length,r=i.morphNormals.length,s=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],l=s?l.materialIndex:0,void 0===k[l]&&(k[l]={hash:l,counter:0}),n=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[n]&&
@@ -379,47 +379,47 @@ j.createBuffer(),K.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexAr
 i),g.__colorArray=new Float32Array(3*i),g.__sortArray=[],g.__webglParticleCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)t(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],t(d.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,t(d.__webglObjects,f,a)):
 a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function t(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function s(a){for(var b in a.attributes)a.attributes[b].needsUpdate=
 !1}function q(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof THREE.Line?u(b.__webglObjects,a):a instanceof THREE.Sprite?w(b.__webglSprites,a):a instanceof THREE.LensFlare?w(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&u(b.__webglObjectsImmediate,a);delete a.__webglActive}function u(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===
-b&&a.splice(c,1)}function v(a,b,c,d,e){aa=0;d.needsUpdate&&(d.program&&Ob(d),K.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==Fa&&(j.useProgram(g),Fa=g,f=!0);d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==fa)j.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==fa&&(fa=a);if(d.skinning)if(Eb&&e.useVertexTexture){if(null!==h.boneTexture){var k=
+b&&a.splice(c,1)}function v(a,b,c,d,e){P=0;d.needsUpdate&&(d.program&&Ob(d),K.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==Ea&&(j.useProgram(g),Ea=g,f=!0);d.id!==Da&&(Da=d.id,f=!0);if(f||a!==fa)j.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==fa&&(fa=a);if(d.skinning)if(Eb&&e.useVertexTexture){if(null!==h.boneTexture){var k=
 C();j.uniform1i(h.boneTexture,k);K.setTexture(e.boneTexture,k)}}else null!==h.boneGlobalMatrices&&j.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){for(var m,l=k=0,n=0,p,r,s,q=Ra,t=q.directional.colors,u=q.directional.positions,
-w=q.point.colors,x=q.point.positions,v=q.point.distances,B=q.spot.colors,D=q.spot.positions,F=q.spot.distances,J=q.spot.directions,N=q.spot.anglesCos,O=q.spot.exponents,I=q.hemi.skyColors,V=q.hemi.groundColors,R=q.hemi.positions,M=0,T=0,ea=0,za=0,P=0,wc=0,X=0,W=0,Q=m=0,c=s=Q=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||(p=m.color,r=m.intensity,s=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(k+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?
-(P+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(m=3*M,u[m]=ha.x,u[m+1]=ha.y,u[m+2]=ha.z,K.gammaInput?z(t,m,p,r*r):y(t,m,p,r),M+=1))):m instanceof THREE.PointLight?(wc+=1,m.visible&&(Q=3*T,K.gammaInput?z(w,Q,p,r*r):y(w,Q,p,r),ua.getPositionFromMatrix(m.matrixWorld),x[Q]=ua.x,x[Q+1]=ua.y,x[Q+2]=ua.z,v[T]=s,T+=1)):m instanceof THREE.SpotLight?(X+=1,m.visible&&(Q=3*ea,K.gammaInput?z(B,Q,p,
-r*r):y(B,Q,p,r),ua.getPositionFromMatrix(m.matrixWorld),D[Q]=ua.x,D[Q+1]=ua.y,D[Q+2]=ua.z,F[ea]=s,ha.copy(ua),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),J[Q]=ha.x,J[Q+1]=ha.y,J[Q+2]=ha.z,N[ea]=Math.cos(m.angle),O[ea]=m.exponent,ea+=1)):m instanceof THREE.HemisphereLight&&(W+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(s=3*za,R[s]=ha.x,R[s+1]=ha.y,R[s+2]=ha.z,p=m.color,m=m.groundColor,K.gammaInput?(r*=r,z(I,s,p,r),
-z(V,s,m,r)):(y(I,s,p,r),y(V,s,m,r)),za+=1))));c=3*M;for(f=Math.max(t.length,3*P);c<f;c++)t[c]=0;c=3*T;for(f=Math.max(w.length,3*wc);c<f;c++)w[c]=0;c=3*ea;for(f=Math.max(B.length,3*X);c<f;c++)B[c]=0;c=3*za;for(f=Math.max(I.length,3*W);c<f;c++)I[c]=0;c=3*za;for(f=Math.max(V.length,3*W);c<f;c++)V[c]=0;q.directional.length=M;q.point.length=T;q.spot.length=ea;q.hemi.length=za;q.ambient[0]=k;q.ambient[1]=l;q.ambient[2]=n;wa=!1}c=Ra;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;
+w=q.point.colors,x=q.point.positions,B=q.point.distances,v=q.spot.colors,D=q.spot.positions,F=q.spot.distances,J=q.spot.directions,N=q.spot.anglesCos,O=q.spot.exponents,I=q.hemi.skyColors,V=q.hemi.groundColors,R=q.hemi.positions,M=0,T=0,ea=0,Z=0,Ia=0,wc=0,X=0,W=0,Q=m=0,c=s=Q=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||(p=m.color,r=m.intensity,s=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(k+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?
+(Ia+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(m=3*M,u[m]=ha.x,u[m+1]=ha.y,u[m+2]=ha.z,K.gammaInput?z(t,m,p,r*r):y(t,m,p,r),M+=1))):m instanceof THREE.PointLight?(wc+=1,m.visible&&(Q=3*T,K.gammaInput?z(w,Q,p,r*r):y(w,Q,p,r),ua.getPositionFromMatrix(m.matrixWorld),x[Q]=ua.x,x[Q+1]=ua.y,x[Q+2]=ua.z,B[T]=s,T+=1)):m instanceof THREE.SpotLight?(X+=1,m.visible&&(Q=3*ea,K.gammaInput?z(v,Q,
+p,r*r):y(v,Q,p,r),ua.getPositionFromMatrix(m.matrixWorld),D[Q]=ua.x,D[Q+1]=ua.y,D[Q+2]=ua.z,F[ea]=s,ha.copy(ua),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),J[Q]=ha.x,J[Q+1]=ha.y,J[Q+2]=ha.z,N[ea]=Math.cos(m.angle),O[ea]=m.exponent,ea+=1)):m instanceof THREE.HemisphereLight&&(W+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(s=3*Z,R[s]=ha.x,R[s+1]=ha.y,R[s+2]=ha.z,p=m.color,m=m.groundColor,K.gammaInput?(r*=r,z(I,s,p,
+r),z(V,s,m,r)):(y(I,s,p,r),y(V,s,m,r)),Z+=1))));c=3*M;for(f=Math.max(t.length,3*Ia);c<f;c++)t[c]=0;c=3*T;for(f=Math.max(w.length,3*wc);c<f;c++)w[c]=0;c=3*ea;for(f=Math.max(v.length,3*X);c<f;c++)v[c]=0;c=3*Z;for(f=Math.max(I.length,3*W);c<f;c++)I[c]=0;c=3*Z;for(f=Math.max(V.length,3*W);c<f;c++)V[c]=0;q.directional.length=M;q.point.length=T;q.spot.length=ea;q.hemi.length=Z;q.ambient[0]=k;q.ambient[1]=l;q.ambient[2]=n;wa=!1}c=Ra;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;
 i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=
 c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;K.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));
-var Z;d.map?Z=d.map:d.specularMap?Z=d.specularMap:d.normalMap?Z=d.normalMap:d.bumpMap&&(Z=d.bumpMap);void 0!==Z&&(c=Z.offset,Z=Z.repeat,i.offsetRepeat.value.set(c.x,c.y,Z.x,Z.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?
+var $;d.map?$=d.map:d.specularMap?$=d.specularMap:d.normalMap?$=d.normalMap:d.bumpMap&&($=d.bumpMap);void 0!==$&&(c=$.offset,$=$.repeat,i.offsetRepeat.value.set(c.x,c.y,$.x,$.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?
 (i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleBasicMaterial?(i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=G.height/2,i.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(i.shininess.value=d.shininess,K.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),
 i.emissive.value.copyGammaToLinear(d.emissive),i.specular.value.copyGammaToLinear(d.specular)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(K.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?
-(i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(i.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=Z=0;for(f=b.length;c<f;c++)if(k=b[c],k.castShadow&&(k instanceof THREE.SpotLight||k instanceof THREE.DirectionalLight&&!k.shadowCascade))i.shadowMap.value[Z]=k.shadowMap,i.shadowMapSize.value[Z]=k.shadowMapSize,i.shadowMatrix.value[Z]=k.shadowMatrix,i.shadowDarkness.value[Z]=k.shadowDarkness,i.shadowBias.value[Z]=
-k.shadowBias,Z++}b=d.uniformsList;i=0;for(Z=b.length;i<Z;i++)if(f=g.uniforms[b[i][1]])if(c=b[i][0],l=c.type,k=c.value,"i"===l)j.uniform1i(f,k);else if("f"===l)j.uniform1f(f,k);else if("v2"===l)j.uniform2f(f,k.x,k.y);else if("v3"===l)j.uniform3f(f,k.x,k.y,k.z);else if("v4"===l)j.uniform4f(f,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(f,k.r,k.g,k.b);else if("iv1"===l)j.uniform1iv(f,k);else if("iv"===l)j.uniform3iv(f,k);else if("fv1"===l)j.uniform1fv(f,k);else if("fv"===l)j.uniform3fv(f,k);else if("v2v"===
+(i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(i.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=$=0;for(f=b.length;c<f;c++)if(k=b[c],k.castShadow&&(k instanceof THREE.SpotLight||k instanceof THREE.DirectionalLight&&!k.shadowCascade))i.shadowMap.value[$]=k.shadowMap,i.shadowMapSize.value[$]=k.shadowMapSize,i.shadowMatrix.value[$]=k.shadowMatrix,i.shadowDarkness.value[$]=k.shadowDarkness,i.shadowBias.value[$]=
+k.shadowBias,$++}b=d.uniformsList;i=0;for($=b.length;i<$;i++)if(f=g.uniforms[b[i][1]])if(c=b[i][0],l=c.type,k=c.value,"i"===l)j.uniform1i(f,k);else if("f"===l)j.uniform1f(f,k);else if("v2"===l)j.uniform2f(f,k.x,k.y);else if("v3"===l)j.uniform3f(f,k.x,k.y,k.z);else if("v4"===l)j.uniform4f(f,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(f,k.r,k.g,k.b);else if("iv1"===l)j.uniform1iv(f,k);else if("iv"===l)j.uniform3iv(f,k);else if("fv1"===l)j.uniform1fv(f,k);else if("fv"===l)j.uniform3fv(f,k);else if("v2v"===
 l){void 0===c._array&&(c._array=new Float32Array(2*k.length));l=0;for(n=k.length;l<n;l++)q=2*l,c._array[q]=k[l].x,c._array[q+1]=k[l].y;j.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*k.length));l=0;for(n=k.length;l<n;l++)q=3*l,c._array[q]=k[l].x,c._array[q+1]=k[l].y,c._array[q+2]=k[l].z;j.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*k.length));l=0;for(n=k.length;l<n;l++)q=4*l,c._array[q]=k[l].x,c._array[q+1]=
 k[l].y,c._array[q+2]=k[l].z,c._array[q+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=new Float32Array(16*k.length));l=0;for(n=k.length;l<n;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(q=k,k=C(),j.uniform1i(f,k),q)if(q.image instanceof Array&&6===q.image.length){if(c=q,f=k,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||
 (c.addEventListener("dispose",Kb),c.image.__webglTextureCube=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+f);j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(l=0;6>l;l++)K.autoScaleCubemaps&&!f?(n=k,q=l,t=c.image[l],w=qc,t.width<=w&&t.height<=w||(x=Math.max(t.width,t.height),u=Math.floor(t.width*w/x),w=Math.floor(t.height*w/x),x=document.createElement("canvas"),x.width=
-u,x.height=w,x.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,u,w),t=x),n[q]=t):k[l]=c.image[l];l=k[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);q=A(c.format);t=A(c.type);E(j.TEXTURE_CUBE_MAP,c,n);for(l=0;6>l;l++)if(f){w=k[l].mipmaps;x=0;for(v=w.length;x<v;x++)u=w[x],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,x,q,u.width,u.height,0,u.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,q,q,t,k[l]);c.generateMipmaps&&n&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=
+u,x.height=w,x.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,u,w),t=x),n[q]=t):k[l]=c.image[l];l=k[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);q=A(c.format);t=A(c.type);E(j.TEXTURE_CUBE_MAP,c,n);for(l=0;6>l;l++)if(f){w=k[l].mipmaps;x=0;for(B=w.length;x<B;x++)u=w[x],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,x,q,u.width,u.height,0,u.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,q,q,t,k[l]);c.generateMipmaps&&n&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=
 !1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else q instanceof THREE.WebGLRenderTargetCube?(c=q,j.activeTexture(j.TEXTURE0+k),j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture)):K.setTexture(q,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(n=c.value.length;l<n;l++)c._array[l]=C();j.uniform1iv(f,c._array);l=0;for(n=c.value.length;l<n;l++)q=c.value[l],k=c._array[l],q&&K.setTexture(q,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
 l);if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition)ua.getPositionFromMatrix(a.matrixWorld),j.uniform3f(h.cameraPosition,ua.x,ua.y,ua.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&j.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&j.uniformMatrix3fv(h.normalMatrix,
-!1,e._normalMatrix.elements);null!==h.modelMatrix&&j.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function C(){var a=aa;a>=Wb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Wb);aa+=1;return a}function z(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function y(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function F(a){a!==Aa&&(j.lineWidth(a),Aa=a)}function x(a,b,c){Ha!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),
-Ha=a);if(a&&(Xa!==b||Sa!==c))j.polygonOffset(b,c),Xa=b,Sa=c}function O(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function B(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(O(b)),null):c}function E(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,A(b.wrapS)),
+!1,e._normalMatrix.elements);null!==h.modelMatrix&&j.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function C(){var a=P;a>=Wb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Wb);P+=1;return a}function z(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function y(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function F(a){a!==za&&(j.lineWidth(a),za=a)}function x(a,b,c){Ga!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),
+Ga=a);if(a&&(Xa!==b||Sa!==c))j.polygonOffset(b,c),Xa=b,Sa=c}function O(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function B(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(O(b)),null):c}function E(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,A(b.wrapS)),
 j.texParameteri(a,j.TEXTURE_WRAP_T,A(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,A(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,A(b.minFilter))):(j.texParameteri(a,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,D(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,D(b.minFilter)));if(ya&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,ya.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
 Xb)),b.__oldAnisotropy=b.anisotropy}function I(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,
 j.RGBA4,b.width,b.height)}function D(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?j.NEAREST:j.LINEAR}function A(a){if(a===THREE.RepeatWrapping)return j.REPEAT;if(a===THREE.ClampToEdgeWrapping)return j.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return j.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return j.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return j.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return j.NEAREST_MIPMAP_LINEAR;
 if(a===THREE.LinearFilter)return j.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return j.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return j.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return j.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return j.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return j.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return j.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return j.BYTE;if(a===THREE.ShortType)return j.SHORT;
 if(a===THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===
 THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;
-if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==Ia){if(a===THREE.RGB_S3TC_DXT1_Format)return Ia.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ia.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Ia.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ia.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);
+if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==Ha){if(a===THREE.RGB_S3TC_DXT1_Format)return Ha.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ha.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Ha.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ha.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);
 var a=a||{},G=void 0!==a.canvas?a.canvas:document.createElement("canvas"),R=void 0!==a.precision?a.precision:"highp",J=void 0!==a.alpha?a.alpha:!0,ba=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,qa=void 0!==a.antialias?a.antialias:!1,ra=void 0!==a.stencil?a.stencil:!0,N=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=new THREE.Color(0),Q=0;void 0!==a.clearColor&&(console.warn("DEPRECATED: clearColor in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),
 M.setHex(a.clearColor));void 0!==a.clearAlpha&&(console.warn("DEPRECATED: clearAlpha in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),Q=a.clearAlpha);this.domElement=G;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=
-this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var K=this,da=[],za=0,Fa=null,ea=null,Ea=-1,Z=null,fa=null,V=0,aa=0,P=-1,T=-1,ma=-1,va=
--1,ja=-1,Pa=-1,Ja=-1,ga=-1,Ha=null,Xa=null,Sa=null,Aa=null,hb=0,ib=0,tb=0,ub=0,vb=0,jb=0,Ka={},na=new THREE.Frustum,ta=new THREE.Matrix4,kb=new THREE.Matrix4,ua=new THREE.Vector3,ha=new THREE.Vector3,wa=!0,Ra={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},j,Wa,xa,ya,Ia;try{if(!(j=
-G.getContext("experimental-webgl",{alpha:J,premultipliedAlpha:ba,antialias:qa,stencil:ra,preserveDrawingBuffer:N})))throw"Error creating WebGL context.";}catch(Ta){console.error(Ta)}Wa=j.getExtension("OES_texture_float");j.getExtension("OES_texture_float_linear");xa=j.getExtension("OES_standard_derivatives");ya=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ia=j.getExtension("WEBGL_compressed_texture_s3tc")||
-j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Wa||console.log("THREE.WebGLRenderer: Float textures not supported.");xa||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");ya||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");Ia||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,
-rangeMax:1,precision:1}});j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(M.r,M.g,M.b,Q);this.context=j;var Wb=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),pc=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var qc=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),
-Xb=ya?j.getParameter(ya.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Ib=0<pc,Eb=Ib&&Wa;Ia&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var rc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),sc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var tc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),uc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,
-j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var vc=0<rc.precision&&0<tc.precision,Yb=0<sc.precision&&0<uc.precision;"highp"===R&&!vc&&(Yb?(R="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(R="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));
-"mediump"===R&&!Yb&&(R="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return Ib};this.supportsFloatTextures=function(){return Wa};this.supportsStandardDerivatives=function(){return xa};this.supportsCompressedTextureS3TC=function(){return Ia};this.getMaxAnisotropy=function(){return Xb};this.getPrecision=function(){return R};this.setSize=function(a,b,c){G.width=a*this.devicePixelRatio;G.height=b*this.devicePixelRatio;
+this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var K=this,da=[],Ia=0,Ea=null,ea=null,Da=-1,$=null,fa=null,V=0,P=0,Z=-1,T=-1,ma=-1,va=-1,
+ja=-1,Pa=-1,Ja=-1,ga=-1,Ga=null,Xa=null,Sa=null,za=null,hb=0,ib=0,tb=0,ub=0,vb=0,jb=0,Ka={},na=new THREE.Frustum,ta=new THREE.Matrix4,kb=new THREE.Matrix4,ua=new THREE.Vector3,ha=new THREE.Vector3,wa=!0,Ra={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},j,Wa,xa,ya,Ha;try{if(!(j=G.getContext("experimental-webgl",
+{alpha:J,premultipliedAlpha:ba,antialias:qa,stencil:ra,preserveDrawingBuffer:N})))throw"Error creating WebGL context.";}catch(Ta){console.error(Ta)}Wa=j.getExtension("OES_texture_float");j.getExtension("OES_texture_float_linear");xa=j.getExtension("OES_standard_derivatives");ya=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ha=j.getExtension("WEBGL_compressed_texture_s3tc")||j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||
+j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Wa||console.log("THREE.WebGLRenderer: Float textures not supported.");xa||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");ya||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");Ha||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});j.clearColor(0,
+0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(M.r,M.g,M.b,Q);this.context=j;var Wb=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),pc=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var qc=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Xb=ya?j.getParameter(ya.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
+0,Ib=0<pc,Eb=Ib&&Wa;Ha&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var rc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),sc=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var tc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),uc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,
+j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var vc=0<rc.precision&&0<tc.precision,Yb=0<sc.precision&&0<uc.precision;"highp"===R&&!vc&&(Yb?(R="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(R="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));
+"mediump"===R&&!Yb&&(R="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return Ib};this.supportsFloatTextures=function(){return Wa};this.supportsStandardDerivatives=function(){return xa};this.supportsCompressedTextureS3TC=function(){return Ha};this.getMaxAnisotropy=function(){return Xb};this.getPrecision=function(){return R};this.setSize=function(a,b,c){G.width=a*this.devicePixelRatio;G.height=b*this.devicePixelRatio;
 1!==this.devicePixelRatio&&!1!==c&&(G.style.width=a+"px",G.style.height=b+"px");this.setViewport(0,0,G.width,G.height)};this.setViewport=function(a,b,c,d){hb=void 0!==a?a:0;ib=void 0!==b?b:0;tb=void 0!==c?c:G.width;ub=void 0!==d?d:G.height;j.viewport(hb,ib,tb,ub)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColor=function(a,b){M.set(a);Q=void 0!==b?b:1;j.clearColor(M.r,M.g,M.b,Q)};this.setClearColorHex=
 function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return M};this.getClearAlpha=function(){return Q};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);
-this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Fa=null;Ea=Z=ga=Ja=ma=-1;wa=!0;T=P=-1;this.shadowMapPlugin.update(a,b)};var Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&j.deleteBuffer(b[c].buffer)}else{if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];
+this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Ea=null;Da=$=ga=Ja=ma=-1;wa=!0;T=Z=-1;this.shadowMapPlugin.update(a,b)};var Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&j.deleteBuffer(b[c].buffer)}else{if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];
 if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}Nb(c)}Nb(a)}K.info.memory.geometries--},Kb=function(a){a=a.target;a.removeEventListener("dispose",Kb);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));K.info.memory.textures--},
 Lb=function(a){a=a.target;a.removeEventListener("dispose",Lb);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);K.info.memory.textures--},Mb=function(a){a=a.target;a.removeEventListener("dispose",Mb);Ob(a)},Nb=function(a){void 0!==a.__webglVertexBuffer&&
 j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);
@@ -427,12 +427,12 @@ void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__w
 d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=da.length;a<c;a++)d=da[a],d.program!==b&&e.push(d);da=e;j.deleteProgram(b);K.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());
 a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,g,h,i,k,l,m,n,p,r=3*a.count;for(p=0;p<r;p+=9)n=a.normalArray,d=n[p],e=n[p+1],f=n[p+2],g=n[p+3],i=n[p+4],l=n[p+5],h=n[p+6],k=n[p+7],m=n[p+8],d=(d+g+h)/
 3,e=(e+i+k)/3,f=(f+l+m)/3,n[p]=d,n[p+1]=e,n[p+2]=f,n[p+3]=d,n[p+4]=e,n[p+5]=f,n[p+6]=d,n[p+7]=e,n[p+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,a.uvArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&
-c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,k,l,m;i=v(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==Z&&(Z=i,c=!0);c&&g();if(f instanceof
+c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,k,l,m;i=v(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==$&&($=i,c=!0);c&&g();if(f instanceof
 THREE.Mesh)if(f=a.index){e=e.offsets;1<e.length&&(c=!0);for(var n=0,p=e.length;n<p;n++){var r=e[n].index;if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*r*m)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,f.buffer)}j.drawElements(j.TRIANGLES,
 e[n].count,j.UNSIGNED_SHORT,2*e[n].start);K.info.render.calls++;K.info.render.vertices+=e[n].count;K.info.render.faces+=e[n].count/3}}else{if(c)for(k in b)"index"!==k&&(l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k]))));
 d=e.attributes.position;j.drawArrays(j.TRIANGLES,0,d.numItems/3);K.info.render.calls++;K.info.render.vertices+=d.numItems/3;K.info.render.faces+=d.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&
 j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));d=a.position;j.drawArrays(j.POINTS,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems/3}}else if(f instanceof THREE.Line&&c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&
-j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;F(d.linewidth);d=a.position;j.drawArrays(k,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=v(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Z&&(Z=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,
+j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;F(d.linewidth);d=a.position;j.drawArrays(k,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=v(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==$&&($=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,
 3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;l=f.morphTargetForcedOrder;for(i=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&
 m<l.length;)0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[m]]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[m]]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[l[m]],m++}else{l=[];i=f.morphTargetInfluences;var n,p=i.length;for(n=0;n<p;n++)m=i[n],0<m&&l.push([m,
 n]);l.length>d.numSupportedMorphTargets?(l.sort(k),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(k):0===l.length&&l.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)l[m]?(n=l[m][1],0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n]),h(c["morphNormal"+
@@ -442,37 +442,37 @@ j.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0))}0<=
 d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv2,d.defaultAttributeValues.uv2));d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(a.skinIndex),j.vertexAttribPointer(a.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),h(a.skinWeight),j.vertexAttribPointer(a.skinWeight,4,j.FLOAT,!1,0,0));0<=a.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(a.lineDistance),j.vertexAttribPointer(a.lineDistance,
 1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(F(d.wireframeLinewidth),b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),K.info.render.calls++,K.info.render.vertices+=e.__webglFaceCount,K.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:
 j.LINES,F(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),K.info.render.calls++):f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),K.info.render.calls++,K.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),K.info.render.calls++)}};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,
-f,g,h,k=a.__lights,p=a.fog;Ea=-1;wa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ta.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);na.setFromMatrix(ta);this.autoUpdateObjects&&this.initWebGLObjects(a);l(this.renderPluginsPre,a,b);K.info.render.calls=0;K.info.render.vertices=0;K.info.render.faces=0;K.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,
+f,g,h,k=a.__lights,p=a.fog;Da=-1;wa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ta.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);na.setFromMatrix(ta);this.autoUpdateObjects&&this.initWebGLObjects(a);l(this.renderPluginsPre,a,b);K.info.render.calls=0;K.info.render.vertices=0;K.info.render.faces=0;K.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,
 this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh||g instanceof THREE.ParticleSystem)||!g.frustumCulled||na.intersectsObject(g))){var r=g;r._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,r.matrixWorld);r._normalMatrix.getNormalMatrix(r._modelViewMatrix);var r=f,s=r.buffer,q=void 0,t=q=void 0,t=r.object.material;if(t instanceof THREE.MeshFaceMaterial)q=s.materialIndex,q=t.materials[q],q.transparent?
 (r.transparent=q,r.opaque=null):(r.opaque=q,r.transparent=null);else if(q=t)q.transparent?(r.transparent=q,r.opaque=null):(r.opaque=q,r.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ua.getPositionFromMatrix(g.matrixWorld),ua.applyProjection(ta),f.z=ua.z))}this.sortObjects&&h.sort(i);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),
 g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),x(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(a.__webglObjects,!1,"",b,k,p,!0,d),n(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(a.__webglObjects,!0,"opaque",b,k,p,!1,d),n(a.__webglObjectsImmediate,
 "opaque",b,k,p,!1,d),m(a.__webglObjects,!1,"transparent",b,k,p,!0,d),n(a.__webglObjectsImmediate,"transparent",b,k,p,!0,d));l(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,
-null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=v(a,b,c,d,e);Z=-1;K.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,na):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)r(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)q(a.__objectsRemoved[0],
+null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=v(a,b,c,d,e);$=-1;K.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,na):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)r(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)q(a.__objectsRemoved[0],
 a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&q(h,a),r(h,a));var i=h,l=i.geometry,m=void 0,n=void 0,t=void 0;if(l instanceof THREE.BufferGeometry){var u=j.DYNAMIC_DRAW,w=!l.dynamic,x=l.attributes,y=void 0,z=void 0;for(y in x)z=x[y],z.needsUpdate&&("index"===y?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,z.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,z.array,u)):(j.bindBuffer(j.ARRAY_BUFFER,
 z.buffer),j.bufferData(j.ARRAY_BUFFER,z.array,u)),z.needsUpdate=!1),w&&!z.dynamic&&(z.array=null)}else if(i instanceof THREE.Mesh){for(var A=0,B=l.geometryGroupsList.length;A<B;A++)if(m=l.geometryGroupsList[A],t=d(i,m),l.buffersNeedUpdate&&c(m,i),n=t.attributes&&p(t),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||n){var v=m,D=i,C=j.DYNAMIC_DRAW,F=!l.dynamic,G=t;if(v.__inittedArrays){var J=e(G),K=
-G.vertexColors?G.vertexColors:!1,N=f(G),O=J===THREE.SmoothShading,E=void 0,I=void 0,V=void 0,M=void 0,R=void 0,Q=void 0,T=void 0,ea=void 0,za=void 0,Z=void 0,aa=void 0,P=void 0,X=void 0,W=void 0,Fa=void 0,fa=void 0,Ea=void 0,ba=void 0,da=void 0,ja=void 0,ga=void 0,ha=void 0,ma=void 0,na=void 0,qa=void 0,ra=void 0,va=void 0,wa=void 0,xa=void 0,Ga=void 0,Ha=void 0,Ja=void 0,Ia=void 0,Pa=void 0,Ua=void 0,Ka=void 0,ya=void 0,Aa=void 0,Sa=void 0,Wa=void 0,fb=0,gb=0,Ra=0,Ta=0,Xa=0,lb=0,Va=0,yb=0,cb=0,sa=
-0,Ba=0,L=0,Qa=void 0,mb=v.__vertexArray,hb=v.__uvArray,ib=v.__uv2Array,Ab=v.__normalArray,Ya=v.__tangentArray,nb=v.__colorArray,Za=v.__skinIndexArray,$a=v.__skinWeightArray,tb=v.__morphTargetsArrays,ub=v.__morphNormalsArrays,vb=v.__webglCustomAttributesList,H=void 0,jb=v.__faceArray,Bb=v.__lineArray,La=D.geometry,Ib=La.elementsNeedUpdate,Eb=La.uvsNeedUpdate,Kb=La.normalsNeedUpdate,Wb=La.tangentsNeedUpdate,Xb=La.colorsNeedUpdate,Yb=La.morphTargetsNeedUpdate,xc=La.vertices,$=v.faces3,ob=La.faces,Jb=
-La.faceVertexUvs[0],Lb=La.faceVertexUvs[1],yc=La.skinIndices,Zb=La.skinWeights,$b=La.morphTargets,Mb=La.morphNormals;if(La.verticesNeedUpdate){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],P=xc[M.a],X=xc[M.b],W=xc[M.c],mb[gb]=P.x,mb[gb+1]=P.y,mb[gb+2]=P.z,mb[gb+3]=X.x,mb[gb+4]=X.y,mb[gb+5]=X.z,mb[gb+6]=W.x,mb[gb+7]=W.y,mb[gb+8]=W.z,gb+=9;j.bindBuffer(j.ARRAY_BUFFER,v.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,mb,C)}if(Yb){Ua=0;for(Ka=$b.length;Ua<Ka;Ua++){E=Ba=0;for(I=$.length;E<I;E++)Sa=$[E],M=ob[Sa],
-P=$b[Ua].vertices[M.a],X=$b[Ua].vertices[M.b],W=$b[Ua].vertices[M.c],ya=tb[Ua],ya[Ba]=P.x,ya[Ba+1]=P.y,ya[Ba+2]=P.z,ya[Ba+3]=X.x,ya[Ba+4]=X.y,ya[Ba+5]=X.z,ya[Ba+6]=W.x,ya[Ba+7]=W.y,ya[Ba+8]=W.z,G.morphNormals&&(O?(Wa=Mb[Ua].vertexNormals[Sa],ba=Wa.a,da=Wa.b,ja=Wa.c):ja=da=ba=Mb[Ua].faceNormals[Sa],Aa=ub[Ua],Aa[Ba]=ba.x,Aa[Ba+1]=ba.y,Aa[Ba+2]=ba.z,Aa[Ba+3]=da.x,Aa[Ba+4]=da.y,Aa[Ba+5]=da.z,Aa[Ba+6]=ja.x,Aa[Ba+7]=ja.y,Aa[Ba+8]=ja.z),Ba+=9;j.bindBuffer(j.ARRAY_BUFFER,v.__webglMorphTargetsBuffers[Ua]);
-j.bufferData(j.ARRAY_BUFFER,tb[Ua],C);G.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglMorphNormalsBuffers[Ua]),j.bufferData(j.ARRAY_BUFFER,ub[Ua],C))}}if(Zb.length){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],na=Zb[M.a],qa=Zb[M.b],ra=Zb[M.c],$a[sa]=na.x,$a[sa+1]=na.y,$a[sa+2]=na.z,$a[sa+3]=na.w,$a[sa+4]=qa.x,$a[sa+5]=qa.y,$a[sa+6]=qa.z,$a[sa+7]=qa.w,$a[sa+8]=ra.x,$a[sa+9]=ra.y,$a[sa+10]=ra.z,$a[sa+11]=ra.w,va=yc[M.a],wa=yc[M.b],xa=yc[M.c],Za[sa]=va.x,Za[sa+1]=va.y,Za[sa+2]=va.z,Za[sa+3]=va.w,Za[sa+
-4]=wa.x,Za[sa+5]=wa.y,Za[sa+6]=wa.z,Za[sa+7]=wa.w,Za[sa+8]=xa.x,Za[sa+9]=xa.y,Za[sa+10]=xa.z,Za[sa+11]=xa.w,sa+=12;0<sa&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,Za,C),j.bindBuffer(j.ARRAY_BUFFER,v.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,$a,C))}if(Xb&&K){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],T=M.vertexColors,ea=M.color,3===T.length&&K===THREE.VertexColors?(ga=T[0],ha=T[1],ma=T[2]):ma=ha=ga=ea,nb[cb]=ga.r,nb[cb+1]=ga.g,nb[cb+2]=ga.b,nb[cb+3]=
-ha.r,nb[cb+4]=ha.g,nb[cb+5]=ha.b,nb[cb+6]=ma.r,nb[cb+7]=ma.g,nb[cb+8]=ma.b,cb+=9;0<cb&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,nb,C))}if(Wb&&La.hasTangents){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],za=M.vertexTangents,Fa=za[0],fa=za[1],Ea=za[2],Ya[Va]=Fa.x,Ya[Va+1]=Fa.y,Ya[Va+2]=Fa.z,Ya[Va+3]=Fa.w,Ya[Va+4]=fa.x,Ya[Va+5]=fa.y,Ya[Va+6]=fa.z,Ya[Va+7]=fa.w,Ya[Va+8]=Ea.x,Ya[Va+9]=Ea.y,Ya[Va+10]=Ea.z,Ya[Va+11]=Ea.w,Va+=12;j.bindBuffer(j.ARRAY_BUFFER,v.__webglTangentBuffer);
-j.bufferData(j.ARRAY_BUFFER,Ya,C)}if(Kb&&J){E=0;for(I=$.length;E<I;E++)if(M=ob[$[E]],R=M.vertexNormals,Q=M.normal,3===R.length&&O)for(Ga=0;3>Ga;Ga++)Ja=R[Ga],Ab[lb]=Ja.x,Ab[lb+1]=Ja.y,Ab[lb+2]=Ja.z,lb+=3;else for(Ga=0;3>Ga;Ga++)Ab[lb]=Q.x,Ab[lb+1]=Q.y,Ab[lb+2]=Q.z,lb+=3;j.bindBuffer(j.ARRAY_BUFFER,v.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Ab,C)}if(Eb&&Jb&&N){E=0;for(I=$.length;E<I;E++)if(V=$[E],Z=Jb[V],void 0!==Z)for(Ga=0;3>Ga;Ga++)Ia=Z[Ga],hb[Ra]=Ia.x,hb[Ra+1]=Ia.y,Ra+=2;0<Ra&&(j.bindBuffer(j.ARRAY_BUFFER,
-v.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,hb,C))}if(Eb&&Lb&&N){E=0;for(I=$.length;E<I;E++)if(V=$[E],aa=Lb[V],void 0!==aa)for(Ga=0;3>Ga;Ga++)Pa=aa[Ga],ib[Ta]=Pa.x,ib[Ta+1]=Pa.y,Ta+=2;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,ib,C))}if(Ib){E=0;for(I=$.length;E<I;E++)jb[Xa]=fb,jb[Xa+1]=fb+1,jb[Xa+2]=fb+2,Xa+=3,Bb[yb]=fb,Bb[yb+1]=fb+1,Bb[yb+2]=fb,Bb[yb+3]=fb+2,Bb[yb+4]=fb+1,Bb[yb+5]=fb+2,yb+=6,fb+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,v.__webglFaceBuffer);
-j.bufferData(j.ELEMENT_ARRAY_BUFFER,jb,C);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,v.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,C)}if(vb){Ga=0;for(Ha=vb.length;Ga<Ha;Ga++)if(H=vb[Ga],H.__original.needsUpdate){L=0;if(1===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],H.array[L]=H.value[M.a],H.array[L+1]=H.value[M.b],H.array[L+2]=H.value[M.c],L+=3}else{if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)Qa=H.value[$[E]],H.array[L]=Qa,H.array[L+1]=
-Qa,H.array[L+2]=Qa,L+=3}}else if(2===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}else{if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)W=X=P=Qa=H.value[$[E]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}}else if(3===H.size){var pa;pa="c"===H.type?
-["r","g","b"]:["x","y","z"];if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)W=X=P=Qa=H.value[$[E]],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],
-H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faceVertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)Qa=H.value[$[E]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}}else if(4===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=
-0;for(I=$.length;E<I;E++)M=ob[$[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)W=X=P=Qa=H.value[$[E]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,
-H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faceVertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)Qa=H.value[$[E]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}j.bindBuffer(j.ARRAY_BUFFER,H.buffer);j.bufferData(j.ARRAY_BUFFER,H.array,C)}}F&&(delete v.__inittedArrays,delete v.__colorArray,
-delete v.__normalArray,delete v.__tangentArray,delete v.__uvArray,delete v.__uv2Array,delete v.__faceArray,delete v.__vertexArray,delete v.__lineArray,delete v.__skinIndexArray,delete v.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Ribbon){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||
-l.colorsNeedUpdate||l.normalsNeedUpdate||n){var ab=l,ac=j.DYNAMIC_DRAW,Pb=void 0,Qb=void 0,Rb=void 0,bc=void 0,ca=void 0,cc=void 0,dc=void 0,ec=void 0,Nb=void 0,Ca=void 0,Fb=void 0,ka=void 0,Ma=void 0,Ob=ab.vertices,Ec=ab.colors,Fc=ab.normals,pc=Ob.length,qc=Ec.length,rc=Fc.length,fc=ab.__vertexArray,gc=ab.__colorArray,hc=ab.__normalArray,sc=ab.colorsNeedUpdate,tc=ab.normalsNeedUpdate,zc=ab.__webglCustomAttributesList;if(ab.verticesNeedUpdate){for(Pb=0;Pb<pc;Pb++)bc=Ob[Pb],ca=3*Pb,fc[ca]=bc.x,fc[ca+
+G.vertexColors?G.vertexColors:!1,N=f(G),O=J===THREE.SmoothShading,E=void 0,I=void 0,V=void 0,M=void 0,R=void 0,Q=void 0,T=void 0,ea=void 0,Z=void 0,$=void 0,Ia=void 0,P=void 0,X=void 0,W=void 0,Ea=void 0,fa=void 0,Da=void 0,ba=void 0,da=void 0,ja=void 0,ga=void 0,ha=void 0,ma=void 0,na=void 0,qa=void 0,ra=void 0,va=void 0,wa=void 0,xa=void 0,Fa=void 0,Ga=void 0,Ja=void 0,Ha=void 0,Pa=void 0,Ua=void 0,Ka=void 0,ya=void 0,za=void 0,Sa=void 0,Wa=void 0,fb=0,gb=0,Ra=0,Ta=0,Xa=0,lb=0,Va=0,yb=0,cb=0,sa=
+0,Aa=0,L=0,Qa=void 0,mb=v.__vertexArray,hb=v.__uvArray,ib=v.__uv2Array,Ab=v.__normalArray,Ya=v.__tangentArray,nb=v.__colorArray,Za=v.__skinIndexArray,$a=v.__skinWeightArray,tb=v.__morphTargetsArrays,ub=v.__morphNormalsArrays,vb=v.__webglCustomAttributesList,H=void 0,jb=v.__faceArray,Bb=v.__lineArray,La=D.geometry,Ib=La.elementsNeedUpdate,Eb=La.uvsNeedUpdate,Kb=La.normalsNeedUpdate,Wb=La.tangentsNeedUpdate,Xb=La.colorsNeedUpdate,Yb=La.morphTargetsNeedUpdate,xc=La.vertices,aa=v.faces3,ob=La.faces,Jb=
+La.faceVertexUvs[0],Lb=La.faceVertexUvs[1],yc=La.skinIndices,Zb=La.skinWeights,$b=La.morphTargets,Mb=La.morphNormals;if(La.verticesNeedUpdate){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],P=xc[M.a],X=xc[M.b],W=xc[M.c],mb[gb]=P.x,mb[gb+1]=P.y,mb[gb+2]=P.z,mb[gb+3]=X.x,mb[gb+4]=X.y,mb[gb+5]=X.z,mb[gb+6]=W.x,mb[gb+7]=W.y,mb[gb+8]=W.z,gb+=9;j.bindBuffer(j.ARRAY_BUFFER,v.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,mb,C)}if(Yb){Ua=0;for(Ka=$b.length;Ua<Ka;Ua++){E=Aa=0;for(I=aa.length;E<I;E++)Sa=aa[E],M=
+ob[Sa],P=$b[Ua].vertices[M.a],X=$b[Ua].vertices[M.b],W=$b[Ua].vertices[M.c],ya=tb[Ua],ya[Aa]=P.x,ya[Aa+1]=P.y,ya[Aa+2]=P.z,ya[Aa+3]=X.x,ya[Aa+4]=X.y,ya[Aa+5]=X.z,ya[Aa+6]=W.x,ya[Aa+7]=W.y,ya[Aa+8]=W.z,G.morphNormals&&(O?(Wa=Mb[Ua].vertexNormals[Sa],ba=Wa.a,da=Wa.b,ja=Wa.c):ja=da=ba=Mb[Ua].faceNormals[Sa],za=ub[Ua],za[Aa]=ba.x,za[Aa+1]=ba.y,za[Aa+2]=ba.z,za[Aa+3]=da.x,za[Aa+4]=da.y,za[Aa+5]=da.z,za[Aa+6]=ja.x,za[Aa+7]=ja.y,za[Aa+8]=ja.z),Aa+=9;j.bindBuffer(j.ARRAY_BUFFER,v.__webglMorphTargetsBuffers[Ua]);
+j.bufferData(j.ARRAY_BUFFER,tb[Ua],C);G.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglMorphNormalsBuffers[Ua]),j.bufferData(j.ARRAY_BUFFER,ub[Ua],C))}}if(Zb.length){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],na=Zb[M.a],qa=Zb[M.b],ra=Zb[M.c],$a[sa]=na.x,$a[sa+1]=na.y,$a[sa+2]=na.z,$a[sa+3]=na.w,$a[sa+4]=qa.x,$a[sa+5]=qa.y,$a[sa+6]=qa.z,$a[sa+7]=qa.w,$a[sa+8]=ra.x,$a[sa+9]=ra.y,$a[sa+10]=ra.z,$a[sa+11]=ra.w,va=yc[M.a],wa=yc[M.b],xa=yc[M.c],Za[sa]=va.x,Za[sa+1]=va.y,Za[sa+2]=va.z,Za[sa+3]=va.w,Za[sa+
+4]=wa.x,Za[sa+5]=wa.y,Za[sa+6]=wa.z,Za[sa+7]=wa.w,Za[sa+8]=xa.x,Za[sa+9]=xa.y,Za[sa+10]=xa.z,Za[sa+11]=xa.w,sa+=12;0<sa&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,Za,C),j.bindBuffer(j.ARRAY_BUFFER,v.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,$a,C))}if(Xb&&K){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],T=M.vertexColors,ea=M.color,3===T.length&&K===THREE.VertexColors?(ga=T[0],ha=T[1],ma=T[2]):ma=ha=ga=ea,nb[cb]=ga.r,nb[cb+1]=ga.g,nb[cb+2]=ga.b,nb[cb+
+3]=ha.r,nb[cb+4]=ha.g,nb[cb+5]=ha.b,nb[cb+6]=ma.r,nb[cb+7]=ma.g,nb[cb+8]=ma.b,cb+=9;0<cb&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,nb,C))}if(Wb&&La.hasTangents){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],Z=M.vertexTangents,Ea=Z[0],fa=Z[1],Da=Z[2],Ya[Va]=Ea.x,Ya[Va+1]=Ea.y,Ya[Va+2]=Ea.z,Ya[Va+3]=Ea.w,Ya[Va+4]=fa.x,Ya[Va+5]=fa.y,Ya[Va+6]=fa.z,Ya[Va+7]=fa.w,Ya[Va+8]=Da.x,Ya[Va+9]=Da.y,Ya[Va+10]=Da.z,Ya[Va+11]=Da.w,Va+=12;j.bindBuffer(j.ARRAY_BUFFER,v.__webglTangentBuffer);
+j.bufferData(j.ARRAY_BUFFER,Ya,C)}if(Kb&&J){E=0;for(I=aa.length;E<I;E++)if(M=ob[aa[E]],R=M.vertexNormals,Q=M.normal,3===R.length&&O)for(Fa=0;3>Fa;Fa++)Ja=R[Fa],Ab[lb]=Ja.x,Ab[lb+1]=Ja.y,Ab[lb+2]=Ja.z,lb+=3;else for(Fa=0;3>Fa;Fa++)Ab[lb]=Q.x,Ab[lb+1]=Q.y,Ab[lb+2]=Q.z,lb+=3;j.bindBuffer(j.ARRAY_BUFFER,v.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Ab,C)}if(Eb&&Jb&&N){E=0;for(I=aa.length;E<I;E++)if(V=aa[E],$=Jb[V],void 0!==$)for(Fa=0;3>Fa;Fa++)Ha=$[Fa],hb[Ra]=Ha.x,hb[Ra+1]=Ha.y,Ra+=2;0<Ra&&(j.bindBuffer(j.ARRAY_BUFFER,
+v.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,hb,C))}if(Eb&&Lb&&N){E=0;for(I=aa.length;E<I;E++)if(V=aa[E],Ia=Lb[V],void 0!==Ia)for(Fa=0;3>Fa;Fa++)Pa=Ia[Fa],ib[Ta]=Pa.x,ib[Ta+1]=Pa.y,Ta+=2;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,ib,C))}if(Ib){E=0;for(I=aa.length;E<I;E++)jb[Xa]=fb,jb[Xa+1]=fb+1,jb[Xa+2]=fb+2,Xa+=3,Bb[yb]=fb,Bb[yb+1]=fb+1,Bb[yb+2]=fb,Bb[yb+3]=fb+2,Bb[yb+4]=fb+1,Bb[yb+5]=fb+2,yb+=6,fb+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,v.__webglFaceBuffer);
+j.bufferData(j.ELEMENT_ARRAY_BUFFER,jb,C);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,v.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,C)}if(vb){Fa=0;for(Ga=vb.length;Fa<Ga;Fa++)if(H=vb[Fa],H.__original.needsUpdate){L=0;if(1===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],H.array[L]=H.value[M.a],H.array[L+1]=H.value[M.b],H.array[L+2]=H.value[M.c],L+=3}else{if("faces"===H.boundTo){E=0;for(I=aa.length;E<I;E++)Qa=H.value[aa[E]],H.array[L]=Qa,H.array[L+
+1]=Qa,H.array[L+2]=Qa,L+=3}}else if(2===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}else{if("faces"===H.boundTo){E=0;for(I=aa.length;E<I;E++)W=X=P=Qa=H.value[aa[E]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}}else if(3===H.size){var pa;pa=
+"c"===H.type?["r","g","b"]:["x","y","z"];if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faces"===H.boundTo){E=0;for(I=aa.length;E<I;E++)W=X=P=Qa=H.value[aa[E]],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+
+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faceVertices"===H.boundTo){E=0;for(I=aa.length;E<I;E++)Qa=H.value[aa[E]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}}else if(4===H.size)if(void 0===H.boundTo||"vertices"===
+H.boundTo){E=0;for(I=aa.length;E<I;E++)M=ob[aa[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faces"===H.boundTo){E=0;for(I=aa.length;E<I;E++)W=X=P=Qa=H.value[aa[E]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,
+H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faceVertices"===H.boundTo){E=0;for(I=aa.length;E<I;E++)Qa=H.value[aa[E]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}j.bindBuffer(j.ARRAY_BUFFER,H.buffer);j.bufferData(j.ARRAY_BUFFER,H.array,C)}}F&&(delete v.__inittedArrays,
+delete v.__colorArray,delete v.__normalArray,delete v.__tangentArray,delete v.__uvArray,delete v.__uv2Array,delete v.__faceArray,delete v.__vertexArray,delete v.__lineArray,delete v.__skinIndexArray,delete v.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Ribbon){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||
+l.colorsNeedUpdate||l.normalsNeedUpdate||n){var ab=l,ac=j.DYNAMIC_DRAW,Pb=void 0,Qb=void 0,Rb=void 0,bc=void 0,ca=void 0,cc=void 0,dc=void 0,ec=void 0,Nb=void 0,Ba=void 0,Fb=void 0,ka=void 0,Ma=void 0,Ob=ab.vertices,Ec=ab.colors,Fc=ab.normals,pc=Ob.length,qc=Ec.length,rc=Fc.length,fc=ab.__vertexArray,gc=ab.__colorArray,hc=ab.__normalArray,sc=ab.colorsNeedUpdate,tc=ab.normalsNeedUpdate,zc=ab.__webglCustomAttributesList;if(ab.verticesNeedUpdate){for(Pb=0;Pb<pc;Pb++)bc=Ob[Pb],ca=3*Pb,fc[ca]=bc.x,fc[ca+
 1]=bc.y,fc[ca+2]=bc.z;j.bindBuffer(j.ARRAY_BUFFER,ab.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,fc,ac)}if(sc){for(Qb=0;Qb<qc;Qb++)cc=Ec[Qb],ca=3*Qb,gc[ca]=cc.r,gc[ca+1]=cc.g,gc[ca+2]=cc.b;j.bindBuffer(j.ARRAY_BUFFER,ab.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,gc,ac)}if(tc){for(Rb=0;Rb<rc;Rb++)dc=Fc[Rb],ca=3*Rb,hc[ca]=dc.x,hc[ca+1]=dc.y,hc[ca+2]=dc.z;j.bindBuffer(j.ARRAY_BUFFER,ab.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,hc,ac)}if(zc){ec=0;for(Nb=zc.length;ec<Nb;ec++)if(ka=zc[ec],
-ka.needsUpdate&&(void 0===ka.boundTo||"vertices"===ka.boundTo)){ca=0;Fb=ka.value.length;if(1===ka.size)for(Ca=0;Ca<Fb;Ca++)ka.array[Ca]=ka.value[Ca];else if(2===ka.size)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ca+=2;else if(3===ka.size)if("c"===ka.type)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.r,ka.array[ca+1]=Ma.g,ka.array[ca+2]=Ma.b,ca+=3;else for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ca+=3;else if(4===
-ka.size)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ka.array[ca+3]=Ma.w,ca+=4;j.bindBuffer(j.ARRAY_BUFFER,ka.buffer);j.bufferData(j.ARRAY_BUFFER,ka.array,ac)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.normalsNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Line){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var bb=l,ic=j.DYNAMIC_DRAW,Sb=void 0,Tb=void 0,Ub=void 0,jc=void 0,
-oa=void 0,kc=void 0,Gc=bb.vertices,Hc=bb.colors,Ic=bb.lineDistances,uc=Gc.length,vc=Hc.length,Oc=Ic.length,lc=bb.__vertexArray,mc=bb.__colorArray,Jc=bb.__lineDistanceArray,Pc=bb.colorsNeedUpdate,Qc=bb.lineDistancesNeedUpdate,Ac=bb.__webglCustomAttributesList,nc=void 0,Kc=void 0,Da=void 0,Gb=void 0,Na=void 0,la=void 0;if(bb.verticesNeedUpdate){for(Sb=0;Sb<uc;Sb++)jc=Gc[Sb],oa=3*Sb,lc[oa]=jc.x,lc[oa+1]=jc.y,lc[oa+2]=jc.z;j.bindBuffer(j.ARRAY_BUFFER,bb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,
-lc,ic)}if(Pc){for(Tb=0;Tb<vc;Tb++)kc=Hc[Tb],oa=3*Tb,mc[oa]=kc.r,mc[oa+1]=kc.g,mc[oa+2]=kc.b;j.bindBuffer(j.ARRAY_BUFFER,bb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,mc,ic)}if(Qc){for(Ub=0;Ub<Oc;Ub++)Jc[Ub]=Ic[Ub];j.bindBuffer(j.ARRAY_BUFFER,bb.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,Jc,ic)}if(Ac){nc=0;for(Kc=Ac.length;nc<Kc;nc++)if(la=Ac[nc],la.needsUpdate&&(void 0===la.boundTo||"vertices"===la.boundTo)){oa=0;Gb=la.value.length;if(1===la.size)for(Da=0;Da<Gb;Da++)la.array[Da]=
-la.value[Da];else if(2===la.size)for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.x,la.array[oa+1]=Na.y,oa+=2;else if(3===la.size)if("c"===la.type)for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.r,la.array[oa+1]=Na.g,la.array[oa+2]=Na.b,oa+=3;else for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.x,la.array[oa+1]=Na.y,la.array[oa+2]=Na.z,oa+=3;else if(4===la.size)for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.x,la.array[oa+1]=Na.y,la.array[oa+2]=Na.z,la.array[oa+3]=Na.w,oa+=4;j.bindBuffer(j.ARRAY_BUFFER,
+ka.needsUpdate&&(void 0===ka.boundTo||"vertices"===ka.boundTo)){ca=0;Fb=ka.value.length;if(1===ka.size)for(Ba=0;Ba<Fb;Ba++)ka.array[Ba]=ka.value[Ba];else if(2===ka.size)for(Ba=0;Ba<Fb;Ba++)Ma=ka.value[Ba],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ca+=2;else if(3===ka.size)if("c"===ka.type)for(Ba=0;Ba<Fb;Ba++)Ma=ka.value[Ba],ka.array[ca]=Ma.r,ka.array[ca+1]=Ma.g,ka.array[ca+2]=Ma.b,ca+=3;else for(Ba=0;Ba<Fb;Ba++)Ma=ka.value[Ba],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ca+=3;else if(4===
+ka.size)for(Ba=0;Ba<Fb;Ba++)Ma=ka.value[Ba],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ka.array[ca+3]=Ma.w,ca+=4;j.bindBuffer(j.ARRAY_BUFFER,ka.buffer);j.bufferData(j.ARRAY_BUFFER,ka.array,ac)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.normalsNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Line){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var bb=l,ic=j.DYNAMIC_DRAW,Sb=void 0,Tb=void 0,Ub=void 0,jc=void 0,
+oa=void 0,kc=void 0,Gc=bb.vertices,Hc=bb.colors,Ic=bb.lineDistances,uc=Gc.length,vc=Hc.length,Oc=Ic.length,lc=bb.__vertexArray,mc=bb.__colorArray,Jc=bb.__lineDistanceArray,Pc=bb.colorsNeedUpdate,Qc=bb.lineDistancesNeedUpdate,Ac=bb.__webglCustomAttributesList,nc=void 0,Kc=void 0,Ca=void 0,Gb=void 0,Na=void 0,la=void 0;if(bb.verticesNeedUpdate){for(Sb=0;Sb<uc;Sb++)jc=Gc[Sb],oa=3*Sb,lc[oa]=jc.x,lc[oa+1]=jc.y,lc[oa+2]=jc.z;j.bindBuffer(j.ARRAY_BUFFER,bb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,
+lc,ic)}if(Pc){for(Tb=0;Tb<vc;Tb++)kc=Hc[Tb],oa=3*Tb,mc[oa]=kc.r,mc[oa+1]=kc.g,mc[oa+2]=kc.b;j.bindBuffer(j.ARRAY_BUFFER,bb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,mc,ic)}if(Qc){for(Ub=0;Ub<Oc;Ub++)Jc[Ub]=Ic[Ub];j.bindBuffer(j.ARRAY_BUFFER,bb.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,Jc,ic)}if(Ac){nc=0;for(Kc=Ac.length;nc<Kc;nc++)if(la=Ac[nc],la.needsUpdate&&(void 0===la.boundTo||"vertices"===la.boundTo)){oa=0;Gb=la.value.length;if(1===la.size)for(Ca=0;Ca<Gb;Ca++)la.array[Ca]=
+la.value[Ca];else if(2===la.size)for(Ca=0;Ca<Gb;Ca++)Na=la.value[Ca],la.array[oa]=Na.x,la.array[oa+1]=Na.y,oa+=2;else if(3===la.size)if("c"===la.type)for(Ca=0;Ca<Gb;Ca++)Na=la.value[Ca],la.array[oa]=Na.r,la.array[oa+1]=Na.g,la.array[oa+2]=Na.b,oa+=3;else for(Ca=0;Ca<Gb;Ca++)Na=la.value[Ca],la.array[oa]=Na.x,la.array[oa+1]=Na.y,la.array[oa+2]=Na.z,oa+=3;else if(4===la.size)for(Ca=0;Ca<Gb;Ca++)Na=la.value[Ca],la.array[oa]=Na.x,la.array[oa+1]=Na.y,la.array[oa+2]=Na.z,la.array[oa+3]=Na.w,oa+=4;j.bindBuffer(j.ARRAY_BUFFER,
 la.buffer);j.bufferData(j.ARRAY_BUFFER,la.array,ic)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.ParticleSystem){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||i.sortParticles||n){var pb=l,Bc=j.DYNAMIC_DRAW,Vb=i,Oa=void 0,qb=void 0,rb=void 0,U=void 0,sb=void 0,zb=void 0,oc=pb.vertices,Cc=oc.length,Dc=pb.colors,Lc=Dc.length,Cb=pb.__vertexArray,Db=pb.__colorArray,wb=pb.__sortArray,Mc=pb.verticesNeedUpdate,
 Nc=pb.colorsNeedUpdate,xb=pb.__webglCustomAttributesList,db=void 0,Hb=void 0,Y=void 0,eb=void 0,ia=void 0,S=void 0;if(Vb.sortParticles){kb.copy(ta);kb.multiply(Vb.matrixWorld);for(Oa=0;Oa<Cc;Oa++)rb=oc[Oa],ua.copy(rb),ua.applyProjection(kb),wb[Oa]=[ua.z,Oa];wb.sort(k);for(Oa=0;Oa<Cc;Oa++)rb=oc[wb[Oa][1]],U=3*Oa,Cb[U]=rb.x,Cb[U+1]=rb.y,Cb[U+2]=rb.z;for(qb=0;qb<Lc;qb++)U=3*qb,zb=Dc[wb[qb][1]],Db[U]=zb.r,Db[U+1]=zb.g,Db[U+2]=zb.b;if(xb){db=0;for(Hb=xb.length;db<Hb;db++)if(S=xb[db],void 0===S.boundTo||
 "vertices"===S.boundTo)if(U=0,eb=S.value.length,1===S.size)for(Y=0;Y<eb;Y++)sb=wb[Y][1],S.array[Y]=S.value[sb];else if(2===S.size)for(Y=0;Y<eb;Y++)sb=wb[Y][1],ia=S.value[sb],S.array[U]=ia.x,S.array[U+1]=ia.y,U+=2;else if(3===S.size)if("c"===S.type)for(Y=0;Y<eb;Y++)sb=wb[Y][1],ia=S.value[sb],S.array[U]=ia.r,S.array[U+1]=ia.g,S.array[U+2]=ia.b,U+=3;else for(Y=0;Y<eb;Y++)sb=wb[Y][1],ia=S.value[sb],S.array[U]=ia.x,S.array[U+1]=ia.y,S.array[U+2]=ia.z,U+=3;else if(4===S.size)for(Y=0;Y<eb;Y++)sb=wb[Y][1],
@@ -491,9 +491,9 @@ t=["precision "+R+" float;","precision "+R+" int;",c.bumpMap||c.normalMap?"#exte
 "",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
 "",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");u=B("vertex",u+r);t=B("fragment",t+q);j.attachShader(w,u);j.attachShader(w,t);d&&j.bindAttribLocation(w,0,d);j.linkProgram(w);j.getProgramParameter(w,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(w,
 j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(w)));j.deleteShader(t);j.deleteShader(u);w.uniforms={};w.attributes={};var v;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(v in p)t.push(v);v=t;t=0;for(u=v.length;t<u;t++)p=v[t],w.uniforms[p]=j.getUniformLocation(w,p);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");
-for(v=0;v<c.maxMorphTargets;v++)t.push("morphTarget"+v);for(v=0;v<c.maxMorphNormals;v++)t.push("morphNormal"+v);for(k in b)t.push(k);k=t;v=0;for(b=k.length;v<b;v++)t=k[v],w.attributes[t]=j.getAttribLocation(w,t);w.id=za++;da.push({program:w,code:n,usedTimes:1});K.info.memory.programs=da.length;k=w}a.program=k;v=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=v[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=
+for(v=0;v<c.maxMorphTargets;v++)t.push("morphTarget"+v);for(v=0;v<c.maxMorphNormals;v++)t.push("morphNormal"+v);for(k in b)t.push(k);k=t;v=0;for(b=k.length;v<b;v++)t=k[v],w.attributes[t]=j.getAttribLocation(w,t);w.id=Ia++;da.push({program:w,code:n,usedTimes:1});K.info.memory.programs=da.length;k=w}a.program=k;v=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=v[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=
 0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)w=b+k,0<=v[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=
-a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;P!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),P=b);T!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),T=a)};this.setDepthTest=function(a){Ja!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),Ja=a)};this.setDepthWrite=function(a){ga!==a&&(j.depthMask(a),ga=a)};this.setBlending=function(a,b,c,d){a!==ma&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,
+a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;Z!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),Z=b);T!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),T=a)};this.setDepthTest=function(a){Ja!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),Ja=a)};this.setDepthWrite=function(a){ga!==a&&(j.depthMask(a),ga=a)};this.setBlending=function(a,b,c,d){a!==ma&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,
 j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)),ma=a);if(a===THREE.CustomBlending){if(b!==va&&(j.blendEquation(A(b)),va=b),
 c!==ja||d!==Pa)j.blendFunc(A(c),A(d)),ja=c,Pa=d}else Pa=ja=va=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Kb),a.__webglTexture=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===
 (c.width&c.width-1)&&0===(c.height&c.height-1),e=A(a.format),f=A(a.type);E(j.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,i=g.length;h<i;h++)c=g[h],j.texImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture){h=0;for(i=g.length;h<i;h++)c=g[h],j.compressedTexImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,c.data)}else if(0<
@@ -600,12 +600,12 @@ t,s,[q,u,v]));this.faceVertexUvs[0].push([C,z,F]);this.faces.push(new THREE.Face
 b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)r=k[i][g+1],t=k[i][g],p=this.vertices.length-1,q=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),C=l[i][g+1].clone(),z=l[i][g].clone(),y=new THREE.Vector2(z.u,1),this.faces.push(new THREE.Face3(r,t,p,[q,u,w])),this.faceVertexUvs[0].push([C,z,y])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
 h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(N=c.length;0<=--N;){e=N;f=N-1;0>f&&(f=c.length-1);for(var g=0,h=r+2*l,
-g=0;g<h;g++){var i=ba*g,k=ba*(g+1),m=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,s=h,t=e,v=f,m=m+E,i=i+E,n=n+E,k=k+E;B.faces.push(new THREE.Face4(m,i,n,k,null,null,u));m=w.generateSideWallUV(B,a,p,b,m,i,n,k,q,s,t,v);B.faceVertexUvs[0].push(m)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=E;d+=E;e+=E;B.faces.push(new THREE.Face3(c,d,e,null,null,q));c=f?w.generateBottomUV(B,a,b,c,d,e):w.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
-100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,p,s=!1,q=b.material,u=b.extrudeMaterial,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,C,z,y;t&&(p=t.getSpacedPoints(r),s=!0,m=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,
-!1),C=new THREE.Vector3,z=new THREE.Vector3,y=new THREE.Vector3);m||(k=i=l=0);var F,x,O,B=this,E=this.vertices.length,n=a.extractPoints(n),I=n.shape,n=n.holes;if(t=!THREE.Shape.Utils.isClockWise(I)){I=I.reverse();x=0;for(O=n.length;x<O;x++)F=n[x],THREE.Shape.Utils.isClockWise(F)&&(n[x]=F.reverse());t=!1}var D=THREE.Shape.Utils.triangulateShape(I,n),t=I;x=0;for(O=n.length;x<O;x++)F=n[x],I=I.concat(F);var A,G,R,J,ba=I.length,qa=D.length,ra=[],N=0,M=t.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=
-0),G===M&&(G=0),ra[N]=d(t[N],t[A],t[G]);var Q=[],K,da=ra.concat();x=0;for(O=n.length;x<O;x++){F=n[x];K=[];N=0;M=F.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=0),G===M&&(G=0),K[N]=d(F[N],F[A],F[G]);Q.push(K);da=da.concat(K)}for(A=0;A<l;A++){F=A/l;R=i*(1-F);G=k*Math.sin(F*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],ra[N],G),f(J.x,J.y,-R);x=0;for(O=n.length;x<O;x++){F=n[x];K=Q[x];N=0;for(M=F.length;N<M;N++)J=c(F[N],K[N],G),f(J.x,J.y,-R)}}G=k;for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],s?(z.copy(v.normals[0]).multiplyScalar(J.x),
-C.copy(v.binormals[0]).multiplyScalar(J.y),y.copy(p[0]).add(z).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,0);for(F=1;F<=r;F++)for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],s?(z.copy(v.normals[F]).multiplyScalar(J.x),C.copy(v.binormals[F]).multiplyScalar(J.y),y.copy(p[F]).add(z).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,g/r*F);for(A=l-1;0<=A;A--){F=A/l;R=i*(1-F);G=k*Math.sin(F*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],ra[N],G),f(J.x,J.y,g+R);x=0;for(O=n.length;x<O;x++){F=n[x];K=Q[x];N=0;for(M=F.length;N<M;N++)J=c(F[N],
-K[N],G),s?f(J.x,J.y+p[r-1].y,p[r-1].x+R):f(J.x,J.y,g+R)}}if(m){i=0*ba;for(N=0;N<qa;N++)g=D[N],h(g[2]+i,g[1]+i,g[0]+i,!0);i=ba*(r+2*l);for(N=0;N<qa;N++)g=D[N],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(N=0;N<qa;N++)g=D[N],h(g[2],g[1],g[0],!0);for(N=0;N<qa;N++)g=D[N],h(g[0]+ba*r,g[1]+ba*r,g[2]+ba*r,!1)}g=0;e(t,g);g+=t.length;x=0;for(O=n.length;x<O;x++)F=n[x],e(F,g),g+=F.length};
+g=0;g<h;g++){var i=ba*g,k=ba*(g+1),m=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,s=h,t=e,v=f,m=m+E,i=i+E,n=n+E,k=k+E;B.faces.push(new THREE.Face3(m,i,k,null,null,u));B.faces.push(new THREE.Face3(i,n,k,null,null,u));m=w.generateSideWallUV(B,a,p,b,m,i,n,k,q,s,t,v);B.faceVertexUvs[0].push([m[0],m[1],m[3]]);B.faceVertexUvs[0].push([m[1],m[2],m[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=E;d+=E;e+=E;B.faces.push(new THREE.Face3(c,d,e,null,null,q));c=f?w.generateBottomUV(B,
+a,b,c,d,e):w.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,p,s=!1,q=b.material,u=b.extrudeMaterial,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,C,z,y;t&&(p=
+t.getSpacedPoints(r),s=!0,m=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),C=new THREE.Vector3,z=new THREE.Vector3,y=new THREE.Vector3);m||(k=i=l=0);var F,x,O,B=this,E=this.vertices.length,n=a.extractPoints(n),I=n.shape,n=n.holes;if(t=!THREE.Shape.Utils.isClockWise(I)){I=I.reverse();x=0;for(O=n.length;x<O;x++)F=n[x],THREE.Shape.Utils.isClockWise(F)&&(n[x]=F.reverse());t=!1}var D=THREE.Shape.Utils.triangulateShape(I,n),t=I;x=0;for(O=n.length;x<O;x++)F=n[x],I=I.concat(F);
+var A,G,R,J,ba=I.length,qa=D.length,ra=[],N=0,M=t.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=0),G===M&&(G=0),ra[N]=d(t[N],t[A],t[G]);var Q=[],K,da=ra.concat();x=0;for(O=n.length;x<O;x++){F=n[x];K=[];N=0;M=F.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=0),G===M&&(G=0),K[N]=d(F[N],F[A],F[G]);Q.push(K);da=da.concat(K)}for(A=0;A<l;A++){F=A/l;R=i*(1-F);G=k*Math.sin(F*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],ra[N],G),f(J.x,J.y,-R);x=0;for(O=n.length;x<O;x++){F=n[x];K=Q[x];N=0;for(M=F.length;N<
+M;N++)J=c(F[N],K[N],G),f(J.x,J.y,-R)}}G=k;for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],s?(z.copy(v.normals[0]).multiplyScalar(J.x),C.copy(v.binormals[0]).multiplyScalar(J.y),y.copy(p[0]).add(z).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,0);for(F=1;F<=r;F++)for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],s?(z.copy(v.normals[F]).multiplyScalar(J.x),C.copy(v.binormals[F]).multiplyScalar(J.y),y.copy(p[F]).add(z).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,g/r*F);for(A=l-1;0<=A;A--){F=A/l;R=i*(1-F);G=k*Math.sin(F*Math.PI/2);N=0;for(M=
+t.length;N<M;N++)J=c(t[N],ra[N],G),f(J.x,J.y,g+R);x=0;for(O=n.length;x<O;x++){F=n[x];K=Q[x];N=0;for(M=F.length;N<M;N++)J=c(F[N],K[N],G),s?f(J.x,J.y+p[r-1].y,p[r-1].x+R):f(J.x,J.y,g+R)}}if(m){i=0*ba;for(N=0;N<qa;N++)g=D[N],h(g[2]+i,g[1]+i,g[0]+i,!0);i=ba*(r+2*l);for(N=0;N<qa;N++)g=D[N],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(N=0;N<qa;N++)g=D[N],h(g[2],g[1],g[0],!0);for(N=0;N<qa;N++)g=D[N],h(g[0]+ba*r,g[1]+ba*r,g[2]+ba*r,!1)}g=0;e(t,g);g+=t.length;x=0;for(O=n.length;x<O;x++)F=n[x],e(F,g),g+=F.length};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
 l=a.vertices[h].y,h=a.vertices[h].z,m=a.vertices[g].x,n=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(m,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(l,1-h),new THREE.Vector2(n,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};