Browse Source

Updated builds.

Mr.doob 5 years ago
parent
commit
212abf87f5
3 changed files with 142 additions and 119 deletions
  1. 39 17
      build/three.js
  2. 81 80
      build/three.min.js
  3. 22 22
      build/three.module.js

+ 39 - 17
build/three.js

@@ -594,9 +594,12 @@
 	 */
 
 	function Vector2( x, y ) {
+		if ( x === void 0 ) x = 0;
+		if ( y === void 0 ) y = 0;
 
-		this.x = x || 0;
-		this.y = y || 0;
+
+		this.x = x;
+		this.y = y;
 
 	}
 
@@ -1834,11 +1837,16 @@
 	 */
 
 	function Vector4( x, y, z, w ) {
+		if ( x === void 0 ) x = 0;
+		if ( y === void 0 ) y = 0;
+		if ( z === void 0 ) z = 0;
+		if ( w === void 0 ) w = 1;
 
-		this.x = x || 0;
-		this.y = y || 0;
-		this.z = z || 0;
-		this.w = ( w !== undefined ) ? w : 1;
+
+		this.x = x;
+		this.y = y;
+		this.z = z;
+		this.w = w;
 
 	}
 
@@ -2626,11 +2634,16 @@
 	 */
 
 	function Quaternion( x, y, z, w ) {
+		if ( x === void 0 ) x = 0;
+		if ( y === void 0 ) y = 0;
+		if ( z === void 0 ) z = 0;
+		if ( w === void 0 ) w = 1;
 
-		this._x = x || 0;
-		this._y = y || 0;
-		this._z = z || 0;
-		this._w = ( w !== undefined ) ? w : 1;
+
+		this._x = x;
+		this._y = y;
+		this._z = z;
+		this._w = w;
 
 	}
 
@@ -3299,10 +3312,14 @@
 	var _quaternion = new Quaternion();
 
 	function Vector3( x, y, z ) {
+		if ( x === void 0 ) x = 0;
+		if ( y === void 0 ) y = 0;
+		if ( z === void 0 ) z = 0;
 
-		this.x = x || 0;
-		this.y = y || 0;
-		this.z = z || 0;
+
+		this.x = x;
+		this.y = y;
+		this.z = z;
 
 	}
 
@@ -4915,11 +4932,16 @@
 	var _quaternion$1 = new Quaternion();
 
 	function Euler( x, y, z, order ) {
+		if ( x === void 0 ) x = 0;
+		if ( y === void 0 ) y = 0;
+		if ( z === void 0 ) z = 0;
+		if ( order === void 0 ) order = Euler.DefaultOrder;
+
 
-		this._x = x || 0;
-		this._y = y || 0;
-		this._z = z || 0;
-		this._order = order || Euler.DefaultOrder;
+		this._x = x;
+		this._y = y;
+		this._z = z;
+		this._order = order;
 
 	}
 

+ 81 - 80
build/three.min.js

@@ -1,84 +1,85 @@
 // threejs.org/license
-(function(k,ua){"object"===typeof exports&&"undefined"!==typeof module?ua(exports):"function"===typeof define&&define.amd?define(["exports"],ua):(k=k||self,ua(k.THREE={}))})(this,function(k){function ua(){}function w(a,b){this.x=a||0;this.y=b||0}function xa(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function W(a,b,c,d,e,f,g,h,l,n){Object.defineProperty(this,"id",{value:hj++});this.uuid=K.generateUUID();
-this.name="";this.image=void 0!==a?a:W.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:W.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==e?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==l?l:1;this.format=void 0!==g?g:1023;this.internalFormat=null;this.type=void 0!==h?h:1009;this.offset=new w(0,0);this.repeat=new w(1,1);this.center=new w(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new xa;this.generateMipmaps=
-!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==n?n:3E3;this.version=0;this.onUpdate=null}function Y(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}function Ha(a,b,c){this.width=a;this.height=b;this.scissor=new Y(0,0,a,b);this.scissorTest=!1;this.viewport=new Y(0,0,a,b);c=c||{};this.texture=new W(void 0,c.mapping,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy,c.encoding);this.texture.image={};this.texture.image.width=
-a;this.texture.image.height=b;this.texture.generateMipmaps=void 0!==c.generateMipmaps?c.generateMipmaps:!1;this.texture.minFilter=void 0!==c.minFilter?c.minFilter:1006;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.depthTexture=void 0!==c.depthTexture?c.depthTexture:null}function ag(a,b,c){Ha.call(this,a,b,c);this.samples=4}function na(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function m(a,b,
-c){this.x=a||0;this.y=b||0;this.z=c||0}function M(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Ub(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||Ub.DefaultOrder}function Fe(){this.mask=1}function z(){Object.defineProperty(this,"id",{value:ij++});this.uuid=K.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=z.DefaultUp.clone();
-var a=new m,b=new Ub,c=new na,d=new m(1,1,1);b._onChange(function(){c.setFromEuler(b,!1)});c._onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:a},rotation:{configurable:!0,enumerable:!0,value:b},quaternion:{configurable:!0,enumerable:!0,value:c},scale:{configurable:!0,enumerable:!0,value:d},modelViewMatrix:{value:new M},normalMatrix:{value:new xa}});this.matrix=new M;this.matrixWorld=new M;this.matrixAutoUpdate=z.DefaultMatrixAutoUpdate;
-this.matrixWorldNeedsUpdate=!1;this.layers=new Fe;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function xd(){z.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.environment=this.background=null;this.autoUpdate=!0;"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ta(a,b){this.min=void 0!==a?a:new m(Infinity,Infinity,Infinity);this.max=void 0!==
-b?b:new m(-Infinity,-Infinity,-Infinity)}function bg(a,b,c,d,e){for(var f=0,g=a.length-3;f<=g;f+=3){Vb.fromArray(a,f);var h=e.x*Math.abs(Vb.x)+e.y*Math.abs(Vb.y)+e.z*Math.abs(Vb.z),l=b.dot(Vb),n=c.dot(Vb),q=d.dot(Vb);if(Math.max(-Math.max(l,n,q),Math.min(l,n,q))>h)return!1}return!0}function eb(a,b){this.center=void 0!==a?a:new m;this.radius=void 0!==b?b:-1}function Wb(a,b){this.origin=void 0!==a?a:new m;this.direction=void 0!==b?b:new m(0,0,-1)}function Ua(a,b){this.normal=void 0!==a?a:new m(1,0,
-0);this.constant=void 0!==b?b:0}function wa(a,b,c){this.a=void 0!==a?a:new m;this.b=void 0!==b?b:new m;this.c=void 0!==c?c:new m}function D(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function cg(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function dg(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function eg(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function zc(a,b,c,d,e,f){this.a=a;this.b=
-b;this.c=c;this.normal=d&&d.isVector3?d:new m;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new D;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function G(){Object.defineProperty(this,"id",{value:jj++});this.uuid=K.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexColors=this.flatShading=!1;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=
-this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.stencilWriteMask=255;this.stencilFunc=519;this.stencilRef=0;this.stencilFuncMask=255;this.stencilZPass=this.stencilZFail=this.stencilFail=7680;this.stencilWrite=!1;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha=
-!1;this.toneMapped=this.visible=!0;this.userData={};this.version=0}function Oa(a){G.call(this);this.type="MeshBasicMaterial";this.color=new D(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphTargets=this.skinning=!1;this.setValues(a)}
-function H(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.usage=35044;this.updateRange={offset:0,count:-1};this.version=0}function yd(a,b,c){H.call(this,new Int8Array(a),b,c)}function zd(a,b,c){H.call(this,new Uint8Array(a),b,c)}function Ad(a,b,c){H.call(this,new Uint8ClampedArray(a),b,c)}function Bd(a,b,c){H.call(this,new Int16Array(a),
-b,c)}function Xb(a,b,c){H.call(this,new Uint16Array(a),b,c)}function Cd(a,b,c){H.call(this,new Int32Array(a),b,c)}function Yb(a,b,c){H.call(this,new Uint32Array(a),b,c)}function B(a,b,c){H.call(this,new Float32Array(a),b,c)}function Dd(a,b,c){H.call(this,new Float64Array(a),b,c)}function vh(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=
-this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function wh(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;c<d;++c)a[c]>b&&(b=a[c]);return b}function F(){Object.defineProperty(this,"id",{value:kj+=2});this.uuid=K.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};
-this.userData={}}function X(a,b){z.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new F;this.material=void 0!==b?b:new Oa;this.updateMorphTargets()}function xh(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==b.side,h)))return null;Ge.copy(h);Ge.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Ge);return b<c.near||b>c.far?null:{distance:b,point:Ge.clone(),object:a}}function He(a,b,c,d,e,f,g,h,l,n,q,p){Cb.fromBufferAttribute(e,n);Db.fromBufferAttribute(e,
-q);Eb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Ie.set(0,0,0);Je.set(0,0,0);Ke.set(0,0,0);for(var v=0,t=f.length;v<t;v++){var k=e[v],u=f[v];0!==k&&(fg.fromBufferAttribute(u,n),gg.fromBufferAttribute(u,q),hg.fromBufferAttribute(u,p),g?(Ie.addScaledVector(fg,k),Je.addScaledVector(gg,k),Ke.addScaledVector(hg,k)):(Ie.addScaledVector(fg.sub(Cb),k),Je.addScaledVector(gg.sub(Db),k),Ke.addScaledVector(hg.sub(Eb),k)))}Cb.add(Ie);Db.add(Je);Eb.add(Ke)}a.isSkinnedMesh&&(a.boneTransform(n,
-Cb),a.boneTransform(q,Db),a.boneTransform(p,Eb));if(a=xh(a,b,c,d,Cb,Db,Eb,Ed))h&&(Ac.fromBufferAttribute(h,n),Bc.fromBufferAttribute(h,q),Cc.fromBufferAttribute(h,p),a.uv=wa.getUV(Ed,Cb,Db,Eb,Ac,Bc,Cc,new w)),l&&(Ac.fromBufferAttribute(l,n),Bc.fromBufferAttribute(l,q),Cc.fromBufferAttribute(l,p),a.uv2=wa.getUV(Ed,Cb,Db,Eb,Ac,Bc,Cc,new w)),h=new zc(n,q,p),wa.getNormal(Cb,Db,Eb,h.normal),a.face=h;return a}function L(){Object.defineProperty(this,"id",{value:lj+=2});this.uuid=K.generateUUID();this.name=
-"";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function Dc(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e&&(e.isColor||e.isMatrix3||
-e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}}return b}function va(a){for(var b={},c=0;c<a.length;c++){var d=Dc(a[c]),e;for(e in d)b[e]=d[e]}return b}function Ba(a){G.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
-this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(a))}
-function fb(){z.call(this);this.type="Camera";this.matrixWorldInverse=new M;this.projectionMatrix=new M;this.projectionMatrixInverse=new M}function O(a,b,c,d){fb.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Ec(a,b,c){z.call(this);this.type="CubeCamera";if(!0!==c.isWebGLCubeRenderTarget)console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");
-else{this.renderTarget=c;var d=new O(90,1,a,b);d.layers=this.layers;d.up.set(0,-1,0);d.lookAt(new m(1,0,0));this.add(d);var e=new O(90,1,a,b);e.layers=this.layers;e.up.set(0,-1,0);e.lookAt(new m(-1,0,0));this.add(e);var f=new O(90,1,a,b);f.layers=this.layers;f.up.set(0,0,1);f.lookAt(new m(0,1,0));this.add(f);var g=new O(90,1,a,b);g.layers=this.layers;g.up.set(0,0,-1);g.lookAt(new m(0,-1,0));this.add(g);var h=new O(90,1,a,b);h.layers=this.layers;h.up.set(0,-1,0);h.lookAt(new m(0,0,1));this.add(h);
-var l=new O(90,1,a,b);l.layers=this.layers;l.up.set(0,-1,0);l.lookAt(new m(0,0,-1));this.add(l);this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var n=a.xr.enabled,q=a.getRenderTarget();a.xr.enabled=!1;var t=c.texture.generateMipmaps;c.texture.generateMipmaps=!1;a.setRenderTarget(c,0);a.render(b,d);a.setRenderTarget(c,1);a.render(b,e);a.setRenderTarget(c,2);a.render(b,f);a.setRenderTarget(c,3);a.render(b,g);a.setRenderTarget(c,4);a.render(b,h);c.texture.generateMipmaps=t;a.setRenderTarget(c,
-5);a.render(b,l);a.setRenderTarget(q);a.xr.enabled=n};this.clear=function(a,b,d,e){for(var f=a.getRenderTarget(),g=0;6>g;g++)a.setRenderTarget(c,g),a.clear(b,d,e);a.setRenderTarget(f)}}}function Zb(a,b,c){Number.isInteger(b)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),b=c);Ha.call(this,a,a,b)}function $b(a,b,c,d,e,f,g,h,l,n,q,p){W.call(this,null,f,g,h,l,n,d,e,q,p);this.image={data:a||null,width:b||1,height:c||1};this.magFilter=
-void 0!==l?l:1003;this.minFilter=void 0!==n?n:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0}function Fc(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ua,void 0!==b?b:new Ua,void 0!==c?c:new Ua,void 0!==d?d:new Ua,void 0!==e?e:new Ua,void 0!==f?f:new Ua]}function yh(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!==c&&null!==d&&(b.requestAnimationFrame(a),c=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=
-a},setContext:function(a){b=a}}}function mj(a,b){function c(b,c){var d=b.array,e=b.usage,f=a.createBuffer();a.bindBuffer(c,f);a.bufferData(c,d,e);b.onUploadCallback();c=5126;d instanceof Float32Array?c=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=5123:d instanceof Int16Array?c=5122:d instanceof Uint32Array?c=5125:d instanceof Int32Array?c=5124:d instanceof Int8Array?c=5120:d instanceof Uint8Array&&(c=
-5121);return{buffer:f,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var d=b.isWebGL2,e=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return e.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var c=e.get(b);c&&(a.deleteBuffer(c.buffer),e.delete(b))},update:function(b,g){b.isInterleavedBufferAttribute&&(b=b.data);var f=e.get(b);if(void 0===f)e.set(b,c(b,g));else if(f.version<b.version){var l=b.array,n=b.updateRange;a.bindBuffer(g,
-f.buffer);-1===n.count?a.bufferSubData(g,0,l):(d?a.bufferSubData(g,n.offset*l.BYTES_PER_ELEMENT,l,n.offset,n.count):a.bufferSubData(g,n.offset*l.BYTES_PER_ELEMENT,l.subarray(n.offset,n.offset+n.count)),n.count=-1);f.version=b.version}}}}function Fd(a,b,c,d){L.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new ac(a,b,c,d));this.mergeVertices()}function ac(a,b,c,d){F.call(this);this.type="PlaneBufferGeometry";this.parameters=
-{width:a,height:b,widthSegments:c,heightSegments:d};a=a||1;b=b||1;var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,n=b/d;b=[];a=[];for(var q=[],p=[],k=0;k<h;k++)for(var t=k*n-f,r=0;r<g;r++)a.push(r*l-e,-t,0),q.push(0,0,1),p.push(r/c),p.push(1-k/d);for(e=0;e<d;e++)for(f=0;f<c;f++)h=f+g*(e+1),l=f+1+g*(e+1),n=f+1+g*e,b.push(f+g*e,h,n),b.push(h,l,n);this.setIndex(b);this.setAttribute("position",new B(a,3));this.setAttribute("normal",new B(q,3));this.setAttribute("uv",new B(p,
-2))}function nj(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new D(0),g=0,h,l,n=null,q=0,p=null;return{getClearColor:function(){return f},setClearColor:function(a,b){f.set(a);g=void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},setClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,k,u){d=!0===d.isScene?d.background:null;k=a.xr;(k=k.getSession&&k.getSession())&&"additive"===k.environmentBlendMode&&(d=null);null===d?e(f,g):d&&d.isColor&&(e(d,1),u=!0);(a.autoClear||
-u)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);if(d&&(d.isCubeTexture||d.isWebGLCubeRenderTarget||306===d.mapping)){void 0===l&&(l=new X(new Gd(1,1,1),new Ba({name:"BackgroundCubeMaterial",uniforms:Dc(gb.cube.uniforms),vertexShader:gb.cube.vertexShader,fragmentShader:gb.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},
-Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),c.update(l));u=d.isWebGLCubeRenderTarget?d.texture:d;l.material.uniforms.envMap.value=u;l.material.uniforms.flipEnvMap.value=u.isCubeTexture?-1:1;if(n!==d||q!==u.version||p!==a.toneMapping)l.material.needsUpdate=!0,n=d,q=u.version,p=a.toneMapping;b.unshift(l,l.geometry,l.material,0,0,null)}else if(d&&d.isTexture){void 0===h&&(h=new X(new ac(2,2),new Ba({name:"BackgroundMaterial",uniforms:Dc(gb.background.uniforms),
-vertexShader:gb.background.vertexShader,fragmentShader:gb.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),c.update(h));h.material.uniforms.t2D.value=d;!0===d.matrixAutoUpdate&&d.updateMatrix();h.material.uniforms.uvTransform.value.copy(d.matrix);if(n!==d||q!==d.version||p!==a.toneMapping)h.material.needsUpdate=!0,n=d,q=d.version,p=a.toneMapping;b.unshift(h,
-h.geometry,h.material,0,0,null)}}}}function oj(a,b,c,d){var e=d.isWebGL2,f;this.setMode=function(a){f=a};this.render=function(b,d){a.drawArrays(f,b,d);c.update(d,f)};this.renderInstances=function(d,h,l,n){if(0!==n){if(e){d=a;var g="drawArraysInstanced"}else if(d=b.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",null===d){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[g](f,h,l,n);c.update(l,
-f,n)}}}function pj(a,b,c){function d(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(35633,36338).precision&&0<a.getShaderPrecisionFormat(35632,36338).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(35633,36337).precision&&0<a.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var e,f="undefined"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&a instanceof WebGL2ComputeRenderingContext,
-g=void 0!==c.precision?c.precision:"highp",h=d(g);h!==g&&(console.warn("THREE.WebGLRenderer:",g,"not supported, using",h,"instead."),g=h);c=!0===c.logarithmicDepthBuffer;h=a.getParameter(34930);var l=a.getParameter(35660),n=a.getParameter(3379),q=a.getParameter(34076),p=a.getParameter(34921),k=a.getParameter(36347),t=a.getParameter(36348),r=a.getParameter(36349),u=0<l,m=f||!!b.get("OES_texture_float"),E=u&&m,x=f?a.getParameter(36183):0;return{isWebGL2:f,getMaxAnisotropy:function(){if(void 0!==e)return e;
-var c=b.get("EXT_texture_filter_anisotropic");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:g,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:l,maxTextureSize:n,maxCubemapSize:q,maxAttributes:p,maxVertexUniforms:k,maxVaryings:t,maxFragmentUniforms:r,vertexTextures:u,floatFragmentTextures:m,floatVertexTextures:E,maxSamples:x}}function qj(){function a(){n.value!==d&&(n.value=d,n.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,
-b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=n.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;l.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,l),h.normal.toArray(g,d),g[d+3]=h.constant}n.value=g;n.needsUpdate=!0}c.numPlanes=f;c.numIntersection=0;return g}var c=this,d=null,e=0,f=!1,g=!1,h=new Ua,l=new xa,n={value:null,needsUpdate:!1};this.uniform=n;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=
-0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,l,k,r,u){if(!f||null===c||0===c.length||g&&!l)g?b(null):a();else{l=g?0:e;var q=4*l,p=r.clippingState||null;n.value=p;p=b(c,k,q,u);for(c=0;c!==q;++c)p[c]=d[c];r.clippingState=p;this.numIntersection=h?this.numPlanes:0;this.numPlanes+=l}}}function rj(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];switch(c){case "WEBGL_depth_texture":var d=
-a.getExtension("WEBGL_depth_texture")||a.getExtension("MOZ_WEBGL_depth_texture")||a.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
-break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}}}function sj(a,b,c){function d(a){var e=a.target;a=f.get(e);null!==a.index&&b.remove(a.index);for(var h in a.attributes)b.remove(a.attributes[h]);e.removeEventListener("dispose",d);f.delete(e);if(h=g.get(a))b.remove(h),g.delete(a);
-c.memory.geometries--}function e(a){var c=[],d=a.index,e=a.attributes.position;if(null!==d){e=d.array;d=d.version;for(var f=0,h=e.length;f<h;f+=3){var k=e[f+0],r=e[f+1],u=e[f+2];c.push(k,r,r,u,u,k)}}else for(f=e.array,d=e.version,e=0,f=f.length/3-1;e<f;e+=3)h=e+0,k=e+1,r=e+2,c.push(h,k,k,r,r,h);c=new (65535<wh(c)?Yb:Xb)(c,1);c.version=d;b.update(c,34963);(d=g.get(a))&&b.remove(d);g.set(a,c)}var f=new WeakMap,g=new WeakMap;return{get:function(a,b){var e=f.get(b);if(e)return e;b.addEventListener("dispose",
-d);b.isBufferGeometry?e=b:b.isGeometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new F).setFromObject(a)),e=b._bufferGeometry);f.set(b,e);c.memory.geometries++;return e},update:function(a){var c=a.index,d=a.attributes;null!==c&&b.update(c,34963);for(var e in d)b.update(d[e],34962);a=a.morphAttributes;for(var f in a)for(c=a[f],d=0,e=c.length;d<e;d++)b.update(c[d],34962)},getWireframeAttribute:function(a){var b=g.get(a);if(b){var c=a.index;null!==c&&b.version<c.version&&e(a)}else e(a);return g.get(a)}}}
-function tj(a,b,c,d){var e=d.isWebGL2,f,g,h;this.setMode=function(a){f=a};this.setIndex=function(a){g=a.type;h=a.bytesPerElement};this.render=function(b,d){a.drawElements(f,d,g,b*h);c.update(d,f)};this.renderInstances=function(d,n,q,p){if(0!==p){if(e){d=a;var l="drawElementsInstanced"}else if(d=b.get("ANGLE_instanced_arrays"),l="drawElementsInstancedANGLE",null===d){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-return}d[l](f,q,g,n*h,p);c.update(q,f,p)}}}function uj(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.frame++;b.calls=0;b.triangles=0;b.points=0;b.lines=0},update:function(a,d,e){e=e||1;b.calls++;switch(d){case 4:b.triangles+=a/3*e;break;case 1:b.lines+=a/2*e;break;case 3:b.lines+=e*(a-1);break;case 2:b.lines+=e*a;break;case 0:b.points+=e*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",
-d)}}}}function vj(a,b){return Math.abs(b[1])-Math.abs(a[1])}function wj(a){var b={},c=new Float32Array(8);return{update:function(d,e,f,g){var h=d.morphTargetInfluences,l=void 0===h?0:h.length;d=b[e.id];if(void 0===d){d=[];for(var n=0;n<l;n++)d[n]=[n,0];b[e.id]=d}n=f.morphTargets&&e.morphAttributes.position;f=f.morphNormals&&e.morphAttributes.normal;for(var q=0;q<l;q++)0!==d[q][1]&&(n&&e.deleteAttribute("morphTarget"+q),f&&e.deleteAttribute("morphNormal"+q));for(q=0;q<l;q++){var p=d[q];p[0]=q;p[1]=
-h[q]}d.sort(vj);for(l=h=0;8>l;l++){if(p=d[l])if(q=p[0],p=p[1]){n&&e.setAttribute("morphTarget"+l,n[q]);f&&e.setAttribute("morphNormal"+l,f[q]);c[l]=p;h+=p;continue}c[l]=0}e=e.morphTargetsRelative?1:1-h;g.getUniforms().setValue(a,"morphTargetBaseInfluence",e);g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function xj(a,b,c,d){var e=new WeakMap;return{update:function(a){var f=d.render.frame,h=a.geometry,l=b.get(a,h);e.get(l)!==f&&(h.isGeometry&&l.updateFromObject(a),b.update(l),e.set(l,f));
-a.isInstancedMesh&&c.update(a.instanceMatrix,34962);return l},dispose:function(){e=new WeakMap}}}function qb(a,b,c,d,e,f,g,h,l,n){a=void 0!==a?a:[];W.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,n);this.flipY=!1}function Gc(a,b,c,d){W.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Hc(a,b,c,d){W.call(this,null);this.image={data:a||null,width:b||
-1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Ic(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=zh[e];void 0===f&&(f=new Float32Array(e),zh[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function Pa(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function Ia(a,b){for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}function Ah(a,
-b){var c=Bh[b];void 0===c&&(c=new Int32Array(b),Bh[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocateTextureUnit();return c}function yj(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function zj(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else Pa(c,b)||(a.uniform2fv(this.addr,b),Ia(c,b))}function Aj(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,
-c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else Pa(c,b)||(a.uniform3fv(this.addr,b),Ia(c,b))}function Bj(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else Pa(c,b)||(a.uniform4fv(this.addr,b),Ia(c,b))}function Cj(a,b){var c=this.cache,d=b.elements;void 0===d?Pa(c,b)||(a.uniformMatrix2fv(this.addr,
-!1,b),Ia(c,b)):Pa(c,d)||(Ch.set(d),a.uniformMatrix2fv(this.addr,!1,Ch),Ia(c,d))}function Dj(a,b){var c=this.cache,d=b.elements;void 0===d?Pa(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),Ia(c,b)):Pa(c,d)||(Dh.set(d),a.uniformMatrix3fv(this.addr,!1,Dh),Ia(c,d))}function Ej(a,b){var c=this.cache,d=b.elements;void 0===d?Pa(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),Ia(c,b)):Pa(c,d)||(Eh.set(d),a.uniformMatrix4fv(this.addr,!1,Eh),Ia(c,d))}function Fj(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==
-e&&(a.uniform1i(this.addr,e),d[0]=e);c.safeSetTexture2D(b||Fh,e)}function Gj(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2DArray(b||Hj,e)}function Ij(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture3D(b||Jj,e)}function Kj(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.safeSetTextureCube(b||Gh,e)}function Lj(a,b){var c=this.cache;c[0]!==
-b&&(a.uniform1i(this.addr,b),c[0]=b)}function Mj(a,b){var c=this.cache;Pa(c,b)||(a.uniform2iv(this.addr,b),Ia(c,b))}function Nj(a,b){var c=this.cache;Pa(c,b)||(a.uniform3iv(this.addr,b),Ia(c,b))}function Oj(a,b){var c=this.cache;Pa(c,b)||(a.uniform4iv(this.addr,b),Ia(c,b))}function Pj(a,b){var c=this.cache;c[0]!==b&&(a.uniform1ui(this.addr,b),c[0]=b)}function Qj(a){switch(a){case 5126:return yj;case 35664:return zj;case 35665:return Aj;case 35666:return Bj;case 35674:return Cj;case 35675:return Dj;
-case 35676:return Ej;case 5124:case 35670:return Lj;case 35667:case 35671:return Mj;case 35668:case 35672:return Nj;case 35669:case 35673:return Oj;case 5125:return Pj;case 35678:case 36198:case 36298:case 36306:case 35682:return Fj;case 35679:case 36299:case 36307:return Ij;case 35680:case 36300:case 36308:case 36293:return Kj;case 36289:case 36303:case 36311:case 36292:return Gj}}function Rj(a,b){a.uniform1fv(this.addr,b)}function Sj(a,b){a.uniform1iv(this.addr,b)}function Tj(a,b){a.uniform2iv(this.addr,
-b)}function Uj(a,b){a.uniform3iv(this.addr,b)}function Vj(a,b){a.uniform4iv(this.addr,b)}function Wj(a,b){b=Ic(b,this.size,2);a.uniform2fv(this.addr,b)}function Xj(a,b){b=Ic(b,this.size,3);a.uniform3fv(this.addr,b)}function Yj(a,b){b=Ic(b,this.size,4);a.uniform4fv(this.addr,b)}function Zj(a,b){b=Ic(b,this.size,4);a.uniformMatrix2fv(this.addr,!1,b)}function ak(a,b){b=Ic(b,this.size,9);a.uniformMatrix3fv(this.addr,!1,b)}function bk(a,b){b=Ic(b,this.size,16);a.uniformMatrix4fv(this.addr,!1,b)}function ck(a,
-b,c){var d=b.length,e=Ah(c,d);a.uniform1iv(this.addr,e);for(a=0;a!==d;++a)c.safeSetTexture2D(b[a]||Fh,e[a])}function dk(a,b,c){var d=b.length,e=Ah(c,d);a.uniform1iv(this.addr,e);for(a=0;a!==d;++a)c.safeSetTextureCube(b[a]||Gh,e[a])}function ek(a){switch(a){case 5126:return Rj;case 35664:return Wj;case 35665:return Xj;case 35666:return Yj;case 35674:return Zj;case 35675:return ak;case 35676:return bk;case 5124:case 35670:return Sj;case 35667:case 35671:return Tj;case 35668:case 35672:return Uj;case 35669:case 35673:return Vj;
-case 35678:case 36198:case 36298:case 36306:case 35682:return ck;case 35680:case 36300:case 36308:case 36293:return dk}}function fk(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=Qj(b.type)}function Hh(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;this.setValue=ek(b.type)}function Ih(a){this.id=a;this.seq=[];this.map={}}function Fb(a,b){this.seq=[];this.map={};for(var c=a.getProgramParameter(b,35718),d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),
-g=this,h=e.name,l=h.length;for(ig.lastIndex=0;;){var n=ig.exec(h),q=ig.lastIndex,p=n[1],k=n[3];"]"===n[2]&&(p|=0);if(void 0===k||"["===k&&q+2===l){h=g;e=void 0===k?new fk(p,e,f):new Hh(p,e,f);h.seq.push(e);h.map[e.id]=e;break}else k=g.map[p],void 0===k&&(k=new Ih(p),p=g,g=k,p.seq.push(g),p.map[g.id]=g),g=k}}}function Jh(a,b,c){b=a.createShader(b);a.shaderSource(b,c);a.compileShader(b);return b}function Kh(a){switch(a){case 3E3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE",
-"( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",a),["Linear","( value )"]}}function Lh(a,b,c){var d=a.getShaderParameter(b,35713),e=a.getShaderInfoLog(b).trim();if(d&&""===e)return"";a=a.getShaderSource(b).split("\n");for(b=0;b<a.length;b++)a[b]=
-b+1+": "+a[b];a=a.join("\n");return"THREE.WebGLShader: gl.getShaderInfoLog() "+c+"\n"+e+a}function Hd(a,b){b=Kh(b);return"vec4 "+a+"( vec4 value ) { return "+b[0]+"ToLinear"+b[1]+"; }"}function gk(a,b){b=Kh(b);return"vec4 "+a+"( vec4 value ) { return LinearTo"+b[0]+b[1]+"; }"}function hk(a,b){switch(b){case 1:b="Linear";break;case 2:b="Reinhard";break;case 3:b="OptimizedCineon";break;case 4:b="ACESFilmic";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",b),b="Linear"}return"vec3 "+
-a+"( vec3 color ) { return "+b+"ToneMapping( color ); }"}function ik(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}function Id(a){return""!==a}function Mh(a,b){return a.replace(/NUM_DIR_LIGHTS/g,b.numDirLights).replace(/NUM_SPOT_LIGHTS/g,b.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,b.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,b.numPointLights).replace(/NUM_HEMI_LIGHTS/g,b.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,b.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,
-b.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,b.numPointLightShadows)}function Nh(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,b.numClippingPlanes-b.numClipIntersection)}function jg(a,b){a=N[b];if(void 0===a)throw Error("Can not resolve #include <"+b+">");return a.replace(kg,jg)}function Oh(a,b,c,d){console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.");return lg(a,
-b,c,d)}function lg(a,b,c,d){a="";for(b=parseInt(b);b<parseInt(c);b++)a+=d.replace(/\[ i \]/g,"[ "+b+" ]").replace(/UNROLLED_LOOP_INDEX/g,b);return a}function Ph(a){var b="precision "+a.precision+" float;\nprecision "+a.precision+" int;";"highp"===a.precision?b+="\n#define HIGH_PRECISION":"mediump"===a.precision?b+="\n#define MEDIUM_PRECISION":"lowp"===a.precision&&(b+="\n#define LOW_PRECISION");return b}function jk(a){var b="SHADOWMAP_TYPE_BASIC";1===a.shadowMapType?b="SHADOWMAP_TYPE_PCF":2===a.shadowMapType?
-b="SHADOWMAP_TYPE_PCF_SOFT":3===a.shadowMapType&&(b="SHADOWMAP_TYPE_VSM");return b}function kk(a){var b="ENVMAP_TYPE_CUBE";if(a.envMap)switch(a.envMapMode){case 301:case 302:b="ENVMAP_TYPE_CUBE";break;case 306:case 307:b="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:b="ENVMAP_TYPE_EQUIREC"}return b}function lk(a){var b="ENVMAP_MODE_REFLECTION";if(a.envMap)switch(a.envMapMode){case 302:case 304:b="ENVMAP_MODE_REFRACTION"}return b}function mk(a){var b="ENVMAP_BLENDING_NONE";if(a.envMap)switch(a.combine){case 0:b=
-"ENVMAP_BLENDING_MULTIPLY";break;case 1:b="ENVMAP_BLENDING_MIX";break;case 2:b="ENVMAP_BLENDING_ADD"}return b}function nk(a,b,c){var d=a.getContext(),e=c.defines,f=c.vertexShader,g=c.fragmentShader,h=jk(c),l=kk(c),n=lk(c),q=mk(c),p=0<a.gammaFactor?a.gammaFactor:1,k=c.isWebGL2?"":[c.extensionDerivatives||c.envMapCubeUV||c.bumpMap||c.tangentSpaceNormalMap||c.clearcoatNormalMap||c.flatShading||"physical"===c.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(c.extensionFragDepth||c.logarithmicDepthBuffer)&&
-c.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",c.extensionDrawBuffers&&c.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(c.extensionShaderTextureLOD||c.envMap)&&c.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Id).join("\n"),t=ik(e),r=d.createProgram();c.isRawShaderMaterial?(e=[t].filter(Id).join("\n"),0<e.length&&(e+="\n"),h=[k,t].filter(Id).join("\n"),0<h.length&&(h+="\n")):(e=[Ph(c),"#define SHADER_NAME "+
-c.shaderName,t,c.instancing?"#define USE_INSTANCING":"",c.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+c.maxBones,c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+n:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":
-"",c.normalMap&&c.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",c.normalMap&&c.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",c.clearcoatMap?"#define USE_CLEARCOATMAP":"",c.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.displacementMap&&c.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":
-"",c.alphaMap?"#define USE_ALPHAMAP":"",c.vertexTangents?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexUvs?"#define USE_UV":"",c.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",c.flatShading?"#define FLAT_SHADED":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals&&!1===c.flatShading?"#define USE_MORPHNORMALS":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
-"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+h:"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"",c.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",c.logarithmicDepthBuffer&&c.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING",
-" attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;",
-"\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Id).join("\n"),h=[k,Ph(c),"#define SHADER_NAME "+c.shaderName,t,c.alphaTest?"#define ALPHATEST "+c.alphaTest+(c.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,c.useFog&&c.fog?"#define USE_FOG":
-"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.matcap?"#define USE_MATCAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+l:"",c.envMap?"#define "+n:"",c.envMap?"#define "+q:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMap&&c.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",c.normalMap&&c.tangentSpaceNormalMap?
-"#define TANGENTSPACE_NORMALMAP":"",c.clearcoatMap?"#define USE_CLEARCOATMAP":"",c.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.sheen?"#define USE_SHEEN":"",c.vertexTangents?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexUvs?"#define USE_UV":
-"",c.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",c.gradientMap?"#define USE_GRADIENTMAP":"",c.flatShading?"#define FLAT_SHADED":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+h:"",c.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",c.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",c.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",c.logarithmicDepthBuffer&&c.rendererExtensionFragDepth?
-"#define USE_LOGDEPTHBUF_EXT":"",(c.extensionShaderTextureLOD||c.envMap)&&c.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==c.toneMapping?"#define TONE_MAPPING":"",0!==c.toneMapping?N.tonemapping_pars_fragment:"",0!==c.toneMapping?hk("toneMapping",c.toneMapping):"",c.dithering?"#define DITHERING":"",N.encodings_pars_fragment,c.map?Hd("mapTexelToLinear",c.mapEncoding):"",c.matcap?Hd("matcapTexelToLinear",
-c.matcapEncoding):"",c.envMap?Hd("envMapTexelToLinear",c.envMapEncoding):"",c.emissiveMap?Hd("emissiveMapTexelToLinear",c.emissiveMapEncoding):"",c.lightMap?Hd("lightMapTexelToLinear",c.lightMapEncoding):"",gk("linearToOutputTexel",c.outputEncoding),c.depthPacking?"#define DEPTH_PACKING "+c.depthPacking:"","\n"].filter(Id).join("\n"));f=f.replace(kg,jg);f=Mh(f,c);f=Nh(f,c);g=g.replace(kg,jg);g=Mh(g,c);g=Nh(g,c);f=f.replace(Qh,lg).replace(Rh,Oh);g=g.replace(Qh,lg).replace(Rh,Oh);c.isWebGL2&&!c.isRawShaderMaterial&&
-(l=!1,n=/^\s*#version\s+300\s+es\s*\n/,c.isShaderMaterial&&null!==f.match(n)&&null!==g.match(n)&&(l=!0,f=f.replace(n,""),g=g.replace(n,"")),e="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+e,h=["#version 300 es\n\n#define varying in",l?"":"out highp vec4 pc_fragColor;",l?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+
+(function(k,ua){"object"===typeof exports&&"undefined"!==typeof module?ua(exports):"function"===typeof define&&define.amd?define(["exports"],ua):(k=k||self,ua(k.THREE={}))})(this,function(k){function ua(){}function w(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.x=a;this.y=b}function xa(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function W(a,b,c,d,e,f,g,h,l,n){Object.defineProperty(this,"id",
+{value:hj++});this.uuid=K.generateUUID();this.name="";this.image=void 0!==a?a:W.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:W.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==e?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==l?l:1;this.format=void 0!==g?g:1023;this.internalFormat=null;this.type=void 0!==h?h:1009;this.offset=new w(0,0);this.repeat=new w(1,1);this.center=new w(0,0);this.rotation=0;this.matrixAutoUpdate=!0;
+this.matrix=new xa;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==n?n:3E3;this.version=0;this.onUpdate=null}function Y(a,b,c,d){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);void 0===d&&(d=1);this.x=a;this.y=b;this.z=c;this.w=d}function Ha(a,b,c){this.width=a;this.height=b;this.scissor=new Y(0,0,a,b);this.scissorTest=!1;this.viewport=new Y(0,0,a,b);c=c||{};this.texture=new W(void 0,c.mapping,c.wrapS,c.wrapT,c.magFilter,c.minFilter,
+c.format,c.type,c.anisotropy,c.encoding);this.texture.image={};this.texture.image.width=a;this.texture.image.height=b;this.texture.generateMipmaps=void 0!==c.generateMipmaps?c.generateMipmaps:!1;this.texture.minFilter=void 0!==c.minFilter?c.minFilter:1006;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.depthTexture=void 0!==c.depthTexture?c.depthTexture:null}function ag(a,b,c){Ha.call(this,a,b,c);this.samples=4}function na(a,
+b,c,d){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);void 0===d&&(d=1);this._x=a;this._y=b;this._z=c;this._w=d}function m(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this.x=a;this.y=b;this.z=c}function M(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Ub(a,b,c,d){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);void 0===d&&(d=Ub.DefaultOrder);
+this._x=a;this._y=b;this._z=c;this._order=d}function Fe(){this.mask=1}function z(){Object.defineProperty(this,"id",{value:ij++});this.uuid=K.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=z.DefaultUp.clone();var a=new m,b=new Ub,c=new na,d=new m(1,1,1);b._onChange(function(){c.setFromEuler(b,!1)});c._onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:a},rotation:{configurable:!0,
+enumerable:!0,value:b},quaternion:{configurable:!0,enumerable:!0,value:c},scale:{configurable:!0,enumerable:!0,value:d},modelViewMatrix:{value:new M},normalMatrix:{value:new xa}});this.matrix=new M;this.matrixWorld=new M;this.matrixAutoUpdate=z.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Fe;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function xd(){z.call(this);this.type="Scene";this.overrideMaterial=this.fog=
+this.environment=this.background=null;this.autoUpdate=!0;"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ta(a,b){this.min=void 0!==a?a:new m(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new m(-Infinity,-Infinity,-Infinity)}function bg(a,b,c,d,e){for(var f=0,g=a.length-3;f<=g;f+=3){Vb.fromArray(a,f);var h=e.x*Math.abs(Vb.x)+e.y*Math.abs(Vb.y)+e.z*Math.abs(Vb.z),l=b.dot(Vb),n=c.dot(Vb),q=d.dot(Vb);if(Math.max(-Math.max(l,
+n,q),Math.min(l,n,q))>h)return!1}return!0}function eb(a,b){this.center=void 0!==a?a:new m;this.radius=void 0!==b?b:-1}function Wb(a,b){this.origin=void 0!==a?a:new m;this.direction=void 0!==b?b:new m(0,0,-1)}function Ua(a,b){this.normal=void 0!==a?a:new m(1,0,0);this.constant=void 0!==b?b:0}function wa(a,b,c){this.a=void 0!==a?a:new m;this.b=void 0!==b?b:new m;this.c=void 0!==c?c:new m}function D(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function cg(a,b,c){0>c&&(c+=1);1<
+c&&--c;return c<1/6?a+6*(b-a)*c:.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function dg(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function eg(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function zc(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isVector3?d:new m;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new D;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function G(){Object.defineProperty(this,"id",{value:jj++});
+this.uuid=K.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexColors=this.flatShading=!1;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.stencilWriteMask=255;this.stencilFunc=519;this.stencilRef=0;this.stencilFuncMask=255;this.stencilZPass=this.stencilZFail=this.stencilFail=7680;this.stencilWrite=
+!1;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha=!1;this.toneMapped=this.visible=!0;this.userData={};this.version=0}function Oa(a){G.call(this);this.type="MeshBasicMaterial";this.color=new D(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=
+1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphTargets=this.skinning=!1;this.setValues(a)}function H(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.usage=35044;this.updateRange=
+{offset:0,count:-1};this.version=0}function yd(a,b,c){H.call(this,new Int8Array(a),b,c)}function zd(a,b,c){H.call(this,new Uint8Array(a),b,c)}function Ad(a,b,c){H.call(this,new Uint8ClampedArray(a),b,c)}function Bd(a,b,c){H.call(this,new Int16Array(a),b,c)}function Xb(a,b,c){H.call(this,new Uint16Array(a),b,c)}function Cd(a,b,c){H.call(this,new Int32Array(a),b,c)}function Yb(a,b,c){H.call(this,new Uint32Array(a),b,c)}function B(a,b,c){H.call(this,new Float32Array(a),b,c)}function Dd(a,b,c){H.call(this,
+new Float64Array(a),b,c)}function vh(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function wh(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;c<d;++c)a[c]>b&&(b=a[c]);return b}function F(){Object.defineProperty(this,"id",{value:kj+=
+2});this.uuid=K.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function X(a,b){z.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new F;this.material=void 0!==b?b:new Oa;this.updateMorphTargets()}function xh(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,
+f,g,2!==b.side,h)))return null;Ge.copy(h);Ge.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Ge);return b<c.near||b>c.far?null:{distance:b,point:Ge.clone(),object:a}}function He(a,b,c,d,e,f,g,h,l,n,q,p){Cb.fromBufferAttribute(e,n);Db.fromBufferAttribute(e,q);Eb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Ie.set(0,0,0);Je.set(0,0,0);Ke.set(0,0,0);for(var v=0,t=f.length;v<t;v++){var k=e[v],u=f[v];0!==k&&(fg.fromBufferAttribute(u,n),gg.fromBufferAttribute(u,q),hg.fromBufferAttribute(u,
+p),g?(Ie.addScaledVector(fg,k),Je.addScaledVector(gg,k),Ke.addScaledVector(hg,k)):(Ie.addScaledVector(fg.sub(Cb),k),Je.addScaledVector(gg.sub(Db),k),Ke.addScaledVector(hg.sub(Eb),k)))}Cb.add(Ie);Db.add(Je);Eb.add(Ke)}a.isSkinnedMesh&&(a.boneTransform(n,Cb),a.boneTransform(q,Db),a.boneTransform(p,Eb));if(a=xh(a,b,c,d,Cb,Db,Eb,Ed))h&&(Ac.fromBufferAttribute(h,n),Bc.fromBufferAttribute(h,q),Cc.fromBufferAttribute(h,p),a.uv=wa.getUV(Ed,Cb,Db,Eb,Ac,Bc,Cc,new w)),l&&(Ac.fromBufferAttribute(l,n),Bc.fromBufferAttribute(l,
+q),Cc.fromBufferAttribute(l,p),a.uv2=wa.getUV(Ed,Cb,Db,Eb,Ac,Bc,Cc,new w)),h=new zc(n,q,p),wa.getNormal(Cb,Db,Eb,h.normal),a.face=h;return a}function L(){Object.defineProperty(this,"id",{value:lj+=2});this.uuid=K.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=
+this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function Dc(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}}return b}function va(a){for(var b={},c=0;c<a.length;c++){var d=Dc(a[c]),e;for(e in d)b[e]=d[e]}return b}function Ba(a){G.call(this);this.type="ShaderMaterial";
+this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,
+1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(a))}function fb(){z.call(this);this.type="Camera";this.matrixWorldInverse=new M;this.projectionMatrix=new M;this.projectionMatrixInverse=new M}function O(a,b,c,d){fb.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==
+c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Ec(a,b,c){z.call(this);this.type="CubeCamera";if(!0!==c.isWebGLCubeRenderTarget)console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");else{this.renderTarget=c;var d=new O(90,1,a,b);d.layers=this.layers;d.up.set(0,-1,0);d.lookAt(new m(1,0,0));this.add(d);var e=new O(90,1,
+a,b);e.layers=this.layers;e.up.set(0,-1,0);e.lookAt(new m(-1,0,0));this.add(e);var f=new O(90,1,a,b);f.layers=this.layers;f.up.set(0,0,1);f.lookAt(new m(0,1,0));this.add(f);var g=new O(90,1,a,b);g.layers=this.layers;g.up.set(0,0,-1);g.lookAt(new m(0,-1,0));this.add(g);var h=new O(90,1,a,b);h.layers=this.layers;h.up.set(0,-1,0);h.lookAt(new m(0,0,1));this.add(h);var l=new O(90,1,a,b);l.layers=this.layers;l.up.set(0,-1,0);l.lookAt(new m(0,0,-1));this.add(l);this.update=function(a,b){null===this.parent&&
+this.updateMatrixWorld();var n=a.xr.enabled,q=a.getRenderTarget();a.xr.enabled=!1;var t=c.texture.generateMipmaps;c.texture.generateMipmaps=!1;a.setRenderTarget(c,0);a.render(b,d);a.setRenderTarget(c,1);a.render(b,e);a.setRenderTarget(c,2);a.render(b,f);a.setRenderTarget(c,3);a.render(b,g);a.setRenderTarget(c,4);a.render(b,h);c.texture.generateMipmaps=t;a.setRenderTarget(c,5);a.render(b,l);a.setRenderTarget(q);a.xr.enabled=n};this.clear=function(a,b,d,e){for(var f=a.getRenderTarget(),g=0;6>g;g++)a.setRenderTarget(c,
+g),a.clear(b,d,e);a.setRenderTarget(f)}}}function Zb(a,b,c){Number.isInteger(b)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),b=c);Ha.call(this,a,a,b)}function $b(a,b,c,d,e,f,g,h,l,n,q,p){W.call(this,null,f,g,h,l,n,d,e,q,p);this.image={data:a||null,width:b||1,height:c||1};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==n?n:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0}function Fc(a,b,
+c,d,e,f){this.planes=[void 0!==a?a:new Ua,void 0!==b?b:new Ua,void 0!==c?c:new Ua,void 0!==d?d:new Ua,void 0!==e?e:new Ua,void 0!==f?f:new Ua]}function yh(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!==c&&null!==d&&(b.requestAnimationFrame(a),c=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function mj(a,b){function c(b,c){var d=b.array,e=b.usage,f=a.createBuffer();a.bindBuffer(c,f);a.bufferData(c,
+d,e);b.onUploadCallback();c=5126;d instanceof Float32Array?c=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=5123:d instanceof Int16Array?c=5122:d instanceof Uint32Array?c=5125:d instanceof Int32Array?c=5124:d instanceof Int8Array?c=5120:d instanceof Uint8Array&&(c=5121);return{buffer:f,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var d=b.isWebGL2,e=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&
+(a=a.data);return e.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var c=e.get(b);c&&(a.deleteBuffer(c.buffer),e.delete(b))},update:function(b,g){b.isInterleavedBufferAttribute&&(b=b.data);var f=e.get(b);if(void 0===f)e.set(b,c(b,g));else if(f.version<b.version){var l=b.array,n=b.updateRange;a.bindBuffer(g,f.buffer);-1===n.count?a.bufferSubData(g,0,l):(d?a.bufferSubData(g,n.offset*l.BYTES_PER_ELEMENT,l,n.offset,n.count):a.bufferSubData(g,n.offset*l.BYTES_PER_ELEMENT,l.subarray(n.offset,
+n.offset+n.count)),n.count=-1);f.version=b.version}}}}function Fd(a,b,c,d){L.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new ac(a,b,c,d));this.mergeVertices()}function ac(a,b,c,d){F.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};a=a||1;b=b||1;var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,n=b/d;b=[];a=[];for(var q=[],p=[],
+k=0;k<h;k++)for(var t=k*n-f,r=0;r<g;r++)a.push(r*l-e,-t,0),q.push(0,0,1),p.push(r/c),p.push(1-k/d);for(e=0;e<d;e++)for(f=0;f<c;f++)h=f+g*(e+1),l=f+1+g*(e+1),n=f+1+g*e,b.push(f+g*e,h,n),b.push(h,l,n);this.setIndex(b);this.setAttribute("position",new B(a,3));this.setAttribute("normal",new B(q,3));this.setAttribute("uv",new B(p,2))}function nj(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new D(0),g=0,h,l,n=null,q=0,p=null;return{getClearColor:function(){return f},setClearColor:function(a,
+b){f.set(a);g=void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},setClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,k,u){d=!0===d.isScene?d.background:null;k=a.xr;(k=k.getSession&&k.getSession())&&"additive"===k.environmentBlendMode&&(d=null);null===d?e(f,g):d&&d.isColor&&(e(d,1),u=!0);(a.autoClear||u)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);if(d&&(d.isCubeTexture||d.isWebGLCubeRenderTarget||306===d.mapping)){void 0===l&&(l=new X(new Gd(1,1,1),new Ba({name:"BackgroundCubeMaterial",
+uniforms:Dc(gb.cube.uniforms),vertexShader:gb.cube.vertexShader,fragmentShader:gb.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),c.update(l));u=d.isWebGLCubeRenderTarget?d.texture:d;l.material.uniforms.envMap.value=u;l.material.uniforms.flipEnvMap.value=
+u.isCubeTexture?-1:1;if(n!==d||q!==u.version||p!==a.toneMapping)l.material.needsUpdate=!0,n=d,q=u.version,p=a.toneMapping;b.unshift(l,l.geometry,l.material,0,0,null)}else if(d&&d.isTexture){void 0===h&&(h=new X(new ac(2,2),new Ba({name:"BackgroundMaterial",uniforms:Dc(gb.background.uniforms),vertexShader:gb.background.vertexShader,fragmentShader:gb.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),
+c.update(h));h.material.uniforms.t2D.value=d;!0===d.matrixAutoUpdate&&d.updateMatrix();h.material.uniforms.uvTransform.value.copy(d.matrix);if(n!==d||q!==d.version||p!==a.toneMapping)h.material.needsUpdate=!0,n=d,q=d.version,p=a.toneMapping;b.unshift(h,h.geometry,h.material,0,0,null)}}}}function oj(a,b,c,d){var e=d.isWebGL2,f;this.setMode=function(a){f=a};this.render=function(b,d){a.drawArrays(f,b,d);c.update(d,f)};this.renderInstances=function(d,h,l,n){if(0!==n){if(e){d=a;var g="drawArraysInstanced"}else if(d=
+b.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",null===d){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[g](f,h,l,n);c.update(l,f,n)}}}function pj(a,b,c){function d(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(35633,36338).precision&&0<a.getShaderPrecisionFormat(35632,36338).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(35633,36337).precision&&
+0<a.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var e,f="undefined"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&a instanceof WebGL2ComputeRenderingContext,g=void 0!==c.precision?c.precision:"highp",h=d(g);h!==g&&(console.warn("THREE.WebGLRenderer:",g,"not supported, using",h,"instead."),g=h);c=!0===c.logarithmicDepthBuffer;h=a.getParameter(34930);var l=a.getParameter(35660),n=a.getParameter(3379),q=
+a.getParameter(34076),p=a.getParameter(34921),k=a.getParameter(36347),t=a.getParameter(36348),r=a.getParameter(36349),u=0<l,m=f||!!b.get("OES_texture_float"),E=u&&m,x=f?a.getParameter(36183):0;return{isWebGL2:f,getMaxAnisotropy:function(){if(void 0!==e)return e;var c=b.get("EXT_texture_filter_anisotropic");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:g,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:l,maxTextureSize:n,maxCubemapSize:q,
+maxAttributes:p,maxVertexUniforms:k,maxVaryings:t,maxFragmentUniforms:r,vertexTextures:u,floatFragmentTextures:m,floatVertexTextures:E,maxSamples:x}}function qj(){function a(){n.value!==d&&(n.value=d,n.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=n.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;l.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,l),h.normal.toArray(g,
+d),g[d+3]=h.constant}n.value=g;n.needsUpdate=!0}c.numPlanes=f;c.numIntersection=0;return g}var c=this,d=null,e=0,f=!1,g=!1,h=new Ua,l=new xa,n={value:null,needsUpdate:!1};this.uniform=n;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,l,k,r,u){if(!f||null===c||0===c.length||g&&!l)g?b(null):a();else{l=g?0:e;var q=
+4*l,p=r.clippingState||null;n.value=p;p=b(c,k,q,u);for(c=0;c!==q;++c)p[c]=d[c];r.clippingState=p;this.numIntersection=h?this.numPlanes:0;this.numPlanes+=l}}}function rj(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];switch(c){case "WEBGL_depth_texture":var d=a.getExtension("WEBGL_depth_texture")||a.getExtension("MOZ_WEBGL_depth_texture")||a.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||
+a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");
+return b[c]=d}}}function sj(a,b,c){function d(a){var e=a.target;a=f.get(e);null!==a.index&&b.remove(a.index);for(var h in a.attributes)b.remove(a.attributes[h]);e.removeEventListener("dispose",d);f.delete(e);if(h=g.get(a))b.remove(h),g.delete(a);c.memory.geometries--}function e(a){var c=[],d=a.index,e=a.attributes.position;if(null!==d){e=d.array;d=d.version;for(var f=0,h=e.length;f<h;f+=3){var k=e[f+0],r=e[f+1],u=e[f+2];c.push(k,r,r,u,u,k)}}else for(f=e.array,d=e.version,e=0,f=f.length/3-1;e<f;e+=
+3)h=e+0,k=e+1,r=e+2,c.push(h,k,k,r,r,h);c=new (65535<wh(c)?Yb:Xb)(c,1);c.version=d;b.update(c,34963);(d=g.get(a))&&b.remove(d);g.set(a,c)}var f=new WeakMap,g=new WeakMap;return{get:function(a,b){var e=f.get(b);if(e)return e;b.addEventListener("dispose",d);b.isBufferGeometry?e=b:b.isGeometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new F).setFromObject(a)),e=b._bufferGeometry);f.set(b,e);c.memory.geometries++;return e},update:function(a){var c=a.index,d=a.attributes;null!==c&&b.update(c,34963);
+for(var e in d)b.update(d[e],34962);a=a.morphAttributes;for(var f in a)for(c=a[f],d=0,e=c.length;d<e;d++)b.update(c[d],34962)},getWireframeAttribute:function(a){var b=g.get(a);if(b){var c=a.index;null!==c&&b.version<c.version&&e(a)}else e(a);return g.get(a)}}}function tj(a,b,c,d){var e=d.isWebGL2,f,g,h;this.setMode=function(a){f=a};this.setIndex=function(a){g=a.type;h=a.bytesPerElement};this.render=function(b,d){a.drawElements(f,d,g,b*h);c.update(d,f)};this.renderInstances=function(d,n,q,p){if(0!==
+p){if(e){d=a;var l="drawElementsInstanced"}else if(d=b.get("ANGLE_instanced_arrays"),l="drawElementsInstancedANGLE",null===d){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[l](f,q,g,n*h,p);c.update(q,f,p)}}}function uj(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.frame++;b.calls=0;
+b.triangles=0;b.points=0;b.lines=0},update:function(a,d,e){e=e||1;b.calls++;switch(d){case 4:b.triangles+=a/3*e;break;case 1:b.lines+=a/2*e;break;case 3:b.lines+=e*(a-1);break;case 2:b.lines+=e*a;break;case 0:b.points+=e*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",d)}}}}function vj(a,b){return Math.abs(b[1])-Math.abs(a[1])}function wj(a){var b={},c=new Float32Array(8);return{update:function(d,e,f,g){var h=d.morphTargetInfluences,l=void 0===h?0:h.length;d=b[e.id];if(void 0===
+d){d=[];for(var n=0;n<l;n++)d[n]=[n,0];b[e.id]=d}n=f.morphTargets&&e.morphAttributes.position;f=f.morphNormals&&e.morphAttributes.normal;for(var q=0;q<l;q++)0!==d[q][1]&&(n&&e.deleteAttribute("morphTarget"+q),f&&e.deleteAttribute("morphNormal"+q));for(q=0;q<l;q++){var p=d[q];p[0]=q;p[1]=h[q]}d.sort(vj);for(l=h=0;8>l;l++){if(p=d[l])if(q=p[0],p=p[1]){n&&e.setAttribute("morphTarget"+l,n[q]);f&&e.setAttribute("morphNormal"+l,f[q]);c[l]=p;h+=p;continue}c[l]=0}e=e.morphTargetsRelative?1:1-h;g.getUniforms().setValue(a,
+"morphTargetBaseInfluence",e);g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function xj(a,b,c,d){var e=new WeakMap;return{update:function(a){var f=d.render.frame,h=a.geometry,l=b.get(a,h);e.get(l)!==f&&(h.isGeometry&&l.updateFromObject(a),b.update(l),e.set(l,f));a.isInstancedMesh&&c.update(a.instanceMatrix,34962);return l},dispose:function(){e=new WeakMap}}}function qb(a,b,c,d,e,f,g,h,l,n){a=void 0!==a?a:[];W.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,n);this.flipY=!1}function Gc(a,
+b,c,d){W.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Hc(a,b,c,d){W.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Ic(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=zh[e];void 0===f&&(f=new Float32Array(e),
+zh[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function Pa(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function Ia(a,b){for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}function Ah(a,b){var c=Bh[b];void 0===c&&(c=new Int32Array(b),Bh[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocateTextureUnit();return c}function yj(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function zj(a,b){var c=this.cache;
+if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else Pa(c,b)||(a.uniform2fv(this.addr,b),Ia(c,b))}function Aj(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else Pa(c,b)||(a.uniform3fv(this.addr,b),Ia(c,b))}function Bj(a,b){var c=this.cache;if(void 0!==
+b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else Pa(c,b)||(a.uniform4fv(this.addr,b),Ia(c,b))}function Cj(a,b){var c=this.cache,d=b.elements;void 0===d?Pa(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),Ia(c,b)):Pa(c,d)||(Ch.set(d),a.uniformMatrix2fv(this.addr,!1,Ch),Ia(c,d))}function Dj(a,b){var c=this.cache,d=b.elements;void 0===d?Pa(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),Ia(c,b)):Pa(c,d)||(Dh.set(d),a.uniformMatrix3fv(this.addr,
+!1,Dh),Ia(c,d))}function Ej(a,b){var c=this.cache,d=b.elements;void 0===d?Pa(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),Ia(c,b)):Pa(c,d)||(Eh.set(d),a.uniformMatrix4fv(this.addr,!1,Eh),Ia(c,d))}function Fj(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.safeSetTexture2D(b||Fh,e)}function Gj(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2DArray(b||Hj,e)}function Ij(a,b,c){var d=this.cache,e=c.allocateTextureUnit();
+d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture3D(b||Jj,e)}function Kj(a,b,c){var d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.safeSetTextureCube(b||Gh,e)}function Lj(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function Mj(a,b){var c=this.cache;Pa(c,b)||(a.uniform2iv(this.addr,b),Ia(c,b))}function Nj(a,b){var c=this.cache;Pa(c,b)||(a.uniform3iv(this.addr,b),Ia(c,b))}function Oj(a,b){var c=this.cache;Pa(c,b)||(a.uniform4iv(this.addr,
+b),Ia(c,b))}function Pj(a,b){var c=this.cache;c[0]!==b&&(a.uniform1ui(this.addr,b),c[0]=b)}function Qj(a){switch(a){case 5126:return yj;case 35664:return zj;case 35665:return Aj;case 35666:return Bj;case 35674:return Cj;case 35675:return Dj;case 35676:return Ej;case 5124:case 35670:return Lj;case 35667:case 35671:return Mj;case 35668:case 35672:return Nj;case 35669:case 35673:return Oj;case 5125:return Pj;case 35678:case 36198:case 36298:case 36306:case 35682:return Fj;case 35679:case 36299:case 36307:return Ij;
+case 35680:case 36300:case 36308:case 36293:return Kj;case 36289:case 36303:case 36311:case 36292:return Gj}}function Rj(a,b){a.uniform1fv(this.addr,b)}function Sj(a,b){a.uniform1iv(this.addr,b)}function Tj(a,b){a.uniform2iv(this.addr,b)}function Uj(a,b){a.uniform3iv(this.addr,b)}function Vj(a,b){a.uniform4iv(this.addr,b)}function Wj(a,b){b=Ic(b,this.size,2);a.uniform2fv(this.addr,b)}function Xj(a,b){b=Ic(b,this.size,3);a.uniform3fv(this.addr,b)}function Yj(a,b){b=Ic(b,this.size,4);a.uniform4fv(this.addr,
+b)}function Zj(a,b){b=Ic(b,this.size,4);a.uniformMatrix2fv(this.addr,!1,b)}function ak(a,b){b=Ic(b,this.size,9);a.uniformMatrix3fv(this.addr,!1,b)}function bk(a,b){b=Ic(b,this.size,16);a.uniformMatrix4fv(this.addr,!1,b)}function ck(a,b,c){var d=b.length,e=Ah(c,d);a.uniform1iv(this.addr,e);for(a=0;a!==d;++a)c.safeSetTexture2D(b[a]||Fh,e[a])}function dk(a,b,c){var d=b.length,e=Ah(c,d);a.uniform1iv(this.addr,e);for(a=0;a!==d;++a)c.safeSetTextureCube(b[a]||Gh,e[a])}function ek(a){switch(a){case 5126:return Rj;
+case 35664:return Wj;case 35665:return Xj;case 35666:return Yj;case 35674:return Zj;case 35675:return ak;case 35676:return bk;case 5124:case 35670:return Sj;case 35667:case 35671:return Tj;case 35668:case 35672:return Uj;case 35669:case 35673:return Vj;case 35678:case 36198:case 36298:case 36306:case 35682:return ck;case 35680:case 36300:case 36308:case 36293:return dk}}function fk(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=Qj(b.type)}function Hh(a,b,c){this.id=a;this.addr=c;this.cache=
+[];this.size=b.size;this.setValue=ek(b.type)}function Ih(a){this.id=a;this.seq=[];this.map={}}function Fb(a,b){this.seq=[];this.map={};for(var c=a.getProgramParameter(b,35718),d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),g=this,h=e.name,l=h.length;for(ig.lastIndex=0;;){var n=ig.exec(h),q=ig.lastIndex,p=n[1],k=n[3];"]"===n[2]&&(p|=0);if(void 0===k||"["===k&&q+2===l){h=g;e=void 0===k?new fk(p,e,f):new Hh(p,e,f);h.seq.push(e);h.map[e.id]=e;break}else k=g.map[p],void 0===
+k&&(k=new Ih(p),p=g,g=k,p.seq.push(g),p.map[g.id]=g),g=k}}}function Jh(a,b,c){b=a.createShader(b);a.shaderSource(b,c);a.compileShader(b);return b}function Kh(a){switch(a){case 3E3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];
+default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",a),["Linear","( value )"]}}function Lh(a,b,c){var d=a.getShaderParameter(b,35713),e=a.getShaderInfoLog(b).trim();if(d&&""===e)return"";a=a.getShaderSource(b).split("\n");for(b=0;b<a.length;b++)a[b]=b+1+": "+a[b];a=a.join("\n");return"THREE.WebGLShader: gl.getShaderInfoLog() "+c+"\n"+e+a}function Hd(a,b){b=Kh(b);return"vec4 "+a+"( vec4 value ) { return "+b[0]+"ToLinear"+b[1]+"; }"}function gk(a,b){b=Kh(b);return"vec4 "+a+"( vec4 value ) { return LinearTo"+
+b[0]+b[1]+"; }"}function hk(a,b){switch(b){case 1:b="Linear";break;case 2:b="Reinhard";break;case 3:b="OptimizedCineon";break;case 4:b="ACESFilmic";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",b),b="Linear"}return"vec3 "+a+"( vec3 color ) { return "+b+"ToneMapping( color ); }"}function ik(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}function Id(a){return""!==a}function Mh(a,b){return a.replace(/NUM_DIR_LIGHTS/g,b.numDirLights).replace(/NUM_SPOT_LIGHTS/g,
+b.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,b.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,b.numPointLights).replace(/NUM_HEMI_LIGHTS/g,b.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,b.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,b.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,b.numPointLightShadows)}function Nh(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,b.numClippingPlanes-b.numClipIntersection)}function jg(a,b){a=
+N[b];if(void 0===a)throw Error("Can not resolve #include <"+b+">");return a.replace(kg,jg)}function Oh(a,b,c,d){console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.");return lg(a,b,c,d)}function lg(a,b,c,d){a="";for(b=parseInt(b);b<parseInt(c);b++)a+=d.replace(/\[ i \]/g,"[ "+b+" ]").replace(/UNROLLED_LOOP_INDEX/g,b);return a}function Ph(a){var b="precision "+a.precision+" float;\nprecision "+a.precision+" int;";"highp"===
+a.precision?b+="\n#define HIGH_PRECISION":"mediump"===a.precision?b+="\n#define MEDIUM_PRECISION":"lowp"===a.precision&&(b+="\n#define LOW_PRECISION");return b}function jk(a){var b="SHADOWMAP_TYPE_BASIC";1===a.shadowMapType?b="SHADOWMAP_TYPE_PCF":2===a.shadowMapType?b="SHADOWMAP_TYPE_PCF_SOFT":3===a.shadowMapType&&(b="SHADOWMAP_TYPE_VSM");return b}function kk(a){var b="ENVMAP_TYPE_CUBE";if(a.envMap)switch(a.envMapMode){case 301:case 302:b="ENVMAP_TYPE_CUBE";break;case 306:case 307:b="ENVMAP_TYPE_CUBE_UV";
+break;case 303:case 304:b="ENVMAP_TYPE_EQUIREC"}return b}function lk(a){var b="ENVMAP_MODE_REFLECTION";if(a.envMap)switch(a.envMapMode){case 302:case 304:b="ENVMAP_MODE_REFRACTION"}return b}function mk(a){var b="ENVMAP_BLENDING_NONE";if(a.envMap)switch(a.combine){case 0:b="ENVMAP_BLENDING_MULTIPLY";break;case 1:b="ENVMAP_BLENDING_MIX";break;case 2:b="ENVMAP_BLENDING_ADD"}return b}function nk(a,b,c){var d=a.getContext(),e=c.defines,f=c.vertexShader,g=c.fragmentShader,h=jk(c),l=kk(c),n=lk(c),q=mk(c),
+p=0<a.gammaFactor?a.gammaFactor:1,k=c.isWebGL2?"":[c.extensionDerivatives||c.envMapCubeUV||c.bumpMap||c.tangentSpaceNormalMap||c.clearcoatNormalMap||c.flatShading||"physical"===c.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(c.extensionFragDepth||c.logarithmicDepthBuffer)&&c.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",c.extensionDrawBuffers&&c.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(c.extensionShaderTextureLOD||c.envMap)&&
+c.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Id).join("\n"),t=ik(e),r=d.createProgram();c.isRawShaderMaterial?(e=[t].filter(Id).join("\n"),0<e.length&&(e+="\n"),h=[k,t].filter(Id).join("\n"),0<h.length&&(h+="\n")):(e=[Ph(c),"#define SHADER_NAME "+c.shaderName,t,c.instancing?"#define USE_INSTANCING":"",c.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+c.maxBones,c.useFog&&c.fog?"#define USE_FOG":"",
+c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+n:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMap&&c.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",c.normalMap&&c.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",c.clearcoatMap?"#define USE_CLEARCOATMAP":"",
+c.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.displacementMap&&c.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.vertexTangents?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexUvs?"#define USE_UV":"",c.uvsVertexOnly?"#define UVS_VERTEX_ONLY":
+"",c.flatShading?"#define FLAT_SHADED":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals&&!1===c.flatShading?"#define USE_MORPHNORMALS":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+h:"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"",c.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",c.logarithmicDepthBuffer&&
+c.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;",
+"#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif",
+"#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Id).join("\n"),h=[k,Ph(c),"#define SHADER_NAME "+c.shaderName,t,c.alphaTest?"#define ALPHATEST "+c.alphaTest+(c.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.matcap?"#define USE_MATCAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+l:"",c.envMap?"#define "+n:"",c.envMap?"#define "+
+q:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMap&&c.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",c.normalMap&&c.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",c.clearcoatMap?"#define USE_CLEARCOATMAP":"",c.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",
+c.specularMap?"#define USE_SPECULARMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.sheen?"#define USE_SHEEN":"",c.vertexTangents?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexUvs?"#define USE_UV":"",c.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",c.gradientMap?"#define USE_GRADIENTMAP":"",c.flatShading?"#define FLAT_SHADED":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
+"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+h:"",c.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",c.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",c.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",c.logarithmicDepthBuffer&&c.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(c.extensionShaderTextureLOD||c.envMap)&&c.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",
+"uniform bool isOrthographic;",0!==c.toneMapping?"#define TONE_MAPPING":"",0!==c.toneMapping?N.tonemapping_pars_fragment:"",0!==c.toneMapping?hk("toneMapping",c.toneMapping):"",c.dithering?"#define DITHERING":"",N.encodings_pars_fragment,c.map?Hd("mapTexelToLinear",c.mapEncoding):"",c.matcap?Hd("matcapTexelToLinear",c.matcapEncoding):"",c.envMap?Hd("envMapTexelToLinear",c.envMapEncoding):"",c.emissiveMap?Hd("emissiveMapTexelToLinear",c.emissiveMapEncoding):"",c.lightMap?Hd("lightMapTexelToLinear",
+c.lightMapEncoding):"",gk("linearToOutputTexel",c.outputEncoding),c.depthPacking?"#define DEPTH_PACKING "+c.depthPacking:"","\n"].filter(Id).join("\n"));f=f.replace(kg,jg);f=Mh(f,c);f=Nh(f,c);g=g.replace(kg,jg);g=Mh(g,c);g=Nh(g,c);f=f.replace(Qh,lg).replace(Rh,Oh);g=g.replace(Qh,lg).replace(Rh,Oh);c.isWebGL2&&!c.isRawShaderMaterial&&(l=!1,n=/^\s*#version\s+300\s+es\s*\n/,c.isShaderMaterial&&null!==f.match(n)&&null!==g.match(n)&&(l=!0,f=f.replace(n,""),g=g.replace(n,"")),e="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+
+e,h=["#version 300 es\n\n#define varying in",l?"":"out highp vec4 pc_fragColor;",l?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+
 "\n"+h);g=h+g;f=Jh(d,35633,e+f);g=Jh(d,35632,g);d.attachShader(r,f);d.attachShader(r,g);void 0!==c.index0AttributeName?d.bindAttribLocation(r,0,c.index0AttributeName):!0===c.morphTargets&&d.bindAttribLocation(r,0,"position");d.linkProgram(r);if(a.debug.checkShaderErrors){a=d.getProgramInfoLog(r).trim();l=d.getShaderInfoLog(f).trim();n=d.getShaderInfoLog(g).trim();p=q=!0;if(!1===d.getProgramParameter(r,35714))q=!1,k=Lh(d,f,"vertex"),t=Lh(d,g,"fragment"),console.error("THREE.WebGLProgram: shader error: ",
 d.getError(),"35715",d.getProgramParameter(r,35715),"gl.getProgramInfoLog",a,k,t);else if(""!==a)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",a);else if(""===l||""===n)p=!1;p&&(this.diagnostics={runnable:q,programLog:a,vertexShader:{log:l,prefix:e},fragmentShader:{log:n,prefix:h}})}d.deleteShader(f);d.deleteShader(g);var u;this.getUniforms=function(){void 0===u&&(u=new Fb(d,r));return u};var m;this.getAttributes=function(){if(void 0===m){for(var a={},b=d.getProgramParameter(r,35721),
 c=0;c<b;c++){var e=d.getActiveAttrib(r,c).name;a[e]=d.getAttribLocation(r,e)}m=a}return m};this.destroy=function(){d.deleteProgram(r);this.program=void 0};this.name=c.shaderName;this.id=ok++;this.cacheKey=b;this.usedTimes=1;this.program=r;this.vertexShader=f;this.fragmentShader=g;return this}function pk(a,b,c){function d(a){if(a)a.isTexture?b=a.encoding:a.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),

+ 22 - 22
build/three.module.js

@@ -587,10 +587,10 @@ const MathUtils = {
  * @author zz85 / http://www.lab4games.net/zz85/blog
  */
 
-function Vector2( x, y ) {
+function Vector2( x = 0, y = 0 ) {
 
-	this.x = x || 0;
-	this.y = y || 0;
+	this.x = x;
+	this.y = y;
 
 }
 
@@ -1827,12 +1827,12 @@ Object.defineProperty( Texture.prototype, "needsUpdate", {
  * @author WestLangley / http://github.com/WestLangley
  */
 
-function Vector4( x, y, z, w ) {
+function Vector4( x = 0, y = 0, z = 0, w = 1 ) {
 
-	this.x = x || 0;
-	this.y = y || 0;
-	this.z = z || 0;
-	this.w = ( w !== undefined ) ? w : 1;
+	this.x = x;
+	this.y = y;
+	this.z = z;
+	this.w = w;
 
 }
 
@@ -2619,12 +2619,12 @@ WebGLMultisampleRenderTarget.prototype = Object.assign( Object.create( WebGLRend
  * @author bhouston / http://clara.io
  */
 
-function Quaternion( x, y, z, w ) {
+function Quaternion( x = 0, y = 0, z = 0, w = 1 ) {
 
-	this._x = x || 0;
-	this._y = y || 0;
-	this._z = z || 0;
-	this._w = ( w !== undefined ) ? w : 1;
+	this._x = x;
+	this._y = y;
+	this._z = z;
+	this._w = w;
 
 }
 
@@ -3292,11 +3292,11 @@ Object.assign( Quaternion.prototype, {
 const _vector = new Vector3();
 const _quaternion = new Quaternion();
 
-function Vector3( x, y, z ) {
+function Vector3( x = 0, y = 0, z = 0 ) {
 
-	this.x = x || 0;
-	this.y = y || 0;
-	this.z = z || 0;
+	this.x = x;
+	this.y = y;
+	this.z = z;
 
 }
 
@@ -4908,12 +4908,12 @@ Object.assign( Matrix4.prototype, {
 const _matrix = new Matrix4();
 const _quaternion$1 = new Quaternion();
 
-function Euler( x, y, z, order ) {
+function Euler( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) {
 
-	this._x = x || 0;
-	this._y = y || 0;
-	this._z = z || 0;
-	this._order = order || Euler.DefaultOrder;
+	this._x = x;
+	this._y = y;
+	this._z = z;
+	this._order = order;
 
 }