/*! * MineRender 1.1.0 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org * Build #1552941000594 / Mon Mar 18 2019 21:30:00 GMT+0100 (Central European Standard Time) */!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t){e.exports=THREE},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a={},n=new r(e);return a.metadata={},a.metadata.format="pmd",a.metadata.coordinateSystem="left",function(){var e=a.metadata;if(e.magic=n.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=n.getFloat32(),e.modelName=n.getSjisStringsAsUnicode(20),e.comment=n.getSjisStringsAsUnicode(256)}(),function(){var e=function(){var e={};return e.position=n.getFloat32Array(3),e.normal=n.getFloat32Array(3),e.uv=n.getFloat32Array(2),e.skinIndices=n.getUint16Array(2),e.skinWeights=[n.getUint8()/100],e.skinWeights.push(1-e.skinWeights[0]),e.edgeFlag=n.getUint8(),e},t=a.metadata;t.vertexCount=n.getUint32(),a.vertices=[];for(var r=0;r0&&(e.englishModelName=n.getSjisStringsAsUnicode(20),e.englishComment=n.getSjisStringsAsUnicode(256))}(),function(){var e=function(){var e={};return e.name=n.getSjisStringsAsUnicode(20),e},t=a.metadata;if(0!==t.englishCompatibility){a.englishBoneNames=[];for(var r=0;r=2.0 are supported. Use LegacyGLTFLoader instead.")):(h.extensionsUsed&&(h.extensionsUsed.indexOf(t.KHR_LIGHTS)>=0&&(f[t.KHR_LIGHTS]=new function(e){this.name=t.KHR_LIGHTS,this.lights={};var r=(e.extensions&&e.extensions[t.KHR_LIGHTS]||{}).lights||{};for(var n in r){var i,o=r[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,i.angle=o.spot.outerConeAngle,i.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,i.target.position.set(0,0,1),i.add(i.target);break;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}(h)),h.extensionsUsed.indexOf(t.KHR_MATERIALS_UNLIT)>=0&&(f[t.KHR_MATERIALS_UNLIT]=new r(h)),h.extensionsUsed.indexOf(t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(f[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new function(){return{name:t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return a.ShaderMaterial},extendParams:function(e,t,r){var n=t.extensions[this.name],i=a.ShaderLib.standard,o=a.UniformsUtils.clone(i.uniforms),s=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),l=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),u=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),c=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),d=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),f=i.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include ",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",d);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=f,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!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,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.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=0&&(f[t.KHR_DRACO_MESH_COMPRESSION]=new s(this.dracoLoader)),h.extensionsUsed.indexOf(t.MSFT_TEXTURE_DDS)>=0&&(f[t.MSFT_TEXTURE_DDS]=new function(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=t.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader})),new N(h,f,{path:l||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(function(e,t,r,a,n){u({scene:e,scenes:t,cameras:r,animations:a,asset:n})},c))}};var t={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(e){this.name=t.KHR_MATERIALS_UNLIT}r.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},r.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var n="glTF",i=12,o={JSON:1313821514,BIN:5130562};function s(e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=t.KHR_DRACO_MESH_COMPRESSION,this.dracoLoader=e}function l(e,t,r,n){a.Interpolant.call(this,e,t,r,n)}s.prototype.decodePrimitive=function(e,t){var r=this.dracoLoader,a=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,i={};for(var o in n)o in A&&(i[A[o]]=n[o]);return t.getDependency("bufferView",a).then(function(e){return new Promise(function(t){r.decodeDracoFile(e,t,i)})})},l.prototype=Object.create(a.Interpolant.prototype),l.prototype.constructor=l,l.prototype.interpolate_=function(e,t,r,a){for(var n=this.resultBuffer,i=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=a-t,c=(r-t)/u,d=c*c,f=d*c,h=e*l,p=h-l,m=2*f-3*d+1,v=f-2*d+c,g=-2*f+3*d,y=f-d,x=0;x!==o;x++){var b=i[p+x+o],w=i[p+x+s]*u,A=i[h+x+o],M=i[h+x]*u;n[x]=m*b+v*w+g*A+y*M}return n};var u=0,c=1,d=2,f=3,h=4,p=5,m=6,v=(Number,a.Matrix3,a.Matrix4,a.Vector2,a.Vector3,a.Vector4,a.Texture,{5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array}),g={9728:a.NearestFilter,9729:a.LinearFilter,9984:a.NearestMipMapNearestFilter,9985:a.LinearMipMapNearestFilter,9986:a.NearestMipMapLinearFilter,9987:a.LinearMipMapLinearFilter},y={33071:a.ClampToEdgeWrapping,33648:a.MirroredRepeatWrapping,10497:a.RepeatWrapping},x={6406:a.AlphaFormat,6407:a.RGBFormat,6408:a.RGBAFormat,6409:a.LuminanceFormat,6410:a.LuminanceAlphaFormat},b={5121:a.UnsignedByteType,32819:a.UnsignedShort4444Type,32820:a.UnsignedShort5551Type,33635:a.UnsignedShort565Type},w=(a.BackSide,a.FrontSide,a.NeverDepth,a.LessDepth,a.EqualDepth,a.LessEqualDepth,a.GreaterEqualDepth,a.NotEqualDepth,a.GreaterEqualDepth,a.AlwaysDepth,a.AddEquation,a.SubtractEquation,a.ReverseSubtractEquation,a.ZeroFactor,a.OneFactor,a.SrcColorFactor,a.OneMinusSrcColorFactor,a.SrcAlphaFactor,a.OneMinusSrcAlphaFactor,a.DstAlphaFactor,a.OneMinusDstAlphaFactor,a.DstColorFactor,a.OneMinusDstColorFactor,a.SrcAlphaSaturateFactor,{SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}),A={POSITION:"position",NORMAL:"normal",TEXCOORD_0:"uv",TEXCOORD0:"uv",TEXCOORD:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",COLOR0:"color",COLOR:"color",WEIGHTS_0:"skinWeight",WEIGHT:"skinWeight",JOINTS_0:"skinIndex",JOINT:"skinIndex"},M={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},T={CUBICSPLINE:a.InterpolateSmooth,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},S="OPAQUE",E="MASK",_="BLEND";function F(e,t){return"string"!=typeof e||""===e?"":/^(https?:)?\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:/^blob:.*$/i.test(e)?e:t+e}function P(e,t,r,a){for(var n=e.geometry,i=r.targets,o=!1,s=!1,l=0,u=i.length;l=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function N(e,t,r){this.json=e||{},this.extensions=t||{},this.options=r||{},this.cache=new function(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}},this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function I(e,t,r){var a=t.attributes;for(var n in a){var i=A[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return N.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then(function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)}).catch(t)},N.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(_,T[S*l+1]),l>=3&&o.setZ(_,T[S*l+2]),l>=4&&o.setW(_,T[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o})},N.prototype.loadTexture=function(e){var r,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},d=(r=c[t.MSFT_TEXTURE_DDS]?i.images[c[t.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,f=!1;return void 0!==r.bufferView&&(d=n.getDependency("bufferView",r.bufferView).then(function(e){f=!0;var t=new Blob([e],{type:r.mimeType});return d=l.createObjectURL(t)})),Promise.resolve(d).then(function(e){var r=a.Loader.Handlers.get(e);return r||(r=c[t.MSFT_TEXTURE_DDS]?n.extensions[t.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise(function(t,a){r.load(F(e,o.path),t,void 0,a)})}).then(function(e){!0===f&&l.revokeObjectURL(d),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[t.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?x[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==x[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?b[u.type]:a.UnsignedByteType;var r=(i.samplers||{})[u.sampler]||{};return e.magFilter=g[r.magFilter]||a.LinearFilter,e.minFilter=g[r.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=y[r.wrapS]||a.RepeatWrapping,e.wrapT=y[r.wrapT]||a.RepeatWrapping,e})},N.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then(function(r){e[t]=r})},N.prototype.loadMaterial=function(e){this.json;var r,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];r=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[t.KHR_MATERIALS_UNLIT]){var c=n[t.KHR_MATERIALS_UNLIT];r=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{r=a.MeshStandardMaterial;var d=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){var f=d.baseColorFactor;o.color.fromArray(f),o.opacity=f[3]}if(void 0!==d.baseColorTexture&&l.push(this.assignTexture(o,"map",d.baseColorTexture.index)),o.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,o.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture){var h=d.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||S;return p===_?o.transparent=!0:(o.transparent=!1,p===E&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&r!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&r!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&r!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&r!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then(function(){var e;return e=r===a.ShaderMaterial?n[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new r(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e})},N.prototype.loadGeometries=function(e){var r=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then(function(o){for(var s=[],l=0,u=e.length;l1))return A;A.name+="_"+g,s.add(A)}return s})})},N.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},N.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return r.inverseBindMatrices=e,r})},N.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then(function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[t.KHR_LIGHTS]&&void 0!==o.extensions[t.KHR_LIGHTS].light){s=r[t.KHR_LIGHTS].lights[o.extensions[t.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var f=new a.Matrix4;f.fromArray(o.matrix),s.applyMatrix(f)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s})},N.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,d=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,d,f,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,d=4*g,v=new Uint8Array(4),u=new Uint8Array(d);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>d)return t(3,"bad scanline data");if(m)for(l=e[o++],f=0;f0){var w=[];for(var b in v)h=v[b],w[b]=h.name;m="Adding mesh(es) ("+w.length+": "+w+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var A=this.callbacks.onProgress;t.isValid(A)&&A(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,n,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),n=i.materialName,r.name=n;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[n]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var d,f=new a.MaterialLoader;for(n in c)d=c[n],t.isValid(d)&&(r=f.parse(d),this.logging.enabled&&console.info('De-serialized material with name "'+n+'" will be added.'),this.materials[n]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(n in c)r=c[n],this.logging.enabled&&console.info('Material with name "'+n+'" will be added.'),this.materials[n]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),i.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",function(t){e.processMessage(t.data)},!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),i.WorkerSupport=function(){var e="2.2.0",t=i.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(n.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function o(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===n.Worker)throw"This browser does not support web workers!";if(void 0===n.Blob)throw"This browser does not support Blob!";if("function"!=typeof n.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}o.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},o.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},o.prototype.validate=function(e,r,n,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=i.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(s,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var d=this;if(t.isValid(n)&&n.length>0){var f="";!function e(t,r){if(0===r.length)d.loaderWorker.initWorker(f+c,u.name),d.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var n=new a.FileLoader;n.setPath(t),n.setResponseType("text"),n.load(r[0],function(a){f+=a,e(t,r)}),r.shift()}}(o,n)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},o.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},o.prototype.run=function(e){this.loaderWorker.run(e)},o.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var s=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var d="";return t.isValid(n)&&(d+="\n",d+=u+".prototype = Object.create( "+n+".prototype );\n",d+=u+".constructor = "+u+";\n",d+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+d+s+l:(s=e+" = (function () {\n\n",l=(s+=d+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return o}(),i.WorkerDirector=function(){var e="2.2.0",t=i.Validator,r=16,n=8192;function o(a){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=n,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(a))throw"Provided invalid classDef: "+a;this.workerDescription={classDef:a,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return o.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},o.prototype.getMaxQueueSize=function(){return this.maxQueueSize},o.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},o.prototype.setCrossOrigin=function(e){this.crossOrigin=e},o.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},o.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,n),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},o.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var d=c.split(a,3);r[u]=[parseFloat(d[0]),parseFloat(d[1]),parseFloat(d[2])]}else r[u]=c}}var f=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return f.setCrossOrigin(this.crossOrigin),f.setManager(this.manager),f.setMaterials(i),f}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a=t.getTextureParams(r,n),i=t.loadTexture(function(e,t){return"string"!=typeof t||""===t?"":/^https?:\/\//i.test(t)?t:e+t}(t.baseUrl,a.url));i.repeat.copy(a.scale),i.offset.copy(a.offset),i.wrapS=t.wrap,i.wrapT=t.wrap,n[e]=i}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach(function(e){e.geometryNeedsUpdate=!0})}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach(function(e){e.geometryNeedsUpdate=!0})}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9}),jDirection=[firstDirection,secondDirection,axisInIJK].find(function(e){return Math.abs(e.dot(base[1]))>.9}),kDirection=[firstDirection,secondDirection,axisInIJK].find(function(e){return Math.abs(e.dot(base[2]))>.9}),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map(function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)}),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach(function(e){e.repaint()}),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","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() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={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() {","vUv = uv;","gl_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() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={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() {","vUV = uv;","gl_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 ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return 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 ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","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, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","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, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_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 ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{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 a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 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() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_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;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_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 ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,d=r.height,f=0;f","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_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() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var n=r(40);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})});var i=r(48);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var o=r(90);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(112);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var l=r(144);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),d=p(r(37)),f=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=d.default,t.TransformControls=f.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r=function(e){t.deviceOrientation=e},n=function(){t.screenOrientation=window.orientation||0},i=function(){var e=new a.Vector3(0,0,1),t=new a.Euler,r=new a.Quaternion,n=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(a,i,o,s,l){t.set(o,i,-s,"YXZ"),a.setFromEuler(t),a.multiply(n),a.multiply(r.setFromAxisAngle(e,-l))}}();this.connect=function(){n(),window.addEventListener("orientationchange",n,!1),window.addEventListener("deviceorientation",r,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",n,!1),window.removeEventListener("deviceorientation",r,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,o=e.gamma?a.Math.degToRad(e.gamma):0,s=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;i(t.object.quaternion,r,n,o,s)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,d=null,f=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",x,!1),r.addEventListener("touchend",b,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",x,!1),r.removeEventListener("touchend",b,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&f.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void f.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),d!==p&&(f.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",d=p)}else null!==d&&(f.dispatchEvent({type:"hoveroff",object:d}),r.style.cursor="auto",d=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",f.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(f.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&f.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void f.dispatchEvent({type:"drag",object:c})}function x(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var d=o.intersectObjects(e);d.length>0&&(c=d[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",f.dispatchEvent({type:"dragstart",object:c}))}function b(e){e.preventDefault(),c&&(f.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),f.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),f.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),f.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,d=new a.Spherical,f={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(f)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(f)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(f))},this.rotate=function(t){n.copy(e.position).sub(s),d.setFromVector3(n),d.theta+=t.x,d.phi+=t.y,d.makeSafe(),n.setFromSpherical(d),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(f)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",w,!1),t.removeEventListener("touchmove",A,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],x=[new a.Vector3,new a.Vector3,new a.Vector3],b=null;function w(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),b=y[0].distanceTo(y[1])}x[0].copy(y[0]),x[1].copy(y[1])}}function A(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],x)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,b-t)),b=t;var n=y[0].clone().sub(o(y[0],x)),i=y[1].clone().sub(o(y[1],x));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}x[0].copy(y[0]),x[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",w,!1),t.addEventListener("touchmove",A,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,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=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(n),r.update(),l=s.NONE},this.update=function(){var t=new a.Vector3,i=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),o=i.clone().inverse(),m=new a.Vector3,v=new a.Quaternion;return function(){var e=r.object.position;return t.copy(e).sub(r.target),t.applyQuaternion(i),c.setFromVector3(t),r.autoRotate&&l===s.NONE&&S(2*Math.PI/60/60*r.autoRotateSpeed),c.theta+=d.theta,c.phi+=d.phi,c.theta=Math.max(r.minAzimuthAngle,Math.min(r.maxAzimuthAngle,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),c.radius*=f,c.radius=Math.max(r.minDistance,Math.min(r.maxDistance,c.radius)),r.target.add(h),t.setFromSpherical(c),t.applyQuaternion(o),e.copy(r.target).add(t),r.object.lookAt(r.target),!0===r.enableDamping?(d.theta*=1-r.dampingFactor,d.phi*=1-r.dampingFactor,h.multiplyScalar(1-r.dampingFactor)):(d.set(0,0,0),h.set(0,0,0)),f=1,!!(p||m.distanceToSquared(r.object.position)>u||8*(1-v.dot(r.object.quaternion))>u)&&(r.dispatchEvent(n),m.copy(r.object.position),v.copy(r.object.quaternion),p=!1,!0)}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",j,!1),r.domElement.removeEventListener("mousedown",O,!1),r.domElement.removeEventListener("wheel",U,!1),r.domElement.removeEventListener("touchstart",R,!1),r.domElement.removeEventListener("touchend",B,!1),r.domElement.removeEventListener("touchmove",k,!1),document.removeEventListener("mousemove",N,!1),document.removeEventListener("mouseup",I,!1),window.removeEventListener("keydown",D,!1)};var r=this,n={type:"change"},i={type:"start"},o={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},l=s.NONE,u=1e-6,c=new a.Spherical,d=new a.Spherical,f=1,h=new a.Vector3,p=!1,m=new a.Vector2,v=new a.Vector2,g=new a.Vector2,y=new a.Vector2,x=new a.Vector2,b=new a.Vector2,w=new a.Vector2,A=new a.Vector2,M=new a.Vector2;function T(){return Math.pow(.95,r.zoomSpeed)}function S(e){d.theta-=e}function E(e){d.phi-=e}var _=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,0),e.multiplyScalar(-t),h.add(e)}}(),F=function(){var e=new a.Vector3;return function(t,a){!0===r.screenSpacePanning?e.setFromMatrixColumn(a,1):(e.setFromMatrixColumn(a,0),e.crossVectors(r.object.up,e)),e.multiplyScalar(t),h.add(e)}}(),P=function(){var e=new a.Vector3;return function(t,a){var n=r.domElement===document?r.domElement.body:r.domElement;if(r.object.isPerspectiveCamera){var i=r.object.position;e.copy(i).sub(r.target);var o=e.length();o*=Math.tan(r.object.fov/2*Math.PI/180),_(2*t*o/n.clientHeight,r.object.matrix),F(2*a*o/n.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(_(t*(r.object.right-r.object.left)/r.object.zoom/n.clientWidth,r.object.matrix),F(a*(r.object.top-r.object.bottom)/r.object.zoom/n.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function L(e){r.object.isPerspectiveCamera?f/=e:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*e)),r.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function C(e){r.object.isPerspectiveCamera?f*=e:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/e)),r.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function O(e){if(!1!==r.enabled){switch(e.preventDefault(),e.button){case r.mouseButtons.ORBIT:if(!1===r.enableRotate)return;!function(e){m.set(e.clientX,e.clientY)}(e),l=s.ROTATE;break;case r.mouseButtons.ZOOM:if(!1===r.enableZoom)return;!function(e){w.set(e.clientX,e.clientY)}(e),l=s.DOLLY;break;case r.mouseButtons.PAN:if(!1===r.enablePan)return;!function(e){y.set(e.clientX,e.clientY)}(e),l=s.PAN}l!==s.NONE&&(document.addEventListener("mousemove",N,!1),document.addEventListener("mouseup",I,!1),r.dispatchEvent(i))}}function N(e){if(!1!==r.enabled)switch(e.preventDefault(),l){case s.ROTATE:if(!1===r.enableRotate)return;!function(e){v.set(e.clientX,e.clientY),g.subVectors(v,m).multiplyScalar(r.rotateSpeed);var t=r.domElement===document?r.domElement.body:r.domElement;S(2*Math.PI*g.x/t.clientHeight),E(2*Math.PI*g.y/t.clientHeight),m.copy(v),r.update()}(e);break;case s.DOLLY:if(!1===r.enableZoom)return;!function(e){A.set(e.clientX,e.clientY),M.subVectors(A,w),M.y>0?L(T()):M.y<0&&C(T()),w.copy(A),r.update()}(e);break;case s.PAN:if(!1===r.enablePan)return;!function(e){x.set(e.clientX,e.clientY),b.subVectors(x,y).multiplyScalar(r.panSpeed),P(b.x,b.y),y.copy(x),r.update()}(e)}}function I(e){!1!==r.enabled&&(document.removeEventListener("mousemove",N,!1),document.removeEventListener("mouseup",I,!1),r.dispatchEvent(o),l=s.NONE)}function U(e){!1===r.enabled||!1===r.enableZoom||l!==s.NONE&&l!==s.ROTATE||(e.preventDefault(),e.stopPropagation(),r.dispatchEvent(i),function(e){e.deltaY<0?C(T()):e.deltaY>0&&L(T()),r.update()}(e),r.dispatchEvent(o))}function D(e){!1!==r.enabled&&!1!==r.enableKeys&&!1!==r.enablePan&&function(e){switch(e.keyCode){case r.keys.UP:P(0,r.keyPanSpeed),r.update();break;case r.keys.BOTTOM:P(0,-r.keyPanSpeed),r.update();break;case r.keys.LEFT:P(r.keyPanSpeed,0),r.update();break;case r.keys.RIGHT:P(-r.keyPanSpeed,0),r.update()}}(e)}function R(e){if(!1!==r.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===r.enableRotate)return;!function(e){m.set(e.touches[0].pageX,e.touches[0].pageY)}(e),l=s.TOUCH_ROTATE;break;case 2:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){if(r.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+a*a);w.set(0,n)}if(r.enablePan){var i=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(i,o)}}(e),l=s.TOUCH_DOLLY_PAN;break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(i)}}function k(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===r.enableRotate)return;if(l!==s.TOUCH_ROTATE)return;!function(e){v.set(e.touches[0].pageX,e.touches[0].pageY),g.subVectors(v,m).multiplyScalar(r.rotateSpeed);var t=r.domElement===document?r.domElement.body:r.domElement;S(2*Math.PI*g.x/t.clientHeight),E(2*Math.PI*g.y/t.clientHeight),m.copy(v),r.update()}(e);break;case 2:if(!1===r.enableZoom&&!1===r.enablePan)return;if(l!==s.TOUCH_DOLLY_PAN)return;!function(e){if(r.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+a*a);A.set(0,n),M.set(0,Math.pow(A.y/w.y,r.zoomSpeed)),L(M.y),w.copy(A)}if(r.enablePan){var i=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);x.set(i,o),b.subVectors(x,y).multiplyScalar(r.panSpeed),P(b.x,b.y),y.copy(x)}r.update()}(e);break;default:l=s.NONE}}function B(e){!1!==r.enabled&&(r.dispatchEvent(o),l=s.NONE)}function j(e){!1!==r.enabled&&e.preventDefault()}r.domElement.addEventListener("contextmenu",j,!1),r.domElement.addEventListener("mousedown",O,!1),r.domElement.addEventListener("wheel",U,!1),r.domElement.addEventListener("touchstart",R,!1),r.domElement.addEventListener("touchend",B,!1),r.domElement.addEventListener("touchmove",k,!1),window.addEventListener("keydown",D,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,d=new a.Vector2,f=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var b=function(){var e=new a.Vector2;return function(t,a){return e.set((t-r.screen.left)/r.screen.width,(a-r.screen.top)/r.screen.height),e}}(),w=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function A(e){!1!==r.enabled&&(window.removeEventListener("keydown",A),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function M(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",A,!1))}function T(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(b(e.pageX,e.pageY)),v.copy(m)):(d.copy(b(e.pageX,e.pageY)),f.copy(d)):(u.copy(w(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",S,!1),document.addEventListener("mouseup",E,!1),r.dispatchEvent(y))}function S(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(b(e.pageX,e.pageY)):f.copy(b(e.pageX,e.pageY)):c.copy(w(e.pageX,e.pageY)))}function E(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E),r.dispatchEvent(x))}function _(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),d.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(x))}function F(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(w(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(b(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function P(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(w(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(b(i,s));break;default:o=n.NONE}}function L(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(w(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(b(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(x)}}function C(e){e.preventDefault()}this.rotateCamera=function(){var e=new a.Vector3,t=new a.Quaternion;return function(){var a=Math.acos(u.dot(c)/u.length()/c.length());a&&(e.crossVectors(u,c).normalize(),a*=r.rotateSpeed,t.setFromAxisAngle(e,-a),l.applyQuaternion(t),r.object.up.applyQuaternion(t),c.applyQuaternion(t),r.staticMoving?u.copy(c):(t.setFromAxisAngle(e,a*(r.dynamicDampingFactor-1)),u.applyQuaternion(t)),i=!0)}}(),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(f.y-d.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?d.copy(f):d.y+=(f.y-d.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=function(){var e=new a.Vector2,t=new a.Vector3,n=new a.Vector3;return function(){if(e.copy(v).sub(m),e.lengthSq()){var a=(r.object.right-r.object.left)/r.object.zoom,o=(r.object.top-r.object.bottom)/r.object.zoom;e.x*=a,e.y*=o,n.copy(l).cross(r.object.up).setLength(e.x),n.add(t.copy(r.object.up).setLength(e.y)),r.object.position.add(n),r.target.add(n),r.staticMoving?m.copy(v):m.add(e.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}}(),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",C,!1),this.domElement.removeEventListener("mousedown",T,!1),this.domElement.removeEventListener("wheel",_,!1),this.domElement.removeEventListener("touchstart",F,!1),this.domElement.removeEventListener("touchend",L,!1),this.domElement.removeEventListener("touchmove",P,!1),document.removeEventListener("mousemove",S,!1),document.removeEventListener("mouseup",E,!1),window.removeEventListener("keydown",A,!1),window.removeEventListener("keyup",M,!1)},this.domElement.addEventListener("contextmenu",C,!1),this.domElement.addEventListener("mousedown",T,!1),this.domElement.addEventListener("wheel",_,!1),this.domElement.addEventListener("touchstart",F,!1),this.domElement.addEventListener("touchend",L,!1),this.domElement.addEventListener("touchmove",P,!1),window.addEventListener("keydown",A,!1),window.addEventListener("keyup",M,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i=Math.PI/2,o=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,o=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*o,r.rotation.x=Math.max(-i,Math.min(i,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",o,!1)},document.addEventListener("mousemove",o,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=function(){var e=new a.Vector3(0,0,-1),t=new a.Euler(0,0,0,"YXZ");return function(a){return t.set(r.rotation.x,n.rotation.y,0),a.copy(e).applyEuler(t),a}}()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,d=new a.Vector3,f=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var x={type:"change"},b={type:"start"},w={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var A=function(){var e=new a.Vector2;return function(t,a){return e.set((t-r.screen.left)/r.screen.width,(a-r.screen.top)/r.screen.height),e}}(),M=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function T(e){!1!==r.enabled&&(window.removeEventListener("keydown",T),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function S(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",T,!1))}function E(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(A(e.pageX,e.pageY)),y.copy(g)):(h.copy(A(e.pageX,e.pageY)),p.copy(h)):(c.copy(M(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",_,!1),document.addEventListener("mouseup",F,!1),r.dispatchEvent(b))}function _(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(A(e.pageX,e.pageY)):p.copy(A(e.pageX,e.pageY)):(u.copy(c),c.copy(M(e.pageX,e.pageY))))}function F(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",F),r.dispatchEvent(w))}function P(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(b),r.dispatchEvent(w)}}function L(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(M(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(A(i,s)),y.copy(g)}r.dispatchEvent(b)}}function C(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(M(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(A(n,i))}}function O(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(M(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(w)}}function N(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=function(){var e,t=new a.Vector3,n=new a.Quaternion,i=new a.Vector3,o=new a.Vector3,s=new a.Vector3,h=new a.Vector3;return function(){h.set(c.x-u.x,c.y-u.y,0),(e=h.length())?(l.copy(r.object.position).sub(r.target),i.copy(l).normalize(),o.copy(r.object.up).normalize(),s.crossVectors(o,i).normalize(),o.setLength(c.y-u.y),s.setLength(c.x-u.x),h.copy(o.add(s)),t.crossVectors(h,l).normalize(),e*=r.rotateSpeed,n.setFromAxisAngle(t,e),l.applyQuaternion(n),r.object.up.applyQuaternion(n),d.copy(t),f=e):!r.staticMoving&&f&&(f*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),n.setFromAxisAngle(d,f),l.applyQuaternion(n),r.object.up.applyQuaternion(n)),u.copy(c)}}(),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=function(){var e=new a.Vector2,t=new a.Vector3,n=new a.Vector3;return function(){e.copy(y).sub(g),e.lengthSq()&&(e.multiplyScalar(l.length()*r.panSpeed),n.copy(l).cross(r.object.up).setLength(e.x),n.add(t.copy(r.object.up).setLength(e.y)),r.object.position.add(n),r.target.add(n),r.staticMoving?g.copy(y):g.add(e.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}}(),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(x),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(x),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",N,!1),this.domElement.removeEventListener("mousedown",E,!1),this.domElement.removeEventListener("wheel",P,!1),this.domElement.removeEventListener("touchstart",L,!1),this.domElement.removeEventListener("touchend",O,!1),this.domElement.removeEventListener("touchmove",C,!1),document.removeEventListener("mousemove",_,!1),document.removeEventListener("mouseup",F,!1),window.removeEventListener("keydown",T,!1),window.removeEventListener("keyup",S,!1)},this.domElement.addEventListener("contextmenu",N,!1),this.domElement.addEventListener("mousedown",E,!1),this.domElement.addEventListener("wheel",P,!1),this.domElement.addEventListener("touchstart",L,!1),this.domElement.addEventListener("touchend",O,!1),this.domElement.addEventListener("touchmove",C,!1),window.addEventListener("keydown",T,!1),window.addEventListener("keyup",S,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse(function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}})},this.highlight=function(e){this.traverse(function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))})}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse(function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)})};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,d=new a.Quaternion,f=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse(function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(d.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,d),e.quaternion.copy(o)),"Z"===e.name&&(f.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,f),e.quaternion.copy(o))})},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var d=u[c];d.visible=c===n,this.add(d)}var f={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,x=new a.Vector3,b=new a.Vector3,w=new a.Vector3,A=1,M=new a.Matrix4,T=new a.Vector3,S=new a.Matrix4,E=new a.Vector3,_=new a.Quaternion,F=new a.Vector3(1,0,0),P=new a.Vector3(0,1,0),L=new a.Vector3(0,0,1),C=new a.Quaternion,O=new a.Quaternion,N=new a.Quaternion,I=new a.Quaternion,U=new a.Quaternion,D=new a.Vector3,R=new a.Vector3,k=new a.Matrix4,B=new a.Matrix4,j=new a.Vector3,V=new a.Vector3,G=new a.Euler,z=new a.Matrix4,X=new a.Vector3,H=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=K(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(f))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=K(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),T.copy(X).sub(V).normalize(),u[n].setActivePlane(r.axis,T);var i=K(t,[u[n].activePlane]);i&&(D.copy(r.object.position),R.copy(r.object.scale),k.extractRotation(r.object.matrix),z.extractRotation(r.object.matrixWorld),B.extractRotation(r.object.parent.matrixWorld),j.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),x.copy(i.point))}}l=!0}}function Q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=K(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(x),y.multiply(j),"local"===r.space&&(y.applyMatrix4(S.getInverse(z)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(k),r.object.position.copy(D),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(B)),r.object.position.copy(D),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(z)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(z))):"scale"===n?(y.sub(x),y.multiply(j),"local"===r.space&&("XYZ"===r.axis?(A=1+y.y/Math.max(R.x,R.y,R.z),r.object.scale.x=R.x*A,r.object.scale.y=R.y*A,r.object.scale.z=R.z*A):(y.applyMatrix4(S.getInverse(z)),"X"===r.axis&&(r.object.scale.x=R.x*(1+y.x/R.x)),"Y"===r.axis&&(r.object.scale.y=R.y*(1+y.y/R.y)),"Z"===r.axis&&(r.object.scale.z=R.z*(1+y.z/R.z))))):"rotate"===n&&(y.sub(V),y.multiply(j),E.copy(x).sub(V),E.multiply(j),"E"===r.axis?(y.applyMatrix4(S.getInverse(M)),E.applyMatrix4(S.getInverse(M)),b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),_.setFromRotationMatrix(S.getInverse(B)),U.setFromAxisAngle(T,b.z-w.z),C.setFromRotationMatrix(z),_.multiplyQuaternions(_,U),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_)):"XYZE"===r.axis?(U.setFromEuler(y.clone().cross(E).normalize()),_.setFromRotationMatrix(S.getInverse(B)),O.setFromAxisAngle(U,-y.clone().angleTo(E)),C.setFromRotationMatrix(z),_.multiplyQuaternions(_,O),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_)):"local"===r.space?(y.applyMatrix4(S.getInverse(z)),E.applyMatrix4(S.getInverse(z)),b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),C.setFromRotationMatrix(k),null!==r.rotationSnap?(O.setFromAxisAngle(F,Math.round((b.x-w.x)/r.rotationSnap)*r.rotationSnap),N.setFromAxisAngle(P,Math.round((b.y-w.y)/r.rotationSnap)*r.rotationSnap),I.setFromAxisAngle(L,Math.round((b.z-w.z)/r.rotationSnap)*r.rotationSnap)):(O.setFromAxisAngle(F,b.x-w.x),N.setFromAxisAngle(P,b.y-w.y),I.setFromAxisAngle(L,b.z-w.z)),"X"===r.axis&&C.multiplyQuaternions(C,O),"Y"===r.axis&&C.multiplyQuaternions(C,N),"Z"===r.axis&&C.multiplyQuaternions(C,I),r.object.quaternion.copy(C)):"world"===r.space&&(b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),_.setFromRotationMatrix(S.getInverse(B)),null!==r.rotationSnap?(O.setFromAxisAngle(F,Math.round((b.x-w.x)/r.rotationSnap)*r.rotationSnap),N.setFromAxisAngle(P,Math.round((b.y-w.y)/r.rotationSnap)*r.rotationSnap),I.setFromAxisAngle(L,Math.round((b.z-w.z)/r.rotationSnap)*r.rotationSnap)):(O.setFromAxisAngle(F,b.x-w.x),N.setFromAxisAngle(P,b.y-w.y),I.setFromAxisAngle(L,b.z-w.z)),C.setFromRotationMatrix(z),"X"===r.axis&&_.multiplyQuaternions(_,O),"Y"===r.axis&&_.multiplyQuaternions(_,N),"Z"===r.axis&&_.multiplyQuaternions(_,I),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_))),r.update(),r.dispatchEvent(f),r.dispatchEvent(m))}}function q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(f)):Y(e))}function K(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",Q,!1),t.addEventListener("touchmove",Q,!1),t.addEventListener("mouseup",q,!1),t.addEventListener("mouseout",q,!1),t.addEventListener("touchend",q,!1),t.addEventListener("touchcancel",q,!1),t.addEventListener("touchleave",q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",Q),t.removeEventListener("touchmove",Q),t.removeEventListener("mouseup",q),t.removeEventListener("mouseout",q),t.removeEventListener("touchend",q),t.removeEventListener("touchcancel",q),t.removeEventListener("touchleave",q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(f)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(f)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(f)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),G.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),X.setFromMatrixPosition(e.matrixWorld),H.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),A=V.distanceTo(X)/6*r.size,this.position.copy(V),this.scale.set(A,A,A),e instanceof a.PerspectiveCamera?T.copy(X).sub(V).normalize():e instanceof a.OrthographicCamera&&T.copy(X).normalize(),"local"===r.space?u[n].update(G,T):"world"===r.space&&u[n].update(new a.Euler,T),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")}).catch(function(){console.warn("THREE.VRControls: Unable to get VR Displays")}),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],d=[],f=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every(function(e,r){return e===t[r]})}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function T(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],d=[],f={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var x=[],w=[],A={};if(void 0!==e.morphTargetDictionary)for(var T in e.morphTargetDictionary)A[e.morphTargetDictionary[T]]=T;for(var S=0;S0&&(s.extras={},s.extras.targetNames=w)}var O=r.forceIndices,N=Array.isArray(e.material);if(N&&0===e.geometry.groups.length)return null;!O&&null===i.index&&N&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),O=!0);var I=!1;if(null===i.index&&O){for(var U=[],D=(S=0,i.attributes.position.count);S0&&(B.targets=d),null!==i.index&&(B.indices=b(i.index,i,k[S].start,k[S].count));var j=M(R[k[S].materialIndex]);null!==j&&(B.material=j),c.push(B)}return I&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function S(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=T(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,d=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return f.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),d=new window.FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){t(d.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)})}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(w):w}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,d=new a.Vector3,f=new a.Vector3,h=new a.Vector2,p=[];return e.traverse(function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var x=g.getAttribute("position"),b=g.getAttribute("normal"),w=g.getAttribute("uv"),A=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==x)for(t=0,i=x.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))},r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i}),o=r(e.materials,function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t});return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function I(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=I(e.children[r],t);if(a)return a}}function U(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=O(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function D(){this.mNumIndices=0,this.mIndices=[]}function R(){this.data=[],this.toString=function(){var e="";return this.data.forEach(function(t){e+=String.fromCharCode(t)}),e.replace(/[^\x20-\x7E]+/g,"")}}function k(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}},r=new DataView(e);if(function(e){e.readOffset=0,e.Seek=function(t,r){r==Fe&&(e.readOffset+=t),r==Pe&&(e.readOffset=t)},e.ReadBytes=function(e,t,r){for(var a=t*r,n=0;n0,_e=re(r)>0,Ee)throw"Shortened binaries are not supported!";if(r.Seek(256,Fe),r.Seek(128,Fe),r.Seek(64,Fe),!_e)return Se(r,t),t.toTHREE();var a=ne(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Se(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,function(e){t(i.parse(e))},r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,function(e){t(i.parse(JSON.parse(e)))},r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function w(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function M(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),d.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(d,f)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function ce(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(d=0,f=n.length;d=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ve(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,e>>16&255,e>>24&255)}(f)),r;h=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var p=d[28];if(r.isCubemap=!!(512&p),r.isCubemap&&(!(1024&p)||!(2048&p)||!(4096&p)||!(8192&p)||!(16384&p)||!(32768&p)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var m=d[1]+4,v=r.isCubemap?6:1,g=0;g>1,1),x=Math.max(x>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,function(e){i.decodeDracoFile(e,t)},r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then(function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})})},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var d=r.num_points()*u;s[a]=new Float32Array(d);for(var f=0;f0&&console.log("Number of faces loaded: "+c.toString())):c=0;var f=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+f.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var x=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==x){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var b=t.GetAttribute(o,x);this.addAttributeToGeometry(e,t,o,y,b,g,v)}}for(var y in i){var w=i[y];b=t.GetAttributeByUniqueId(o,w);this.addAttributeToGeometry(e,t,o,y,b,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var A=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,A);v.indices=new Uint32Array(A.size());for(var M=0;M65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var _=new e.AttributeQuantizationTransform;if(_.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=_.range(),g.attributes.position.numQuantizationBits=_.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(M=0;M<3;++M)g.attributes.position.minValues[M]=_.min_value(M)}return e.destroy(_),e.destroy(t),e.destroy(o),this.decode_time=d-l,this.import_time=performance.now()-d,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then(function(r){t(r.decoder.isVersionSupported(e))})},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then(function(){return i._loadArrayBuffer(r.wasmBinaryFile)}).then(function(e){r.wasmBinary=e})),n=n.then(function(){return new Promise(function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)})}),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise(function(e){a.onload=e,r.appendChild(a)})},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise(function(r,a){t.load(e,r,void 0,a)})},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,f,h,e,d);var p=v.l;if(f=v.c,h=v.lc,s[n]=p,p==u){if(d.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,f,h,e,d);var m=v.l+c;if(f=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function b(e){return 63&e}function w(e){return e>>6}var A={c:0,lc:0};function M(e,t,r,a){e=e<<8|U(r,a),t+=8,A.c=e,A.lc=t}var T={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(M(r,a,n,o),r=A.c,a=A.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var d=out[-1];c-- >0;)s[l.value++]=d}else{if(!(l.value32767?t-65536:t}var _={a:0,b:0};function F(e,t){var r=E(e),a=E(t),n=r+(1&a)+(a>>1),i=n,o=n-a;_.a=i,_.b=o}function P(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,d,f,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,x=a*s;p<=m;p+=g){for(var b=p,w=p+a*(r-s);b<=w;b+=x){var A=b+y,M=(T=b+v)+y;F(t[b+e],t[T+e]),c=_.a,f=_.b,F(t[A+e],t[M+e]),d=_.a,h=_.b,F(c,d),t[b+e]=_.a,t[A+e]=_.b,F(f,h),t[T+e]=_.a,t[M+e]=_.b}if(r&u){var T=b+v;F(t[b+e],t[T+e]),c=_.a,t[T+e]=_.b,t[b+e]=c}}if(n&u)for(b=p,w=p+a*(r-s);b<=w;b+=x){A=b+y;F(t[b+e],t[A+e]),c=_.a,t[A+e]=_.b,t[b+e]=c}s=u,u>>=1}return p}function L(e,t,r,a,l,u,c){var d=r.value,f=I(t,r),h=I(t,r);r.value+=4;var p=I(t,r);if(r.value+=4,f<0||f>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-d)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=w(e[t]),o=b(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;)if((x=t[f>>h-n&s]).len)h-=x.len,S(x.lit,l,f,h,r,0,i,c,d,p),f=T.c,h=T.lc;else{if(!x.p)throw"hufDecode issues";var v;for(v=0;v=g&&w(e[x.p[v]])==(f>>h-g&(1<>=y,h-=y;h>0;){var x;if(!(x=t[f<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function B(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function j(e,t){return k(B(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,d=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach(function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}}),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(d),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach(function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}}),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var f=new n.Float32BufferAttribute(l.normal,3),h=(new n.Matrix3).getNormalMatrix(i);h.applyToBufferAttribute(f),o.addAttribute("normal",f)}if(l.uvs.forEach(function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))}),s.material&&"AllSame"!==s.material.mappingType){var p=l.materialIndex[0],m=0;if(l.materialIndex.forEach(function(e,t){e!==p&&(o.addGroup(m,t-m,p),p=e,m=t)}),o.groups.length>0){var v=o.groups[o.groups.length-1],g=v.start+v.count;g!==l.materialIndex.length&&o.addGroup(g,l.materialIndex.length-g,p)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){null!==a&&(t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach(function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],d=0;d4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],x=[0,0,0,0];v.forEach(function(e,t){var r=e,a=m[t];x.forEach(function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}})}),m=y,v=x}for(;v.length<4;)v.push(0),m.push(0);for(var b=0;b<4;++b)u.push(v[b]),c.push(m[b])}if(e.normal){g=h(f,r,d,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var w=h(f,r,d,e.material)[0];e.uv&&e.uv.forEach(function(e,t){var a=h(f,r,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])}),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=t.length&&t===O(e,0,t.length)}(e))o=(new E).parse(e);else{var c=O(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;function a(t){var a=e[t-1];return e=e.slice(r+t),r++,a}for(var n=0;n0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var d=r[s];void 0!==a[d]?r[s]=a[d]:r[s]=r[s].split("\\").pop()}return r}(o),h=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),f,d),d),w=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var d={id:i};d.rawTargets=l(u,o,n,t),d.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),d.parentGeoID=u.parents[0].ID,a[i]=d}}}return{skeletons:r,morphTargets:a}}(o,d),A=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,d,w);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],d=i.get(u),f=p(d,t,u,c.attrName);if(!f){switch(c.attrType){case"Camera":f=m(e,d);break;case"Light":f=v(e,d);break;case"Mesh":f=g(e,d,r,a);break;case"NurbsCurve":f=y(d,r);break;case"LimbNode":case"Null":default:f=new n.Group}f.name=n.PropertyBinding.sanitizeNodeName(c.attrName),f.ID=u}x(e,f,c),o.set(u,f)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach(function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){var o=a.get(t.ID).children;o.forEach(function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}})}}(e,r,a,t,o),t.get(r.ID).parents.forEach(function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)}),null===r.parent&&o.add(r)}),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach(function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)}):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s],u=i.get(parseInt(l.ID)).parents;u.forEach(function(e){if(r.has(e.ID)){var t=e.ID,s=i.get(t);s.parents.forEach(function(e){if(a.has(e.ID)){var t=a.get(e.ID);t.bind(new n.Skeleton(l.bones),o[e.ID])}})}})}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0!==e.Objects.AnimationCurve){var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(L),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l){var u=l.children;u.forEach(function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach(function(e){void 0!==e.relationship&&(l=e.ID)});var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}}),i.set(parseInt(o),s)}}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}}(e,t);if(void 0!==a)for(var i in a){var o=a[i],s=b(o);r.animations.push(s)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,d,w.skeletons,A,h)}});var f=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach(function(e){e.vertexColors=n.VertexColors}),o.FBX_Deformer?(l.forEach(function(e){e.skinning=!0}),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce(function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e},null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function x(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function b(e){var t=[];return e.layer.forEach(function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=w(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(T(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(T(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(T(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=M(t),o=A(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=w(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))}),new n.AnimationClip(e.name,-1,t)}function w(e,t,r,a){var i=M(t),o=A(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function A(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach(function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])}),n}function M(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort(function(e,t){return e-t}).filter(function(e,t,r){return r.indexOf(e)==t})}function T(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,d=[],f=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",d=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var f=this.parseNode(e,t);null!==f&&this.parseSubNode(o,r,f)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==d&&(r.attrType=d),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach(function(e,t){0!==t&&n.push(e)}),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach(function(e){t[e]=r[e]})}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new _(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(_.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(F.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,function(e){t(i.parse(e))},r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,t){void 0===n&&s(e),v.extruding?(n.vertex.push(e.x,e.y,e.z),n.vertex.push(t.x,t.y,t.z)):(n.pathVertex.push(e.x,e.y,e.z),n.pathVertex.push(t.x,t.y,t.z))}function u(e,r){return t.relative?r:r-e}function c(e,r){return t.relative?e+r:r}o.name="extruded";for(var d=e.replace(/;.+/g,"").split("\n"),f=0;f0&&(v.extruding=u(t.e,v.e)>0,void 0!=n&&v.z==n.z||s(v)),l(t,v),t=v}else if("G2"===p||"G3"===p)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===p)t.relative=!1;else if("G91"===p)t.relative=!0;else if("G92"===p){(v=t).x=void 0!==m.x?m.x:v.x,v.y=void 0!==m.y?m.y:v.y,v.z=void 0!==m.z?m.z:v.z,v.e=void 0!==m.e?m.e:v.e,t=v}else console.warn("THREE.GCodeLoader: Command not supported:"+p)}function g(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+f,y.add(n)}var y=new a.Group;if(y.name="gcode",this.splitLayer)for(f=0;f>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new a.CubeTexture;l.type=e,l.encoding=e===a.UnsignedByteType?a.RGBEEncoding:a.LinearEncoding,l.format=e===a.UnsignedByteType?a.RGBAFormat:a.RGBFormat,l.minFilter=l.encoding===a.RGBEEncoding?a.NearestFilter:a.LinearFilter,l.magFilter=l.encoding===a.RGBEEncoding?a.NearestFilter:a.LinearFilter,l.generateMipmaps=l.encoding!==a.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function d(r,n,i,d){var f=new a.FileLoader(this.manager);f.setResponseType("arraybuffer"),f.load(t[r],function(t){c++;var i=u._parser(t);if(i){if(e===a.FloatType){for(var d=i.data.length/4*3,f=new Float32Array(d),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))},r,a)}()},o.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,function(e){o.setBuffer(e),t(o,i)},r,n)},o.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,function(e){t(i.parseVpd(e))},r,a)},o.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},o.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},o.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},o.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},o.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},o.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},o.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},o.prototype.pourVmdIntoCamera=function(e,t,r){var n=new o.DataCreationHelper;!function(){for(var i=n.createOrderedMotionArray(t.cameras),s=[],l=[],u=[],c=[],d=[],f=[],h=[],p=[],m=[],v=new a.Quaternion,g=new a.Euler,y=new a.Vector3,x=new a.Vector3,b=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},w=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z),e.push(t.w)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},M=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var s=n.length/r.length,l=3===s?12:4,u=1,c=2,d=r.length;cu){for(r[u]=r[c],f=0;f=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l);t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;d.width=r,d.height=n,f.clearRect(0,0,r,n),f.translate(r/2,n/2),f.rotate(.5*Math.PI),f.translate(-r/2,-n/2),f.drawImage(t,0,0),e.image=f.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(w.push(b.slice(0,A)),w.push(b.slice(A+1))):w.push(b);for(var M=0;M=0||T.indexOf(".spa")>=0?(x.envMap=m(T,{sphericalReflectionMapping:!0}),T.indexOf(".sph")>=0?x.envMapType=a.MultiplyOperation:x.envMapType=a.AddOperation):x.map=m(T)}}else{if(-1!==y.textureIndex){var T=e.textures[y.textureIndex];x.map=m(T)}-1===y.envTextureIndex||1!==y.envFlag&&2!=y.envFlag||(T=e.textures[y.envTextureIndex],x.envMap=m(T,{sphericalReflectionMapping:!0}),1===y.envFlag?x.envMapType=a.MultiplyOperation:x.envMapType=a.AddOperation)}var S=void 0===x.map?1:.2;x.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(x)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&_.flag)?a.DoubleSide:E.side,y.transparent=E.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==E.map&&(y.faceOffset=E.faceOffset,y.faceNum=E.faceNum,y.map=v(E.map,l),function(e){e.map.readyCallbacks.push(function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:function(){var e=new a.Quaternion;return function(){for(var t=0;t0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)});for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,o=!0,s={};var l=function(e,a){void 0!==a&&null!==a||(a=1);var n=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,n=2;break;case"sshort":s=Int16Array,n=2;break;case"uint":s=Uint32Array,n=4;break;case"sint":s=Int32Array,n=4;break;case"float":s=Float32Array,n=4;break;case"complex":case"double":s=Float64Array,n=8}var l=new s(t.slice(r,r+=a*n));return i!=o&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,n)),1==a?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,d=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),d=this.parseVertexIndex(t,u),f=this.parseVertexIndex(r,u);if(this.addVertex(c,d,f),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),d=this.parseUVIndex(n,h),f=this.parseUVIndex(i,h),this.addUV(c,d,f)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),d=o===s?c:this.parseNormalIndex(s,p),f=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,d,f)}this.colors.length>0&&this.addColor(c,d,f)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var x=y.split("/");m.push(x)}}var b=m[0];for(v=1,g=m.length-1;v1){var C=u[1].trim().toLowerCase();i.object.smooth="0"!==C&&"off"!==C}else i.object.smooth=!0;(H=i.object.currentMaterial())&&(H.smooth=i.object.smooth)}i.finalize();var O=new a.Group;O.materialLibraries=[].concat(i.materialLibraries);for(d=0,f=i.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(k=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var j,V=[],G=0,z=U.length;G1){for(G=0,z=U.length;Gd){d=f;var r='Download of "'+e.url+'": '+(100*f).toFixed(2)+"%";u.onProgress("progressLoad",r,f)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)},e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder(function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)});if(r.setCallbackProgress(function(e,t){a.onProgress("progressParse",e,t)}),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate(function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)},"Parser"),this.workerSupport.setCallbacks(function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)},i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),d=a.rawMesh.subGroupInUse.uvs;d.push(a.uvs[c++]),d.push(a.uvs[c])}if(r){var f=parseInt(r),h=3*(f>0?f-1:f+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var d=null;return r.length>0&&(d={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),d},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,d=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,f=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(f),v=[],g=t.length>1,y=0,x=[],b=[],w=0,A=0,M=0,T=0,S=0,E=0,_=0;for(var F in t)if(t.hasOwnProperty(F)){if(c=(a=t[F]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var P=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[P],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+P+'".'),(c=P)===u&&(l=s,u=P)}if(!n.default.Validator.isValid(l)){var L={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},C={cmd:"materialData",materials:{materialCloneInstructions:L}};this.callbackMeshBuilder(C),this.useAsync&&(this.materials[u]=L)}if(g?((i=x[u])||(i=y,x[u]=y,v.push(u),y++),o={start:E,count:_=this.useIndices?a.indices.length:a.vertices.length/3,index:i},b.push(o),E+=_):v.push(u),r.set(a.vertices,w),w+=a.vertices.length,d&&(d.set(a.indices,A),A+=a.indices.length),f&&(f.set(a.colors,M),M+=a.colors.length),h&&(h.set(a.normals,T),T+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var O=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",N="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+O+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(N)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:b},buffers:{vertices:r,indices:d,colors:f,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,function(t){e.content=t,u(c.parse(t))},this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,function(r){t(i.parse(r,e))},r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map(function(e){return parseInt(e,10)})),null!==t.count)t.count=t.count[1].split(" ").map(function(e){return parseInt(e,10)});else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),x=t.split("").reverse().join("");return x=(x=/([^\/]*)/.exec(x))[1].split("").reverse().join(""),y.name=x,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,function(e){t(i.parse(e))},r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(f.push([y-1,r-1,1]),p[a]=f.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},d=[],f=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,f);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,d=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],d=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),d=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==d)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var f,h,p,m,v,g,y,x,b=8,w={};for(x=0;x>7&1,m=1+(n>>4&3),b++,g=i(e,v=r[15&n],b=4*Math.ceil(b/4),m*c,l),b+=v.BYTES_PER_ELEMENT*m*c,w[f]={type:p,cardinality:m,values:g}}return b=4*Math.ceil(b/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,b,d,l)),{version:a,attributes:w,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=f,e.numMipmaps=u+1,e.isCubemap=6===f,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,d=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var f=0;f>f,p=e.height>>f;d=p/u,(c=h/l)<2&&(c=2),d<2&&(d=2),s=c*d*t;for(var m=0;m>5&31)/31,n=(A>>10&31)/31):(t=o,r=s,n=l)}for(var M=1;M<=3;M++){var T=y+12*M;m.push(c.getFloat32(T,!0)),m.push(c.getFloat32(T+4,!0)),m.push(c.getFloat32(T+8,!0)),v.push(x,b,w),f&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),f&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(t):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],d=new a.Vector3;null!==(t=n.exec(e));){for(var f=0,h=0,p=t[0];null!==(t=l.exec(p));)d.x=parseFloat(t[1]),d.y=parseFloat(t[2]),d.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(d.x,d.y,d.z),f++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==f&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}(function(e){return"string"!=typeof e?a.LoaderUtils.decodeText(new Uint8Array(e)):e}(e))}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,function(e){t(i.parse(e))},r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,d=Math.cos(n)*u+Math.sin(n)*c,f=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=d*d,v=f*f,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var x=h*v+p*m,b=(h*p-x)/x,w=Math.sqrt(Math.max(0,b));i===o&&(w=-w);var A=w*t*f/a,M=-w*a*d/t,T=Math.cos(n)*A-Math.sin(n)*M+(s.x+l.x)/2,S=Math.sin(n)*A+Math.cos(n)*M+(s.y+l.y)/2,E=r(1,0,(d-A)/t,(f-M)/a),_=r((d-A)/t,(f-M)/a,(-d-A)/t,(-f-M)/a)%(2*Math.PI);e.currentPath.absellipse(T,S,t,a,E,E+_,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,x=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,x=!0;break;case n:x=!0}var b=document.createElement("canvas");b.width=v.width,b.height=v.height;var w=b.getContext("2d"),A=w.createImageData(v.width,v.height),M=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,d;i=new Uint8Array(s);for(var f=0,h=new Uint8Array(o);f>u){default:case f:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case d:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(x)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,d=0,f=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,d++)l=s[d],e[4*(u+f*c)+0]=l,e[4*(u+f*c)+1]=l,e[4*(u+f*c)+2]=l,e[4*(u+f*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+d*u)+0]=s[c+0],e[4*(l+d*u)+1]=s[c+0],e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,d,f=l,h=0,p=v.width;for(d=t;d!==a;d+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*d)+3]=255,e[4*(c+p*d)+2]=f[3*u+0],e[4*(c+p*d)+1]=f[3*u+1],e[4*(c+p*d)+0]=f[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,d=0,f=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,d+=2)l=s[d+0]+(s[d+1]<<8),e[4*(u+f*c)+0]=(31744&l)>>7,e[4*(u+f*c)+1]=(992&l)>>2,e[4*(u+f*c)+2]=(31&l)>>3,e[4*(u+f*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+d*u)+3]=255,e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+1]=s[c+1],e[4*(l+d*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+1]=s[c+1],e[4*(l+d*u)+0]=s[c+2],e[4*(l+d*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(A.data,v.width,v.height,M.pixel_data,M.palettes);return w.putImageData(A,0,0),b}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,function(e){t(i.parse(e))},r,n)},parse:function(e){function t(e){var t,r=[];e.forEach(function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)});var a=[];return r.forEach(function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}}),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var f=0;f0&&this.indexes.push(c),c=[]):c.push(parseInt(i[f])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(f=0;f-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,d=void 0!==o.intensity?o.intensity:1,f=new a.Color;if(o.color&&f.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(f,d)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(f,d,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){d=1,h=0;var p=Math.PI/3;c=!0,void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(f,d,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,x=new a.SphereBufferGeometry(y,20,20),b=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(x,y,o.skyAngle,o.skyColor,!0),b.vertexColors=a.VertexColors;else{var w=o.skyColor[0];b.color.setRGB(w.r,w.b,w.g)}if(n.add(new a.Mesh(x,b)),void 0!==o.groundColor){y=12e3;var A=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),M=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(A,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(A,M))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType)g=o.size,s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z);else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var T,S,E,_,F,P=new a.BufferGeometry,L=[],C=[];for(j=0,E=o.children.length;j-1){var O=/DEF\s+([^\s]+)/.exec(V.string)[1];i[O]=L.slice(0)}V.string.indexOf("USE")>-1&&(W=/USE\s+([^\s]+)/.exec(V.string)[1],L=i[W])}}var N=0;if(o.coordIndex){var I=[],U=[];for(T=new a.Vector3,S=new a.Vector2,j=0,E=o.coordIndex.length;j=3&&N0&&P.addAttribute("uv",new a.Float32BufferAttribute(C,2)),P.computeVertexNormals(),P.computeBoundingSphere(),/DEF/.exec(o.string)&&(P.name=/DEF ([^\s]+)/.exec(o.string)[1],i[P.name]=P),s.geometry=P}return}if(/appearance/.exec(o.string)){for(var j=0;j>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(d+p),l[s++]=n[2]*(f+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],d=u,f=new Float32Array(o*c),h=0;h>1^-(1&d);l[c]+=f,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],d=a[8*r],f=a[8*r+1],h=a[8*r+2];l-=i,d-=i,i=(u-=o)*(h-=s)-(c-=s)*(f-=o),o=c*d-l*h,s=l*f-u*d,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],d=t.codeRange[0],f=3*t.codeRange[2],h=new Uint16Array(f),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,x=0,b=0;b>1^-(1&L))+v[o*M+P]+v[o*T+P]-v[o*S+P];m[P]=C,v[o*y+P]=C,g[o*y+P]=l[P]*(C+s[P])}y++}else this.copyAttrib(o,v,m,F);this.accumulateNormal(M,T,F,v,p)}else{var O=y-(w-A);h[x++]=O,w===A?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,O);var N=y-(w=e.charCodeAt(d++));h[x++]=N,0===w?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,N);var I=y-(w=e.charCodeAt(d++));if(h[x++]=I,0===w){for(P=0;P<5;P++)m[P]=(v[o*O+P]+v[o*N+P])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,I);this.accumulateNormal(O,N,I,v,p)}}for(b=0;b>1^-(1&B)),g[o*b+6]=k*D+(j>>1^-(1&j)),g[o*b+7]=k*R+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*d/4-(i="="===e[d-2]?2:"="===e[d-1]?1:0)),a=i>0?d-4:d;var f=0;for(t=0,r=0;t>16,o[f++]=(65280&n)>>8,o[f++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[f++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[f++]=n>>8&255,o[f++]=255&n),o}function i(e,a){var i=0;if("UInt64"===s.attributes.header_type?i=8:"UInt32"===s.attributes.header_type&&(i=4),"binary"===e.attributes.format&&a){var o,l,u,c,d,f;if("Float32"===e.attributes.type)var h=new Float32Array;else"Int64"===e.attributes.type&&(h=new Int32Array);l=(o=n(e["#text"]))[0];for(var p=1;p0?3-c%3:0,(d=[]).push(f),u=3*i,p=0;p0){r.attributes={};for(var a=0;a0&&(g[y].text=i(g[y],f)),y++;switch(h[p]){case"PointData":var b=parseInt(d.attributes.NumberOfPoints),w=v.attributes.Normals;if(b>0)for(var A=0,M=g.length;A0&&(T=v.DataArray.attributes.NumberOfComponents,(l=new Float32Array(b*T)).set(v.DataArray.text,0));break;case"Strips":var S=parseInt(d.attributes.NumberOfStrips);if(S>0){var E=new Int32Array(v.DataArray[0].text.length),_=new Int32Array(v.DataArray[1].text.length);E.set(v.DataArray[0].text,0),_.set(v.DataArray[1].text,0);var F=S+E.length;c=new Uint32Array(3*F-9*S);var P=0;for(A=0,M=S;A0&&(N=_[A-1]);var I=0;for(O=_[A],N=0;I0&&(N=_[A-1])}}break;case"Polys":var U=parseInt(d.attributes.NumberOfPolys);if(U>0){E=new Int32Array(v.DataArray[0].text.length),_=new Int32Array(v.DataArray[1].text.length),E.set(v.DataArray[0].text,0),_.set(v.DataArray[1].text,0),F=U+E.length,c=new Uint32Array(3*F-9*U),P=0;var D=0;for(A=0,M=U,N=0;A=3)for(var O=parseInt(C[0]),N=1,I=0;I=3)for(I=0;I=u.byteLength)break}var M=new a.BufferGeometry;return M.setIndex(new a.BufferAttribute(h,1)),M.addAttribute("position",new a.BufferAttribute(d,3)),f.length===d.length&&M.addAttribute("normal",new a.BufferAttribute(f,3)),M}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout(function(){e.mainloop()},1):setTimeout(function(){e.onLoad({models:e.Meshes,animations:e.animations})},1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new o,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new function e(){n(this,e),this.boneName="",this.BoneIndex=0,this.Indeces=[],this.Weights=[],this.initMatrix=null,this.OffsetMatrix=null},t=0,r=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=i.substr(1,i.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,r-t);for(var o=this._readLine(i.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},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 maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},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:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\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() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\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\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{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 maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){return e&&e.__esModule?e:{default:e}}(r(1));var n=function(e,t,r,n,i){a.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=n,this.clearAlpha=void 0!==i?i:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};n.prototype=Object.assign(Object.create(a.default.prototype),{constructor:n,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var d=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};d.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},d.prototype=Object.assign(Object.create(n.default.prototype),{constructor:d,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=void 0!==a&&null!==a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=void 0!==a&&null!==a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].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 a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},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+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5I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/+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="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=function(e){return e&&e.__esModule?e:{default:e}}(r(24));var i=function(e,t,r){void 0===n.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),n.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};i.JitterVectors=n.default.JitterVectors,i.prototype=Object.assign(Object.create(n.default.prototype),{constructor:i,render:function(e,t,r,o){if(!this.accumulate)return n.default.prototype.render.call(this,e,t,r,o),void(this.accumulateIndex=-1);var s=i.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new a.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(n.default.prototype.render.call(this,e,this.holdRenderTarget,r,o),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/s.length;if(this.accumulateIndex>=0&&this.accumulateIndex=s.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var d=0;d\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 a.ShaderMaterial({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}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=q(r(113)),n=q(r(114)),i=q(r(115)),o=q(r(22)),s=q(r(14)),l=q(r(116)),u=q(r(117)),c=q(r(118)),d=q(r(119)),f=q(r(13)),h=q(r(2)),p=q(r(20)),m=q(r(17)),v=q(r(120)),g=q(r(15)),y=q(r(16)),x=q(r(121)),b=q(r(122)),w=q(r(123)),A=q(r(124)),M=q(r(125)),T=q(r(18)),S=q(r(126)),E=q(r(127)),_=q(r(128)),F=q(r(129)),P=q(r(26)),L=q(r(11)),C=q(r(130)),O=q(r(131)),N=(q(r(132)),q(r(133))),I=q(r(134)),U=q(r(135)),D=q(r(19)),R=q(r(136)),k=q(r(23)),B=q(r(137)),j=q(r(25)),V=q(r(138)),G=q(r(12)),z=q(r(139)),X=q(r(21)),H=q(r(140)),Y=q(r(141)),W=q(r(142)),Q=q(r(143));function q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=d.default,t.ConvolutionShader=f.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=x.default,t.FreiChenShader=b.default,t.FresnelShader=w.default,t.FXAAShader=A.default,t.GammaCorrectionShader=M.default,t.HalftoneShader=T.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=E.default,t.HueSaturationShader=_.default,t.KaleidoShader=F.default,t.LuminosityHighPassShader=P.default,t.LuminosityShader=L.default,t.MirrorShader=C.default,t.NormalMapShader=O.default,t.ParallaxShader=N.default,t.PixelShader=I.default,t.RGBShiftShader=U.default,t.SAOShader=D.default,t.SepiaShader=R.default,t.SMAAShader=k.default,t.SobelOperatorShader=B.default,t.SSAOShader=j.default,t.TechnicolorShader=V.default,t.ToneMapShader=G.default,t.TriangleBlurShader=z.default,t.UnpackDepthRGBAShader=X.default,t.VerticalBlurShader=H.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=Q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","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 penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_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 immedates."," // Immedates 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")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a=function(e){return e&&e.__esModule?e:{default:e}}(r(10));t.Volume=a.default}]))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(5);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(1);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(8);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(4);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(15);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(14);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(7);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(6);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var d=r(13);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(d).default}});var f=r(12);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(f).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=function(e){return e&&e.__esModule?e:{default:e}}(r(1));var i=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new a.Scene,e.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,n.default),t}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={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(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight)}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof t.container?e=document.querySelector(t.container):t.container instanceof HTMLElement&&(e=t.container),e||window},set:function(e){t.container=e}},debounce:{get:function(){return parseInt(t.debounce,10)||100},set:function(e){t.debounce=e}},tolerance:{get:function(){return parseInt(t.tolerance,10)||0},set:function(e){t.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),function(e,t){var r=window.MutationObserver||window.WebKitMutationObserver;if(r){var a=new r(t);a.observe(e,{childList:!0,subtree:!0})}else e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)}(document.querySelector("body"),function(){Object.keys(e.trackedElements).forEach(function(t){e.on("enter",t),e.on("leave",t)})}),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout(function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach(function(e){r[e].nodes.forEach(function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach(function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")})}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach(function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")})}})}))}(r.trackedElements,r.options)},r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;if(e instanceof HTMLElement){var t=window.getComputedStyle(e);"static"===t.position&&(e.style.position="relative")}e.addEventListener("scroll",this._scroll),window.addEventListener("resize",this._scroll),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);au||8*(1-v.dot(r.object.quaternion))>u)&&(r.dispatchEvent(n),m.copy(r.object.position),v.copy(r.object.quaternion),p=!1,!0)}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",j,!1),r.domElement.removeEventListener("mousedown",O,!1),r.domElement.removeEventListener("wheel",U,!1),r.domElement.removeEventListener("touchstart",R,!1),r.domElement.removeEventListener("touchend",B,!1),r.domElement.removeEventListener("touchmove",k,!1),document.removeEventListener("mousemove",N,!1),document.removeEventListener("mouseup",I,!1),window.removeEventListener("keydown",D,!1)};var r=this,n={type:"change"},i={type:"start"},o={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},l=s.NONE,u=1e-6,c=new a.Spherical,d=new a.Spherical,f=1,h=new a.Vector3,p=!1,m=new a.Vector2,v=new a.Vector2,g=new a.Vector2,y=new a.Vector2,x=new a.Vector2,b=new a.Vector2,w=new a.Vector2,A=new a.Vector2,M=new a.Vector2;function T(){return Math.pow(.95,r.zoomSpeed)}function S(e){d.theta-=e}function E(e){d.phi-=e}var _=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,0),e.multiplyScalar(-t),h.add(e)}}(),F=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),h.add(e)}}(),P=function(){var e=new a.Vector3;return function(t,n){var i=r.domElement===document?r.domElement.body:r.domElement;if(r.object instanceof a.PerspectiveCamera){var o=r.object.position;e.copy(o).sub(r.target);var s=e.length();s*=Math.tan(r.object.fov/2*Math.PI/180),_(2*t*s/i.clientHeight,r.object.matrix),F(2*n*s/i.clientHeight,r.object.matrix)}else r.object instanceof a.OrthographicCamera?(_(t*(r.object.right-r.object.left)/r.object.zoom/i.clientWidth,r.object.matrix),F(n*(r.object.top-r.object.bottom)/r.object.zoom/i.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function L(e){r.object instanceof a.PerspectiveCamera?f/=e:r.object instanceof a.OrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*e)),r.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function C(e){r.object instanceof a.PerspectiveCamera?f*=e:r.object instanceof a.OrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/e)),r.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function O(e){if(!1!==r.enabled){switch(e.preventDefault(),e.button){case r.mouseButtons.ORBIT:if(!1===r.enableRotate)return;!function(e){m.set(e.clientX,e.clientY)}(e),l=s.ROTATE;break;case r.mouseButtons.ZOOM:if(!1===r.enableZoom)return;!function(e){w.set(e.clientX,e.clientY)}(e),l=s.DOLLY;break;case r.mouseButtons.PAN:if(!1===r.enablePan)return;!function(e){y.set(e.clientX,e.clientY)}(e),l=s.PAN}l!==s.NONE&&(document.addEventListener("mousemove",N,!1),document.addEventListener("mouseup",I,!1),r.dispatchEvent(i))}}function N(e){if(!1!==r.enabled)switch(e.preventDefault(),l){case s.ROTATE:if(!1===r.enableRotate)return;!function(e){v.set(e.clientX,e.clientY),g.subVectors(v,m);var t=r.domElement===document?r.domElement.body:r.domElement;S(2*Math.PI*g.x/t.clientWidth*r.rotateSpeed),E(2*Math.PI*g.y/t.clientHeight*r.rotateSpeed),m.copy(v),r.update()}(e);break;case s.DOLLY:if(!1===r.enableZoom)return;!function(e){A.set(e.clientX,e.clientY),M.subVectors(A,w),M.y>0?L(T()):M.y<0&&C(T()),w.copy(A),r.update()}(e);break;case s.PAN:if(!1===r.enablePan)return;!function(e){x.set(e.clientX,e.clientY),b.subVectors(x,y),P(b.x,b.y),y.copy(x),r.update()}(e)}}function I(e){!1!==r.enabled&&(document.removeEventListener("mousemove",N,!1),document.removeEventListener("mouseup",I,!1),r.dispatchEvent(o),l=s.NONE)}function U(e){!1===r.enabled||!1===r.enableZoom||l!==s.NONE&&l!==s.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?C(T()):e.deltaY>0&&L(T()),r.update()}(e),r.dispatchEvent(i),r.dispatchEvent(o))}function D(e){!1!==r.enabled&&!1!==r.enableKeys&&!1!==r.enablePan&&function(e){switch(e.keyCode){case r.keys.UP:P(0,r.keyPanSpeed),r.update();break;case r.keys.BOTTOM:P(0,-r.keyPanSpeed),r.update();break;case r.keys.LEFT:P(r.keyPanSpeed,0),r.update();break;case r.keys.RIGHT:P(-r.keyPanSpeed,0),r.update()}}(e)}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:if(!1===r.enableRotate)return;!function(e){m.set(e.touches[0].pageX,e.touches[0].pageY)}(e),l=s.TOUCH_ROTATE;break;case 2:if(!1===r.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);w.set(0,a)}(e),l=s.TOUCH_DOLLY;break;case 3:if(!1===r.enablePan)return;!function(e){y.set(e.touches[0].pageX,e.touches[0].pageY)}(e),l=s.TOUCH_PAN;break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(i)}}function k(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===r.enableRotate)return;if(l!==s.TOUCH_ROTATE)return;!function(e){v.set(e.touches[0].pageX,e.touches[0].pageY),g.subVectors(v,m);var t=r.domElement===document?r.domElement.body:r.domElement;S(2*Math.PI*g.x/t.clientWidth*r.rotateSpeed),E(2*Math.PI*g.y/t.clientHeight*r.rotateSpeed),m.copy(v),r.update()}(e);break;case 2:if(!1===r.enableZoom)return;if(l!==s.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+a*a);A.set(0,n),M.subVectors(A,w),M.y>0?C(T()):M.y<0&&L(T()),w.copy(A),r.update()}(e);break;case 3:if(!1===r.enablePan)return;if(l!==s.TOUCH_PAN)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),b.subVectors(x,y),P(b.x,b.y),y.copy(x),r.update()}(e);break;default:l=s.NONE}}function B(e){!1!==r.enabled&&(r.dispatchEvent(o),l=s.NONE)}function j(e){!1!==r.enabled&&e.preventDefault()}r.domElement.addEventListener("contextmenu",j,!1),r.domElement.addEventListener("mousedown",O,!1),r.domElement.addEventListener("wheel",U,!1),r.domElement.addEventListener("touchstart",R,!1),r.domElement.addEventListener("touchend",B,!1),r.domElement.addEventListener("touchmove",k,!1),window.addEventListener("keydown",D,!1),this.update()}i.prototype=Object.create(a.EventDispatcher.prototype),i.prototype.constructor=i,Object.defineProperties(i.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var o=r(2),s=r(3),l=r.n(s),u=r(10),c=r.n(u),d=r(9);const f={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},f,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),function(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t{if(this._scene){(new o.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new o.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.1.0"),console.log("PRODUCTION build"),console.log("Built @ 2019-03-18T20:30:00.612Z"),console.log(" "),r.options.sendStats){let e=!1;try{e=window.self!==window.top}catch(e){return!0}d.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:new URL(e?document.referrer:window.location).hostname,source:e?"iframe":"javascript"}})}let n,u=new a.Scene;r._scene=u,n="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=n,r.options.camera.zoom&&(n.zoom=r.options.camera.zoom);let f=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=f,f.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),f.setClearColor(0,0),f.setPixelRatio(window.devicePixelRatio),f.shadowMap.enabled=!0,f.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=f.domElement);let h=new l.a(f);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new o.SSAARenderPass(u,n);p.unbiased=!0,h.addPass(p);let m=new s.ShaderPass(s.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&window.addEventListener("resize",function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)}),r._resize=function(e,t){"orthographic"===r.options.camera.type?(n.left=e/-2,n.right=e/2,n.top=t/2,n.bottom=t/-2):n.aspect=e/t,n.updateProjectionMatrix(),f.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&u.add(new a.AxesHelper(50)),r.options.showGrid&&u.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);u.add(v);let g=new i(n,f.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),n.position.x=r.options.camera.x,n.position.y=r.options.camera.y,n.position.z=r.options.camera.z,n.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let x="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=x,r.options.pauseHidden){r.onScreen=!1;let e=new c.a;e.on("enter","#"+x,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+x,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}let m={camera:{type:"perspective",x:20,y:35,z:20,target:[0,18,0]}};class v extends h{constructor(e,t){super(e,m,t),this.renderType="SkinRender",this._animId=-1,this.element.skinRender=this,this.attached=!1}render(e,t){let r=this,i=!1,o=(o,s)=>{i=!0,o.needsUpdate=!0,s&&(s.needsUpdate=!0);let u=-1;32===o.image.height?u=0:64===o.image.height?u=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+u),o.magFilter=a.NearestFilter,o.minFilter=a.NearestFilter,o.anisotropy=0,s&&(s.magFilter=a.NearestFilter,s.minFilter=a.NearestFilter,s.anisotropy=0),r.attached||r._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene(function(){r.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:r.playerModel}}))}),console.log("Slim: "+l);let c=function(e,t,r,i,o){console.log("optifine cape: "+o);let s=new a.Object3D;s.name="headGroup",s.position.x=0,s.position.y=28,s.position.z=0,s.translateOnAxis(new a.Vector3(0,1,0),-4);let l=g(e,8,8,8,n.head[r],i,"head");if(l.translateOnAxis(new a.Vector3(0,1,0),4),s.add(l),r>=1){let t=g(e,8.504,8.504,8.504,n.hat,i,"hat",!0);t.translateOnAxis(new a.Vector3(0,1,0),4),s.add(t)}let u=new a.Object3D;u.name="bodyGroup",u.position.x=0,u.position.y=18,u.position.z=0;let c=g(e,8,12,4,n.body[r],i,"body");if(u.add(c),r>=1){let t=g(e,8.504,12.504,4.504,n.jacket,i,"jacket",!0);u.add(t)}let d=new a.Object3D;d.name="leftArmGroup",d.position.x=i?-5.5:-6,d.position.y=18,d.position.z=0,d.translateOnAxis(new a.Vector3(0,1,0),4);let f=g(e,i?3:4,12,4,n.leftArm[r],i,"leftArm");if(f.translateOnAxis(new a.Vector3(0,1,0),-4),d.add(f),r>=1){let t=g(e,i?3.504:4.504,12.504,4.504,n.leftSleeve,i,"leftSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),d.add(t)}let h=new a.Object3D;h.name="rightArmGroup",h.position.x=i?5.5:6,h.position.y=18,h.position.z=0,h.translateOnAxis(new a.Vector3(0,1,0),4);let p=g(e,i?3:4,12,4,n.rightArm[r],i,"rightArm");if(p.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(p),r>=1){let t=g(e,i?3.504:4.504,12.504,4.504,n.rightSleeve,i,"rightSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(t)}let m=new a.Object3D;m.name="leftLegGroup",m.position.x=-2,m.position.y=6,m.position.z=0,m.translateOnAxis(new a.Vector3(0,1,0),4);let v=g(e,4,12,4,n.leftLeg[r],i,"leftLeg");if(v.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(v),r>=1){let t=g(e,4.504,12.504,4.504,n.leftTrousers,i,"leftTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(t)}let y=new a.Object3D;y.name="rightLegGroup",y.position.x=2,y.position.y=6,y.position.z=0,y.translateOnAxis(new a.Vector3(0,1,0),4);let x=g(e,4,12,4,n.rightLeg[r],i,"rightLeg");if(x.translateOnAxis(new a.Vector3(0,1,0),-4),y.add(x),r>=1){let t=g(e,4.504,12.504,4.504,n.rightTrousers,i,"rightTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),y.add(t)}let b=new a.Object3D;if(b.add(s),b.add(u),b.add(d),b.add(h),b.add(m),b.add(y),t){let e=new a.Object3D;e.name="capeGroup",e.position.x=0,e.position.y=16,e.position.z=-2.5,e.translateOnAxis(new a.Vector3(0,1,0),8),e.translateOnAxis(new a.Vector3(0,0,1),.5);let r=g(t,8,16,1,o?n.capeOptifine:n.cape,!1,"cape");r.translateOnAxis(new a.Vector3(0,1,0),-8),r.translateOnAxis(new a.Vector3(0,0,1),-.5),r.rotation.y=function(e){return e*(Math.PI/180)}(180),e.add(r),b.add(e)}return b}(o,s,u,l,e.optifine);r.addToScene(c),r.playerModel=c,"function"==typeof t&&t()};r._skinImage=new Image,r._skinImage.crossOrigin="anonymous",r._capeImage=new Image,r._capeImage.crossOrigin="anonymous";let s=void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,l=!1,u=!1,c=!1,d=new a.Texture,f=new a.Texture;if(d.image=r._skinImage,r._skinImage.onload=function(){if(r._skinImage){if(u=!0,console.log("Skin Image Loaded"),void 0===e.slim){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,t.drawImage(r._skinImage,0,0),console.log("Slim Detection:");let a=t.getImageData(46,52,1,12).data,n=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===a[e]){i=!1;break}if(255===n[e]){i=!1;break}}console.log(i),i&&(l=!0)}!u||!c&&s||i||o(d,f)}},r._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+s),s?(f.image=r._capeImage,r._capeImage.onload=function(){r._capeImage&&(c=!0,console.log("Cape Image Loaded"),c&&u&&(i||o(d,f)))},r._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),c=!0,u&&(i||o(d))}):(f=null,r._capeImage=null),"string"==typeof e)0===e.indexOf("http")?r._skinImage.src=e:e.length<=16?y("https://minerender.org/nameToUuid.php?name="+e,function(t,a){if(t)return console.log(t);console.log(a),r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e)}):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":r._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");e.url?r._skinImage.src=e.url:e.data?r._skinImage.src=e.data:e.username?y("https://minerender.org/nameToUuid.php?name="+e.username,function(t,a){if(t)return console.log(t);r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e.username)+"?overlay"}):e.uuid?r._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(r._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.capeUrl?r._capeImage.src=e.capeUrl:e.capeData?r._capeImage.src=e.capeData:e.mineskin&&(r._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape"),l=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function g(e,t,r,n,i,o,s,l){let u=e.image.width,c=e.image.height,d=new a.BoxGeometry(t,r,n),f=new a.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.5,side:l?a.DoubleSide:a.FrontSide});d.computeBoundingBox(),d.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e