"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("gsap"),r=0,n=1,i=2,a=0,o=1,s=2,l=3;function c(){}Object.assign(c.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var r=this._listeners[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var r=t.slice(0),n=0,i=r.length;n>8&255]+h[e>>16&255]+h[e>>24&255]+"-"+h[255&t]+h[t>>8&255]+"-"+h[t>>16&15|64]+h[t>>24&255]+"-"+h[63&r|128]+h[r>>8&255]+"-"+h[r>>16&255]+h[r>>24&255]+h[255&n]+h[n>>8&255]+h[n>>16&255]+h[n>>24&255]).toUpperCase()},clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},lerp:function(e,t,r){return(1-r)*e+r*t},damp:function(e,t,r,n){return p.lerp(e,t,1-Math.exp(-r*n))},pingpong:function(e,t){return void 0===t&&(t=1),t-Math.abs(p.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(d=e%2147483647),((d=16807*d%2147483647)-1)/2147483646},degToRad:function(e){return e*p.DEG2RAD},radToDeg:function(e){return e*p.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,r,n,i){var a=Math.cos,o=Math.sin,s=a(r/2),l=o(r/2),c=a((t+n)/2),h=o((t+n)/2),u=a((t-n)/2),d=o((t-n)/2),p=a((n-t)/2),f=o((n-t)/2);switch(i){case"XYX":e.set(s*h,l*u,l*d,s*c);break;case"YZY":e.set(l*d,s*h,l*u,s*c);break;case"ZXZ":e.set(l*u,l*d,s*h,s*c);break;case"XZX":e.set(s*h,l*f,l*p,s*c);break;case"YXY":e.set(l*p,s*h,l*f,s*c);break;case"ZYZ":e.set(l*f,l*p,s*h,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},f=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t},m={width:{configurable:!0},height:{configurable:!0}};m.width.get=function(){return this.x},m.width.set=function(e){this.x=e},m.height.get=function(){return this.y},m.height.set=function(e){this.y=e},f.prototype.set=function(e,t){return this.x=e,this.y=t,this},f.prototype.setScalar=function(e){return this.x=e,this.y=e,this},f.prototype.setX=function(e){return this.x=e,this},f.prototype.setY=function(e){return this.y=e,this},f.prototype.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},f.prototype.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},f.prototype.clone=function(){return new this.constructor(this.x,this.y)},f.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},f.prototype.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},f.prototype.addScalar=function(e){return this.x+=e,this.y+=e,this},f.prototype.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},f.prototype.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},f.prototype.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},f.prototype.subScalar=function(e){return this.x-=e,this.y-=e,this},f.prototype.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},f.prototype.multiply=function(e){return this.x*=e.x,this.y*=e.y,this},f.prototype.multiplyScalar=function(e){return this.x*=e,this.y*=e,this},f.prototype.divide=function(e){return this.x/=e.x,this.y/=e.y,this},f.prototype.divideScalar=function(e){return this.multiplyScalar(1/e)},f.prototype.applyMatrix3=function(e){var t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this},f.prototype.min=function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},f.prototype.max=function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},f.prototype.clamp=function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},f.prototype.clampScalar=function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},f.prototype.clampLength=function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},f.prototype.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},f.prototype.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},f.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},f.prototype.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},f.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},f.prototype.dot=function(e){return this.x*e.x+this.y*e.y},f.prototype.cross=function(e){return this.x*e.y-this.y*e.x},f.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y},f.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},f.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)},f.prototype.normalize=function(){return this.divideScalar(this.length()||1)},f.prototype.angle=function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e},f.prototype.distanceTo=function(e){return Math.sqrt(this.distanceToSquared(e))},f.prototype.distanceToSquared=function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},f.prototype.manhattanDistanceTo=function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},f.prototype.setLength=function(e){return this.normalize().multiplyScalar(e)},f.prototype.lerp=function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},f.prototype.lerpVectors=function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this},f.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},f.prototype.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},f.prototype.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},f.prototype.fromBufferAttribute=function(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},f.prototype.rotateAround=function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*r-a*n+e.x,this.y=i*n+a*r+e.y,this},f.prototype.random=function(){return this.x=Math.random(),this.y=Math.random(),this},Object.defineProperties(f.prototype,m);var v,g=function(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")};g.prototype.set=function(e,t,r,n,i,a,o,s,l){var c=this.elements;return c[0]=e,c[1]=n,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=r,c[7]=a,c[8]=l,this},g.prototype.identity=function(){return this.set(1,0,0,0,1,0,0,0,1),this},g.prototype.clone=function(){return(new this.constructor).fromArray(this.elements)},g.prototype.copy=function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this},g.prototype.extractBasis=function(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this},g.prototype.setFromMatrix4=function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},g.prototype.multiply=function(e){return this.multiplyMatrices(this,e)},g.prototype.premultiply=function(e){return this.multiplyMatrices(e,this)},g.prototype.multiplyMatrices=function(e,t){var r=e.elements,n=t.elements,i=this.elements,a=r[0],o=r[3],s=r[6],l=r[1],c=r[4],h=r[7],u=r[2],d=r[5],p=r[8],f=n[0],m=n[3],v=n[6],g=n[1],y=n[4],x=n[7],b=n[2],_=n[5],w=n[8];return i[0]=a*f+o*g+s*b,i[3]=a*m+o*y+s*_,i[6]=a*v+o*x+s*w,i[1]=l*f+c*g+h*b,i[4]=l*m+c*y+h*_,i[7]=l*v+c*x+h*w,i[2]=u*f+d*g+p*b,i[5]=u*m+d*y+p*_,i[8]=u*v+d*x+p*w,this},g.prototype.multiplyScalar=function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},g.prototype.determinant=function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-r*i*c+r*o*s+n*i*l-n*a*s},g.prototype.invert=function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],h=c*a-o*l,u=o*s-c*i,d=l*i-a*s,p=t*h+r*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);var f=1/p;return e[0]=h*f,e[1]=(n*l-c*r)*f,e[2]=(o*r-n*a)*f,e[3]=u*f,e[4]=(c*t-n*s)*f,e[5]=(n*i-o*t)*f,e[6]=d*f,e[7]=(r*s-l*t)*f,e[8]=(a*t-r*i)*f,this},g.prototype.transpose=function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},g.prototype.getNormalMatrix=function(e){return this.setFromMatrix4(e).copy(this).invert().transpose()},g.prototype.transposeIntoArray=function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},g.prototype.setUvTransform=function(e,t,r,n,i,a,o){var s=Math.cos(i),l=Math.sin(i);return this.set(r*s,r*l,-r*(s*a+l*o)+a+e,-n*l,n*s,-n*(-l*a+s*o)+o+t,0,0,1),this},g.prototype.scale=function(e,t){var r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this},g.prototype.rotate=function(e){var t=Math.cos(e),r=Math.sin(e),n=this.elements,i=n[0],a=n[3],o=n[6],s=n[1],l=n[4],c=n[7];return n[0]=t*i+r*s,n[3]=t*a+r*l,n[6]=t*o+r*c,n[1]=-r*i+t*s,n[4]=-r*a+t*l,n[7]=-r*o+t*c,this},g.prototype.translate=function(e,t){var r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this},g.prototype.equals=function(e){for(var t=this.elements,r=e.elements,n=0;n<9;n++)if(t[n]!==r[n])return!1;return!0},g.prototype.fromArray=function(e,t){void 0===t&&(t=0);for(var r=0;r<9;r++)this.elements[r]=e[r+t];return this},g.prototype.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e};var y={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===v&&(v=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),v.width=e.width,v.height=e.height;var r=v.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=v}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},x=0;function b(e,t,r,n,i,a,o,s,l,c){void 0===e&&(e=b.DEFAULT_IMAGE),void 0===t&&(t=b.DEFAULT_MAPPING),void 0===r&&(r=1001),void 0===n&&(n=1001),void 0===i&&(i=1006),void 0===a&&(a=1008),void 0===o&&(o=1023),void 0===s&&(s=1009),void 0===l&&(l=1),void 0===c&&(c=3e3),Object.defineProperty(this,"id",{value:x++}),this.uuid=p.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=r,this.wrapT=n,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new f(0,0),this.repeat=new f(1,1),this.center=new f(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new g,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}function _(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?y.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}b.DEFAULT_IMAGE=void 0,b.DEFAULT_MAPPING=300,b.prototype=Object.assign(Object.create(c.prototype),{constructor:b,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=p.generateUUID()),!t&&void 0===e.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var a=0,o=n.length;a1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(b.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});var w=function(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=r,this.w=n},M={width:{configurable:!0},height:{configurable:!0}};M.width.get=function(){return this.z},M.width.set=function(e){this.z=e},M.height.get=function(){return this.w},M.height.set=function(e){this.w=e},w.prototype.set=function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},w.prototype.setScalar=function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},w.prototype.setX=function(e){return this.x=e,this},w.prototype.setY=function(e){return this.y=e,this},w.prototype.setZ=function(e){return this.z=e,this},w.prototype.setW=function(e){return this.w=e,this},w.prototype.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},w.prototype.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},w.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},w.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},w.prototype.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},w.prototype.addScalar=function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},w.prototype.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},w.prototype.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},w.prototype.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},w.prototype.subScalar=function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},w.prototype.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},w.prototype.multiply=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},w.prototype.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},w.prototype.applyMatrix4=function(e){var t=this.x,r=this.y,n=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*n+a[12]*i,this.y=a[1]*t+a[5]*r+a[9]*n+a[13]*i,this.z=a[2]*t+a[6]*r+a[10]*n+a[14]*i,this.w=a[3]*t+a[7]*r+a[11]*n+a[15]*i,this},w.prototype.divideScalar=function(e){return this.multiplyScalar(1/e)},w.prototype.setAxisAngleFromQuaternion=function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},w.prototype.setAxisAngleFromRotationMatrix=function(e){var t,r,n,i,a=.01,o=.1,s=e.elements,l=s[0],c=s[4],h=s[8],u=s[1],d=s[5],p=s[9],f=s[2],m=s[6],v=s[10];if(Math.abs(c-u)y&&g>x?gx?y=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var _=o*g;if(s=s*m+u*_,l=l*m+d*_,c=c*m+p*_,h=h*m+f*_,m===1-o){var w=1/Math.sqrt(s*s+l*l+c*c+h*h);s*=w,l*=w,c*=w,h*=w}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=h},T.multiplyQuaternionsFlat=function(e,t,r,n,i,a){var o=r[n],s=r[n+1],l=r[n+2],c=r[n+3],h=i[a],u=i[a+1],d=i[a+2],p=i[a+3];return e[t]=o*p+c*h+s*d-l*u,e[t+1]=s*p+c*u+l*h-o*d,e[t+2]=l*p+c*d+o*u-s*h,e[t+3]=c*p-o*h-s*u-l*d,e},A.x.get=function(){return this._x},A.x.set=function(e){this._x=e,this._onChangeCallback()},A.y.get=function(){return this._y},A.y.set=function(e){this._y=e,this._onChangeCallback()},A.z.get=function(){return this._z},A.z.set=function(e){this._z=e,this._onChangeCallback()},A.w.get=function(){return this._w},A.w.set=function(e){this._w=e,this._onChangeCallback()},T.prototype.set=function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this},T.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},T.prototype.copy=function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},T.prototype.setFromEuler=function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(r/2),c=o(n/2),h=o(i/2),u=s(r/2),d=s(n/2),p=s(i/2);switch(a){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this},T.prototype.setFromAxisAngle=function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this},T.prototype.setFromRotationMatrix=function(e){var t=e.elements,r=t[0],n=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],h=t[10],u=r+o+h;if(u>0){var d=.5/Math.sqrt(u+1);this._w=.25/d,this._x=(c-s)*d,this._y=(i-l)*d,this._z=(a-n)*d}else if(r>o&&r>h){var p=2*Math.sqrt(1+r-o-h);this._w=(c-s)/p,this._x=.25*p,this._y=(n+a)/p,this._z=(i+l)/p}else if(o>h){var f=2*Math.sqrt(1+o-r-h);this._w=(i-l)/f,this._x=(n+a)/f,this._y=.25*f,this._z=(s+c)/f}else{var m=2*Math.sqrt(1+h-r-o);this._w=(a-n)/m,this._x=(i+l)/m,this._y=(s+c)/m,this._z=.25*m}return this._onChangeCallback(),this},T.prototype.setFromUnitVectors=function(e,t){var r=e.dot(t)+1;return r<1e-6?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()},T.prototype.angleTo=function(e){return 2*Math.acos(Math.abs(p.clamp(this.dot(e),-1,1)))},T.prototype.rotateTowards=function(e,t){var r=this.angleTo(e);if(0===r)return this;var n=Math.min(1,t/r);return this.slerp(e,n),this},T.prototype.identity=function(){return this.set(0,0,0,1)},T.prototype.invert=function(){return this.conjugate()},T.prototype.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},T.prototype.dot=function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},T.prototype.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},T.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},T.prototype.normalize=function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},T.prototype.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},T.prototype.premultiply=function(e){return this.multiplyQuaternions(e,this)},T.prototype.multiplyQuaternions=function(e,t){var r=e._x,n=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=r*c+a*o+n*l-i*s,this._y=n*c+a*s+i*o-r*l,this._z=i*c+a*l+r*s-n*o,this._w=a*c-r*o-n*s-i*l,this._onChangeCallback(),this},T.prototype.slerp=function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,a=this._w,o=a*e._w+r*e._x+n*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=r,this._y=n,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*r+t*this._x,this._y=l*n+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),h=Math.atan2(c,o),u=Math.sin((1-t)*h)/c,d=Math.sin(t*h)/c;return this._w=a*u+this._w*d,this._x=r*u+this._x*d,this._y=n*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this},T.prototype.equals=function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},T.prototype.fromArray=function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},T.prototype.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},T.prototype.fromBufferAttribute=function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},T.prototype._onChange=function(e){return this._onChangeCallback=e,this},T.prototype._onChangeCallback=function(){},Object.defineProperties(T.prototype,A);var E=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=r};E.prototype.set=function(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this},E.prototype.setScalar=function(e){return this.x=e,this.y=e,this.z=e,this},E.prototype.setX=function(e){return this.x=e,this},E.prototype.setY=function(e){return this.y=e,this},E.prototype.setZ=function(e){return this.z=e,this},E.prototype.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},E.prototype.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},E.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z)},E.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},E.prototype.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},E.prototype.addScalar=function(e){return this.x+=e,this.y+=e,this.z+=e,this},E.prototype.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},E.prototype.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},E.prototype.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},E.prototype.subScalar=function(e){return this.x-=e,this.y-=e,this.z-=e,this},E.prototype.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},E.prototype.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},E.prototype.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this},E.prototype.multiplyVectors=function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},E.prototype.applyEuler=function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(P.setFromEuler(e))},E.prototype.applyAxisAngle=function(e,t){return this.applyQuaternion(P.setFromAxisAngle(e,t))},E.prototype.applyMatrix3=function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this},E.prototype.applyNormalMatrix=function(e){return this.applyMatrix3(e).normalize()},E.prototype.applyMatrix4=function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,a=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*a,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*a,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*a,this},E.prototype.applyQuaternion=function(e){var t=this.x,r=this.y,n=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*n-o*r,c=s*r+o*t-i*n,h=s*n+i*r-a*t,u=-i*t-a*r-o*n;return this.x=l*s+u*-i+c*-o-h*-a,this.y=c*s+u*-a+h*-i-l*-o,this.z=h*s+u*-o+l*-a-c*-i,this},E.prototype.project=function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},E.prototype.unproject=function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},E.prototype.transformDirection=function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()},E.prototype.divide=function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},E.prototype.divideScalar=function(e){return this.multiplyScalar(1/e)},E.prototype.min=function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},E.prototype.max=function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},E.prototype.clamp=function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},E.prototype.clampScalar=function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},E.prototype.clampLength=function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},E.prototype.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},E.prototype.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},E.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},E.prototype.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},E.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},E.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},E.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},E.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},E.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},E.prototype.normalize=function(){return this.divideScalar(this.length()||1)},E.prototype.setLength=function(e){return this.normalize().multiplyScalar(e)},E.prototype.lerp=function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},E.prototype.lerpVectors=function(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this},E.prototype.cross=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},E.prototype.crossVectors=function(e,t){var r=e.x,n=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=n*s-i*o,this.y=i*a-r*s,this.z=r*o-n*a,this},E.prototype.projectOnVector=function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)},E.prototype.projectOnPlane=function(e){return L.copy(this).projectOnVector(e),this.sub(L)},E.prototype.reflect=function(e){return this.sub(L.copy(e).multiplyScalar(2*this.dot(e)))},E.prototype.angleTo=function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var r=this.dot(e)/t;return Math.acos(p.clamp(r,-1,1))},E.prototype.distanceTo=function(e){return Math.sqrt(this.distanceToSquared(e))},E.prototype.distanceToSquared=function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},E.prototype.manhattanDistanceTo=function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},E.prototype.setFromSpherical=function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},E.prototype.setFromSphericalCoords=function(e,t,r){var n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this},E.prototype.setFromCylindrical=function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},E.prototype.setFromCylindricalCoords=function(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this},E.prototype.setFromMatrixPosition=function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},E.prototype.setFromMatrixScale=function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this},E.prototype.setFromMatrixColumn=function(e,t){return this.fromArray(e.elements,4*t)},E.prototype.setFromMatrix3Column=function(e,t){return this.fromArray(e.elements,3*t)},E.prototype.equals=function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},E.prototype.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},E.prototype.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},E.prototype.fromBufferAttribute=function(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},E.prototype.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this};var L=new E,P=new T,N=function(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new E(1/0,1/0,1/0),this.max=void 0!==t?t:new E(-1/0,-1/0,-1/0)};function R(e,t,r,n,i){for(var a=0,o=e.length-3;a<=o;a+=3){V.fromArray(e,a);var s=i.x*Math.abs(V.x)+i.y*Math.abs(V.y)+i.z*Math.abs(V.z),l=t.dot(V),c=r.dot(V),h=n.dot(V);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>s)return!1}return!0}N.prototype.set=function(e,t){return this.min.copy(e),this.max.copy(t),this},N.prototype.setFromArray=function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.length;si&&(i=c),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,r,n),this.max.set(i,a,o),this},N.prototype.setFromBufferAttribute=function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.count;si&&(i=c),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,r,n),this.max.set(i,a,o),this},N.prototype.setFromPoints=function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},N.prototype.containsBox=function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},N.prototype.getParameter=function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new E),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},N.prototype.intersectsBox=function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},N.prototype.intersectsSphere=function(e){return this.clampPoint(e.center,F),F.distanceToSquared(e.center)<=e.radius*e.radius},N.prototype.intersectsPlane=function(e){var t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant},N.prototype.intersectsTriangle=function(e){if(this.isEmpty())return!1;this.getCenter(G),k.subVectors(this.max,G),O.subVectors(e.a,G),D.subVectors(e.b,G),U.subVectors(e.c,G),z.subVectors(D,O),B.subVectors(U,D),H.subVectors(O,U);var t=[0,-z.z,z.y,0,-B.z,B.y,0,-H.z,H.y,z.z,0,-z.x,B.z,0,-B.x,H.z,0,-H.x,-z.y,z.x,0,-B.y,B.x,0,-H.y,H.x,0];return!!R(t,O,D,U,k)&&(!!R(t=[1,0,0,0,1,0,0,0,1],O,D,U,k)&&(j.crossVectors(z,B),R(t=[j.x,j.y,j.z],O,D,U,k)))},N.prototype.clampPoint=function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new E),t.copy(e).clamp(this.min,this.max)},N.prototype.distanceToPoint=function(e){return F.copy(e).clamp(this.min,this.max).sub(e).length()},N.prototype.getBoundingSphere=function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(F).length(),e},N.prototype.intersect=function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},N.prototype.union=function(e){return this.min.min(e.min),this.max.max(e.max),this},N.prototype.applyMatrix4=function(e){return this.isEmpty()||(C[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),C[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),C[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),C[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),C[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),C[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),C[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),C[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(C)),this},N.prototype.translate=function(e){return this.min.add(e),this.max.add(e),this},N.prototype.equals=function(e){return e.min.equals(this.min)&&e.max.equals(this.max)};var C=[new E,new E,new E,new E,new E,new E,new E,new E],F=new E,I=new N,O=new E,D=new E,U=new E,z=new E,B=new E,H=new E,G=new E,k=new E,j=new E,V=new E,W=new N,X=function(e,t){this.center=void 0!==e?e:new E,this.radius=void 0!==t?t:-1};X.prototype.set=function(e,t){return this.center.copy(e),this.radius=t,this},X.prototype.setFromPoints=function(e,t){var r=this.center;void 0!==t?r.copy(t):W.setFromPoints(e).getCenter(r);for(var n=0,i=0,a=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},X.prototype.getBoundingBox=function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new N),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)},X.prototype.applyMatrix4=function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},X.prototype.translate=function(e){return this.center.add(e),this},X.prototype.equals=function(e){return e.center.equals(this.center)&&e.radius===this.radius};var Y=new E,q=new E,Q=new E,Z=new E,J=new E,K=new E,$=new E,ee=function(e,t){this.origin=void 0!==e?e:new E,this.direction=void 0!==t?t:new E(0,0,-1)};ee.prototype.set=function(e,t){return this.origin.copy(e),this.direction.copy(t),this},ee.prototype.clone=function(){return(new this.constructor).copy(this)},ee.prototype.copy=function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},ee.prototype.at=function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new E),t.copy(this.direction).multiplyScalar(e).add(this.origin)},ee.prototype.lookAt=function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},ee.prototype.recast=function(e){return this.origin.copy(this.at(e,Y)),this},ee.prototype.closestPointToPoint=function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new E),t.subVectors(e,this.origin);var r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)},ee.prototype.distanceToPoint=function(e){return Math.sqrt(this.distanceSqToPoint(e))},ee.prototype.distanceSqToPoint=function(e){var t=Y.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Y.copy(this.direction).multiplyScalar(t).add(this.origin),Y.distanceToSquared(e))},ee.prototype.distanceSqToSegment=function(e,t,r,n){q.copy(e).add(t).multiplyScalar(.5),Q.copy(t).sub(e).normalize(),Z.copy(this.origin).sub(q);var i,a,o,s,l=.5*e.distanceTo(t),c=-this.direction.dot(Q),h=Z.dot(this.direction),u=-Z.dot(Q),d=Z.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(a=c*h-u,s=l*p,(i=c*u-h)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(i*=f)*(i+c*(a*=f)+2*h)+a*(c*i+a+2*u)+d}else a=l,o=-(i=Math.max(0,-(c*a+h)))*i+a*(a+2*u)+d;else a=-l,o=-(i=Math.max(0,-(c*a+h)))*i+a*(a+2*u)+d;else a<=-s?o=-(i=Math.max(0,-(-c*l+h)))*i+(a=i>0?-l:Math.min(Math.max(-l,-u),l))*(a+2*u)+d:a<=s?(i=0,o=(a=Math.min(Math.max(-l,-u),l))*(a+2*u)+d):o=-(i=Math.max(0,-(c*l+h)))*i+(a=i>0?l:Math.min(Math.max(-l,-u),l))*(a+2*u)+d;else a=c>0?-l:l,o=-(i=Math.max(0,-(c*a+h)))*i+a*(a+2*u)+d;return r&&r.copy(this.direction).multiplyScalar(i).add(this.origin),n&&n.copy(Q).multiplyScalar(a).add(q),o},ee.prototype.intersectSphere=function(e,t){Y.subVectors(e.center,this.origin);var r=Y.dot(this.direction),n=Y.dot(Y)-r*r,i=e.radius*e.radius;if(n>i)return null;var a=Math.sqrt(i-n),o=r-a,s=r+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},ee.prototype.intersectsSphere=function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},ee.prototype.distanceToPlane=function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},ee.prototype.intersectPlane=function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)},ee.prototype.intersectsPlane=function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},ee.prototype.intersectBox=function(e,t){var r,n,i,a,o,s,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(r=(e.min.x-u.x)*l,n=(e.max.x-u.x)*l):(r=(e.max.x-u.x)*l,n=(e.min.x-u.x)*l),c>=0?(i=(e.min.y-u.y)*c,a=(e.max.y-u.y)*c):(i=(e.max.y-u.y)*c,a=(e.min.y-u.y)*c),r>a||i>n?null:((i>r||r!=r)&&(r=i),(a=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),r>s||o>n?null:((o>r||r!=r)&&(r=o),(s=0?r:n,t)))},ee.prototype.intersectsBox=function(e){return null!==this.intersectBox(e,Y)},ee.prototype.intersectTriangle=function(e,t,r,n,i){J.subVectors(t,e),K.subVectors(r,e),$.crossVectors(J,K);var a,o=this.direction.dot($);if(o>0){if(n)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Z.subVectors(this.origin,e);var s=a*this.direction.dot(K.crossVectors(Z,K));if(s<0)return null;var l=a*this.direction.dot(J.cross(Z));if(l<0)return null;if(s+l>o)return null;var c=-a*Z.dot($);return c<0?null:this.at(c/o,i)},ee.prototype.applyMatrix4=function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},ee.prototype.equals=function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)};var te=function(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};te.prototype.set=function(e,t,r,n,i,a,o,s,l,c,h,u,d,p,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=l,v[6]=c,v[10]=h,v[14]=u,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this},te.prototype.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},te.prototype.clone=function(){return(new te).fromArray(this.elements)},te.prototype.copy=function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this},te.prototype.copyPosition=function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this},te.prototype.setFromMatrix3=function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this},te.prototype.extractBasis=function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},te.prototype.makeBasis=function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},te.prototype.extractRotation=function(e){var t=this.elements,r=e.elements,n=1/re.setFromMatrixColumn(e,0).length(),i=1/re.setFromMatrixColumn(e,1).length(),a=1/re.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},te.prototype.makeRotationFromEuler=function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,a=Math.cos(r),o=Math.sin(r),s=Math.cos(n),l=Math.sin(n),c=Math.cos(i),h=Math.sin(i);if("XYZ"===e.order){var u=a*c,d=a*h,p=o*c,f=o*h;t[0]=s*c,t[4]=-s*h,t[8]=l,t[1]=d+p*l,t[5]=u-f*l,t[9]=-o*s,t[2]=f-u*l,t[6]=p+d*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*c,v=s*h,g=l*c,y=l*h;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*l,t[1]=a*h,t[5]=a*c,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){var x=s*c,b=s*h,_=l*c,w=l*h;t[0]=x-w*o,t[4]=-a*h,t[8]=_+b*o,t[1]=b+_*o,t[5]=a*c,t[9]=w-x*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var M=a*c,S=a*h,T=o*c,A=o*h;t[0]=s*c,t[4]=T*l-S,t[8]=M*l+A,t[1]=s*h,t[5]=A*l+M,t[9]=S*l-T,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var E=a*s,L=a*l,P=o*s,N=o*l;t[0]=s*c,t[4]=N-E*h,t[8]=P*h+L,t[1]=h,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=L*h+P,t[10]=E-N*h}else if("XZY"===e.order){var R=a*s,C=a*l,F=o*s,I=o*l;t[0]=s*c,t[4]=-h,t[8]=l*c,t[1]=R*h+I,t[5]=a*c,t[9]=C*h-F,t[2]=F*h-C,t[6]=o*c,t[10]=I*h+R}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},te.prototype.makeRotationFromQuaternion=function(e){return this.compose(ie,e,ae)},te.prototype.lookAt=function(e,t,r){var n=this.elements;return le.subVectors(e,t),0===le.lengthSq()&&(le.z=1),le.normalize(),oe.crossVectors(r,le),0===oe.lengthSq()&&(1===Math.abs(r.z)?le.x+=1e-4:le.z+=1e-4,le.normalize(),oe.crossVectors(r,le)),oe.normalize(),se.crossVectors(le,oe),n[0]=oe.x,n[4]=se.x,n[8]=le.x,n[1]=oe.y,n[5]=se.y,n[9]=le.y,n[2]=oe.z,n[6]=se.z,n[10]=le.z,this},te.prototype.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},te.prototype.premultiply=function(e){return this.multiplyMatrices(e,this)},te.prototype.multiplyMatrices=function(e,t){var r=e.elements,n=t.elements,i=this.elements,a=r[0],o=r[4],s=r[8],l=r[12],c=r[1],h=r[5],u=r[9],d=r[13],p=r[2],f=r[6],m=r[10],v=r[14],g=r[3],y=r[7],x=r[11],b=r[15],_=n[0],w=n[4],M=n[8],S=n[12],T=n[1],A=n[5],E=n[9],L=n[13],P=n[2],N=n[6],R=n[10],C=n[14],F=n[3],I=n[7],O=n[11],D=n[15];return i[0]=a*_+o*T+s*P+l*F,i[4]=a*w+o*A+s*N+l*I,i[8]=a*M+o*E+s*R+l*O,i[12]=a*S+o*L+s*C+l*D,i[1]=c*_+h*T+u*P+d*F,i[5]=c*w+h*A+u*N+d*I,i[9]=c*M+h*E+u*R+d*O,i[13]=c*S+h*L+u*C+d*D,i[2]=p*_+f*T+m*P+v*F,i[6]=p*w+f*A+m*N+v*I,i[10]=p*M+f*E+m*R+v*O,i[14]=p*S+f*L+m*C+v*D,i[3]=g*_+y*T+x*P+b*F,i[7]=g*w+y*A+x*N+b*I,i[11]=g*M+y*E+x*R+b*O,i[15]=g*S+y*L+x*C+b*D,this},te.prototype.multiplyScalar=function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},te.prototype.determinant=function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+i*s*h-n*l*h-i*o*u+r*l*u+n*o*d-r*s*d)+e[7]*(+t*s*d-t*l*u+i*a*u-n*a*d+n*l*c-i*s*c)+e[11]*(+t*l*h-t*o*d-i*a*h+r*a*d+i*o*c-r*l*c)+e[15]*(-n*o*c-t*s*h+t*o*u+n*a*h-r*a*u+r*s*c)},te.prototype.transpose=function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},te.prototype.setPosition=function(e,t,r){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this},te.prototype.invert=function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],v=e[15],g=h*m*l-f*u*l+f*s*d-o*m*d-h*s*v+o*u*v,y=p*u*l-c*m*l-p*s*d+a*m*d+c*s*v-a*u*v,x=c*f*l-p*h*l+p*o*d-a*f*d-c*o*v+a*h*v,b=p*h*s-c*f*s-p*o*u+a*f*u+c*o*m-a*h*m,_=t*g+r*y+n*x+i*b;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/_;return e[0]=g*w,e[1]=(f*u*i-h*m*i-f*n*d+r*m*d+h*n*v-r*u*v)*w,e[2]=(o*m*i-f*s*i+f*n*l-r*m*l-o*n*v+r*s*v)*w,e[3]=(h*s*i-o*u*i-h*n*l+r*u*l+o*n*d-r*s*d)*w,e[4]=y*w,e[5]=(c*m*i-p*u*i+p*n*d-t*m*d-c*n*v+t*u*v)*w,e[6]=(p*s*i-a*m*i-p*n*l+t*m*l+a*n*v-t*s*v)*w,e[7]=(a*u*i-c*s*i+c*n*l-t*u*l-a*n*d+t*s*d)*w,e[8]=x*w,e[9]=(p*h*i-c*f*i-p*r*d+t*f*d+c*r*v-t*h*v)*w,e[10]=(a*f*i-p*o*i+p*r*l-t*f*l-a*r*v+t*o*v)*w,e[11]=(c*o*i-a*h*i-c*r*l+t*h*l+a*r*d-t*o*d)*w,e[12]=b*w,e[13]=(c*f*n-p*h*n+p*r*u-t*f*u-c*r*m+t*h*m)*w,e[14]=(p*o*n-a*f*n-p*r*s+t*f*s+a*r*m-t*o*m)*w,e[15]=(a*h*n-c*o*n+c*r*s-t*h*s-a*r*u+t*o*u)*w,this},te.prototype.scale=function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this},te.prototype.getMaxScaleOnAxis=function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))},te.prototype.makeTranslation=function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},te.prototype.makeRotationX=function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this},te.prototype.makeRotationY=function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this},te.prototype.makeRotationZ=function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this},te.prototype.makeRotationAxis=function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+r,l*o-n*s,l*s+n*o,0,l*o+n*s,c*o+r,c*s-n*a,0,l*s-n*o,c*s+n*a,i*s*s+r,0,0,0,0,1),this},te.prototype.makeScale=function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this},te.prototype.makeShear=function(e,t,r){return this.set(1,t,r,0,e,1,r,0,e,t,1,0,0,0,0,1),this},te.prototype.compose=function(e,t,r){var n=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,h=o+o,u=i*l,d=i*c,p=i*h,f=a*c,m=a*h,v=o*h,g=s*l,y=s*c,x=s*h,b=r.x,_=r.y,w=r.z;return n[0]=(1-(f+v))*b,n[1]=(d+x)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-x)*_,n[5]=(1-(u+v))*_,n[6]=(m+g)*_,n[7]=0,n[8]=(p+y)*w,n[9]=(m-g)*w,n[10]=(1-(u+f))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},te.prototype.decompose=function(e,t,r){var n=this.elements,i=re.set(n[0],n[1],n[2]).length(),a=re.set(n[4],n[5],n[6]).length(),o=re.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],ne.copy(this);var s=1/i,l=1/a,c=1/o;return ne.elements[0]*=s,ne.elements[1]*=s,ne.elements[2]*=s,ne.elements[4]*=l,ne.elements[5]*=l,ne.elements[6]*=l,ne.elements[8]*=c,ne.elements[9]*=c,ne.elements[10]*=c,t.setFromRotationMatrix(ne),r.x=i,r.y=a,r.z=o,this},te.prototype.makePerspective=function(e,t,r,n,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(r-n),c=(t+e)/(t-e),h=(r+n)/(r-n),u=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},te.prototype.makeOrthographic=function(e,t,r,n,i,a){var o=this.elements,s=1/(t-e),l=1/(r-n),c=1/(a-i),h=(t+e)*s,u=(r+n)*l,d=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},te.prototype.equals=function(e){for(var t=this.elements,r=e.elements,n=0;n<16;n++)if(t[n]!==r[n])return!1;return!0},te.prototype.fromArray=function(e,t){void 0===t&&(t=0);for(var r=0;r<16;r++)this.elements[r]=e[r+t];return this},te.prototype.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e};var re=new E,ne=new te,ie=new E(0,0,0),ae=new E(1,1,1),oe=new E,se=new E,le=new E,ce=function e(t,r,n,i){void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=e.DefaultOrder),Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=r,this._z=n,this._order=i},he={x:{configurable:!0},y:{configurable:!0},z:{configurable:!0},order:{configurable:!0}};he.x.get=function(){return this._x},he.x.set=function(e){this._x=e,this._onChangeCallback()},he.y.get=function(){return this._y},he.y.set=function(e){this._y=e,this._onChangeCallback()},he.z.get=function(){return this._z},he.z.set=function(e){this._z=e,this._onChangeCallback()},he.order.get=function(){return this._order},he.order.set=function(e){this._order=e,this._onChangeCallback()},ce.prototype.set=function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._order=n||this._order,this._onChangeCallback(),this},ce.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)},ce.prototype.copy=function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},ce.prototype.setFromRotationMatrix=function(e,t,r){var n=p.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=i[6],f=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==r&&this._onChangeCallback(),this},ce.prototype.setFromQuaternion=function(e,t,r){return ue.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ue,t,r)},ce.prototype.setFromVector3=function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},ce.prototype.reorder=function(e){return de.setFromEuler(this),this.setFromQuaternion(de,e)},ce.prototype.equals=function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},ce.prototype.fromArray=function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},ce.prototype.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},ce.prototype.toVector3=function(e){return e?e.set(this._x,this._y,this._z):new E(this._x,this._y,this._z)},ce.prototype._onChange=function(e){return this._onChangeCallback=e,this},ce.prototype._onChangeCallback=function(){},Object.defineProperties(ce.prototype,he),ce.DefaultOrder="XYZ",ce.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var ue=new te,de=new T,pe=function(){this.mask=1};pe.prototype.set=function(e){this.mask=1<1){for(var r=0;r1){for(var r=0;r0){n.children=[];for(var p=0;p0){n.animations=[];for(var f=0;f0&&(r.geometries=v),g.length>0&&(r.materials=g),y.length>0&&(r.textures=y),x.length>0&&(r.images=x),b.length>0&&(r.shapes=b),_.length>0&&(r.skeletons=_),w.length>0&&(r.animations=w)}return r.object=n,r;function M(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var r=0;r1?void 0:t.copy(r).multiplyScalar(i).add(e.start)},Re.prototype.intersectsLine=function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0},Re.prototype.intersectsBox=function(e){return e.intersectsPlane(this)},Re.prototype.intersectsSphere=function(e){return e.intersectsPlane(this)},Re.prototype.coplanarPoint=function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new E),e.copy(this.normal).multiplyScalar(-this.constant)},Re.prototype.applyMatrix4=function(e,t){var r=t||Ne.getNormalMatrix(e),n=this.coplanarPoint(Le).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this},Re.prototype.translate=function(e){return this.constant-=e.dot(this.normal),this},Re.prototype.equals=function(e){return e.normal.equals(this.normal)&&e.constant===this.constant};var Ce=new E,Fe=new E,Ie=new E,Oe=new E,De=new E,Ue=new E,ze=new E,Be=new E,He=new E,Ge=new E,ke=function(e,t,r){this.a=void 0!==e?e:new E,this.b=void 0!==t?t:new E,this.c=void 0!==r?r:new E};ke.getNormal=function(e,t,r,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new E),n.subVectors(r,t),Ce.subVectors(e,t),n.cross(Ce);var i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)},ke.getBarycoord=function(e,t,r,n,i){Ce.subVectors(n,t),Fe.subVectors(r,t),Ie.subVectors(e,t);var a=Ce.dot(Ce),o=Ce.dot(Fe),s=Ce.dot(Ie),l=Fe.dot(Fe),c=Fe.dot(Ie),h=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new E),0===h)return i.set(-2,-1,-1);var u=1/h,d=(l*s-o*c)*u,p=(a*c-o*s)*u;return i.set(1-d-p,p,d)},ke.containsPoint=function(e,t,r,n){return this.getBarycoord(e,t,r,n,Oe),Oe.x>=0&&Oe.y>=0&&Oe.x+Oe.y<=1},ke.getUV=function(e,t,r,n,i,a,o,s){return this.getBarycoord(e,t,r,n,Oe),s.set(0,0),s.addScaledVector(i,Oe.x),s.addScaledVector(a,Oe.y),s.addScaledVector(o,Oe.z),s},ke.isFrontFacing=function(e,t,r,n){return Ce.subVectors(r,t),Fe.subVectors(e,t),Ce.cross(Fe).dot(n)<0},ke.prototype.set=function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this},ke.prototype.setFromPointsAndIndices=function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this},ke.prototype.clone=function(){return(new this.constructor).copy(this)},ke.prototype.copy=function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},ke.prototype.getArea=function(){return Ce.subVectors(this.c,this.b),Fe.subVectors(this.a,this.b),.5*Ce.cross(Fe).length()},ke.prototype.getMidpoint=function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new E),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},ke.prototype.getNormal=function(e){return ke.getNormal(this.a,this.b,this.c,e)},ke.prototype.getPlane=function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Re),e.setFromCoplanarPoints(this.a,this.b,this.c)},ke.prototype.getBarycoord=function(e,t){return ke.getBarycoord(e,this.a,this.b,this.c,t)},ke.prototype.getUV=function(e,t,r,n,i){return ke.getUV(e,this.a,this.b,this.c,t,r,n,i)},ke.prototype.containsPoint=function(e){return ke.containsPoint(e,this.a,this.b,this.c)},ke.prototype.isFrontFacing=function(e){return ke.isFrontFacing(this.a,this.b,this.c,e)},ke.prototype.intersectsBox=function(e){return e.intersectsTriangle(this)},ke.prototype.closestPointToPoint=function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new E);var r,n,i=this.a,a=this.b,o=this.c;De.subVectors(a,i),Ue.subVectors(o,i),Be.subVectors(e,i);var s=De.dot(Be),l=Ue.dot(Be);if(s<=0&&l<=0)return t.copy(i);He.subVectors(e,a);var c=De.dot(He),h=Ue.dot(He);if(c>=0&&h<=c)return t.copy(a);var u=s*h-c*l;if(u<=0&&s>=0&&c<=0)return r=s/(s-c),t.copy(i).addScaledVector(De,r);Ge.subVectors(e,o);var d=De.dot(Ge),p=Ue.dot(Ge);if(p>=0&&d<=p)return t.copy(o);var f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),t.copy(i).addScaledVector(Ue,n);var m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return ze.subVectors(o,a),n=(h-c)/(h-c+(d-p)),t.copy(a).addScaledVector(ze,n);var v=1/(m+f+u);return r=f*v,n=u*v,t.copy(i).addScaledVector(De,r).addScaledVector(Ue,n)},ke.prototype.equals=function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)};var je={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ve={h:0,s:0,l:0},We={h:0,s:0,l:0};function Xe(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}function Ye(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function qe(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Qe=function(e,t,r){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===r?this.set(e):this.setRGB(e,t,r)};Qe.prototype.set=function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},Qe.prototype.setScalar=function(e){return this.r=e,this.g=e,this.b=e,this},Qe.prototype.setHex=function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},Qe.prototype.setRGB=function(e,t,r){return this.r=e,this.g=t,this.b=r,this},Qe.prototype.setHSL=function(e,t,r){if(e=p.euclideanModulo(e,1),t=p.clamp(t,0,1),r=p.clamp(r,0,1),0===t)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=Xe(i,n,e+1/3),this.g=Xe(i,n,e),this.b=Xe(i,n,e-1/3)}return this},Qe.prototype.setStyle=function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var n,i=r[1],a=r[2];switch(i){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[4]),this;if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[4]),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return t(n[4]),this.setHSL(o,s,l)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){var c=r[1],h=c.length;if(3===h)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},Qe.prototype.setColorName=function(e){var t=je[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},Qe.prototype.clone=function(){return new this.constructor(this.r,this.g,this.b)},Qe.prototype.copy=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},Qe.prototype.copyGammaToLinear=function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},Qe.prototype.copyLinearToGamma=function(e,t){void 0===t&&(t=2);var r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this},Qe.prototype.convertGammaToLinear=function(e){return this.copyGammaToLinear(this,e),this},Qe.prototype.convertLinearToGamma=function(e){return this.copyLinearToGamma(this,e),this},Qe.prototype.copySRGBToLinear=function(e){return this.r=Ye(e.r),this.g=Ye(e.g),this.b=Ye(e.b),this},Qe.prototype.copyLinearToSRGB=function(e){return this.r=qe(e.r),this.g=qe(e.g),this.b=qe(e.b),this},Qe.prototype.convertSRGBToLinear=function(){return this.copySRGBToLinear(this),this},Qe.prototype.convertLinearToSRGB=function(){return this.copyLinearToSRGB(this),this},Qe.prototype.getHex=function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},Qe.prototype.getHexString=function(){return("000000"+this.getHex().toString(16)).slice(-6)},Qe.prototype.getHSL=function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,r,n=this.r,i=this.g,a=this.b,o=Math.max(n,i,a),s=Math.min(n,i,a),l=(s+o)/2;if(s===o)t=0,r=0;else{var c=o-s;switch(r=l<=.5?c/(o+s):c/(2-o-s),o){case n:t=(i-a)/c+(i0&&(r.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.skinning&&(r.skinning=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){var i=n(e.textures),a=n(e.images);i.length>0&&(r.textures=i),a.length>0&&(r.images=a)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,r=null;if(null!==t){var n=t.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ke.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),$e.prototype=Object.create(Ke.prototype),$e.prototype.constructor=$e,$e.prototype.isMeshBasicMaterial=!0,$e.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var et=new E,tt=new f;function rt(e,t,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===r,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function nt(e,t,r){rt.call(this,new Int8Array(e),t,r)}function it(e,t,r){rt.call(this,new Uint8Array(e),t,r)}function at(e,t,r){rt.call(this,new Uint8ClampedArray(e),t,r)}function ot(e,t,r){rt.call(this,new Int16Array(e),t,r)}function st(e,t,r){rt.call(this,new Uint16Array(e),t,r)}function lt(e,t,r){rt.call(this,new Int32Array(e),t,r)}function ct(e,t,r){rt.call(this,new Uint32Array(e),t,r)}function ht(e,t,r){rt.call(this,new Uint16Array(e),t,r)}function ut(e,t,r){rt.call(this,new Float32Array(e),t,r)}function dt(e,t,r){rt.call(this,new Float64Array(e),t,r)}function pt(e){if(0===e.length)return-1/0;for(var t=e[0],r=1,n=e.length;rt&&(t=e[r]);return t}Object.defineProperty(rt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(rt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;n65535?ct:st)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t,r){void 0===r&&(r=0),this.groups.push({start:e,count:t,materialIndex:r})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new g).getNormalMatrix(e);r.applyNormalMatrix(n),r.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return gt.makeRotationX(e),this.applyMatrix4(gt),this},rotateY:function(e){return gt.makeRotationY(e),this.applyMatrix4(gt),this},rotateZ:function(e){return gt.makeRotationZ(e),this.applyMatrix4(gt),this},translate:function(e,t,r){return gt.makeTranslation(e,t,r),this.applyMatrix4(gt),this},scale:function(e,t,r){return gt.makeScale(e,t,r),this.applyMatrix4(gt),this},lookAt:function(e){return yt.lookAt(e),yt.updateMatrix(),this.applyMatrix4(yt.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(xt).negate(),this.translate(xt.x,xt.y,xt.z),this},setFromPoints:function(e){for(var t=[],r=0,n=e.length;r0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(var a in i){var o=i[a],s=o.toJSON(e.data);""!==o.name&&(s.name=o.name),e.data.attributes[a]=s}var l={},c=!1;for(var h in this.morphAttributes){for(var u=this.morphAttributes[h],d=[],p=0,f=u.length;p0&&(l[h]=d,c=!0)}c&&(e.data.morphAttributes=l,e.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(e.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(e.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),e},clone:function(){return(new Mt).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone(t));var n=e.attributes;for(var i in n){var a=n[i];this.setAttribute(i,a.clone(t))}var o=e.morphAttributes;for(var s in o){for(var l=[],c=o[s],h=0,u=c.length;hr.far?null:{distance:l,point:Ht.clone(),object:e}}(e,t,r,n,Et,Lt,Pt,Bt);if(y){s&&(Dt.fromBufferAttribute(s,c),Ut.fromBufferAttribute(s,h),zt.fromBufferAttribute(s,u),y.uv=ke.getUV(Bt,Et,Lt,Pt,Dt,Ut,zt,new f)),l&&(Dt.fromBufferAttribute(l,c),Ut.fromBufferAttribute(l,h),zt.fromBufferAttribute(l,u),y.uv2=ke.getUV(Bt,Et,Lt,Pt,Dt,Ut,zt,new f));var x=new Ze(c,h,u);ke.getNormal(Et,Lt,Pt,x.normal),y.face=x}return y}Gt.prototype=Object.assign(Object.create(Ee.prototype),{constructor:Gt,isMesh:!0,copy:function(e){return Ee.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(r.length>0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=n.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var r,n=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),At.copy(n.boundingSphere),At.applyMatrix4(a),!1!==e.ray.intersectsSphere(At)&&(St.copy(a).invert(),Tt.copy(e.ray).applyMatrix4(St),null===n.boundingBox||!1!==Tt.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var o=n.index,s=n.attributes.position,l=n.morphAttributes.position,c=n.morphTargetsRelative,h=n.attributes.uv,u=n.attributes.uv2,d=n.groups,p=n.drawRange;if(null!==o)if(Array.isArray(i))for(var f=0,m=d.length;f0?1:-1,h.push(L.x,L.y,L.z),u.push(R/m),u.push(1-P/v),T+=1}for(var F=0;F0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},qt.prototype=Object.assign(Object.create(Ee.prototype),{constructor:qt,isCamera:!0,copy:function(e,t){return Ee.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new E),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Ee.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){Ee.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Qt.prototype=Object.assign(Object.create(qt.prototype),{constructor:Qt,isPerspectiveCamera:!0,copy:function(e,t){return qt.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*p.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*p.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*p.RAD2DEG*Math.atan(Math.tan(.5*p.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,r,n,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*p.DEG2RAD*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*n/o,t-=a.offsetY*r/s,n*=a.width/o,r*=a.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){var t=Ee.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});function Zt(e,t,r){if(Ee.call(this),this.type="CubeCamera",!0===r.isWebGLCubeRenderTarget){this.renderTarget=r;var n=new Qt(90,1,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new E(1,0,0)),this.add(n);var i=new Qt(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new E(-1,0,0)),this.add(i);var a=new Qt(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new E(0,1,0)),this.add(a);var o=new Qt(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new E(0,-1,0)),this.add(o);var s=new Qt(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new E(0,0,1)),this.add(s);var l=new Qt(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new E(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var c=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;var u=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,n),e.setRenderTarget(r,1),e.render(t,i),e.setRenderTarget(r,2),e.render(t,a),e.setRenderTarget(r,3),e.render(t,o),e.setRenderTarget(r,4),e.render(t,s),r.texture.generateMipmaps=u,e.setRenderTarget(r,5),e.render(t,l),e.setRenderTarget(h),e.xr.enabled=c}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function Jt(e,t,r,n,i,a,o,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:301,o=void 0!==o?o:1022,b.call(this,e,t,r,n,i,a,o,s,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}Zt.prototype=Object.create(Ee.prototype),Zt.prototype.constructor=Zt,Jt.prototype=Object.create(b.prototype),Jt.prototype.constructor=Jt,Jt.prototype.isCubeTexture=!0,Object.defineProperty(Jt.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var Kt=function(e){function t(t,r,n){Number.isInteger(r)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),r=n),e.call(this,t,t,r),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),r=r||{},this.texture=new Jt(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture._needsFlipEnvMap=!1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var r={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",a=new jt(5,5,5),o=new Yt({name:"CubemapFromEquirect",uniforms:Vt(r),vertexShader:n,fragmentShader:i,side:1,blending:0});o.uniforms.tEquirect.value=t;var s=new Gt(a,o),l=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new Zt(1,10,this).update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this},t.prototype.clear=function(e,t,r,n){for(var i=e.getRenderTarget(),a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,r,n);e.setRenderTarget(i)},t}(S);function $t(e,t,r,n,i,a,o,s,l,c,h,u){b.call(this,null,a,o,s,l,c,n,i,h,u),this.image={data:e||null,width:t||1,height:r||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}$t.prototype=Object.create(b.prototype),$t.prototype.constructor=$t,$t.prototype.isDataTexture=!0;var er=new X,tr=new E,rr=function(e,t,r,n,i,a){this.planes=[void 0!==e?e:new Re,void 0!==t?t:new Re,void 0!==r?r:new Re,void 0!==n?n:new Re,void 0!==i?i:new Re,void 0!==a?a:new Re]};function nr(){var e=null,t=!1,r=null,n=null;function i(t,a){r(t,a),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function ir(e,t){var r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var a=n.get(t);(!a||a.version0?e.max.x:e.min.x,tr.y=n.normal.y>0?e.max.y:e.min.y,tr.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(tr)<0)return!1}return!0},rr.prototype.containsPoint=function(e){for(var t=this.planes,r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0};var ar=function(e){function t(t,r,n,i){void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=1),e.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:r,widthSegments:n,heightSegments:i};for(var a=t/2,o=r/2,s=Math.floor(n),l=Math.floor(i),c=s+1,h=l+1,u=t/s,d=r/l,p=[],f=[],m=[],v=[],g=0;g 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},sr={common:{diffuse:{value:new Qe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new g},uv2Transform:{value:new g},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new f(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Qe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Qe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new g}},sprite:{diffuse:{value:new Qe(15658734)},opacity:{value:1},center:{value:new f(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new g}}},lr={basic:{uniforms:Wt([sr.common,sr.specularmap,sr.envmap,sr.aomap,sr.lightmap,sr.fog]),vertexShader:or.meshbasic_vert,fragmentShader:or.meshbasic_frag},lambert:{uniforms:Wt([sr.common,sr.specularmap,sr.envmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.fog,sr.lights,{emissive:{value:new Qe(0)}}]),vertexShader:or.meshlambert_vert,fragmentShader:or.meshlambert_frag},phong:{uniforms:Wt([sr.common,sr.specularmap,sr.envmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.fog,sr.lights,{emissive:{value:new Qe(0)},specular:{value:new Qe(1118481)},shininess:{value:30}}]),vertexShader:or.meshphong_vert,fragmentShader:or.meshphong_frag},standard:{uniforms:Wt([sr.common,sr.envmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.roughnessmap,sr.metalnessmap,sr.fog,sr.lights,{emissive:{value:new Qe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:or.meshphysical_vert,fragmentShader:or.meshphysical_frag},toon:{uniforms:Wt([sr.common,sr.aomap,sr.lightmap,sr.emissivemap,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.gradientmap,sr.fog,sr.lights,{emissive:{value:new Qe(0)}}]),vertexShader:or.meshtoon_vert,fragmentShader:or.meshtoon_frag},matcap:{uniforms:Wt([sr.common,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.fog,{matcap:{value:null}}]),vertexShader:or.meshmatcap_vert,fragmentShader:or.meshmatcap_frag},points:{uniforms:Wt([sr.points,sr.fog]),vertexShader:or.points_vert,fragmentShader:or.points_frag},dashed:{uniforms:Wt([sr.common,sr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:or.linedashed_vert,fragmentShader:or.linedashed_frag},depth:{uniforms:Wt([sr.common,sr.displacementmap]),vertexShader:or.depth_vert,fragmentShader:or.depth_frag},normal:{uniforms:Wt([sr.common,sr.bumpmap,sr.normalmap,sr.displacementmap,{opacity:{value:1}}]),vertexShader:or.normal_vert,fragmentShader:or.normal_frag},sprite:{uniforms:Wt([sr.sprite,sr.fog]),vertexShader:or.sprite_vert,fragmentShader:or.sprite_frag},background:{uniforms:{uvTransform:{value:new g},t2D:{value:null}},vertexShader:or.background_vert,fragmentShader:or.background_frag},cube:{uniforms:Wt([sr.envmap,{opacity:{value:1}}]),vertexShader:or.cube_vert,fragmentShader:or.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:or.equirect_vert,fragmentShader:or.equirect_frag},distanceRGBA:{uniforms:Wt([sr.common,sr.displacementmap,{referencePosition:{value:new E},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:or.distanceRGBA_vert,fragmentShader:or.distanceRGBA_frag},shadow:{uniforms:Wt([sr.lights,sr.fog,{color:{value:new Qe(0)},opacity:{value:1}}]),vertexShader:or.shadow_vert,fragmentShader:or.shadow_frag}};function cr(e,t,r,n,i){var a,o,s=new Qe(0),l=0,c=null,h=0,u=null;function d(e,t){r.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e,t){void 0===t&&(t=1),s.set(e),d(s,l=t)},getClearAlpha:function(){return l},setClearAlpha:function(e){d(s,l=e)},render:function(r,i,p,f){var m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=t.get(m));var v=e.xr,g=v.getSession&&v.getSession();g&&"additive"===g.environmentBlendMode&&(m=null),null===m?d(s,l):m&&m.isColor&&(d(m,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===o&&((o=new Gt(new jt(1,1,1),new Yt({name:"BackgroundCubeMaterial",uniforms:Vt(lr.cube.uniforms),vertexShader:lr.cube.vertexShader,fragmentShader:lr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o)),m.isWebGLCubeRenderTarget&&(m=m.texture),o.material.uniforms.envMap.value=m,o.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,c===m&&h===m.version&&u===e.toneMapping||(o.material.needsUpdate=!0,c=m,h=m.version,u=e.toneMapping),r.unshift(o,o.geometry,o.material,0,0,null)):m&&m.isTexture&&(void 0===a&&((a=new Gt(new ar(2,2),new Yt({name:"BackgroundMaterial",uniforms:Vt(lr.background.uniforms),vertexShader:lr.background.vertexShader,fragmentShader:lr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),a.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&h===m.version&&u===e.toneMapping||(a.material.needsUpdate=!0,c=m,h=m.version,u=e.toneMapping),r.unshift(a,a.geometry,a.material,0,0,null))}}}function hr(e,t,r,n){var i=e.getParameter(34921),a=n.isWebGL2?null:t.get("OES_vertex_array_object"),o=n.isWebGL2||null!==a,s={},l=d(null),c=l;function h(t){return n.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function u(t){return n.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function d(e){for(var t=[],r=[],n=[],a=0;a=0){var y=l[u];if(void 0!==y){var x=y.normalized,b=y.itemSize,_=r.get(y);if(void 0===_)continue;var w=_.buffer,M=_.type,S=_.bytesPerElement;if(y.isInterleavedBufferAttribute){var T=y.data,A=T.stride,E=y.offset;T&&T.isInstancedInterleavedBuffer?(m(d,T.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=T.meshPerAttribute*T.count)):f(d),e.bindBuffer(34962,w),g(d,b,M,x,A*S,E*S)}else y.isInstancedBufferAttribute?(m(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):f(d),e.bindBuffer(34962,w),g(d,b,M,x,0,0)}else if("instanceMatrix"===u){var L=r.get(i.instanceMatrix);if(void 0===L)continue;var P=L.buffer,N=L.type;m(d+0,1),m(d+1,1),m(d+2,1),m(d+3,1),e.bindBuffer(34962,P),e.vertexAttribPointer(d+0,4,N,!1,64,0),e.vertexAttribPointer(d+1,4,N,!1,64,16),e.vertexAttribPointer(d+2,4,N,!1,64,32),e.vertexAttribPointer(d+3,4,N,!1,64,48)}else if("instanceColor"===u){var R=r.get(i.instanceColor);if(void 0===R)continue;var C=R.buffer,F=R.type;m(d,1),e.bindBuffer(34962,C),e.vertexAttribPointer(d,3,F,!1,12,0)}else if(void 0!==h){var I=h[u];if(void 0!==I)switch(I.length){case 2:e.vertexAttrib2fv(d,I);break;case 3:e.vertexAttrib3fv(d,I);break;case 4:e.vertexAttrib4fv(d,I);break;default:e.vertexAttrib1fv(d,I)}}}}v()}(i,l,u,y),null!==x&&e.bindBuffer(34963,r.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){for(var e in y(),s){var t=s[e];for(var r in t){var n=t[r];for(var i in n)u(n[i].object),delete n[i];delete t[r]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var r in t){var n=t[r];for(var i in n)u(n[i].object),delete n[i];delete t[r]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var r=s[t];if(void 0!==r[e.id]){var n=r[e.id];for(var i in n)u(n[i].object),delete n[i];delete r[e.id]}}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:v}}function ur(e,t,r,n){var i,a=n.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,n){e.drawArrays(i,t,n),r.update(n,i,1)},this.renderInstances=function(n,o,s){if(0!==s){var l,c;if(a)l=e,c="drawArraysInstanced";else if(c="drawArraysInstancedANGLE",null===(l=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](i,n,o,s),r.update(o,i,s)}}}function dr(e,t,r){var n;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==r.precision?r.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===r.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),u=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=h>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==n)return n;var r=t.get("EXT_texture_filter_anisotropic");return n=null!==r?e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:a?e.getParameter(36183):0}}function pr(e){var t=this,r=null,n=0,i=!1,a=!1,o=new Re,s=new g,l={value:null,needsUpdate:!1};function c(){l.value!==r&&(l.value=r,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(e,r,n,i){var a=null!==e?e.length:0,c=null;if(0!==a){if(c=l.value,!0!==i||null===c){var h=n+4*a,u=r.matrixWorldInverse;s.getNormalMatrix(u),(null===c||c.length0){var s=e.getRenderList(),l=e.getRenderTarget(),c=new Kt(o.height/2);return c.fromEquirectangularTexture(e,i),t.set(i,c),e.setRenderTarget(l),e.setRenderList(s),i.addEventListener("dispose",n),r(c.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function mr(e){var t={};function r(r){if(void 0!==t[r])return t[r];var n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float")},get:function(e){var t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function vr(e,t,r,n){var i={},a=new WeakMap;function o(e){var s=e.target;for(var l in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[l]);s.removeEventListener("dispose",o),delete i[s.id];var c=a.get(s);c&&(t.remove(c),a.delete(s)),n.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,r.memory.geometries--}function s(e){var r=[],n=e.index,i=e.attributes.position,o=0;if(null!==n){var s=n.array;o=n.version;for(var l=0,c=s.length;l65535?ct:st)(r,1);x.version=o;var b=a.get(e);b&&t.remove(b),a.set(e,x)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,r.memory.geometries++),t},update:function(e){var r=e.attributes;for(var n in r)t.update(r[n],34962);var i=e.morphAttributes;for(var a in i)for(var o=i[a],s=0,l=o.length;s0)return e;var i=t*r,a=Pr[i];if(void 0===a&&(a=new Float32Array(i),Pr[i]=a),0!==t){n.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=r,e[o].toArray(a,s)}return a}function Or(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;r/gm;function Rn(e){return e.replace(Nn,Cn)}function Cn(e,t){var r=or[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Rn(r)}var Fn=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,In=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function On(e){return e.replace(In,Un).replace(Fn,Dn)}function Dn(e,t,r,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Un(e,t,r,n)}function Un(e,t,r,n){for(var i="",a=parseInt(t);a0?e.gammaFactor:1,y=r.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(En).join("\n")}(r),x=function(e){var t=[];for(var r in e){var n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(h),b=c.createProgram(),_=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?((i=[x].filter(En).join("\n")).length>0&&(i+="\n"),(a=[y,x].filter(En).join("\n")).length>0&&(a+="\n")):(i=[zn(r),"#define SHADER_NAME "+r.shaderName,x,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+m:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+p:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.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","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#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(En).join("\n"),a=[y,zn(r),"#define SHADER_NAME "+r.shaderName,x,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+f:"",r.envMap?"#define "+m:"",r.envMap?"#define "+v:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.sheen?"#define USE_SHEEN":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+p:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?or.tonemapping_pars_fragment:"",0!==r.toneMapping?An("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",or.encodings_pars_fragment,r.map?Tn("mapTexelToLinear",r.mapEncoding):"",r.matcap?Tn("matcapTexelToLinear",r.matcapEncoding):"",r.envMap?Tn("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMap?Tn("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.lightMap?Tn("lightMapTexelToLinear",r.lightMapEncoding):"",(o="linearToOutputTexel",s=r.outputEncoding,l=Mn(s),"vec4 "+o+"( vec4 value ) { return LinearTo"+l[0]+l[1]+"; }"),r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(En).join("\n")),u=Pn(u=Ln(u=Rn(u),r),r),d=Pn(d=Ln(d=Rn(d),r),r),u=On(u),d=On(d),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(_="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in","300 es"===r.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===r.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);var w,M,S=_+a+d,T=_n(c,35633,_+i+u),A=_n(c,35632,S);if(c.attachShader(b,T),c.attachShader(b,A),void 0!==r.index0AttributeName?c.bindAttribLocation(b,0,r.index0AttributeName):!0===r.morphTargets&&c.bindAttribLocation(b,0,"position"),c.linkProgram(b),e.debug.checkShaderErrors){var E=c.getProgramInfoLog(b).trim(),L=c.getShaderInfoLog(T).trim(),P=c.getShaderInfoLog(A).trim(),N=!0,R=!0;if(!1===c.getProgramParameter(b,35714)){N=!1;var C=Sn(c,T,"vertex"),F=Sn(c,A,"fragment");console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(b,35715),"gl.getProgramInfoLog",E,C,F)}else""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==L&&""!==P||(R=!1);R&&(this.diagnostics={runnable:N,programLog:E,vertexShader:{log:L,prefix:i},fragmentShader:{log:P,prefix:a}})}return c.deleteShader(T),c.deleteShader(A),this.getUniforms=function(){return void 0===w&&(w=new bn(c,b)),w},this.getAttributes=function(){return void 0===M&&(M=function(e,t){for(var r={},n=e.getProgramParameter(t,35721),i=0;i0,maxBones:S,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||r.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)r.push(n),r.push(t.defines[n]);if(!1===t.isRawShaderMaterial){for(var i=0;i1&&n.sort(e||kn),i.length>1&&i.sort(t||jn)}}}function Wn(e){var t=new WeakMap;return{get:function(r,n){var i,a=t.get(r);return void 0===a?(i=new Vn(e),t.set(r,new WeakMap),t.get(r).set(n,i)):void 0===(i=a.get(n))&&(i=new Vn(e),a.set(n,i)),i},dispose:function(){t=new WeakMap}}}function Xn(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new E,color:new Qe};break;case"SpotLight":r={position:new E,direction:new E,color:new Qe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new E,color:new Qe,distance:0,decay:0};break;case"HemisphereLight":r={direction:new E,skyColor:new Qe,groundColor:new Qe};break;case"RectAreaLight":r={color:new Qe,position:new E,halfWidth:new E,halfHeight:new E}}return e[t.id]=r,r}}}var Yn=0;function qn(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Qn(e,t){for(var r,n=new Xn,i=(r={},{get:function(e){if(void 0!==r[e.id])return r[e.id];var t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new f};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new f,shadowCameraNear:1,shadowCameraFar:1e3}}return r[e.id]=t,t}}),a={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)a.probe.push(new E);var s=new E,l=new te,c=new te;return{setup:function(r){for(var o=0,s=0,l=0,c=0;c<9;c++)a.probe[c].set(0,0,0);var h=0,u=0,d=0,p=0,f=0,m=0,v=0,g=0;r.sort(qn);for(var y=0,x=r.length;y0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(a.rectAreaLTC1=sr.LTC_FLOAT_1,a.rectAreaLTC2=sr.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(a.rectAreaLTC1=sr.LTC_HALF_1,a.rectAreaLTC2=sr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),a.ambient[0]=o,a.ambient[1]=s,a.ambient[2]=l;var U=a.hash;U.directionalLength===h&&U.pointLength===u&&U.spotLength===d&&U.rectAreaLength===p&&U.hemiLength===f&&U.numDirectionalShadows===m&&U.numPointShadows===v&&U.numSpotShadows===g||(a.directional.length=h,a.spot.length=d,a.rectArea.length=p,a.point.length=u,a.hemi.length=f,a.directionalShadow.length=m,a.directionalShadowMap.length=m,a.pointShadow.length=v,a.pointShadowMap.length=v,a.spotShadow.length=g,a.spotShadowMap.length=g,a.directionalShadowMatrix.length=m,a.pointShadowMatrix.length=v,a.spotShadowMatrix.length=g,U.directionalLength=h,U.pointLength=u,U.spotLength=d,U.rectAreaLength=p,U.hemiLength=f,U.numDirectionalShadows=m,U.numPointShadows=v,U.numSpotShadows=g,a.version=Yn++)},setupView:function(e,t){for(var r=0,n=0,i=0,o=0,h=0,u=t.matrixWorldInverse,d=0,p=e.length;d=r.get(n).length?(a=new Zn(e,t),r.get(n).push(a)):a=r.get(n)[i],a},dispose:function(){r=new WeakMap}}}function Kn(e){Ke.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function $n(e){Ke.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new E,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}Kn.prototype=Object.create(Ke.prototype),Kn.prototype.constructor=Kn,Kn.prototype.isMeshDepthMaterial=!0,Kn.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},$n.prototype=Object.create(Ke.prototype),$n.prototype.constructor=$n,$n.prototype.isMeshDistanceMaterial=!0,$n.prototype.copy=function(e){return Ke.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function ei(e,t,r){var n=new rr,i=new f,a=new f,o=new w,s=[],l=[],c={},h={0:1,1:0,2:2},u=new Yt({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new f},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=u.clone();d.defines.HORIZONTAL_PASS=1;var p=new Mt;p.setAttribute("position",new rt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var m=new Gt(p,u),v=this;function g(r,n){var i=t.update(m);u.uniforms.shadow_pass.value=r.map.texture,u.uniforms.resolution.value=r.mapSize,u.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,i,u,m,null),d.uniforms.shadow_pass.value=r.mapPass.texture,d.uniforms.resolution.value=r.mapSize,d.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,i,d,m,null)}function y(e,t,r){var n=e<<0|t<<1|r<<2,i=s[n];return void 0===i&&(i=new Kn({depthPacking:3201,morphTargets:e,skinning:t}),s[n]=i),i}function x(e,t,r){var n=e<<0|t<<1|r<<2,i=l[n];return void 0===i&&(i=new $n({morphTargets:e,skinning:t}),l[n]=i),i}function b(t,r,n,i,a,o,s){var l=null,u=y,d=t.customDepthMaterial;if(!0===i.isPointLight&&(u=x,d=t.customDistanceMaterial),void 0===d){var p=!1;!0===n.morphTargets&&(p=r.morphAttributes&&r.morphAttributes.position&&r.morphAttributes.position.length>0);var f=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=u(p,f,!0===t.isInstancedMesh)}else l=d;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=l.uuid,v=n.uuid,g=c[m];void 0===g&&(g={},c[m]=g);var b=g[v];void 0===b&&(b=l.clone(),g[v]=b),l=b}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=3===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=a,l.farDistance=o),l}function _(r,i,a,o,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===s)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,r.matrixWorld);var l=t.update(r),c=r.material;if(Array.isArray(c))for(var h=l.groups,u=0,d=h.length;ur||i.y>r)&&(i.x>r&&(a.x=Math.floor(r/x.x),i.x=a.x*x.x,y.mapSize.x=a.x),i.y>r&&(a.y=Math.floor(r/x.y),i.y=a.y*x.y,y.mapSize.y=a.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new S(i.x,i.y,b),y.map.texture.name=m.name+".shadowMap",y.mapPass=new S(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){var w={minFilter:1003,magFilter:1003,format:1023};y.map=new S(i.x,i.y,w),y.map.texture.name=m.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var M=y.getViewportCount(),T=0;T=1):-1!==E.indexOf("OpenGL ES")&&(A=parseFloat(/^OpenGL ES (\d)/.exec(E)[1]),T=A>=2);var L=null,P={},N=new w,R=new w;function C(t,r,n){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;on||e.height>n)&&(i=n/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?p.floorPowerOfTwo:Math.floor,o=a(i*e.width),l=a(i*e.height);void 0===s&&(s=v(o,l));var c=r?v(o,l):s;return c.width=o,c.height=l,c.getContext("2d").drawImage(e,0,0,o,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+l+")."),c}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function y(e){return p.isPowerOfTwo(e.width)&&p.isPowerOfTwo(e.height)}function x(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function b(t,r,i,a){e.generateMipmap(t),n.get(r).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function _(r,n,i){if(!1===l)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}var a=n;return 6403===n&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===n&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===n&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function w(e){return 1003===e||1004===e||1005===e?9728:9729}function M(t){var r=t.target;r.removeEventListener("dispose",M),function(t){var r=n.get(t);if(void 0===r.__webglInit)return;e.deleteTexture(r.__webglTexture),n.remove(t)}(r),r.isVideoTexture&&f.delete(r),o.memory.textures--}function S(t){var r=t.target;r.removeEventListener("dispose",S),function(t){var r=n.get(t),i=n.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(r.__webglFramebuffer[a]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[a]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&e.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer);n.remove(t.texture),n.remove(t)}(r),o.memory.textures--}var T=0;function A(e,t){var i=n.get(e);if(e.isVideoTexture&&function(e){var t=o.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void C(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+t),r.bindTexture(3553,i.__webglTexture)}function E(t,i){var o=n.get(t);t.version>0&&o.__version!==t.version?function(t,n,i){if(6!==n.image.length)return;R(t,n),r.activeTexture(33984+i),r.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment);for(var o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),s=n.image[0]&&n.image[0].isDataTexture,c=[],u=0;u<6;u++)c[u]=o||s?s?n.image[u].image:n.image[u]:g(n.image[u],!1,!0,h);var d,p=c[0],f=y(p)||l,m=a.convert(n.format),v=a.convert(n.type),w=_(n.internalFormat,m,v);if(N(34067,n,f),o){for(var M=0;M<6;M++){d=c[M].mipmaps;for(var S=0;S1||n.get(a).__currentAnisotropy)&&(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function R(t,r){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",M),t.__webglTexture=e.createTexture(),o.memory.textures++)}function C(t,n,i){var o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),R(t,n),r.activeTexture(33984+i),r.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment);var s,c=function(e){return!l&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(n)&&!1===y(n.image),h=g(n.image,c,!1,u),d=y(h)||l,p=a.convert(n.format),f=a.convert(n.type),m=_(n.internalFormat,p,f);N(o,n,d);var v=n.mipmaps;if(n.isDepthTexture)m=6402,l?m=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===m&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,f=a.convert(n.type)),1027===n.format&&6402===m&&(m=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,f=a.convert(n.type))),r.texImage2D(3553,0,m,h.width,h.height,0,p,f,null);else if(n.isDataTexture)if(v.length>0&&d){for(var w=0,M=v.length;w0&&d){for(var A=0,E=v.length;A=c&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=A,this.setTexture2DArray=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?C(i,e,t):(r.activeTexture(33984+t),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?C(i,e,t):(r.activeTexture(33984+t),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(t){var i=n.get(t),s=n.get(t.texture);t.addEventListener("dispose",S),s.__webglTexture=e.createTexture(),o.memory.textures++;var c=!0===t.isWebGLCubeRenderTarget,h=!0===t.isWebGLMultisampleRenderTarget,u=y(t)||l;if(!l||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(var d=0;d<6;d++)i.__webglFramebuffer[d]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),h)if(l){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var p=a.convert(t.texture.format),f=a.convert(t.texture.type),m=_(t.texture.internalFormat,p,f),v=D(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),I(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){r.bindTexture(34067,s.__webglTexture),N(34067,t.texture,u);for(var g=0;g<6;g++)F(i.__webglFramebuffer[g],t,36064,34069+g);x(t.texture,u)&&b(34067,t.texture,t.width,t.height),r.bindTexture(34067,null)}else r.bindTexture(3553,s.__webglTexture),N(3553,t.texture,u),F(i.__webglFramebuffer,t,36064,3553),x(t.texture,u)&&b(3553,t.texture,t.width,t.height),r.bindTexture(3553,null);t.depthBuffer&&O(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(x(t,y(e)||l)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=n.get(t).__webglTexture;r.bindTexture(i,a),b(i,t,e.width,e.height),r.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(l){var r=n.get(t);e.bindFramebuffer(36008,r.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,r.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,r.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),A(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===z&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),z=!0),e=e.texture),E(e,t)}}function ni(e,t,r){var n=r.isWebGL2;return{convert:function(e){var r;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return n?5131:null!==(r=t.get("OES_texture_half_float"))?r.HALF_FLOAT_OES:null;if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===e)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===e)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return null!==(r=t.get("WEBGL_compressed_texture_etc1"))?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&null!==(r=t.get("WEBGL_compressed_texture_etc"))){if(37492===e)return r.COMPRESSED_RGB8_ETC2;if(37496===e)return r.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?null!==(r=t.get("WEBGL_compressed_texture_astc"))?e:null:36492===e?null!==(r=t.get("EXT_texture_compression_bptc"))?e:null:1020===e?n?34042:null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function ii(e){void 0===e&&(e=[]),Qt.call(this),this.cameras=e}function ai(){Ee.call(this),this.type="Group"}function oi(){this._targetRay=null,this._grip=null,this._hand=null}function si(e,t){var r=this,n=null,i=1,a=null,o="local-floor",s=null,l=[],c=new Map,h=new Qt;h.layers.enable(1),h.viewport=new w;var u=new Qt;u.layers.enable(2),u.viewport=new w;var d=[h,u],p=new ii;p.layers.enable(1),p.layers.enable(2);var f=null,m=null;function v(e){var t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function g(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),f=null,m=null,e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),S.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}function y(e){for(var t=n.inputSources,r=0;r0&&Le(a,e,t),o.length>0&&Le(o,e,t),!0===e.isScene&&e.onAfterRender(g,e,t),null!==M&&(J.updateRenderTargetMipmap(M),J.updateMultisampleRenderTarget(M)),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1),v.pop(),m=v.length>0?v[v.length-1]:null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){x!==e&&null===M&&fe.bindFramebuffer(36160,e),x=e},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return _},this.getRenderList=function(){return d},this.setRenderList=function(e){d=e},this.getRenderTarget=function(){return M},this.setRenderTarget=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0),M=e,b=t,_=r,e&&void 0===Z.get(e).__webglFramebuffer&&J.setupRenderTarget(e);var n=x,i=!1;if(e){var a=Z.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=a[t],i=!0):n=e.isWebGLMultisampleRenderTarget?Z.get(e).__webglMultisampledFramebuffer:a,L.copy(e.viewport),P.copy(e.scissor),N=e.scissorTest}else L.copy(D).multiplyScalar(F).floor(),P.copy(U).multiplyScalar(F).floor(),N=z;if(S!==n&&(fe.bindFramebuffer(36160,n),S=n),q.viewport(L),q.scissor(P),q.setScissorTest(N),i){var o=Z.get(e.texture);fe.framebufferTexture2D(36160,36064,34069+t,o.__webglTexture,r)}},this.readRenderTargetPixels=function(e,t,r,n,i,a,o){if(e&&e.isWebGLRenderTarget){var s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==S&&(fe.bindFramebuffer(36160,s),l=!0);try{var c=e.texture,h=c.format,u=c.type;if(1023!==h&&de.convert(h)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");var d=1016===u&&(X.has("EXT_color_buffer_half_float")||Y.isWebGL2&&X.has("EXT_color_buffer_float"));if(!(1009===u||de.convert(u)===fe.getParameter(35738)||1015===u&&(Y.isWebGL2||X.has("OES_texture_float")||X.has("WEBGL_color_buffer_float"))||d))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===fe.checkFramebufferStatus(36160)?t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&fe.readPixels(t,r,n,i,de.convert(h),de.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&fe.bindFramebuffer(36160,S)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,r){void 0===r&&(r=0);var n=Math.pow(2,-r),i=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n),o=de.convert(t.format);J.setTexture2D(t,0),fe.copyTexImage2D(3553,r,o,e.x,e.y,i,a,0),q.unbindTexture()},this.copyTextureToTexture=function(e,t,r,n){void 0===n&&(n=0);var i=t.image.width,a=t.image.height,o=de.convert(r.format),s=de.convert(r.type);J.setTexture2D(r,0),fe.pixelStorei(37440,r.flipY),fe.pixelStorei(37441,r.premultiplyAlpha),fe.pixelStorei(3317,r.unpackAlignment),t.isDataTexture?fe.texSubImage2D(3553,n,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?fe.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):fe.texSubImage2D(3553,n,e.x,e.y,o,s,t.image),0===n&&r.generateMipmaps&&fe.generateMipmap(3553),q.unbindTexture()},this.initTexture=function(e){J.setTexture2D(e,0),q.unbindTexture()},this.resetState=function(){q.reset(),pe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function hi(e){ci.call(this,e)}ii.prototype=Object.assign(Object.create(Qt.prototype),{constructor:ii,isArrayCamera:!0}),ai.prototype=Object.assign(Object.create(Ee.prototype),{constructor:ai,isGroup:!0}),Object.assign(oi.prototype,{constructor:oi,getHandSpace:function(){return null===this._hand&&(this._hand=new ai,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new ai,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new ai,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,r){var n=null,i=null,a=null,o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(l&&e.hand){for(var c of(a=!0,e.hand.values())){var h=t.getJointPose(c,r);if(void 0===l.joints[c.jointName]){var u=new ai;u.matrixAutoUpdate=!1,u.visible=!1,l.joints[c.jointName]=u,l.add(u)}var d=l.joints[c.jointName];null!==h&&(d.matrix.fromArray(h.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.jointRadius=h.radius),d.visible=null!==h}var p=l.joints["index-finger-tip"],f=l.joints["thumb-tip"],m=p.position.distanceTo(f.position);l.inputState.pinching&&m>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&m<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&null!==(n=t.getPose(e.targetRaySpace,r))&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,r))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==o&&(o.visible=null!==n),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}}),Object.assign(si.prototype,c.prototype),hi.prototype=Object.assign(Object.create(ci.prototype),{constructor:hi,isWebGL1Renderer:!0});var ui=function(e){function t(){e.call(this),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.copy=function(t,r){return e.prototype.copy.call(this,t,r),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},t.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t);return null!==this.background&&(r.object.background=this.background.toJSON(t)),null!==this.environment&&(r.object.environment=this.environment.toJSON(t)),null!==this.fog&&(r.object.fog=this.fog.toJSON()),r},t}(Ee);function di(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=p.generateUUID()}Object.defineProperty(di.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(di.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,r){e*=this.stride,r*=t.stride;for(var n=0,i=this.stride;ne.far||t.push({distance:s,point:gi.clone(),uv:ke.getUV(gi,Mi,Si,Ti,Ai,Ei,Li,new f),face:null,object:this})}},copy:function(e){return Ee.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var Ri=new E,Ci=new E;function Fi(){Ee.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Fi.prototype=Object.assign(Object.create(Ee.prototype),{constructor:Fi,isLOD:!0,copy:function(e){Ee.prototype.copy.call(this,e,!1);for(var t=e.levels,r=0,n=t.length;r0){var r,n;for(r=1,n=t.length;r0){Ri.setFromMatrixPosition(this.matrixWorld);var r=e.ray.origin.distanceTo(Ri);this.getObjectForDistance(r).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Ri.setFromMatrixPosition(e.matrixWorld),Ci.setFromMatrixPosition(this.matrixWorld);var r,n,i=Ri.distanceTo(Ci)/e.zoom;for(t[0].object.visible=!0,r=1,n=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;ro)){h.applyMatrix4(this.matrixWorld);var x=e.ray.origin.distanceTo(h);xe.far||t.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var b=0,_=p.count-1;b<_;b+=u){if(s.fromBufferAttribute(p,b),l.fromBufferAttribute(p,b+1),!($i.distanceSqToSegment(s,l,h,c)>o)){h.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(h);we.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(r.length>0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=n.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var ra=new E,na=new E;function ia(e,t){ta.call(this,e,t),this.type="LineSegments"}function aa(e,t){ta.call(this,e,t),this.type="LineLoop"}function oa(e){Ke.call(this),this.type="PointsMaterial",this.color=new Qe(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}ia.prototype=Object.assign(Object.create(ta.prototype),{constructor:ia,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[],n=0,i=t.count;ni.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:o})}}function pa(e,t,r,n,i,a,o,s,l){b.call(this,e,t,r,n,i,a,o,s,l),this.format=void 0!==o?o:1022,this.minFilter=void 0!==a?a:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;var c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function fa(e,t,r,n,i,a,o,s,l,c,h,u){b.call(this,null,a,o,s,l,c,n,i,h,u),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function ma(e,t,r,n,i,a,o,s,l){b.call(this,e,t,r,n,i,a,o,s,l),this.needsUpdate=!0}function va(e,t,r,n,i,a,o,s,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&1026===c&&(r=1012),void 0===r&&1027===c&&(r=1020),b.call(this,null,n,i,a,o,s,c,r,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}ua.prototype=Object.assign(Object.create(Ee.prototype),{constructor:ua,isPoints:!0,copy:function(e){return Ee.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var r=this.geometry,n=this.matrixWorld,i=e.params.Points.threshold;if(null===r.boundingSphere&&r.computeBoundingSphere(),ca.copy(r.boundingSphere),ca.applyMatrix4(n),ca.radius+=i,!1!==e.ray.intersectsSphere(ca)){sa.copy(n).invert(),la.copy(e.ray).applyMatrix4(sa);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(r.isBufferGeometry){var s=r.index,l=r.attributes.position;if(null!==s)for(var c=s.array,h=0,u=c.length;h0){var n=t[r[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=n.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),pa.prototype=Object.assign(Object.create(b.prototype),{constructor:pa,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){var e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),fa.prototype=Object.create(b.prototype),fa.prototype.constructor=fa,fa.prototype.isCompressedTexture=!0,ma.prototype=Object.create(b.prototype),ma.prototype.constructor=ma,ma.prototype.isCanvasTexture=!0,va.prototype=Object.create(b.prototype),va.prototype.constructor=va,va.prototype.isDepthTexture=!0;var ga=function(e){function t(t,r,n,i){void 0===t&&(t=1),void 0===r&&(r=8),void 0===n&&(n=0),void 0===i&&(i=2*Math.PI),e.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:r,thetaStart:n,thetaLength:i},r=Math.max(3,r);var a=[],o=[],s=[],l=[],c=new E,h=new f;o.push(0,0,0),s.push(0,0,1),l.push(.5,.5);for(var u=0,d=3;u<=r;u++,d+=3){var p=n+u/r*i;c.x=t*Math.cos(p),c.y=t*Math.sin(p),o.push(c.x,c.y,c.z),s.push(0,0,1),h.x=(o[d]/t+1)/2,h.y=(o[d+1]/t+1)/2,l.push(h.x,h.y)}for(var m=1;m<=r;m++)a.push(m,m+1,0);this.setIndex(a),this.setAttribute("position",new ut(o,3)),this.setAttribute("normal",new ut(s,3)),this.setAttribute("uv",new ut(l,2))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Mt),ya=function(e){function t(t,r,n,i,a,o,s,l){void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=8),void 0===a&&(a=1),void 0===o&&(o=!1),void 0===s&&(s=0),void 0===l&&(l=2*Math.PI),e.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:r,height:n,radialSegments:i,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:l};var c=this;i=Math.floor(i),a=Math.floor(a);var h=[],u=[],d=[],p=[],m=0,v=[],g=n/2,y=0;function x(e){for(var n=m,a=new f,o=new E,v=0,x=!0===e?t:r,b=!0===e?1:-1,_=1;_<=i;_++)u.push(0,g*b,0),d.push(0,b,0),p.push(.5,.5),m++;for(var w=m,M=0;M<=i;M++){var S=M/i*l+s,T=Math.cos(S),A=Math.sin(S);o.x=x*A,o.y=g*b,o.z=x*T,u.push(o.x,o.y,o.z),d.push(0,b,0),a.x=.5*T+.5,a.y=.5*A*b+.5,p.push(a.x,a.y),m++}for(var L=0;L0&&x(!0),r>0&&x(!1)),this.setIndex(h),this.setAttribute("position",new ut(u,3)),this.setAttribute("normal",new ut(d,3)),this.setAttribute("uv",new ut(p,2))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Mt),xa=function(e){function t(t,r,n,i,a,o,s){void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=8),void 0===i&&(i=1),void 0===a&&(a=!1),void 0===o&&(o=0),void 0===s&&(s=2*Math.PI),e.call(this,0,t,r,n,i,a,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:r,radialSegments:n,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(ya),ba=function(e){function t(t,r,n,i){void 0===n&&(n=1),void 0===i&&(i=0),e.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:r,radius:n,detail:i};var a=[],o=[];function s(e,t,r,n){for(var i=n+1,a=[],o=0;o<=i;o++){a[o]=[];for(var s=e.clone().lerp(r,o/i),c=t.clone().lerp(r,o/i),h=i-o,u=0;u<=h;u++)a[o][u]=0===u&&o===i?s:s.clone().lerp(c,u/h)}for(var d=0;d.9&&a<.1&&(t<.2&&(o[e+0]+=1),r<.2&&(o[e+2]+=1),n<.2&&(o[e+4]+=1))}}()}(),this.setAttribute("position",new ut(a,3)),this.setAttribute("normal",new ut(a.slice(),3)),this.setAttribute("uv",new ut(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Mt),_a=function(e){function t(t,r){void 0===t&&(t=1),void 0===r&&(r=0);var n=(1+Math.sqrt(5))/2,i=1/n,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];e.call(this,a,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,r),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:r}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(ba);new E,new E,new E,new ke;var wa=function(e,t,r){r=r||2;var n,i,a,o,s,l,c,h=t&&t.length,u=h?t[0]*r:e.length,d=Ma(e,0,u,r,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=function(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i80*r){n=a=e[0],i=o=e[1];for(var f=r;fa&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return Ta(d,p,r,n,i,c),p};function Ma(e,t,r,n,i){var a,o;if(i===function(e,t,r,n){for(var i=0,a=t,o=r-n;a0)for(a=t;a=t;a-=n)o=Va(a,e[a],e[a+1],o);return o&&za(o,o.next)&&(Wa(o),o=o.next),o}function Sa(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!za(n,n.next)&&0!==Ua(n.prev,n,n.next))n=n.next;else{if(Wa(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Ta(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=Fa(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?Ea(e,n,i,a):Aa(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Wa(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Ta(e=La(Sa(e),t,r),t,r,n,i,a,2):2===o&&Pa(e,t,r,n,i,a):Ta(Sa(e),t,r,n,i,a,1);break}}}function Aa(e){var t=e.prev,r=e,n=e.next;if(Ua(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Oa(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ua(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ea(e,t,r,n){var i=e.prev,a=e,o=e.next;if(Ua(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=Fa(s,l,t,r,n),d=Fa(c,h,t,r,n),p=e.prevZ,f=e.nextZ;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Oa(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ua(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Oa(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ua(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Oa(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ua(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Oa(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ua(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function La(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!za(i,a)&&Ba(i,n,n.next,a)&&ka(i,a)&&ka(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Wa(n),Wa(n.next),n=e=a),n=n.next}while(n!==e);return Sa(n)}function Pa(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Da(o,s)){var l=ja(o,s);return o=Sa(o,o.next),l=Sa(l,l.next),Ta(o,t,r,n,i,a),void Ta(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function Na(e,t){return e.x-t.x}function Ra(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=h&&i!==n.x&&Oa(ar.x||n.x===r.x&&Ca(r,n)))&&(r=n,d=l)),n=n.next}while(n!==c);return r}(e,t)){var r=ja(t,e);Sa(t,t.next),Sa(r,r.next)}}function Ca(e,t){return Ua(e.prev,e,t.prev)<0&&Ua(t.next,e,e.next)<0}function Fa(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Ia(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Da(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Ba(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(ka(e,t)&&ka(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Ua(e.prev,e,t.prev)||Ua(e,t.prev,t))||za(e,t)&&Ua(e.prev,e,e.next)>0&&Ua(t.prev,t,t.next)>0)}function Ua(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function za(e,t){return e.x===t.x&&e.y===t.y}function Ba(e,t,r,n){var i=Ga(Ua(e,t,r)),a=Ga(Ua(e,t,n)),o=Ga(Ua(r,n,e)),s=Ga(Ua(r,n,t));return i!==a&&o!==s||(!(0!==i||!Ha(e,r,t))||(!(0!==a||!Ha(e,n,t))||(!(0!==o||!Ha(r,e,n))||!(0!==s||!Ha(r,t,n)))))}function Ha(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ga(e){return e>0?1:e<0?-1:0}function ka(e,t){return Ua(e.prev,e,e.next)<0?Ua(e,t,e.next)>=0&&Ua(e,e.prev,t)>=0:Ua(e,t,e.prev)<0||Ua(e,e.next,t)<0}function ja(e,t){var r=new Xa(e.i,e.x,e.y),n=new Xa(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Va(e,t,r,n){var i=new Xa(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Wa(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Xa(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Ya={area:function(e){for(var t=e.length,r=0,n=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function Qa(e,t){for(var r=0;rNumber.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(l*l+c*c),m=t.x-s/d,v=t.y+o/d,g=((r.x-c/p-m)*c-(r.y+l/p-v)*l)/(o*c-s*l),y=(n=m+o*g-e.x)*n+(i=v+s*g-e.y)*i;if(y<=2)return new f(n,i);a=Math.sqrt(y/2)}else{var x=!1;o>Number.EPSILON?l>Number.EPSILON&&(x=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(c)&&(x=!0),x?(n=-s,i=o,a=Math.sqrt(h)):(n=o,i=s,a=Math.sqrt(h/2))}return new f(n/a,i/a)}for(var B=[],H=0,G=R.length,k=G-1,j=H+1;H=0;xe--){for(var be=xe/p,_e=h*Math.cos(be*Math.PI/2),we=u*Math.sin(be*Math.PI/2)+d,Me=0,Se=R.length;Me=0;){var n=r,i=r-1;i<0&&(i=e.length-1);for(var a=0,o=s+2*p;a=0?(e(g-s,m,h),u.subVectors(c,h)):(e(g+s,m,h),u.subVectors(h,c)),m-s>=0?(e(g,m-s,h),d.subVectors(c,h)):(e(g,m+s,h),d.subVectors(h,c)),l.crossVectors(u,d).normalize(),a.push(l.x,l.y,l.z),o.push(g,m)}for(var y=0;y0)&&p.push(T,A,P),(M!==n-1||l=n)){h.push(l.times[d]);for(var f=0;fa.tracks[v].times[0]&&(m=a.tracks[v].times[0]);for(var g=0;g=n.times[u]){var m=u*l+s,v=m+l-s;d=wo.arraySlice(n.values,m,v)}else{var g=n.createInterpolant(),y=s,x=l-s;g.evaluate(a),d=wo.arraySlice(g.resultBuffer,y,x)}if("quaternion"===i)(new T).fromArray(d).normalize().conjugate().toArray(d);for(var b=o.times.length,_=0;_=i)break e;var s=t[1];e=(i=t[--r-1]))break t}a=r,r=0}for(;r>>1;et;)--a;if(++a,0!==i||a!==n){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=wo.arraySlice(r,i,a),this.values=wo.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=r[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==n&&wo.isTypedArray(n))for(var l=0,c=n.length;l!==c;++l){var h=n[l];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,h),e=!1;break}}return e},optimize:function(){for(var e=wo.arraySlice(this.times),t=wo.arraySlice(this.values),r=this.getValueSize(),n=2302===this.getInterpolation(),i=e.length-1,a=1,o=1;o0){e[a]=e[i];for(var g=i*r,y=a*r,x=0;x!==r;++x)t[y+x]=t[g+x];++a}return a!==e.length?(this.times=wo.arraySlice(e,0,a),this.values=wo.arraySlice(t,0,a*r)):(this.times=e,this.values=t),this},clone:function(){var e=wo.arraySlice(this.times,0),t=wo.arraySlice(this.values,0),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}),Lo.prototype=Object.assign(Object.create(Eo.prototype),{constructor:Lo,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Po.prototype=Object.assign(Object.create(Eo.prototype),{constructor:Po,ValueTypeName:"color"}),No.prototype=Object.assign(Object.create(Eo.prototype),{constructor:No,ValueTypeName:"number"}),Ro.prototype=Object.assign(Object.create(Mo.prototype),{constructor:Ro,interpolate_:function(e,t,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(r-t)/(n-t),l=e*o,c=l+o;l!==c;l+=4)T.slerpFlat(i,0,a,l-o,a,l,s);return i}}),Co.prototype=Object.assign(Object.create(Eo.prototype),{constructor:Co,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Ro(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Fo.prototype=Object.assign(Object.create(Eo.prototype),{constructor:Fo,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Io.prototype=Object.assign(Object.create(Eo.prototype),{constructor:Io,ValueTypeName:"vector"}),Object.assign(Oo,{parse:function(e){for(var t=[],r=e.tracks,n=1/(e.fps||1),i=0,a=r.length;i!==a;++i)t.push(Do(r[i]).scale(n));var o=new Oo(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o},toJSON:function(e){for(var t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,a=r.length;i!==a;++i)t.push(Eo.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(e,t,r,n){for(var i=t.length,a=[],o=0;o1){var c=l[1],h=n[c];h||(n[c]=h=[]),h.push(s)}}var u=[];for(var d in n)u.push(Oo.CreateFromMorphTargetSequence(d,n[d],t,r));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(e,t,r,n,i){if(0!==r.length){var a=[],o=[];wo.flattenJSON(r,a,o,n),0!==a.length&&i.push(new e(t,a,o))}},n=[],i=e.name||"default",a=e.fps||30,o=e.blendMode,s=e.length||-1,l=e.hierarchy||[],c=0;c0||0===e.search(/^data\:image\/jpeg/);i.format=n?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),r,n),i}}),Object.assign(qo.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var r=this.getUtoTmapping(e);return this.getPoint(r,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r=[],n=this.getPoint(0),i=0;r.push(0);for(var a=1;a<=e;a++)i+=(t=this.getPoint(a/e)).distanceTo(n),r.push(i),n=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var r,n=this.getLengths(),i=0,a=n.length;r=t||e*n[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=n[i=Math.floor(s+(l-s)/2)]-r)<0)s=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(n[i=l]===r)return i/(a-1);var c=n[i];return(i+(r-c)/(n[i+1]-c))/(a-1)},getTangent:function(e,t){var r=1e-4,n=e-r,i=e+r;n<0&&(n=0),i>1&&(i=1);var a=this.getPoint(n),o=this.getPoint(i),s=t||(a.isVector2?new f:new E);return s.copy(o).sub(a).normalize(),s},getTangentAt:function(e,t){var r=this.getUtoTmapping(e);return this.getTangent(r,t)},computeFrenetFrames:function(e,t){for(var r=new E,n=[],i=[],a=[],o=new E,s=new te,l=0;l<=e;l++){var c=l/e;n[l]=this.getTangentAt(c,new E),n[l].normalize()}i[0]=new E,a[0]=new E;var h=Number.MAX_VALUE,u=Math.abs(n[0].x),d=Math.abs(n[0].y),f=Math.abs(n[0].z);u<=h&&(h=u,r.set(1,0,0)),d<=h&&(h=d,r.set(0,1,0)),f<=h&&r.set(0,0,1),o.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],o),a[0].crossVectors(n[0],i[0]);for(var m=1;m<=e;m++){if(i[m]=i[m-1].clone(),a[m]=a[m-1].clone(),o.crossVectors(n[m-1],n[m]),o.length()>Number.EPSILON){o.normalize();var v=Math.acos(p.clamp(n[m-1].dot(n[m]),-1,1));i[m].applyMatrix4(s.makeRotationAxis(o,v))}a[m].crossVectors(n[m],i[m])}if(!0===t){var g=Math.acos(p.clamp(i[0].dot(i[e]),-1,1));g/=e,n[0].dot(o.crossVectors(i[0],i[e]))>0&&(g=-g);for(var y=1;y<=e;y++)i[y].applyMatrix4(s.makeRotationAxis(n[y],g*y)),a[y].crossVectors(n[y],i[y])}return{tangents:n,normals:i,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Qo.prototype=Object.create(qo.prototype),Qo.prototype.constructor=Qo,Qo.prototype.isEllipseCurve=!0,Qo.prototype.getPoint=function(e,t){for(var r=t||new f,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(l)/o)+1)*o:0===c&&l===o-1&&(l=o-2,c=1),this.closed||l>0?r=a[(l-1)%o]:(Ko.subVectors(a[0],a[1]).add(a[0]),r=Ko);var h=a[l%o],u=a[(l+1)%o];if(this.closed||l+2n.length-2?n.length-1:a+1],h=n[a>n.length-3?n.length-1:a+2];return r.set(ns(o,s.x,l.x,c.x,h.x),ns(o,s.y,l.y,c.y,h.y)),r},ds.prototype.copy=function(e){qo.prototype.copy.call(this,e),this.points=[];for(var t=0,r=e.points.length;t=t){var i=r[n]-t,a=this.curves[n],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}n++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,r=0,n=this.curves.length;r1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},copy:function(e){qo.prototype.copy.call(this,e),this.curves=[];for(var t=0,r=e.curves.length;t0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var h=l.getPoint(1);return this.currentPoint.copy(h),this},copy:function(e){return fs.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=fs.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return fs.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),vs.prototype=Object.assign(Object.create(ms.prototype),{constructor:vs,getPointsHoles:function(e){for(var t=[],r=0,n=this.holes.length;r0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(n.uniforms[i]={},a.type){case"t":n.uniforms[i].value=r(a.value);break;case"c":n.uniforms[i].value=(new Qe).setHex(a.value);break;case"v2":n.uniforms[i].value=(new f).fromArray(a.value);break;case"v3":n.uniforms[i].value=(new E).fromArray(a.value);break;case"v4":n.uniforms[i].value=(new w).fromArray(a.value);break;case"m3":n.uniforms[i].value=(new g).fromArray(a.value);break;case"m4":n.uniforms[i].value=(new te).fromArray(a.value);break;default:n.uniforms[i].value=a.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)n.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(n.flatShading=1===e.shading),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=r(e.map)),void 0!==e.matcap&&(n.matcap=r(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),n.normalScale=(new f).fromArray(s)}return void 0!==e.displacementMap&&(n.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=r(e.specularMap)),void 0!==e.envMap&&(n.envMap=r(e.envMap)),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new f).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(n.transmission=e.transmission),void 0!==e.transmissionMap&&(n.transmissionMap=r(e.transmissionMap)),n},setTextures:function(e){return this.textures=e,this}});var Cs=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;rNumber.EPSILON){if(c<0&&(o=t[a],l=-l,s=t[i],c=-c),e.ys.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=c*(e.x-o.x)-l*(e.y-o.y);if(0===h)return!0;if(h<0)continue;n=!n}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return n}var i,a,o,s=Ya.isClockWise,l=this.subPaths;if(0===l.length)return[];if(!0===t)return r(l);var c=[];if(1===l.length)return a=l[0],(o=new vs).curves=a.curves,c.push(o),c;var h=!s(l[0].getPoints());h=e?!h:h;var u,d,p=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=l.length;g1){for(var x=!1,b=[],_=0,w=f.length;_0&&(x||(m=p))}for(var N=0,R=f.length;N0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(var l=t,c=t+t;l!==c;++l)if(r[l]!==r[l+t]){o.setValue(r,n);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(var i=r,a=n;i!==a;++i)t[i]=t[n+i%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,r=e;r=.5)for(var a=0;a!==i;++a)e[t+a]=e[r+a]},_slerp:function(e,t,r,n){T.slerpFlat(e,t,e,t,e,r,n)},_slerpAdditive:function(e,t,r,n,i){var a=this._workIndex*i;T.multiplyQuaternionsFlat(e,a,e,t,e,r),T.slerpFlat(e,t,e,t,e,a,n)},_lerp:function(e,t,r,n,i){for(var a=1-n,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[r+o]*n}},_lerpAdditive:function(e,t,r,n,i){for(var a=0;a!==i;++a){var o=t+a;e[o]=e[o]+e[r+a]*n}}});var $s=new RegExp("[\\[\\]\\.:\\/]","g"),el="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",tl=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),rl=/(WCOD+)?/.source.replace("WCOD",el),nl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),il=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),al=new RegExp("^"+tl+rl+nl+il+"$"),ol=["material","materials","bones"];function sl(e,t,r){var n=r||ll.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}function ll(e,t,r){this.path=t,this.parsedPath=r||ll.parseTrackName(t),this.node=ll.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(sl.prototype,{getValue:function(e,t){this.bind();var r=this._targetGroup.nCachedObjects_,n=this._bindings[r];void 0!==n&&n.getValue(e,t)},setValue:function(e,t){for(var r=this._bindings,n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}),Object.assign(ll,{Composite:sl,create:function(e,t,r){return e&&e.isAnimationObjectGroup?new ll.Composite(e,t,r):new ll(e,t,r)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace($s,"")},parseTrackName:function(e){var t=al.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var i=r.nodeName.substring(n+1);-1!==ol.indexOf(i)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=i)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){var n=function(e){for(var r=0;r=a){var u=a++,d=t[u];r[d.uuid]=h,t[h]=d,r[c]=u,t[u]=l;for(var p=0,f=i;p!==f;++p){var m=n[p],v=m[u],g=m[h];m[h]=v,m[u]=g}}}this.nCachedObjects_=a},uncache:function(){for(var e=arguments,t=this._objects,r=this._indicesByUUID,n=this._bindings,i=n.length,a=this.nCachedObjects_,o=t.length,s=0,l=arguments.length;s!==l;++s){var c=e[s],h=c.uuid,u=r[h];if(void 0!==u)if(delete r[h],u0&&(r[w.uuid]=u),t[u]=w,t.pop();for(var M=0,S=i;M!==S;++M){var T=n[M];T[u]=T[_],T.pop()}}}this.nCachedObjects_=a},subscribe_:function(e,t){var r=this._bindingsIndicesByPath,n=r[e],i=this._bindings;if(void 0!==n)return i[n];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,h=new Array(l);n=i.length,r[e]=n,a.push(e),o.push(t),i.push(h);for(var u=c,d=s.length;u!==d;++u){var p=s[u];h[u]=new ll(p,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){var n=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=r,a[r]=s,a.pop(),i[r]=i[o],i.pop(),n[r]=n[o],n.pop()}}});var cl=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=t.blendMode),this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;for(var i=t.tracks,a=i.length,o=new Array(a),s={endingStart:2400,endingEnd:2400},l=0;l!==a;++l){var c=i[l].createInterpolant(null);o[l]=c,c.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0};function hl(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}cl.prototype.play=function(){return this._mixer._activateAction(this),this},cl.prototype.stop=function(){return this._mixer._deactivateAction(this),this.reset()},cl.prototype.reset=function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},cl.prototype.isRunning=function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},cl.prototype.isScheduled=function(){return this._mixer._isActiveAction(this)},cl.prototype.startAt=function(e){return this._startTime=e,this},cl.prototype.setLoop=function(e,t){return this.loop=e,this.repetitions=t,this},cl.prototype.setEffectiveWeight=function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},cl.prototype.getEffectiveWeight=function(){return this._effectiveWeight},cl.prototype.fadeIn=function(e){return this._scheduleFading(e,0,1)},cl.prototype.fadeOut=function(e){return this._scheduleFading(e,1,0)},cl.prototype.crossFadeFrom=function(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){var n=this._clip.duration,i=e._clip.duration,a=i/n,o=n/i;e.warp(1,a,t),this.warp(o,1,t)}return this},cl.prototype.crossFadeTo=function(e,t,r){return e.crossFadeFrom(this,t,r)},cl.prototype.stopFading=function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},cl.prototype.setEffectiveTimeScale=function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},cl.prototype.getEffectiveTimeScale=function(){return this._effectiveTimeScale},cl.prototype.setDuration=function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},cl.prototype.syncWith=function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},cl.prototype.halt=function(e){return this.warp(this._effectiveTimeScale,0,e)},cl.prototype.warp=function(e,t,r){var n=this._mixer,i=n.time,a=this.timeScale,o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+r,l[0]=e/a,l[1]=t/a,this},cl.prototype.stopWarping=function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},cl.prototype.getMixer=function(){return this._mixer},cl.prototype.getClip=function(){return this._clip},cl.prototype.getRoot=function(){return this._localRoot||this._mixer._root},cl.prototype._update=function(e,t,r,n){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*r;if(a<0||0===r)return;this._startTime=null,t=r*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case 2501:for(var h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulateAdditive(s);break;case 2500:default:for(var d=0,p=l.length;d!==p;++d)l[d].evaluate(o),c[d].accumulate(n,s)}}}else this._updateWeight(e)},cl.prototype._updateWeight=function(e){var t=0;if(this.enabled){t=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t},cl.prototype._updateTimeScale=function(e){var t=0;if(!this.paused){t=this.timeScale;var r=this._timeScaleInterpolant;if(null!==r)t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},cl.prototype._updateTime=function(e){var t=this._clip.duration,r=this.loop,n=this.time+e,i=this._loopCount,a=2202===r;if(0===e)return-1===i?n:a&&1==(1&i)?t-n:n;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n>=t||n<0){var o=Math.floor(n/t);n-=t*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=n;if(a&&1==(1&i))return t-n}return n},cl.prototype._setEndings=function(e,t,r){var n=this._interpolantSettings;r?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},cl.prototype._scheduleFading=function(e,t,r){var n=this._mixer,i=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=r,this},hl.prototype=Object.assign(Object.create(c.prototype),{constructor:hl,_bindAction:function(e,t){var r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,a=e._propertyBindings,o=e._interpolants,s=r.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var h=0;h!==i;++h){var u=n[h],d=u.name,p=c[d];if(void 0!==p)a[h]=p;else{if(void 0!==(p=a[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;++(p=new Ks(ll.create(r,d,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[h]=p}o[h].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,r=0,n=t.length;r!==n;++r){var i=t[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==r;++o){t[o]._update(n,e,i,a)}for(var s=this._bindings,l=this._nActiveBindings,c=0;c!==l;++c)s[c].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;tthis.max.x||e.ythis.max.y)},xl.prototype.containsBox=function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},xl.prototype.getParameter=function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new f),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},xl.prototype.intersectsBox=function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},xl.prototype.clampPoint=function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new f),t.copy(e).clamp(this.min,this.max)},xl.prototype.distanceToPoint=function(e){return yl.copy(e).clamp(this.min,this.max).sub(e).length()},xl.prototype.intersect=function(e){return this.min.max(e.min),this.max.min(e.max),this},xl.prototype.union=function(e){return this.min.min(e.min),this.max.max(e.max),this},xl.prototype.translate=function(e){return this.min.add(e),this.max.add(e),this},xl.prototype.equals=function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},bl.prototype=Object.create(Ee.prototype),bl.prototype.constructor=bl,bl.prototype.isImmediateRenderObject=!0;var _l=new $e({side:1,depthWrite:!1,depthTest:!1});function wl(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),rs.call(this,e),this.type="catmullrom"}new Gt(new jt,_l),qo.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(qo.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(ms.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),wl.prototype=Object.create(rs.prototype),Object.assign(wl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Object.assign(Bo.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Fs(e)}}),Bo.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(xl.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(N.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(X.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),rr.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Object.assign(p,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),p.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),p.ceilPowerOfTwo(e)}}),Object.assign(g.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(te.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new E).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,r,n,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,r,i,a)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Re.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(T.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(ee.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(ke.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(ke,{barycoordFromPoint:function(e,t,r,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ke.getBarycoord(e,t,r,n,i)},normal:function(e,t,r,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ke.getNormal(e,t,r,n)}}),Object.assign(vs.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Za(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new no(this,e)}}),Object.assign(f.prototype,{fromAttribute:function(e,t,r){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(E.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,r){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(w.prototype,{fromAttribute:function(e,t,r){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ee.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Ee.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Gt.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Gt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Fi.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(ji.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Bi.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(qo.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Qt.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(gs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(rt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(rt.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Mt.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new rt(arguments[1],arguments[2])))},addDrawCall:function(e,t,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Mt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Is.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(fl.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(di.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(di.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Za.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ui.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(ul.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Ke.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Qe}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(mo.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(fo.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(Yt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ci.prototype,{clearTarget:function(e,t,r,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,r,n)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ci.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(ei.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(S.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Js.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Vs).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Zt.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Zt.prototype.clear=function(e,t,r,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,r,n)},y.crossOrigin=void 0,y.loadTexture=function(e,t,r,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Yo;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,r,void 0,n);return t&&(a.mapping=t),a},y.loadTextureCube=function(e,t,r,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Wo;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,r,void 0,n);return t&&(a.mapping=t),a},y.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},y.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"125"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="125");var Ml=function(e,t){var c,h,u,d,p,m;void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.target=new E,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:r,MIDDLE:n,RIGHT:i},this.touches={ONE:a,TWO:s},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return M.phi},this.getAzimuthalAngle=function(){return M.theta},this.listenToKeyEvents=function(e){e.addEventListener("keydown",oe),this._domElementKeyEvents=e},this.saveState=function(){v.target0.copy(v.target),v.position0.copy(v.object.position),v.zoom0=v.object.zoom},this.reset=function(){v.target.copy(v.target0),v.object.position.copy(v.position0),v.object.zoom=v.zoom0,v.object.updateProjectionMatrix(),v.dispatchEvent(g),v.update(),_=b.NONE},this.update=(c=new E,h=(new T).setFromUnitVectors(e.up,new E(0,1,0)),u=h.clone().invert(),d=new E,p=new T,m=2*Math.PI,function(){var e=v.object.position;c.copy(e).sub(v.target),c.applyQuaternion(h),M.setFromVector3(c),v.autoRotate&&_===b.NONE&&H(2*Math.PI/60/60*v.autoRotateSpeed),v.enableDamping?(M.theta+=S.theta*v.dampingFactor,M.phi+=S.phi*v.dampingFactor):(M.theta+=S.theta,M.phi+=S.phi);var t=v.minAzimuthAngle,r=v.maxAzimuthAngle;return isFinite(t)&&isFinite(r)&&(t<-Math.PI?t+=m:t>Math.PI&&(t-=m),r<-Math.PI?r+=m:r>Math.PI&&(r-=m),M.theta=t<=r?Math.max(t,Math.min(r,M.theta)):M.theta>(t+r)/2?Math.max(t,M.theta):Math.min(r,M.theta)),M.phi=Math.max(v.minPolarAngle,Math.min(v.maxPolarAngle,M.phi)),M.makeSafe(),M.radius*=A,M.radius=Math.max(v.minDistance,Math.min(v.maxDistance,M.radius)),!0===v.enableDamping?v.target.addScaledVector(L,v.dampingFactor):v.target.add(L),c.setFromSpherical(M),c.applyQuaternion(u),e.copy(v.target).add(c),v.object.lookAt(v.target),!0===v.enableDamping?(S.theta*=1-v.dampingFactor,S.phi*=1-v.dampingFactor,L.multiplyScalar(1-v.dampingFactor)):(S.set(0,0,0),L.set(0,0,0)),A=1,!!(P||d.distanceToSquared(v.object.position)>w||8*(1-p.dot(v.object.quaternion))>w)&&(v.dispatchEvent(g),d.copy(v.object.position),p.copy(v.object.quaternion),P=!1,!0)}),this.dispose=function(){v.domElement.removeEventListener("contextmenu",he),v.domElement.removeEventListener("pointerdown",re),v.domElement.removeEventListener("wheel",ae),v.domElement.removeEventListener("touchstart",se),v.domElement.removeEventListener("touchend",ce),v.domElement.removeEventListener("touchmove",le),v.domElement.ownerDocument.removeEventListener("pointermove",ne),v.domElement.ownerDocument.removeEventListener("pointerup",ie),null!==v._domElementKeyEvents&&v._domElementKeyEvents.removeEventListener("keydown",oe)};var v=this,g={type:"change"},y={type:"start"},x={type:"end"},b={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},_=b.NONE,w=1e-6,M=new gl,S=new gl,A=1,L=new E,P=!1,N=new f,R=new f,C=new f,F=new f,I=new f,O=new f,D=new f,U=new f,z=new f;function B(){return Math.pow(.95,v.zoomSpeed)}function H(e){S.theta-=e}function G(e){S.phi-=e}var k,j=(k=new E,function(e,t){k.setFromMatrixColumn(t,0),k.multiplyScalar(-e),L.add(k)}),V=function(){var e=new E;return function(t,r){!0===v.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(v.object.up,e)),e.multiplyScalar(t),L.add(e)}}(),W=function(){var e=new E;return function(t,r){var n=v.domElement;if(v.object.isPerspectiveCamera){var i=v.object.position;e.copy(i).sub(v.target);var a=e.length();a*=Math.tan(v.object.fov/2*Math.PI/180),j(2*t*a/n.clientHeight,v.object.matrix),V(2*r*a/n.clientHeight,v.object.matrix)}else v.object.isOrthographicCamera?(j(t*(v.object.right-v.object.left)/v.object.zoom/n.clientWidth,v.object.matrix),V(r*(v.object.top-v.object.bottom)/v.object.zoom/n.clientHeight,v.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),v.enablePan=!1)}}();function X(e){v.object.isPerspectiveCamera?A/=e:v.object.isOrthographicCamera?(v.object.zoom=Math.max(v.minZoom,Math.min(v.maxZoom,v.object.zoom*e)),v.object.updateProjectionMatrix(),P=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),v.enableZoom=!1)}function Y(e){v.object.isPerspectiveCamera?A*=e:v.object.isOrthographicCamera?(v.object.zoom=Math.max(v.minZoom,Math.min(v.maxZoom,v.object.zoom/e)),v.object.updateProjectionMatrix(),P=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),v.enableZoom=!1)}function q(e){N.set(e.clientX,e.clientY)}function Q(e){F.set(e.clientX,e.clientY)}function Z(e){if(1==e.touches.length)N.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);N.set(t,r)}}function J(e){if(1==e.touches.length)F.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);F.set(t,r)}}function K(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+r*r);D.set(0,n)}function $(e){if(1==e.touches.length)R.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);R.set(t,r)}C.subVectors(R,N).multiplyScalar(v.rotateSpeed);var n=v.domElement;H(2*Math.PI*C.x/n.clientHeight),G(2*Math.PI*C.y/n.clientHeight),N.copy(R)}function ee(e){if(1==e.touches.length)I.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);I.set(t,r)}O.subVectors(I,F).multiplyScalar(v.panSpeed),W(O.x,O.y),F.copy(I)}function te(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+r*r);U.set(0,n),z.set(0,Math.pow(U.y/D.y,v.zoomSpeed)),X(z.y),D.copy(U)}function re(e){if(!1!==v.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){var t;switch(e.preventDefault(),v.domElement.focus?v.domElement.focus():window.focus(),e.button){case 0:t=v.mouseButtons.LEFT;break;case 1:t=v.mouseButtons.MIDDLE;break;case 2:t=v.mouseButtons.RIGHT;break;default:t=-1}switch(t){case n:if(!1===v.enableZoom)return;!function(e){D.set(e.clientX,e.clientY)}(e),_=b.DOLLY;break;case r:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===v.enablePan)return;Q(e),_=b.PAN}else{if(!1===v.enableRotate)return;q(e),_=b.ROTATE}break;case i:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===v.enableRotate)return;q(e),_=b.ROTATE}else{if(!1===v.enablePan)return;Q(e),_=b.PAN}break;default:_=b.NONE}_!==b.NONE&&(v.domElement.ownerDocument.addEventListener("pointermove",ne),v.domElement.ownerDocument.addEventListener("pointerup",ie),v.dispatchEvent(y))}(e)}}function ne(e){if(!1!==v.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1===v.enabled)return;switch(e.preventDefault(),_){case b.ROTATE:if(!1===v.enableRotate)return;!function(e){R.set(e.clientX,e.clientY),C.subVectors(R,N).multiplyScalar(v.rotateSpeed);var t=v.domElement;H(2*Math.PI*C.x/t.clientHeight),G(2*Math.PI*C.y/t.clientHeight),N.copy(R),v.update()}(e);break;case b.DOLLY:if(!1===v.enableZoom)return;!function(e){U.set(e.clientX,e.clientY),z.subVectors(U,D),z.y>0?X(B()):z.y<0&&Y(B()),D.copy(U),v.update()}(e);break;case b.PAN:if(!1===v.enablePan)return;!function(e){I.set(e.clientX,e.clientY),O.subVectors(I,F).multiplyScalar(v.panSpeed),W(O.x,O.y),F.copy(I),v.update()}(e)}}(e)}}function ie(e){switch(e.pointerType){case"mouse":case"pen":!function(e){if(v.domElement.ownerDocument.removeEventListener("pointermove",ne),v.domElement.ownerDocument.removeEventListener("pointerup",ie),!1===v.enabled)return;v.dispatchEvent(x),_=b.NONE}()}}function ae(e){!1===v.enabled||!1===v.enableZoom||_!==b.NONE&&_!==b.ROTATE||(e.preventDefault(),e.stopPropagation(),v.dispatchEvent(y),function(e){e.deltaY<0?Y(B()):e.deltaY>0&&X(B()),v.update()}(e),v.dispatchEvent(x))}function oe(e){!1!==v.enabled&&!1!==v.enablePan&&function(e){var t=!1;switch(e.keyCode){case v.keys.UP:W(0,v.keyPanSpeed),t=!0;break;case v.keys.BOTTOM:W(0,-v.keyPanSpeed),t=!0;break;case v.keys.LEFT:W(v.keyPanSpeed,0),t=!0;break;case v.keys.RIGHT:W(-v.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),v.update())}(e)}function se(e){if(!1!==v.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(v.touches.ONE){case a:if(!1===v.enableRotate)return;Z(e),_=b.TOUCH_ROTATE;break;case o:if(!1===v.enablePan)return;J(e),_=b.TOUCH_PAN;break;default:_=b.NONE}break;case 2:switch(v.touches.TWO){case s:if(!1===v.enableZoom&&!1===v.enablePan)return;!function(e){v.enableZoom&&K(e),v.enablePan&&J(e)}(e),_=b.TOUCH_DOLLY_PAN;break;case l:if(!1===v.enableZoom&&!1===v.enableRotate)return;!function(e){v.enableZoom&&K(e),v.enableRotate&&Z(e)}(e),_=b.TOUCH_DOLLY_ROTATE;break;default:_=b.NONE}break;default:_=b.NONE}_!==b.NONE&&v.dispatchEvent(y)}}function le(e){if(!1!==v.enabled)switch(e.preventDefault(),e.stopPropagation(),_){case b.TOUCH_ROTATE:if(!1===v.enableRotate)return;$(e),v.update();break;case b.TOUCH_PAN:if(!1===v.enablePan)return;ee(e),v.update();break;case b.TOUCH_DOLLY_PAN:if(!1===v.enableZoom&&!1===v.enablePan)return;!function(e){v.enableZoom&&te(e),v.enablePan&&ee(e)}(e),v.update();break;case b.TOUCH_DOLLY_ROTATE:if(!1===v.enableZoom&&!1===v.enableRotate)return;!function(e){v.enableZoom&&te(e),v.enableRotate&&$(e)}(e),v.update();break;default:_=b.NONE}}function ce(e){!1!==v.enabled&&(v.dispatchEvent(x),_=b.NONE)}function he(e){!1!==v.enabled&&e.preventDefault()}v.domElement.addEventListener("contextmenu",he),v.domElement.addEventListener("pointerdown",re),v.domElement.addEventListener("wheel",ae),v.domElement.addEventListener("touchstart",se),v.domElement.addEventListener("touchend",ce),v.domElement.addEventListener("touchmove",le),this.update()};(Ml.prototype=Object.create(c.prototype)).constructor=Ml;var Sl=function(e,t){Ml.call(this,e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=i,this.mouseButtons.RIGHT=r,this.touches.ONE=o,this.touches.TWO=l};function Tl(){var e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,mouse_over:!1,click:!1,resize:!0,width:0,height:0},t={width:1,height:1,wWidth:1,wHeight:1,ratio:1},r=[],n=[],i=[],a=new f,o=new E,s=new Re(new E(0,0,1),0),l=new fl,c=[],h={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:a,mouseV3:o,init:function(t){t&&Object.entries(t).forEach((function(t){var r=t[0],n=t[1];e[r]=n}));if(!h.scene)return void console.error("Missing Scene");if(!h.camera)return void console.error("Missing Camera");h.renderer=new ci({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),h.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(h.orbitCtrl=new Ml(h.camera,h.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach((function(e){var t=e[0],r=e[1];h.orbitCtrl[t]=r})));e.width&&e.height?g(e.width,e.height):e.resize&&(v(),window.addEventListener("resize",v));e.mouse_move=e.mouse_move||e.mouse_over,e.mouse_move&&("body"===e.mouse_move?h.mouse_move_element=document.body:h.mouse_move_element=h.renderer.domElement,h.mouse_move_element.addEventListener("mousemove",d),h.mouse_move_element.addEventListener("mouseleave",p));e.click&&h.renderer.domElement.addEventListener("click",u);return r.forEach((function(e){return e()})),!0},dispose:function(){i=[],window.removeEventListener("resize",v),h.mouse_move_element&&(h.mouse_move_element.removeEventListener("mousemove",d),h.mouse_move_element.removeEventListener("mouseleave",p));h.renderer.domElement.removeEventListener("click",u),h.orbitCtrl&&h.orbitCtrl.dispose();this.renderer.dispose()},render:function(){h.orbitCtrl&&h.orbitCtrl.update();i.forEach((function(e){return e()})),h.renderer.render(h.scene,h.camera)},renderC:function(){h.orbitCtrl&&h.orbitCtrl.update();i.forEach((function(e){return e()})),h.composer.render()},setSize:g,onAfterInit:function(e){r.push(e)},onAfterResize:function(e){n.push(e)},offAfterResize:function(e){n=n.filter((function(t){return t!==e}))},onBeforeRender:function(e){i.push(e)},offBeforeRender:function(e){i=i.filter((function(t){return t!==e}))},addIntersectObject:function(e){-1===c.indexOf(e)&&c.push(e)},removeIntersectObject:function(e){var t=c.indexOf(e);-1!==t&&c.splice(t,1)}};function u(e){a.x=e.clientX/t.width*2-1,a.y=-e.clientY/t.height*2+1,l.setFromCamera(a,h.camera);for(var r=l.intersectObjects(c),n=0;n1?1:r)}function Nl(e,t,r){e.x=Pl(e.x,t.x,r),e.y=Pl(e.y,t.y,r)}function Rl(e,t,r){e.x=Pl(e.x,t.x,r),e.y=Pl(e.y,t.y,r),e.z=Pl(e.z,t.z,r)}function Cl(e,t,r){return er?r:e}function Fl(e,t){return void 0===t&&(t=1024),"https://rawcdn.githack.com/emmelleppi/matcaps/9b36ccaaf0a24881a39062d05566c9e92be4aa0d/"+t+"/"+(""+e+function(e){switch(e){case 64:return"-64px";case 128:return"-128px";case 256:return"-256px";case 512:return"-512px";default:return""}}(t)+".png")}function Il(t,r,n){if(t[r]){var i=e.toRef(t,r);El(n,i.value),e.watch(i,(function(){El(n,i.value)}),{deep:!0})}}var Ol={inject:["three"],props:{left:{type:Number,default:-1},right:{type:Number,default:1},top:{type:Number,default:1},bottom:{type:Number,default:-1},near:{type:Number,default:.1},far:{type:Number,default:2e3},zoom:{type:Number,default:1},position:{type:[Object,E],default:{x:0,y:0,z:0}}},created:function(){var t=this;this.camera=new Ss(this.left,this.right,this.top,this.bottom,this.near,this.far),Il(this,"position",this.camera.position),["left","right","top","bottom","near","far","zoom"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.camera[r]=t[r],t.camera.updateProjectionMatrix()}))})),this.three.camera=this.camera},render:function(){return[]},__hmrId:"OrthographicCamera"},Dl={inject:["three"],props:{aspect:{type:Number,default:1},far:{type:Number,default:2e3},fov:{type:Number,default:50},near:{type:Number,default:.1},position:{type:[Object,E],default:{x:0,y:0,z:0}}},created:function(){var t=this;this.camera=new Qt(this.fov,this.aspect,this.near,this.far),Il(this,"position",this.camera.position),["aspect","far","fov","near"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.camera[r]=t[r],t.camera.updateProjectionMatrix()}))})),this.three.camera=this.camera},render:function(){return[]},__hmrId:"PerspectiveCamera"},Ul={inject:["three","scene"],props:{position:Object,rotation:Object,scale:Object},setup:function(t){var r=e.inject("group",e.inject("scene")),n=new ai;return Il(t,"position",n.position),Il(t,"rotation",n.rotation),Il(t,"scale",n.scale),{parent:r,group:n}},provide:function(){return{group:this.group}},created:function(){this.parent.add(this.group)},unmounted:function(){this.parent.remove(this.group)},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Group"},zl={inject:["three"],props:{id:String,background:[String,Number]},setup:function(t){var r=new ui;return t.background&&(r.background=new Qe(t.background)),e.watch((function(){return t.background}),(function(e){r.background=new Qe(e)})),{scene:r}},provide:function(){return{scene:this.scene}},mounted:function(){this.three.scene||(this.three.scene=this.scene)},methods:{},render:function(){return this.$slots.default?this.$slots.default():[]}},Bl={emits:["ready"],inject:["mesh"],props:{rotateX:Number,rotateY:Number,rotateZ:Number},created:function(){var e=this;this.mesh||console.error("Missing parent Mesh"),this.watchProps=[],Object.entries(this.$props).forEach((function(t){return e.watchProps.push(t[0])}))},beforeMount:function(){this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry)},mounted:function(){this.addWatchers()},unmounted:function(){this.geometry.dispose()},methods:{rotateGeometry:function(){this.rotateX&&this.geometry.rotateX(this.rotateX),this.rotateY&&this.geometry.rotateY(this.rotateY),this.rotateZ&&this.geometry.rotateZ(this.rotateZ)},addWatchers:function(){var t=this;this.watchProps.forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},refreshGeometry:function(){var e=this.geometry;this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry),e.dispose()}},render:function(){return[]}},Hl={extends:Bl,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},methods:{createGeometry:function(){var e=this.width,t=this.height,r=this.depth;this.size&&(e=this.size,t=this.size,r=this.size),this.geometry=new jt(e,t,r,this.widthSegments,this.heightSegments,this.depthSegments)}}},Gl={extends:Bl,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new ga(this.radius,this.segments,this.thetaStart,this.thetaLength)}}},kl={extends:Bl,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new xa(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},jl={extends:Bl,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new ya(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},Vl={extends:Bl,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new _a(this.radius,this.detail)}}},Wl={extends:Bl,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new Ka(this.radius,this.detail)}}},Xl={extends:Bl,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new $a(this.points,this.segments,this.phiStart,this.phiLength)}}},Yl={extends:Bl,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new eo(this.radius,this.detail)}}},ql={extends:Bl,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new ba(this.vertices,this.indices,this.radius,this.detail)}}},Ql={extends:Bl,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new ro(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}}},Zl={extends:Bl,props:{radius:{type:Number,default:1},widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},methods:{createGeometry:function(){this.geometry=new io(this.radius,this.widthSegments,this.heightSegments)}}},Jl={extends:Bl,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new ao(this.radius,this.detail)}}},Kl={extends:Bl,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new so(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}}},$l={extends:Bl,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},methods:{createGeometry:function(){this.geometry=new lo(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}}},ec={extends:Bl,props:{path:qo,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radiusSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},methods:{createGeometry:function(){this.geometry=new co(this.path,this.tubularSegments,this.radius,this.radiusSegments,this.closed)}}},tc={inject:["scene"],props:{color:{type:String,default:"#ffffff"},intensity:{type:Number,default:1},castShadow:{type:Boolean,default:!1},shadowMapSize:Object,position:Object},created:function(){this.parent=e.inject("group",this.scene)},mounted:function(){var t=this;Il(this,"position",this.light.position),this.light.target&&Il(this,"target",this.light.target.position),this.light.shadow&&(this.light.castShadow=this.castShadow,El(this.light.shadow.mapSize,this.shadowMapSize)),["color","intensity","castShadow"].forEach((function(r){e.watch((function(){return t[r]}),(function(){"color"===r?t.light.color=new Qe(t.color):t.light[r]=t[r]}))})),this.parent.add(this.light),this.light.target&&this.parent.add(this.light.target)},unmounted:function(){this.parent.remove(this.light),this.light.target&&this.parent.remove(this.light.target)},render:function(){return[]},__hmrId:"Light"},rc={extends:tc,created:function(){this.light=new Es(this.color,this.intensity)},__hmrId:"AmbientLight"},nc={extends:tc,props:{target:Object},created:function(){this.light=new As(this.color,this.intensity)},__hmrId:"DirectionalLight"},ic={extends:tc,props:{distance:{type:Number,default:0},decay:{type:Number,default:1}},created:function(){this.light=new Ms(this.color,this.intensity,this.distance,this.decay)},__hmrId:"PointLight"},ac={extends:tc,props:{angle:{type:Number,default:Math.PI/3},decay:{type:Number,default:1},distance:{type:Number,default:0},penumbra:{type:Number,default:0},target:Object},created:function(){var t=this;this.light=new _s(this.color,this.intensity,this.distance,this.angle,this.penumbra,this.decay),["angle","decay","distance","penumbra"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.light[r]=t[r]}))}))},__hmrId:"SpotLight"},oc={inject:["three","mesh"],props:{id:String,color:{type:[String,Number],default:"#ffffff"},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0},flatShading:Boolean,fog:{type:Boolean,default:!0},opacity:{type:Number,default:1},side:{type:Number,default:0},transparent:Boolean,vertexColors:Boolean},provide:function(){return{material:this}},beforeMount:function(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted:function(){this._addWatchers(),this.addWatchers&&this.addWatchers()},unmounted:function(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},methods:{setProp:function(e,t,r){void 0===r&&(r=!1),this.material[e]=t,this.material.needsUpdate=r},setTexture:function(e,t){void 0===t&&(t="map"),this.setProp(t,e,!0)},_addWatchers:function(){var t=this;["color","depthTest","depthWrite","fog","opacity","side","transparent"].forEach((function(r){e.watch((function(){return t[r]}),(function(){"color"===r?t.material.color.set(t.color):t.material[r]=t[r]}))}))}},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Material"},sc={extends:oc,methods:{createMaterial:function(){this.material=new $e(Ll(this.$props,["id"]))}},__hmrId:"BasicMaterial"},lc={extends:oc,methods:{createMaterial:function(){this.material=new yo(Ll(this.$props,["id"]))}},__hmrId:"LambertMaterial"},cc={extends:oc,props:{src:String,name:String},methods:{createMaterial:function(){var e=this.name?Fl(this.name):this.src,t=Ll(this.$props,["id","src","name"]);t.matcap=(new Yo).load(e),this.material=new xo(t)}},__hmrId:"MatcapMaterial"},hc={extends:oc,props:{emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},reflectivity:{type:Number,default:1},shininess:{type:Number,default:30},specular:{type:[String,Number],default:1118481}},methods:{createMaterial:function(){this.material=new mo(Ll(this.$props,["id"]))},addWatchers:function(){var t=this;["emissive","emissiveIntensity","reflectivity","shininess","specular"].forEach((function(r){e.watch((function(){return t[r]}),(function(e){"emissive"===r||"specular"===r?t.material[r].set(e):t.material[r]=e}))}))}},__hmrId:"PhongMaterial"},uc={aoMapIntensity:{type:Number,default:1},bumpScale:{type:Number,default:1},displacementBias:{type:Number,default:0},displacementScale:{type:Number,default:1},emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},envMapIntensity:{type:Number,default:1},lightMapIntensity:{type:Number,default:1},metalness:{type:Number,default:0},normalScale:{type:Object,default:function(){return new f(1,1)}},roughness:{type:Number,default:1},refractionRatio:{type:Number,default:.98},wireframe:Boolean},dc={extends:oc,props:uc,methods:{createMaterial:function(){this.material=new po(Ll(this.$props,["id","normalScale"]))},addWatchers:function(){var t=this;Object.keys(uc).forEach((function(r){"normalScale"!==r&&e.watch((function(){return t[r]}),(function(e){"emissive"===r?t.material[r].set(e):t.material[r]=e}))})),Il(this,"normalScale",this.material.normalScale)}},__hmrId:"StandardMaterial"},pc={extends:dc,methods:{createMaterial:function(){this.material=new fo(Ll(this.$props,["id"]))}},__hmrId:"PhysicalMaterial"};var fc,mc,vc,gc,yc,xc,bc=or.meshphong_frag.slice(0,or.meshphong_frag.indexOf("void main() {")),_c=or.meshphong_frag.slice(or.meshphong_frag.indexOf("void main() {")),wc={uniforms:Xt.merge([lr.phong.uniforms,{thicknessColor:{value:new Qe(6718871)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:"\n #define USE_UV\n "+or.meshphong_vert+"\n ",fragmentShader:"\n #define USE_UV\n #define SUBSURFACE\n\n "+bc+"\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n "+_c.replace("#include ",(fc=or.lights_fragment_begin,mc="RE_Direct( directLight, geometry, material, reflectedLight );",vc="\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n ",fc.split(mc).join(vc)))},Mc={extends:{inject:["three","mesh"],props:{id:String,uniforms:Object,vertexShader:String,fragmentShader:String},beforeMount:function(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted:function(){this.addWatchers&&this.addWatchers()},unmounted:function(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},render:function(){return[]},__hmrId:"ShaderMaterial"},props:{diffuse:{type:String,default:"#ffffff"},thicknessColor:{type:String,default:"#ffffff"},thicknessDistortion:{type:Number,default:.4},thicknessAmbient:{type:Number,default:.01},thicknessAttenuation:{type:Number,default:.7},thicknessPower:{type:Number,default:2},thicknessScale:{type:Number,default:4},transparent:{type:Boolean,default:!1},opacity:{type:Number,default:1},vertexColors:{type:Boolean,default:!1}},methods:{createMaterial:function(){var e=wc,t=Xt.clone(e.uniforms);Object.entries(this.$props).forEach((function(e){var r=e[0],n=e[1];"diffuse"!==r&&"thicknessColor"!==r||(n=new Qe(n)),"id"!==r&&"transparent"!==r&&"vertexColors"!==r&&(t[r].value=n)})),this.material=new Yt(Object.assign({},e,{uniforms:t,lights:!0,transparent:this.transparent,vertexColors:this.vertexColors}))}},__hmrId:"SubSurfaceMaterial"},Sc={extends:oc,methods:{createMaterial:function(){this.material=new vo(Ll(this.$props,["id"]))}},__hmrId:"ToonMaterial"},Tc={inject:["material"],emits:["loaded"],props:{src:String,onLoad:Function,onProgress:Function,onError:Function,id:{type:String,default:"map"}},created:function(){var t=this;this.refreshTexture(),e.watch((function(){return t.src}),this.refreshTexture)},unmounted:function(){this.material.setTexture(null,this.id),this.texture.dispose()},methods:{createTexture:function(){this.texture=(new Yo).load(this.src,this.onLoaded,this.onProgress,this.onError)},refreshTexture:function(){this.createTexture(),this.material.setTexture(this.texture,this.id)},onLoaded:function(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:function(){return[]}},Ac={inject:["material"],emits:["loaded"],props:{path:String,urls:{type:Array,default:["px.jpg","nx.jpg","py.jpg","ny.jpg","pz.jpg","nz.jpg"]},onLoad:Function,onProgress:Function,onError:Function,id:{type:String,default:"envMap"},refraction:Boolean,refractionRatio:{type:Number,default:.98}},created:function(){var t=this;this.refreshTexture(),e.watch((function(){return t.path}),this.refreshTexture),e.watch((function(){return t.urls}),this.refreshTexture)},unmounted:function(){this.material.setTexture(null,this.id),this.texture.dispose()},methods:{createTexture:function(){this.texture=(new Wo).setPath(this.path).load(this.urls,this.onLoaded,this.onProgress,this.onError)},refreshTexture:function(){this.createTexture(),this.material.setTexture(this.texture,this.id),this.refraction&&(this.texture.mapping=302,this.material.setProp("refractionRatio",this.refractionRatio))},onLoaded:function(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:function(){return[]}},Ec={inject:["three","scene","rendererComponent"],emits:["ready"],props:{materialId:String,position:Object,rotation:Object,scale:Object,castShadow:Boolean,receiveShadow:Boolean,onHover:Function,onClick:Function},created:function(){this.parent=e.inject("group",this.scene)},provide:function(){return{mesh:this}},mounted:function(){this.geometry&&!this.mesh&&this.initMesh()},unmounted:function(){this.mesh&&(this.three.removeIntersectObject(this.mesh),this.parent.remove(this.mesh)),this.geometry&&this.geometry.dispose(),this.material&&!this.materialId&&this.material.dispose()},methods:{initMesh:function(){var e=this;!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new Gt(this.geometry,this.material),this.onHover&&(this.mesh.onHover=function(t){e.onHover({component:e,over:t})},this.three.addIntersectObject(this.mesh)),this.onClick&&(this.mesh.onClick=function(t){e.onClick({component:e,event:t})},this.three.addIntersectObject(this.mesh)),this.bindProps(),this.parent.add(this.mesh),this.$emit("ready")},bindProps:function(){var t=this;Il(this,"position",this.mesh.position),Il(this,"rotation",this.mesh.rotation),Il(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach((function(r){t.mesh[r]=t[r],e.watch((function(){return t[r]}),(function(){t.mesh[r]=t[r]}))})),e.watch((function(){return t.materialId}),(function(){t.mesh.material=t.three.materials[t.materialId]}))},setGeometry:function(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial:function(e){this.material=e,this.mesh&&(this.mesh.material=e)},refreshGeometry:function(){var e=this.geometry;this.createGeometry(),this.mesh.geometry=this.geometry,e.dispose()}},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Mesh"},Lc={extends:Ec,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},created:function(){var t=this;this.createGeometry(),["size","width","height","depth","widthSegments","heightSegments","depthSegments"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.size?this.geometry=new jt(this.size,this.size,this.size):this.geometry=new jt(this.width,this.height,this.depth)}},__hmrId:"Box"},Pc={extends:Ec,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var t=this;this.createGeometry();["radius","segments","thetaStart","thetaLength"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new ga(this.radius,this.segments,this.thetaStart,this.thetaLength)}},__hmrId:"Circle"},Nc={extends:Ec,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var t=this;this.createGeometry();["radius","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new xa(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cone"},Rc={extends:Ec,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var t=this;this.createGeometry();["radiusTop","radiusBottom","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new ya(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cylinder"},Cc={extends:Ec,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var t=this;this.createGeometry();["radius","detail"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new _a(this.radius,this.detail)}},__hmrId:"Dodecahedron"},Fc={extends:Ec,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var t=this;this.createGeometry();["radius","detail"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new Ka(this.radius,this.detail)}},__hmrId:"Icosahedron"},Ic={extends:Ec,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},created:function(){var t=this;this.createGeometry();["points","segments","phiStart","phiLength"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new $a(this.points,this.segments,this.phiStart,this.phiLength)}},__hmrId:"Lathe"},Oc={extends:Ec,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var t=this;this.createGeometry();["radius","detail"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new eo(this.radius,this.detail)}},__hmrId:"Octahedron"},Dc={extends:Ec,props:{width:{type:Number,default:1},height:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1}},created:function(){var t=this;this.createGeometry();["width","height","widthSegments","heightSegments"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new ar(this.width,this.height,this.widthSegments,this.heightSegments)}},__hmrId:"Plane"},Uc={extends:Ec,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var t=this;this.createGeometry();["vertices","indices","radius","detail"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new ba(this.vertices,this.indices,this.radius,this.detail)}},__hmrId:"Polyhedron"},zc={extends:Ec,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var t=this;this.createGeometry();["innerRadius","outerRadius","thetaSegments","phiSegments","thetaStart","thetaLength"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new ro(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}},__hmrId:"Ring"},Bc={extends:Ec,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},watch:{radius:function(){this.refreshGeometry()},widthSegments:function(){this.refreshGeometry()},heightSegments:function(){this.refreshGeometry()}},created:function(){this.createGeometry()},methods:{createGeometry:function(){this.geometry=new io(this.radius,this.widthSegments,this.heightSegments)}},__hmrId:"Sphere"},Hc={extends:Ec,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var t=this;this.createGeometry();["radius","detail"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new ao(this.radius,this.detail)}},__hmrId:"Tetrahedron"},Gc={text:String,fontSrc:String,size:{type:Number,default:80},height:{type:Number,default:5},depth:{type:Number,default:1},curveSegments:{type:Number,default:12},bevelEnabled:{type:Boolean,default:!1},bevelThickness:{type:Number,default:10},bevelSize:{type:Number,default:8},bevelOffset:{type:Number,default:0},bevelSegments:{type:Number,default:5},align:{type:[Boolean,String],default:!1}},kc={extends:Ec,props:Object.assign({},Gc),created:function(){var t=this;["text","size","height","curveSegments","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","align"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.font&&t.refreshGeometry()}))})),(new ks).load(this.fontSrc,(function(e){t.font=e,t.createGeometry(),t.initMesh()}))},methods:{createGeometry:function(){this.geometry=new oo(this.text,{font:this.font,size:this.size,height:this.height,depth:this.depth,curveSegments:this.curveSegments,bevelEnabled:this.bevelEnabled,bevelThickness:this.bevelThickness,bevelSize:this.bevelSize,bevelOffset:this.bevelOffset,bevelSegments:this.bevelSegments}),"center"===this.align&&this.geometry.center()}}},jc={extends:Ec,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},created:function(){var t=this;this.createGeometry();["radius","tube","radialSegments","tubularSegments","arc"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new so(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}},__hmrId:"Torus"},Vc={extends:Ec,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},created:function(){var t=this;this.createGeometry();["radius","tube","radialSegments","tubularSegments","p","q"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new lo(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}},__hmrId:"TorusKnot"},Wc={extends:Ec,props:{path:qo,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radialSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},created:function(){var t=this;this.createGeometry();["path","tubularSegments","radius","radialSegments","closed"].forEach((function(r){e.watch((function(){return t[r]}),(function(){t.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new co(this.path,this.tubularSegments,this.radius,this.radialSegments,this.closed)}},__hmrId:"Tube"},Xc={extends:Ec,props:{cubeRTSize:{type:Number,default:256},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initGem(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT),this.meshBack&&this.parent.remove(this.meshBack),this.materialBack&&this.materialBack.dispose()},methods:{initGem:function(){var e=new Kt(this.cubeRTSize,{format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new Zt(this.cubeCameraNear,this.cubeCameraFar,e),Il(this,"position",this.cubeCamera.position),this.parent.add(this.cubeCamera),this.material.side=0,this.material.envMap=e.texture,this.material.envMapIntensity=10,this.material.metalness=0,this.material.roughness=0,this.material.opacity=.75,this.material.transparent=!0,this.material.premultipliedAlpha=!0,this.material.needsUpdate=!0,this.materialBack=this.material.clone(),this.materialBack.side=1,this.materialBack.envMapIntensity=5,this.materialBack.metalness=1,this.materialBack.roughness=0,this.materialBack.opacity=.5,this.meshBack=new Gt(this.geometry,this.materialBack),Il(this,"position",this.meshBack.position),Il(this,"rotation",this.meshBack.rotation),Il(this,"scale",this.meshBack.scale),this.parent.add(this.meshBack)},updateCubeRT:function(){this.mesh.visible=!1,this.meshBack.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0,this.meshBack.visible=!0}},__hmrId:"Gem"},Yc={emits:["loaded"],extends:Ec,props:{src:String,width:Number,height:Number,keepSize:Boolean},created:function(){var t=this;this.createGeometry(),this.createMaterial(),this.initMesh(),e.watch((function(){return t.src}),this.refreshTexture),["width","height"].forEach((function(r){e.watch((function(){return t[r]}),t.resize)})),this.keepSize&&this.three.onAfterResize(this.resize)},methods:{createGeometry:function(){this.geometry=new ar(1,1,1,1)},createMaterial:function(){this.material=new $e({side:2,map:this.loadTexture()})},loadTexture:function(){return(new Yo).load(this.src,this.onLoaded)},refreshTexture:function(){this.texture&&this.texture.dispose(),this.material.map=this.loadTexture(),this.material.needsUpdate=!0},onLoaded:function(e){this.texture=e,this.resize(),this.$emit("loaded")},resize:function(){if(this.texture){var e,t,r=this.three.size,n=this.texture.image.width/this.texture.image.height;this.width&&this.height?(e=this.width*r.wWidth/r.width,t=this.height*r.wHeight/r.height):this.width?t=(e=this.width*r.wWidth/r.width)/n:this.height&&(e=(t=this.height*r.wHeight/r.height)*n),this.mesh.scale.x=e,this.mesh.scale.y=t}}},__hmrId:"Image"},qc={inject:["three","scene"],props:{materialId:String,count:Number,position:Object,castShadow:Boolean,receiveShadow:Boolean},created:function(){this.parent=e.inject("group",this.scene)},provide:function(){return{mesh:this}},beforeMount:function(){this.$slots.default||console.error("Missing Geometry")},mounted:function(){this.initMesh()},unmounted:function(){this.parent.remove(this.mesh)},methods:{initMesh:function(){var t=this;!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new qi(this.geometry,this.material,this.count),Il(this,"position",this.mesh.position),Il(this,"rotation",this.mesh.rotation),Il(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach((function(r){t.mesh[r]=t[r],e.watch((function(){return t[r]}),(function(){t.mesh[r]=t[r]}))})),this.parent.add(this.mesh)},setGeometry:function(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial:function(e){this.material=e,this.mesh&&(this.mesh.material=e)}},render:function(){return this.$slots.default()},__hmrId:"InstancedMesh"},Qc={extends:Ec,props:{cubeRTSize:{type:Number,default:256},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT),this.cubeCamera&&this.parent.remove(this.cubeCamera)},methods:{initMirrorMesh:function(){var e=new Kt(this.cubeRTSize,{format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new Zt(this.cubeCameraNear,this.cubeCameraFar,e),this.parent.add(this.cubeCamera),this.material.envMap=e.texture,this.material.needsUpdate=!0},updateCubeRT:function(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"MirrorMesh"},Zc={extends:Ec,props:{cubeRTSize:{type:Number,default:256},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},refractionRatio:{type:Number,default:.98},autoUpdate:Boolean},mounted:function(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT),this.cubeCamera&&this.parent.remove(this.cubeCamera)},methods:{initMirrorMesh:function(){var e=new Kt(this.cubeRTSize,{mapping:302,format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new Zt(this.cubeCameraNear,this.cubeCameraFar,e),Il(this,"position",this.cubeCamera.position),this.parent.add(this.cubeCamera),this.material.envMap=e.texture,this.material.refractionRatio=this.refractionRatio,this.material.needsUpdate=!0},updateCubeRT:function(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"RefractionMesh"},Jc={emits:["ready","loaded"],inject:["three","scene"],props:{src:String,position:Object,scale:Object},created:function(){this.parent=e.inject("group",this.scene)},mounted:function(){this.texture=(new Yo).load(this.src,this.onLoaded),this.material=new vi({map:this.texture}),this.sprite=new Pi(this.material),this.geometry=this.sprite.geometry,Il(this,"position",this.sprite.position),Il(this,"scale",this.sprite.scale),this.parent.add(this.sprite),this.$emit("ready")},unmounted:function(){this.texture.dispose(),this.material.dispose(),this.parent.remove(this.sprite)},methods:{onLoaded:function(){this.updateUV(),this.$emit("loaded")},updateUV:function(){this.iWidth=this.texture.image.width,this.iHeight=this.texture.image.height,this.iRatio=this.iWidth/this.iHeight;var e=.5,t=.5;this.iRatio>1?t=.5/this.iRatio:e=.5/this.iRatio;var r=this.geometry.attributes.position.array;r[0]=-e,r[1]=-t,r[5]=e,r[6]=-t,r[10]=e,r[11]=t,r[15]=-e,r[16]=t,this.geometry.attributes.position.needsUpdate=!0}},render:function(){return[]},__hmrId:"Sprite"},Kc={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")};function $c(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign($c.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),$c.FullScreenQuad=(gc=new Ss(-1,1,1,-1,0,1),yc=new ar(2,2),xc=function(e){this._mesh=new Gt(yc,e)},Object.defineProperty(xc.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign(xc.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(e){e.render(this._mesh,gc)}}),xc);var eh=function(e,t){$c.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof Yt?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Xt.clone(e.uniforms),this.material=new Yt({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new $c.FullScreenQuad(this.material)};eh.prototype=Object.assign(Object.create($c.prototype),{constructor:eh,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}});var th=function(e,t){$c.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1};th.prototype=Object.assign(Object.create($c.prototype),{constructor:th,render:function(e,t,r){var n,i,a=e.getContext(),o=e.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(n=0,i=1):(n=1,i=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.buffers.stencil.setFunc(a.ALWAYS,n,4294967295),o.buffers.stencil.setClear(i),o.buffers.stencil.setLocked(!0),e.setRenderTarget(r),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(a.EQUAL,1,4294967295),o.buffers.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.buffers.stencil.setLocked(!0)}});var rh=function(){$c.call(this),this.needsSwap=!1};rh.prototype=Object.create($c.prototype),Object.assign(rh.prototype,{render:function(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}});var nh=function(e,t){if(this.renderer=e,void 0===t){var r={minFilter:1006,magFilter:1006,format:1023},n=e.getSize(new f);this._pixelRatio=e.getPixelRatio(),this._width=n.width,this._height=n.height,(t=new S(this._width*this._pixelRatio,this._height*this._pixelRatio,r)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Kc&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===eh&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new eh(Kc),this.clock=new Qs};Object.assign(nh.prototype,{swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},removePass:function(e){var t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)},isLastEnabledPass:function(e){for(var t=e+1;t","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")},hh=function(e,t,r){$c.call(this),this.scene=e,this.camera=t;var n=void 0!==r.focus?r.focus:1,i=void 0!==r.aspect?r.aspect:t.aspect,a=void 0!==r.aperture?r.aperture:.025,o=void 0!==r.maxblur?r.maxblur:1,s=r.width||window.innerWidth||1,l=r.height||window.innerHeight||1;this.renderTargetDepth=new S(s,l,{minFilter:1003,magFilter:1003}),this.renderTargetDepth.texture.name="BokehPass.depth",this.materialDepth=new Kn,this.materialDepth.depthPacking=3201,this.materialDepth.blending=0,void 0===ch&&console.error("THREE.BokehPass relies on BokehShader");var c=ch,h=Xt.clone(c.uniforms);h.tDepth.value=this.renderTargetDepth.texture,h.focus.value=n,h.aspect.value=i,h.aperture.value=a,h.maxblur.value=o,h.nearClip.value=t.near,h.farClip.value=t.far,this.materialBokeh=new Yt({defines:Object.assign({},c.defines),uniforms:h,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}),this.uniforms=h,this.needsSwap=!1,this.fsQuad=new $c.FullScreenQuad(this.materialBokeh),this._oldClearColor=new Qe};hh.prototype=Object.assign(Object.create($c.prototype),{constructor:hh,render:function(e,t,r){this.scene.overrideMaterial=this.materialDepth,e.getClearColor(this._oldClearColor);var n=e.getClearAlpha(),i=e.autoClear;e.autoClear=!1,e.setClearColor(16777215),e.setClearAlpha(1),e.setRenderTarget(this.renderTargetDepth),e.clear(),e.render(this.scene,this.camera),this.uniforms.tColor.value=r.texture,this.uniforms.nearClip.value=this.camera.near,this.uniforms.farClip.value=this.camera.far,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),this.scene.overrideMaterial=null,e.setClearColor(this._oldClearColor),e.setClearAlpha(n),e.autoClear=i}});var uh={extends:sh,props:{focus:{type:Number,default:1},aperture:{type:Number,default:.025},maxblur:{type:Number,default:.01}},watch:{focus:function(){this.pass.uniforms.focus.value=this.focus},aperture:function(){this.pass.uniforms.aperture.value=this.aperture},maxblur:function(){this.pass.uniforms.maxblur.value=this.maxblur}},mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e={focus:this.focus,aperture:this.aperture,maxblur:this.maxblur,width:this.three.size.width,height:this.three.size.height},t=new hh(this.three.scene,this.three.camera,e);this.passes.push(t),this.pass=t},__hmrId:"BokehPass"},dh={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")},ph=function(e,t,r,n){$c.call(this),void 0===dh&&console.error("THREE.FilmPass relies on FilmShader");var i=dh;this.uniforms=Xt.clone(i.uniforms),this.material=new Yt({uniforms:this.uniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}),void 0!==n&&(this.uniforms.grayscale.value=n),void 0!==e&&(this.uniforms.nIntensity.value=e),void 0!==t&&(this.uniforms.sIntensity.value=t),void 0!==r&&(this.uniforms.sCount.value=r),this.fsQuad=new $c.FullScreenQuad(this.material)};ph.prototype=Object.assign(Object.create($c.prototype),{constructor:ph,render:function(e,t,r,n){this.uniforms.tDiffuse.value=r.texture,this.uniforms.time.value+=n,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}});var fh={extends:sh,props:{noiseIntensity:{type:Number,default:.5},scanlinesIntensity:{type:Number,default:.05},scanlinesCount:{type:Number,default:4096},grayscale:{type:Number,default:0}},watch:{noiseIntensity:function(){this.pass.uniforms.nIntensity.value=this.noiseIntensity},scanlinesIntensity:function(){this.pass.uniforms.sIntensity.value=this.scanlinesIntensity},scanlinesCount:function(){this.pass.uniforms.sCount.value=this.scanlinesCount},grayscale:function(){this.pass.uniforms.grayscale.value=this.grayscale}},mounted:function(){var e=new ph(this.noiseIntensity,this.scanlinesIntensity,this.scanlinesCount,this.grayscale);this.passes.push(e),this.pass=e},__hmrId:"FilmPass"},mh={uniforms:{tDiffuse:{value:null},resolution:{value:new f(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immediates."," // Immediates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")},vh={extends:sh,mounted:function(){var e=new eh(mh);this.passes.push(e),this.pass=e,this.three.onAfterResize(this.resize)},unmounted:function(){this.three.offAfterResize(this.resize)},methods:{resize:function(){var e=this.pass.material.uniforms.resolution;e.value.x=1/this.three.size.width,e.value.y=1/this.three.size.height}},__hmrId:"FXAAPass"},gh={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")},yh=function(e,t,r){for(var n in $c.call(this),void 0===gh&&console.error("THREE.HalftonePass requires HalftoneShader"),this.uniforms=Xt.clone(gh.uniforms),this.material=new Yt({uniforms:this.uniforms,fragmentShader:gh.fragmentShader,vertexShader:gh.vertexShader}),this.uniforms.width.value=e,this.uniforms.height.value=t,r)r.hasOwnProperty(n)&&this.uniforms.hasOwnProperty(n)&&(this.uniforms[n].value=r[n]);this.fsQuad=new $c.FullScreenQuad(this.material)};yh.prototype=Object.assign(Object.create($c.prototype),{constructor:yh,render:function(e,t,r){this.material.uniforms.tDiffuse.value=r.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))},setSize:function(e,t){this.uniforms.width.value=e,this.uniforms.height.value=t}});var xh={extends:sh,props:{shape:{type:Number,default:1},radius:{type:Number,default:4},rotateR:{type:Number,default:Math.PI/12*1},rotateG:{type:Number,default:Math.PI/12*2},rotateB:{type:Number,default:Math.PI/12*3},scatter:{type:Number,default:0}},mounted:function(){var t=this,r=new yh(this.three.size.width,this.three.size.height,{});["shape","radius","rotateR","rotateG","rotateB","scatter"].forEach((function(n){r.uniforms[n].value=t[n],e.watch((function(){return t[n]}),(function(){r.uniforms[n].value=t[n]}))})),this.passes.push(r),this.pass=r},__hmrId:"HalftonePass"},bh={defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new f(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","\tvOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","\tvUv = uv;","\tSMAAEdgeDetectionVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","\tvec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","\tvec4 delta;","\tvec3 C = texture2D( colorTex, texcoord ).rgb;","\tvec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","\tvec3 t = abs( C - Cleft );","\tdelta.x = max( max( t.r, t.g ), t.b );","\tvec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","\tt = abs( C - Ctop );","\tdelta.y = max( max( t.r, t.g ), t.b );","\tvec2 edges = step( threshold, delta.xy );","\tif ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","\t\tdiscard;","\tvec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","\tt = abs( C - Cright );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","\tt = abs( C - Cbottom );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tfloat maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","\tvec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","\tt = abs( C - Cleftleft );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","\tt = abs( C - Ctoptop );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tmaxDelta = max( max( maxDelta, delta.z ), delta.w );","\tedges.xy *= step( 0.5 * maxDelta, delta.xy );","\treturn vec4( edges, 0.0, 0.0 );","}","void main() {","\tgl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},_h={defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new f(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","\tvPixcoord = texcoord / resolution;","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","\tvOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","\tvUv = uv;","\tSMAABlendingWeightCalculationVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","#if __VERSION__ == 100","vec2 round( vec2 x ) {","\treturn sign( x ) * floor( abs( x ) + 0.5 );","}","#endif","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","\te.r = bias + e.r * scale;","\treturn 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x += 0.25 * resolution.x;","\ttexcoord.x += resolution.x;","\ttexcoord.x += 2.0 * resolution.x;","\ttexcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","\treturn texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x -= 0.25 * resolution.x;","\ttexcoord.x -= resolution.x;","\ttexcoord.x -= 2.0 * resolution.x;","\ttexcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","\treturn texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y -= 0.25 * resolution.y;","\ttexcoord.y -= resolution.y;","\ttexcoord.y -= 2.0 * resolution.y;","\ttexcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","\treturn texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y += 0.25 * resolution.y;","\ttexcoord.y += resolution.y;","\ttexcoord.y += 2.0 * resolution.y;","\ttexcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","\treturn texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","\tvec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","\ttexcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","\ttexcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","\treturn texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","\tvec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","\tvec2 e = texture2D( edgesTex, texcoord ).rg;","\tif ( e.g > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","\t\tcoords.y = offset[ 1 ].y;","\t\td.x = coords.x;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).r;","\t\tcoords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","\t\td.y = coords.x;","\t\td = d / resolution.x - pixcoord.x;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","\t\tweights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","\t}","\tif ( e.r > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","\t\tcoords.x = offset[ 0 ].x;","\t\td.x = coords.y;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).g;","\t\tcoords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","\t\td.y = coords.y;","\t\td = d / resolution.y - pixcoord.y;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","\t\tweights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","\t}","\treturn weights;","}","void main() {","\tgl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},wh={uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new f(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","\tvUv = uv;","\tSMAANeighborhoodBlendingVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","\tvec4 a;","\ta.xz = texture2D( blendTex, texcoord ).xz;","\ta.y = texture2D( blendTex, offset[ 1 ].zw ).g;","\ta.w = texture2D( blendTex, offset[ 1 ].xy ).a;","\tif ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","\t\treturn texture2D( colorTex, texcoord, 0.0 );","\t} else {","\t\tvec2 offset;","\t\toffset.x = a.a > a.b ? a.a : -a.b;","\t\toffset.y = a.g > a.r ? -a.g : a.r;","\t\tif ( abs( offset.x ) > abs( offset.y )) {","\t\t\toffset.y = 0.0;","\t\t} else {","\t\t\toffset.x = 0.0;","\t\t}","\t\tvec4 C = texture2D( colorTex, texcoord, 0.0 );","\t\ttexcoord += sign( offset ) * resolution;","\t\tvec4 Cop = texture2D( colorTex, texcoord, 0.0 );","\t\tfloat s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","\t\tC.xyz = pow(C.xyz, vec3(2.2));","\t\tCop.xyz = pow(Cop.xyz, vec3(2.2));","\t\tvec4 mixed = mix(C, Cop, s);","\t\tmixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","\t\treturn mixed;","\t}","}","void main() {","\tgl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")},Mh=function(e,t){$c.call(this),this.edgesRT=new S(e,t,{depthBuffer:!1,generateMipmaps:!1,minFilter:1006,format:1022}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new S(e,t,{depthBuffer:!1,generateMipmaps:!1,minFilter:1006,format:1023}),this.weightsRT.texture.name="SMAAPass.weights";var r=this,n=new Image;n.src=this.getAreaTexture(),n.onload=function(){r.areaTexture.needsUpdate=!0},this.areaTexture=new b,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=n,this.areaTexture.format=1022,this.areaTexture.minFilter=1006,this.areaTexture.generateMipmaps=!1,this.areaTexture.flipY=!1;var i=new Image;i.src=this.getSearchTexture(),i.onload=function(){r.searchTexture.needsUpdate=!0},this.searchTexture=new b,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=i,this.searchTexture.magFilter=1003,this.searchTexture.minFilter=1003,this.searchTexture.generateMipmaps=!1,this.searchTexture.flipY=!1,void 0===bh&&console.error("THREE.SMAAPass relies on SMAAShader"),this.uniformsEdges=Xt.clone(bh.uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new Yt({defines:Object.assign({},bh.defines),uniforms:this.uniformsEdges,vertexShader:bh.vertexShader,fragmentShader:bh.fragmentShader}),this.uniformsWeights=Xt.clone(_h.uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new Yt({defines:Object.assign({},_h.defines),uniforms:this.uniformsWeights,vertexShader:_h.vertexShader,fragmentShader:_h.fragmentShader}),this.uniformsBlend=Xt.clone(wh.uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new Yt({uniforms:this.uniformsBlend,vertexShader:wh.vertexShader,fragmentShader:wh.fragmentShader}),this.needsSwap=!1,this.fsQuad=new $c.FullScreenQuad(null)};Mh.prototype=Object.assign(Object.create($c.prototype),{constructor:Mh,render:function(e,t,r){this.uniformsEdges.tDiffuse.value=r.texture,this.fsQuad.material=this.materialEdges,e.setRenderTarget(this.edgesRT),this.clear&&e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialWeights,e.setRenderTarget(this.weightsRT),this.clear&&e.clear(),this.fsQuad.render(e),this.uniformsBlend.tColor.value=r.texture,this.fsQuad.material=this.materialBlend,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwd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nMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}});var Sh={extends:sh,mounted:function(){var e=new Mh(this.three.size.width,this.three.size.height);this.passes.push(e),this.pass=e},__hmrId:"SMAAPass"},Th="\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",Ah={uniforms:{tDiffuse:{value:null},blurRadius:{value:0},gradientRadius:{value:0},start:{value:new f},end:{value:new f},delta:{value:new f},texSize:{value:new f}},vertexShader:Th,fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float blurRadius;\n uniform float gradientRadius;\n uniform vec2 start;\n uniform vec2 end;\n uniform vec2 delta;\n uniform vec2 texSize;\n varying vec2 vUv;\n\n float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n }\n\n void main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientRadius) * blurRadius;\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 texel = texture2D(tDiffuse, vUv + delta / texSize * percent * radius);\n // vec4 texel2 = texture2D(tDiffuse, vUv + vec2(-delta.y, delta.x) / texSize * percent * radius);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n texel.rgb *= texel.a;\n // texel2.rgb *= texel2.a;\n\n color += texel * weight;\n total += 2.0 * weight;\n }\n\n gl_FragColor = color / total;\n\n /* switch back from pre-multiplied alpha */\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n }\n "};function Eh(t,r,n,i){void 0===i&&(i="value"),t[r]&&(n[i]=t[r],e.watch((function(){return t[r]}),(function(e){n[i]=e})))}var Lh={extends:sh,props:{blurRadius:{type:Number,default:10},gradientRadius:{type:Number,default:100},start:{type:Object,default:{x:0,y:100}},end:{type:Object,default:{x:10,y:100}}},mounted:function(){var t=this;this.pass=new eh(Ah),this.passes.push(this.pass),this.pass1=new eh(Ah),this.passes.push(this.pass1);var r=this.uniforms=this.pass.uniforms,n=this.uniforms1=this.pass1.uniforms;n.blurRadius=r.blurRadius,n.gradientRadius=r.gradientRadius,n.start=r.start,n.end=r.end,n.texSize=r.texSize,Eh(this,"blurRadius",r.blurRadius),Eh(this,"gradientRadius",r.gradientRadius),this.updateFocusLine(),["start","end"].forEach((function(r){e.watch((function(){return t[r]}),t.updateFocusLine)})),this.pass.setSize=function(e,t){r.texSize.value.set(e,t)}},methods:{updateFocusLine:function(){this.uniforms.start.value.copy(this.start),this.uniforms.end.value.copy(this.end);var e=(new f).copy(this.end).sub(this.start).normalize();this.uniforms.delta.value.copy(e),this.uniforms1.delta.value.set(-e.y,e.x)}},__hmrId:"TiltShiftPass"},Ph={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Qe(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")},Nh=function(e,t,r,n){$c.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=n,this.resolution=void 0!==e?new f(e.x,e.y):new f(256,256),this.clearColor=new Qe(0,0,0);var i={minFilter:1006,magFilter:1006,format:1023};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var a=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new S(a,o,i),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var s=0;s\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new Yt({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),Nh.BlurDirectionX=new f(1,0),Nh.BlurDirectionY=new f(0,1);var Rh={extends:sh,props:{strength:{type:Number,default:1.5},radius:{type:Number,default:0},threshold:{type:Number,default:0}},watch:{strength:function(){this.pass.strength=this.strength},radius:function(){this.pass.radius=this.radius},threshold:function(){this.pass.threshold=this.threshold}},mounted:function(){var e=new f(this.three.size.width,this.three.size.height),t=new Nh(e,this.strength,this.radius,this.threshold);this.passes.push(t),this.pass=t},__hmrId:"UnrealBloomPass"},Ch={uniforms:{tDiffuse:{value:null},center:{value:new f(.5,.5)},strength:{value:0}},vertexShader:Th,fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform vec2 center;\n uniform float strength;\n varying vec2 vUv;\n\n float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n }\n \n void main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 toCenter = center - vUv;\n \n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n \n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t + offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n vec4 texel = texture2D(tDiffuse, vUv + toCenter * percent * strength);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n texel.rgb *= texel.a;\n\n color += texel * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n\n /* switch back from pre-multiplied alpha */\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n }\n "},Fh={extends:sh,props:{center:{type:Object,default:{x:.5,y:.5}},strength:{type:Number,default:.5}},mounted:function(){this.pass=new eh(Ch),this.passes.push(this.pass);var e=this.uniforms=this.pass.uniforms;Il(this,"center",e.center.value),Eh(this,"strength",e.strength)},__hmrId:"ZoomBlurPass"},Ih="\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n",Oh={extends:Yc,props:{widthSegments:{type:Number,default:20},heightSegments:{type:Number,default:20},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5},dispCoef:{type:Number,default:.05}},setup:function(t){var r={value:t.noiseCoef};e.watch((function(){return t.noiseCoef}),(function(e){r.value=e}));var n={value:t.zCoef};e.watch((function(){return t.zCoef}),(function(e){n.value=e}));var i={value:t.dispCoef};return e.watch((function(){return t.dispCoef}),(function(e){i.value=e})),{uTime:{value:0},uNoiseCoef:r,uZCoef:n,uDispCoef:i}},mounted:function(){this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{createGeometry:function(){this.geometry=new ar(1,1,this.widthSegments,this.heightSegments)},createMaterial:function(){var e=this;this.material=new $e({side:2,map:this.loadTexture()}),this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.uniforms.uDispCoef=e.uDispCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n "+Ih+"\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n vNoise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),t.fragmentShader="\n uniform float uDispCoef;\n varying float vNoise;\n "+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("#include ","\n vec4 texelColor = texture2D(map, vUv);\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\n texelColor.r = dispTexel.r;\n diffuseColor = texelColor;\n "),e.materialShader=t}},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyImage"},Dh={extends:Dc,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:5},deltaCoef:{type:Number,default:1/512},displacementScale:{type:Number,default:5}},setup:function(t){var r={value:t.noiseCoef};e.watch((function(){return t.noiseCoef}),(function(e){r.value=e}));var n={value:new f(t.deltaCoef,t.deltaCoef)};return e.watch((function(){return t.deltaCoef}),(function(e){n.value.set(e,e)})),{uTime:{value:0},uNoiseCoef:r,uDelta:n}},mounted:function(){var t=this;this.init(),e.watch((function(){return t.displacementScale}),(function(e){t.material.displacementScale=e})),this.startTime=Date.now(),this.three.onBeforeRender(this.update)},unmounted:function(){this.three.offBeforeRender(this.update),this.fsQuad.dispose(),this.dispRT.dispose(),this.dispMat.dispose(),this.normRT.dispose(),this.normMat.dispose()},methods:{init:function(){this.fsQuad=new $c.FullScreenQuad,this.dispRT=new S(512,512,{depthBuffer:!1,stencilBuffer:!1}),this.dispMat=new Yt({uniforms:{uTime:this.uTime,uNoiseCoef:this.uNoiseCoef},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n // gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_Position = vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform float uTime;\n uniform float uNoiseCoef;\n varying vec2 vUv;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\n void main() {\n vec2 p = vec2(vUv * uNoiseCoef);\n float noise = (snoise(vec3(p.x, p.y, uTime)) + 1.0) / 2.0;\n gl_FragColor = vec4(noise, 0.0, 0.0, 1.0);\n }\n "}),this.normRT=new S(512,512,{depthBuffer:!1,stencilBuffer:!1}),this.normMat=new Yt({uniforms:{dispMap:{value:this.dispRT.texture},delta:this.uDelta},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n // gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_Position = vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform sampler2D dispMap;\n uniform vec2 delta;\n varying vec2 vUv;\n void main() {\n // gl_FragColor = vec4(0.5, 0.5, 1.0, 0.0);\n float x1 = texture2D(dispMap, vec2(vUv.x - delta.x, vUv.y)).r;\n float x2 = texture2D(dispMap, vec2(vUv.x + delta.x, vUv.y)).r;\n float y1 = texture2D(dispMap, vec2(vUv.x, vUv.y - delta.y)).r;\n float y2 = texture2D(dispMap, vec2(vUv.x, vUv.y + delta.y)).r;\n gl_FragColor = vec4(0.5 + (x1 - x2), 0.5 + (y1 - y2), 1.0, 1.0);\n }\n "}),this.material.displacementMap=this.dispRT.texture,this.material.displacementScale=this.displacementScale,this.material.normalMap=this.normRT.texture,this.material.normalMapType=1},update:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef,this.renderDisp()},renderDisp:function(){this.renderMat(this.dispMat,this.dispRT),this.renderMat(this.normMat,this.normRT)},renderMat:function(e,t){var r=this.three.renderer;this.fsQuad.material=e;var n=r.getRenderTarget();r.setRenderTarget(t),this.fsQuad.render(r),r.setRenderTarget(n)}},__hmrId:"NoisyPlane"},Uh={extends:Bc,props:{radius:{type:Number,default:20},widthSegments:{type:Number,default:128},heightSegments:{type:Number,default:128},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.05},dispCoef:{type:Number,default:5}},setup:function(t){var r={value:t.noiseCoef};e.watch((function(){return t.noiseCoef}),(function(e){r.value=e}));var n={value:t.dispCoef};return e.watch((function(){return t.dispCoef}),(function(e){n.value=e})),{uTime:{value:0},uNoiseCoef:r,uDispCoef:n}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uDispCoef=e.uDispCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uDispCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include ","\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\n vNoise = snoise(p);\n vec3 transformed = vec3(position);\n transformed += normalize(position) * vNoise * uDispCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisySphere"},zh={extends:kc,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.015},zCoef:{type:Number,default:10}},setup:function(t){var r={value:t.noiseCoef};e.watch((function(){return t.noiseCoef}),(function(e){r.value=e}));var n={value:t.zCoef};return e.watch((function(){return t.zCoef}),(function(e){n.value=e})),{uTime:{value:0},uNoiseCoef:r,uZCoef:n}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n "+Ih+"\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyText"},Bh=new te,Hh=new Ee,Gh=new E;function kh(){this.uuid=p.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.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}kh.prototype=Object.assign(Object.create(c.prototype),{constructor:kh,isGeometry:!0,applyMatrix4:function(e){for(var t=(new g).getNormalMatrix(e),r=0,n=this.vertices.length;r0)for(var d=0;d0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var e=0,t=this.faces.length;e=0;m--){var v=c[m];this.faces.splice(v,1);for(var g=0,y=this.faceVertexUvs.length;g0,g=f.vertexNormals.length>0,y=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=f.vertexColors.length>0,b=0;if(b=S(b,0,0),b=S(b,1,!0),b=S(b,2,!1),b=S(b,3,m),b=S(b,4,v),b=S(b,5,g),b=S(b,6,y),b=S(b,7,x),o.push(b),o.push(f.a,f.b,f.c),o.push(f.materialIndex),m){var _=this.faceVertexUvs[0][p];o.push(E(_[0]),E(_[1]),E(_[2]))}if(v&&o.push(T(f.normal)),g){var w=f.vertexNormals;o.push(T(w[0]),T(w[1]),T(w[2]))}if(y&&o.push(A(f.color)),x){var M=f.vertexColors;o.push(A(M[0]),A(M[1]),A(M[2]))}}function S(e,t,r){return r?e|1<0&&(e.data.colors=c),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return(new kh).copy(this)},copy:function(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;for(var t=e.vertices,r=0,n=t.length;r0){var n=new Float32Array(3*e.normals.length);t.setAttribute("normal",new rt(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(3*e.colors.length);t.setAttribute("color",new rt(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var a=new Float32Array(2*e.uvs.length);t.setAttribute("uv",new rt(a,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);t.setAttribute("uv2",new rt(o,2).copyVector2sArray(e.uvs2))}for(var s in t.groups=e.groups,e.morphTargets){for(var l=[],c=e.morphTargets[s],h=0,u=c.length;h0){var f=new ut(4*e.skinIndices.length,4);t.setAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new ut(4*e.skinWeights.length,4);t.setAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(t.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(t.boundingBox=e.boundingBox.clone()),t},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),kh.createBufferGeometryFromObject=function(e){var t=new Mt,r=e.geometry;if(e.isPoints||e.isLine){var n=new ut(3*r.vertices.length,3),i=new ut(3*r.colors.length,3);if(t.setAttribute("position",n.copyVector3sArray(r.vertices)),t.setAttribute("color",i.copyColorsArray(r.colors)),r.lineDistances&&r.lineDistances.length===r.vertices.length){var a=new ut(r.lineDistances.length,1);t.setAttribute("lineDistance",a.copyArray(r.lineDistances))}null!==r.boundingSphere&&(t.boundingSphere=r.boundingSphere.clone()),null!==r.boundingBox&&(t.boundingBox=r.boundingBox.clone())}else e.isMesh&&(t=r.toBufferGeometry());return t};var jh=function(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1};jh.prototype.computeGroups=function(e){var t,r,n=[],i=void 0,a=e.faces;for(r=0;r0,o=i[1]&&i[1].length>0,s=e.morphTargets,l=s.length;if(l>0){t=[];for(var c=0;c0){h=[];for(var p=0;p0&&0===r.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var x=0;x","\n #include \n vUv = vUv * uvScale + uvOffset;\n "),t.vertexShader=t.vertexShader.replace("#include ","\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\n transformed = rotMat * transformed;\n\n vec4 mvPosition = vec4(transformed, 1.0);\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n mvPosition.xyz += progress * offset;\n\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n ")}})},Wh.prototype.initPlane=function(){var e=this.screen,t=e.width,r=e.wWidth,n=e.wHeight;this.wSize=this.size*r/t,this.nx=Math.ceil(r/this.wSize)+1,this.ny=Math.ceil(n/this.wSize)+1,this.icount=this.nx*this.ny,this.initGeometry(),this.initUV(),this.initAnimAttributes(),this.imesh&&this.o3d.remove(this.imesh),this.imesh=new qi(this.bGeometry,this.material,this.icount),this.o3d.add(this.imesh);for(var i=new Ee,a=0,o=-(r-(r-this.nx*this.wSize))/2+this.dx,s=0;st?this.uvScale.set(1/this.nx,t/e/this.ny):this.uvScale.set(e/t/this.nx,1/this.ny);for(var r=this.uvScale.x*this.nx,n=this.uvScale.y*this.ny,i=new f,a=new Float32Array(2*this.icount),o=0;o0?this.setTargetProgress(this.targetProgress+.05):this.setTargetProgress(this.targetProgress-.05)},onClick:function(e){e.clientY0&&n=2.0 are supported."));else{var d=new q(h,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(var p=0;p=0&&void 0===c[m]&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}d.setExtensions(l),d.setPlugins(c),d.parse(i,o)}}});var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=e}function i(e){this.parser=e,this.name=r.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function a(){this.name=r.KHR_MATERIALS_UNLIT}function o(e){this.parser=e,this.name=r.KHR_MATERIALS_CLEARCOAT}function s(e){this.parser=e,this.name=r.KHR_MATERIALS_TRANSMISSION}function l(e){this.parser=e,this.name=r.KHR_TEXTURE_BASISU}function c(e){this.parser=e,this.name=r.EXT_TEXTURE_WEBP,this.isSupported=null}function h(e){this.name=r.EXT_MESHOPT_COMPRESSION,this.parser=e}i.prototype._markDefs=function(){for(var e=this.parser,t=this.parser.json.nodes||[],r=0,n=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a,o)},c.prototype.loadTexture=function(e){var t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;var a=i.extensions[t],o=n.images[a.source],s=o.uri?r.options.manager.getHandler(o.uri):r.textureLoader;return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,o,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))},c.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported},h.prototype.loadBufferView=function(e){var t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){var n=r.extensions[this.name],i=this.parser.getDependency("buffer",n.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([i,a.ready]).then((function(e){var t=n.byteOffset||0,r=n.byteLength||0,i=n.count,o=n.byteStride,s=new ArrayBuffer(i*o),l=new Uint8Array(e[0],t,r);return a.decodeGltfBuffer(new Uint8Array(s),i,o,l,n.mode,n.filter),s}))}return null};var u="glTF",d=1313821514,m=5130562;function v(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:Cs(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==u)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var n=this.header.length-12,i=new DataView(e,12),a=0;a",t).replace("#include ",r).replace("#include ",n).replace("#include ",i).replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function b(){return{name:r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return x},extendParams:function(e,t,r){var n=t.extensions[this.name];e.color=new Qe(1,1,1),e.opacity=1;var i=[];if(Array.isArray(n.diffuseFactor)){var a=n.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==n.diffuseTexture&&i.push(r.assignTexture(e,"map",n.diffuseTexture)),e.emissive=new Qe(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new Qe(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var o=n.specularGlossinessTexture;i.push(r.assignTexture(e,"glossinessMap",o)),i.push(r.assignTexture(e,"specularMap",o))}return Promise.all(i)},createMaterial:function(e){var t=new x(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function _(){this.name=r.KHR_MESH_QUANTIZATION}function w(e,t,r,n){Mo.call(this,e,t,r,n)}g.prototype.decodePrimitive=function(e,t){var r=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(var c in a){var h=D[c]||c.toLowerCase();o[h]=a[c]}for(c in e.attributes){h=D[c]||c.toLowerCase();if(void 0!==a[c]){var u=r.accessors[e.attributes[c]],d=C[u.componentType];l[h]=d,s[h]=!0===u.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){n.decodeDracoFile(e,(function(e){for(var r in e.attributes){var n=e.attributes[r],i=s[r];void 0!==i&&(n.normalized=i)}t(e)}),o,l)}))}))},y.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},x.prototype=Object.create(po.prototype),x.prototype.constructor=x,x.prototype.copy=function(e){return po.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},w.prototype=Object.create(Mo.prototype),w.prototype.constructor=w,w.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n*3+n,a=0;a!==n;a++)t[a]=r[i+a];return t},w.prototype.beforeStart_=w.prototype.copySampleValue_,w.prototype.afterEnd_=w.prototype.copySampleValue_,w.prototype.interpolate_=function(e,t,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,c=n-t,h=(r-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,m=-2*d+3*u,v=d-u,g=1-m,y=v-u+h,x=0;x!==o;x++){var b=a[f+x+o],_=a[f+x+s]*c,w=a[p+x+o],M=a[p+x]*c;i[x]=g*b+y*_+m*w+v*M}return i};var M=0,S=1,T=2,A=3,L=4,P=5,R=6,C={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},F={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},I={33071:1001,33648:1002,10497:1e3},O={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},U={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},z={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},B="OPAQUE",H="MASK",G="BLEND";function k(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function j(e,t,r){for(var n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function V(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function W(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,n=t.weights.length;r=2&&i.setY(S,_[w*o+1]),o>=3&&i.setZ(S,_[w*o+2]),o>=4&&i.setW(S,_[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i}))},q.prototype.loadTexture=function(e){var t,n,i=this.json,a=this.options,o=i.textures[e],s=o.extensions||{};return(t=s[r.MSFT_TEXTURE_DDS]?i.images[s[r.MSFT_TEXTURE_DDS].source]:i.images[o.source]).uri&&(n=a.manager.getHandler(t.uri)),n||(n=s[r.MSFT_TEXTURE_DDS]?this.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,n)},q.prototype.loadTextureImage=function(e,t,r){var n=this,i=this.json,a=this.options,o=i.textures[e],s=self.URL||self.webkitURL,l=t.uri,c=!1,h=!0;return"image/jpeg"===t.mimeType&&(h=!1),void 0!==t.bufferView&&(l=n.getDependency("bufferView",t.bufferView).then((function(e){if("image/png"===t.mimeType){var r=new DataView(e,25,1).getUint8(0,!1);h=6===r||4===r||3===r}c=!0;var n=new Blob([e],{type:t.mimeType});return l=s.createObjectURL(n)}))),Promise.resolve(l).then((function(e){return new Promise((function(t,n){var i=t;!0===r.isImageBitmapLoader&&(i=function(e){t(new ma(e))}),r.load(k(e,a.path),i,void 0,n)}))})).then((function(t){!0===c&&s.revokeObjectURL(l),t.flipY=!1,o.name&&(t.name=o.name),h||(t.format=1022);var r=(i.samplers||{})[o.sampler]||{};return t.magFilter=F[r.magFilter]||1006,t.minFilter=F[r.minFilter]||1008,t.wrapS=I[r.wrapS]||1e3,t.wrapT=I[r.wrapT]||1e3,n.associations.set(t,{type:"textures",index:e}),t}))},q.prototype.assignTexture=function(e,t,n){var i=this;return this.getDependency("texture",n.index).then((function(a){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[r.KHR_TEXTURE_TRANSFORM]){var o=void 0!==n.extensions?n.extensions[r.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var s=i.associations.get(a);a=i.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),i.associations.set(a,s)}}e[t]=a}))},q.prototype.assignFinalMaterial=function(e){var t=e.geometry,r=e.material,n=void 0!==t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal,o=!0===e.isSkinnedMesh,s=Object.keys(t.morphAttributes).length>0,l=s&&void 0!==t.morphAttributes.normal;if(e.isPoints){var c="PointsMaterial:"+r.uuid,h=this.cache.get(c);h||(h=new oa,Ke.prototype.copy.call(h,r),h.color.copy(r.color),h.map=r.map,h.sizeAttenuation=!1,this.cache.add(c,h)),r=h}else if(e.isLine){c="LineBasicMaterial:"+r.uuid;var u=this.cache.get(c);u||(u=new Qi,Ke.prototype.copy.call(u,r),u.color.copy(r.color),this.cache.add(c,u)),r=u}if(n||i||a||o||s){c="ClonedMaterial:"+r.uuid+":";r.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),o&&(c+="skinning:"),n&&(c+="vertex-tangents:"),i&&(c+="vertex-colors:"),a&&(c+="flat-shading:"),s&&(c+="morph-targets:"),l&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=r.clone(),o&&(d.skinning=!0),i&&(d.vertexColors=!0),a&&(d.flatShading=!0),s&&(d.morphTargets=!0),l&&(d.morphNormals=!0),n&&(d.vertexTangents=!0,d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(c,d),this.associations.set(d,this.associations.get(r))),r=d}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=r},q.prototype.getMaterialType=function(){return po},q.prototype.loadMaterial=function(e){var t,n=this,i=this.json,a=this.extensions,o=i.materials[e],s={},l=o.extensions||{},c=[];if(l[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=a[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=h.getMaterialType(),c.push(h.extendParams(s,o,n))}else if(l[r.KHR_MATERIALS_UNLIT]){var u=a[r.KHR_MATERIALS_UNLIT];t=u.getMaterialType(),c.push(u.extendParams(s,o,n))}else{var d=o.pbrMetallicRoughness||{};if(s.color=new Qe(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;s.color.fromArray(p),s.opacity=p[3]}void 0!==d.baseColorTexture&&c.push(n.assignTexture(s,"map",d.baseColorTexture)),s.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,s.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)}))))}!0===o.doubleSided&&(s.side=2);var m=o.alphaMode||B;return m===G?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,m===H&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&t!==$e&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new f(1,-1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,-o.normalTexture.scale)),void 0!==o.occlusionTexture&&t!==$e&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&t!==$e&&(s.emissive=(new Qe).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&t!==$e&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture)),Promise.all(c).then((function(){var i;return i=t===x?a[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new t(s),o.name&&(i.name=o.name),i.map&&(i.map.encoding=3001),i.emissiveMap&&(i.emissiveMap.encoding=3001),V(i,o),n.associations.set(i,{type:"materials",index:e}),o.extensions&&j(a,i,o),i}))},q.prototype.createUniqueName=function(e){for(var t=ll.sanitizeNodeName(e||""),r=t,n=1;this.nodeNamesUsed[r];++n)r=t+"_"+n;return this.nodeNamesUsed[r]=!0,r},q.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;function a(e){return n[r.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return Q(r,e,t)}))}for(var o,s,l=[],c=0,h=e.length;c0&&W(u,a),u.name=r.createUniqueName(a.name||"mesh_"+e),V(u,a),p.extensions&&j(i,u,p),r.assignFinalMaterial(u),l.push(u)}if(1===l.length)return l[0];var m=new ai;for(c=0,h=l.length;c1?new ai:1===t.length?t[0]:new Ee)!==t[0])for(var s=0,l=t.length;s