mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
3 lines
67 KiB
JavaScript
3 lines
67 KiB
JavaScript
import{h as e,toRef as t,watch as i,resolveComponent as r,openBlock as n,createBlock as s,withCtx as a,createVNode as o,renderSlot as h}from"vue";import{Vector2 as u,Vector3 as m,Plane as d,Raycaster as c,WebGLRenderer as f,PerspectiveCamera as l,Scene as p,Color as y,TextureLoader as g,CubeTextureLoader as v,BoxBufferGeometry as x,CircleBufferGeometry as b,ConeBufferGeometry as S,CylinderBufferGeometry as w,DodecahedronBufferGeometry as N,IcosahedronBufferGeometry as C,LatheBufferGeometry as z,OctahedronBufferGeometry as M,PolyhedronBufferGeometry as _,RingBufferGeometry as T,SphereBufferGeometry as G,TetrahedronBufferGeometry as P,TorusBufferGeometry as I,TorusKnotBufferGeometry as L,Curve as E,TubeBufferGeometry as B,AmbientLight as j,DirectionalLight as R,PointLight as k,SpotLight as A,FrontSide as D,MeshBasicMaterial as O,MeshLambertMaterial as F,MeshPhongMaterial as U,MeshStandardMaterial as $,MeshPhysicalMaterial as Z,ShaderChunk as W,UniformsUtils as q,ShaderLib as V,ShaderMaterial as H,MeshToonMaterial as Y,Mesh as X,PlaneBufferGeometry as K,FontLoader as J,TextBufferGeometry as Q,WebGLCubeRenderTarget as ee,RGBFormat as te,LinearMipmapLinearFilter as ie,CubeCamera as re,BackSide as ne,DoubleSide as se,InstancedMesh as ae,CubeRefractionMapping as oe,SpriteMaterial as he,Sprite as ue,Object3D as me,Geometry as de,Face3 as ce,BufferGeometry as fe,MathUtils as le,InstancedBufferAttribute as pe}from"three";import{OrbitControls as ye}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as ge}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as ve}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as xe}from"three/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as be}from"three/examples/jsm/postprocessing/FilmPass.js";import{HalftonePass as Se}from"three/examples/jsm/postprocessing/HalftonePass.js";import{SAOPass as we}from"three/examples/jsm/postprocessing/SAOPass.js";import{UnrealBloomPass as Ne}from"three/examples/jsm/postprocessing/UnrealBloomPass.js";import{gsap as Ce,Power4 as ze}from"gsap";import{GLTFLoader as Me}from"three/examples/jsm/loaders/GLTFLoader.js";function _e(){var e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,resize:"window",width:0,height:0},t={width:0,height:0,wWidth:0,wHeight:0,ratio:0},i=[],r=[],n=[],s=new u,a=new m,o=new d(new m(0,0,1),0),h=new c,l={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:s,mouseV3:a,init:function(t){t&&Object.entries(t).forEach((function(t){var i=t[0],r=t[1];e[i]=r}));if(!l.scene)return void console.error("Missing Scene");if(!l.camera)return void console.error("Missing Camera");l.renderer=new f({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),l.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(l.orbitCtrl=new ye(l.camera,l.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach((function(e){var t=e[0],i=e[1];l.orbitCtrl[t]=i})));e.width&&e.height?x(e.width,e.height):e.resize&&(v(),window.addEventListener("resize",v));e.mouse_move&&("body"===e.mouse_move?l.mouse_move_element=document.body:l.mouse_move_element=l.renderer.domElement,l.mouse_move_element.addEventListener("mousemove",p),l.mouse_move_element.addEventListener("mouseleave",y));return i.forEach((function(e){return e()})),!0},dispose:function(){n=[],window.removeEventListener("resize",v),l.mouse_move_element&&(l.mouse_move_element.removeEventListener("mousemove",p),l.mouse_move_element.removeEventListener("mouseleave",y));l.orbitCtrl&&l.orbitCtrl.dispose();this.renderer.dispose()},render:function(){l.orbitCtrl&&l.orbitCtrl.update();n.forEach((function(e){return e()})),l.renderer.render(l.scene,l.camera)},renderC:function(){l.orbitCtrl&&l.orbitCtrl.update();n.forEach((function(e){return e()})),l.composer.render()},setSize:x,onAfterInit:function(e){i.push(e)},onAfterResize:function(e){r.push(e)},offAfterResize:function(e){r=r.filter((function(t){return t!==e}))},onBeforeRender:function(e){n.push(e)},offBeforeRender:function(e){n=n.filter((function(t){return t!==e}))}};function p(e){s.x=e.clientX/t.width*2-1,s.y=-e.clientY/t.height*2+1,g()}function y(e){s.x=0,s.y=0,g()}function g(){e.mouse_raycast&&(l.camera.getWorldDirection(o.normal),o.normal.normalize(),h.setFromCamera(s,l.camera),h.ray.intersectPlane(o,a))}function v(){"window"===e.resize?x(window.innerWidth,window.innerHeight):x(e.resize.clientWidth,e.resize.clientHeight),r.forEach((function(e){return e()}))}function x(e,i){t.width=e,t.height=i,t.ratio=e/i,l.renderer.setSize(e,i,!1),l.camera.aspect=t.ratio,l.camera.updateProjectionMatrix(),l.composer&&l.composer.setSize(e,i);var r=function(){var e=l.camera.fov*Math.PI/180,t=2*Math.tan(e/2)*Math.abs(l.camera.position.z);return[t*l.camera.aspect,t]}();t.wWidth=r[0],t.wHeight=r[1]}return l}var Te={props:{antialias:{type:Boolean,default:!0},alpha:{type:Boolean,default:!1},autoClear:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},orbitCtrl:{type:[Boolean,Object],default:!1},mouseMove:{type:[Boolean,String],default:!1},mouseRaycast:{type:Boolean,default:!1},resize:{type:[Boolean,String,Element],default:"window"},width:String,height:String},setup:function(){return{three:_e(),raf:!0,onMountedCallbacks:[]}},provide:function(){return{three:this.three,rendererComponent:this}},mounted:function(){var e={canvas:this.$refs.canvas,antialias:this.antialias,alpha:this.alpha,autoClear:this.autoClear,orbit_ctrl:this.orbitCtrl,mouse_move:this.mouseMove,mouse_raycast:this.mouseRaycast,resize:this.resize,width:this.width,height:this.height};this.three.init(e)&&(this.three.renderer.shadowMap.enabled=this.shadow,this.three.composer?this.animateC():this.animate()),this.onMountedCallbacks.forEach((function(e){return e()}))},beforeUnmount:function(){this.raf=!1,this.three.dispose()},methods:{onMounted:function(e){this.onMountedCallbacks.push(e)},onBeforeRender:function(e){this.three.onBeforeRender(e)},onAfterResize:function(e){this.three.onAfterResize(e)},animate:function(){this.raf&&requestAnimationFrame(this.animate),this.three.render()},animateC:function(){this.raf&&requestAnimationFrame(this.animateC),this.three.renderC()}},render:function(){return e("canvas",{ref:"canvas"},this.$slots.default())}};function Ge(e,t){t instanceof Object&&Object.entries(t).forEach((function(t){var i=t[0],r=t[1];e[i]=r}))}function Pe(e,t){var i={};return Object.entries(e).forEach((function(e){var r=e[0],n=e[1];(!t||t&&!t.includes(r))&&(i[r]=n)})),i}function Ie(e,t,i){return e+(t-e)*(i=(i=i<0?0:i)>1?1:i)}function Le(e,t,i){e.x=Ie(e.x,t.x,i),e.y=Ie(e.y,t.y,i),e.z=Ie(e.z,t.z,i)}function Ee(e,t,i){return e<t?t:e>i?i:e}function Be(e,r,n){if(e[r]){var s=t(e,r);Ge(n,s.value),i(s,(function(){Ge(n,s.value)}),{deep:!0})}}var je={inject:["three"],props:{aspect:{type:Number,default:1},far:{type:Number,default:2e3},fov:{type:Number,default:50},near:{type:Number,default:.1},position:{type:[Object,m],default:{x:0,y:0,z:0}}},created:function(){var e=this;this.camera=new l(this.fov,this.aspect,this.near,this.far),Be(this,"position",this.camera.position),["aspect","far","fov","near"].forEach((function(t){i((function(){return e[t]}),(function(){e.camera[t]=e[t],e.camera.updateProjectionMatrix()}))})),this.three.camera=this.camera},render:function(){return[]},__hmrId:"PerspectiveCamera"},Re={inject:["three"],props:{id:String,background:[String,Number]},setup:function(e){var t=new p;return e.background&&(t.background=new y(e.background)),i((function(){return e.background}),(function(e){t.background=new y(e)})),{scene:t}},provide:function(){return{scene:this.scene}},mounted:function(){this.three.scene||(this.three.scene=this.scene)},methods:{},render:function(){return this.$slots.default?this.$slots.default():[]}},ke={inject:["three"],emits:["loaded"],props:{src:String,onLoad:Function,onProgress:Function,onError:Function},created:function(){var e=this;this.createTexture(),i((function(){return e.src}),this.refreshTexture)},unmounted:function(){this.texture.dispose()},methods:{createTexture:function(){this.texture=(new g).load(this.src,this.onLoaded,this.onProgress,this.onError)},refreshTexture:function(){this.createTexture()},onLoaded:function(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:function(){return[]}},Ae={inject:["three"],emits:["loaded"],props:{path:String,urls:{type:Array,default:["px.jpg","nx.jpg","py.jpg","ny.jpg","pz.jpg","nz.jpg"]},onLoad:Function,onProgress:Function,onError:Function},created:function(){var e=this;this.createTexture(),i((function(){return e.path}),this.refreshTexture),i((function(){return e.urls}),this.refreshTexture)},unmounted:function(){this.texture.dispose()},methods:{createTexture:function(){this.texture=(new v).setPath(this.path).load(this.urls,this.onLoaded,this.onProgress,this.onError)},refreshTexture:function(){this.createTexture()},onLoaded:function(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:function(){return[]}},De={emits:["ready"],inject:["mesh"],props:{rotateX:Number,rotateY:Number,rotateZ:Number},created:function(){var e=this;this.mesh||console.error("Missing parent Mesh"),this.watchProps=[],Object.entries(this.$props).forEach((function(t){return e.watchProps.push(t[0])}))},beforeMount:function(){this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry)},mounted:function(){this.addWatchers()},unmounted:function(){this.geometry.dispose()},methods:{rotateGeometry:function(){this.rotateX&&this.geometry.rotateX(this.rotateX),this.rotateY&&this.geometry.rotateY(this.rotateY),this.rotateZ&&this.geometry.rotateZ(this.rotateZ)},addWatchers:function(){var e=this;this.watchProps.forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},refreshGeometry:function(){var e=this.geometry;this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry),e.dispose()}},render:function(){return[]}},Oe={extends:De,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},methods:{createGeometry:function(){var e=this.width,t=this.height,i=this.depth;this.size&&(e=this.size,t=this.size,i=this.size),this.geometry=new x(e,t,i,this.widthSegments,this.heightSegments,this.depthSegments)}}},Fe={extends:De,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new b(this.radius,this.segments,this.thetaStart,this.thetaLength)}}},Ue={extends:De,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new S(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},$e={extends:De,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new w(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},Ze={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new N(this.radius,this.detail)}}},We={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new C(this.radius,this.detail)}}},qe={extends:De,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new z(this.points,this.segments,this.phiStart,this.phiLength)}}},Ve={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new M(this.radius,this.detail)}}},He={extends:De,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new _(this.vertices,this.indices,this.radius,this.detail)}}},Ye={extends:De,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new T(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}}},Xe={extends:De,props:{radius:{type:Number,default:1},widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},methods:{createGeometry:function(){this.geometry=new G(this.radius,this.widthSegments,this.heightSegments)}}},Ke={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new P(this.radius,this.detail)}}},Je={extends:De,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new I(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}}},Qe={extends:De,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},methods:{createGeometry:function(){this.geometry=new L(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}}},et={extends:De,props:{path:E,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radiusSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},methods:{createGeometry:function(){this.geometry=new B(this.path,this.tubularSegments,this.radius,this.radiusSegments,this.closed)}}},tt={inject:["scene"],props:{color:{type:String,default:"#ffffff"},intensity:{type:Number,default:1},castShadow:{type:Boolean,default:!1},shadowMapSize:Object,position:Object},mounted:function(){var e=this;Be(this,"position",this.light.position),this.light.target&&Be(this,"target",this.light.target.position),this.light.shadow&&(this.light.castShadow=this.castShadow,Ge(this.light.shadow.mapSize,this.shadowMapSize)),["color","intensity","castShadow"].forEach((function(t){i((function(){return e[t]}),(function(){"color"===t?e.light.color=new y(e.color):e.light[t]=e[t]}))})),this.scene.add(this.light),this.light.target&&this.scene.add(this.light.target)},unmounted:function(){this.scene.remove(this.light)},render:function(){return[]},__hmrId:"Light"},it={extends:tt,created:function(){this.light=new j(this.color,this.intensity)},__hmrId:"AmbientLight"},rt={extends:tt,props:{target:Object},created:function(){this.light=new R(this.color,this.intensity)},__hmrId:"DirectionalLight"},nt={extends:tt,props:{distance:{type:Number,default:0},decay:{type:Number,default:1}},created:function(){this.light=new k(this.color,this.intensity,this.distance,this.decay)},__hmrId:"PointLight"},st={extends:tt,props:{angle:{type:Number,default:Math.PI/3},decay:{type:Number,default:1},distance:{type:Number,default:0},penumbra:{type:Number,default:0},target:Object},created:function(){var e=this;this.light=new A(this.color,this.intensity,this.distance,this.angle,this.penumbra,this.decay),["angle","decay","distance","penumbra"].forEach((function(t){i((function(){return e[t]}),(function(){e.light[t]=e[t]}))}))},__hmrId:"SpotLight"},at={inject:["three","mesh"],props:{id:String,color:{type:[String,Number],default:"#ffffff"},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0},flatShading:Boolean,fog:{type:Boolean,default:!0},opacity:{type:Number,default:1},side:{type:Number,default:D},transparent:Boolean,vertexColors:Boolean},provide:function(){return{material:this}},beforeMount:function(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted:function(){this._addWatchers(),this.addWatchers&&this.addWatchers()},unmounted:function(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},methods:{setMap:function(e){this.material.map=e,this.material.needsUpdate=!0},setEnvMap:function(e){this.material.envMap=e,this.material.needsUpdate=!0},_addWatchers:function(){var e=this;["color","depthTest","depthWrite","fog","opacity","side","transparent"].forEach((function(t){i((function(){return e[t]}),(function(){"color"===t?e.material.color.set(e.color):e.material[t]=e[t]}))}))}},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Material"},ot={extends:at,methods:{createMaterial:function(){this.material=new O(Pe(this.$props,["id"]))}},__hmrId:"BasicMaterial"},ht={extends:at,methods:{createMaterial:function(){this.material=new F(Pe(this.$props,["id"]))}},__hmrId:"LambertMaterial"},ut={extends:at,methods:{createMaterial:function(){this.material=new U(Pe(this.$props,["id"]))}},__hmrId:"PhongMaterial"},mt={extends:at,props:{emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},metalness:{type:Number,default:0},roughness:{type:Number,default:1}},methods:{createMaterial:function(){this.material=new $(Pe(this.$props,["id"]))},addWatchers:function(){var e=this;["emissive","emissiveIntensity","metalness","roughness"].forEach((function(t){i((function(){return e[t]}),(function(i){"emissive"===t?e.material.emissive=new y(i):e.material[t]=i}))}))}},__hmrId:"StandardMaterial"},dt={extends:mt,methods:{createMaterial:function(){this.material=new Z(Pe(this.$props,["id"]))}},__hmrId:"PhysicalMaterial"};var ct,ft,lt,pt=W.meshphong_frag.slice(0,W.meshphong_frag.indexOf("void main() {")),yt=W.meshphong_frag.slice(W.meshphong_frag.indexOf("void main() {")),gt={uniforms:q.merge([V.phong.uniforms,{thicknessColor:{value:new y(6718871)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:"\n #define USE_UV\n "+W.meshphong_vert+"\n ",fragmentShader:"\n #define USE_UV\n #define SUBSURFACE\n\n "+pt+"\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n "+yt.replace("#include <lights_fragment_begin>",(ct=W.lights_fragment_begin,ft="RE_Direct( directLight, geometry, material, reflectedLight );",lt="\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n ",ct.split(ft).join(lt)))},vt={extends:{inject:["three","mesh"],props:{id:String,uniforms:Object,vertexShader:String,fragmentShader:String},beforeMount:function(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted:function(){this.addWatchers&&this.addWatchers()},unmounted:function(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},render:function(){return[]},__hmrId:"ShaderMaterial"},props:{diffuse:{type:String,default:"#ffffff"},thicknessColor:{type:String,default:"#ffffff"},thicknessDistortion:{type:Number,default:.4},thicknessAmbient:{type:Number,default:.01},thicknessAttenuation:{type:Number,default:.7},thicknessPower:{type:Number,default:2},thicknessScale:{type:Number,default:4},transparent:{type:Boolean,default:!1},opacity:{type:Number,default:1},vertexColors:{type:Boolean,default:!1}},methods:{createMaterial:function(){var e=gt,t=q.clone(e.uniforms);Object.entries(this.$props).forEach((function(e){var i=e[0],r=e[1];"diffuse"!==i&&"thicknessColor"!==i||(r=new y(r)),"id"!==i&&"transparent"!==i&&"vertexColors"!==i&&(t[i].value=r)})),this.material=new H(Object.assign({},e,{uniforms:t,lights:!0,transparent:this.transparent,vertexColors:this.vertexColors}))}},__hmrId:"SubSurfaceMaterial"},xt={extends:at,methods:{createMaterial:function(){this.material=new Y(Pe(this.$props,["id"]))}},__hmrId:"ToonMaterial"},bt={extends:ke,inject:["material"],created:function(){this.material.setMap(this.texture)},unmounted:function(){this.material.setMap(null)},methods:{refreshTexture:function(){this.createTexture(),this.material.setMap(this.texture)}},__hmrId:"Map"},St={extends:Ae,inject:["material"],created:function(){this.material.setEnvMap(this.texture)},unmounted:function(){this.material.setEnvMap(null)},methods:{refreshTexture:function(){this.createTexture(),this.material.setEnvMap(this.texture)}},__hmrId:"EnvMap"},wt={inject:["three","scene","rendererComponent"],emits:["ready"],props:{materialId:String,position:Object,rotation:Object,scale:Object,castShadow:Boolean,receiveShadow:Boolean},provide:function(){return{mesh:this}},mounted:function(){this.geometry&&!this.mesh&&this.initMesh()},unmounted:function(){this.mesh&&this.scene.remove(this.mesh),this.geometry&&this.geometry.dispose(),this.material&&!this.materialId&&this.material.dispose()},methods:{initMesh:function(){!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new X(this.geometry,this.material),this.bindProps(),this.scene.add(this.mesh),this.$emit("ready")},bindProps:function(){var e=this;Be(this,"position",this.mesh.position),Be(this,"rotation",this.mesh.rotation),Be(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach((function(t){e.mesh[t]=e[t],i((function(){return e[t]}),(function(){e.mesh[t]=e[t]}))})),i((function(){return e.materialId}),(function(){e.mesh.material=e.three.materials[e.materialId]}))},setGeometry:function(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial:function(e){this.material=e,this.mesh&&(this.mesh.material=e)},refreshGeometry:function(){var e=this.geometry;this.createGeometry(),this.mesh.geometry=this.geometry,e.dispose()}},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Mesh"},Nt={extends:wt,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},created:function(){var e=this;this.createGeometry(),["size","width","height","depth","widthSegments","heightSegments","depthSegments"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.size?this.geometry=new x(this.size,this.size,this.size):this.geometry=new x(this.width,this.height,this.depth)}},__hmrId:"Box"},Ct={extends:wt,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radius","segments","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new b(this.radius,this.segments,this.thetaStart,this.thetaLength)}},__hmrId:"Circle"},zt={extends:wt,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radius","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new S(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cone"},Mt={extends:wt,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radiusTop","radiusBottom","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new w(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cylinder"},_t={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new N(this.radius,this.detail)}},__hmrId:"Dodecahedron"},Tt={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new C(this.radius,this.detail)}},__hmrId:"Icosahedron"},Gt={extends:wt,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["points","segments","phiStart","phiLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new z(this.points,this.segments,this.phiStart,this.phiLength)}},__hmrId:"Lathe"},Pt={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new M(this.radius,this.detail)}},__hmrId:"Octahedron"},It={extends:wt,props:{width:{type:Number,default:1},height:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1}},created:function(){var e=this;this.createGeometry();["width","height","widthSegments","heightSegments"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new K(this.width,this.height,this.widthSegments,this.heightSegments)}},__hmrId:"Plane"},Lt={extends:wt,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["vertices","indices","radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new _(this.vertices,this.indices,this.radius,this.detail)}},__hmrId:"Polyhedron"},Et={extends:wt,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["innerRadius","outerRadius","thetaSegments","phiSegments","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new T(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}},__hmrId:"Ring"},Bt={extends:wt,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},watch:{radius:function(){this.refreshGeometry()},widthSegments:function(){this.refreshGeometry()},heightSegments:function(){this.refreshGeometry()}},created:function(){this.createGeometry()},methods:{createGeometry:function(){this.geometry=new G(this.radius,this.widthSegments,this.heightSegments)}},__hmrId:"Sphere"},jt={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new P(this.radius,this.detail)}},__hmrId:"Tetrahedron"},Rt={text:String,fontSrc:String,size:{type:Number,default:80},height:{type:Number,default:5},depth:{type:Number,default:1},curveSegments:{type:Number,default:12},bevelEnabled:{type:Boolean,default:!1},bevelThickness:{type:Number,default:10},bevelSize:{type:Number,default:8},bevelOffset:{type:Number,default:0},bevelSegments:{type:Number,default:5},align:{type:[Boolean,String],default:!1}},kt={extends:wt,props:Object.assign({},Rt),created:function(){var e=this;["text","size","height","curveSegments","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","align"].forEach((function(t){i((function(){return e[t]}),(function(){e.font&&e.refreshGeometry()}))})),(new J).load(this.fontSrc,(function(t){e.font=t,e.createGeometry(),e.initMesh()}))},methods:{createGeometry:function(){this.geometry=new Q(this.text,{font:this.font,size:this.size,height:this.height,depth:this.depth,curveSegments:this.curveSegments,bevelEnabled:this.bevelEnabled,bevelThickness:this.bevelThickness,bevelSize:this.bevelSize,bevelOffset:this.bevelOffset,bevelSegments:this.bevelSegments}),"center"===this.align&&this.geometry.center()}}},At={extends:wt,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radius","tube","radialSegments","tubularSegments","arc"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new I(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}},__hmrId:"Torus"},Dt={extends:wt,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},created:function(){var e=this;this.createGeometry();["radius","tube","radialSegments","tubularSegments","p","q"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new L(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}},__hmrId:"TorusKnot"},Ot={extends:wt,props:{path:E,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radialSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},created:function(){var e=this;this.createGeometry();["path","tubularSegments","radius","radialSegments","closed"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new B(this.path,this.tubularSegments,this.radius,this.radialSegments,this.closed)}},__hmrId:"Tube"},Ft={extends:wt,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initGem(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT),this.meshBack&&this.scene.remove(this.meshBack),this.materialBack&&this.materialBack.dispose()},methods:{initGem:function(){var e=new ee(this.cubeRTSize,{format:te,generateMipmaps:!0,minFilter:ie});this.cubeCamera=new re(this.cubeCameraNear,this.cubeCameraFar,e),Be(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.side=D,this.material.envMap=e.texture,this.material.envMapIntensity=10,this.material.metalness=0,this.material.roughness=0,this.material.opacity=.75,this.material.transparent=!0,this.material.premultipliedAlpha=!0,this.material.needsUpdate=!0,this.materialBack=this.material.clone(),this.materialBack.side=ne,this.materialBack.envMapIntensity=5,this.materialBack.metalness=1,this.materialBack.roughness=0,this.materialBack.opacity=.5,this.meshBack=new X(this.geometry,this.materialBack),Be(this,"position",this.meshBack.position),Be(this,"rotation",this.meshBack.rotation),Be(this,"scale",this.meshBack.scale),this.scene.add(this.meshBack)},updateCubeRT:function(){this.mesh.visible=!1,this.meshBack.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0,this.meshBack.visible=!0}},__hmrId:"Gem"},Ut={emits:["loaded"],extends:wt,props:{src:String,width:Number,height:Number,keepSize:Boolean},created:function(){var e=this;this.createGeometry(),this.createMaterial(),this.initMesh(),i((function(){return e.src}),this.refreshTexture),["width","height"].forEach((function(t){i((function(){return e[t]}),e.resize)})),this.keepSize&&this.three.onAfterResize(this.resize)},methods:{createGeometry:function(){this.geometry=new K(1,1,1,1)},createMaterial:function(){this.material=new O({side:se,map:this.loadTexture()})},loadTexture:function(){return(new g).load(this.src,this.onLoaded)},refreshTexture:function(){this.texture&&this.texture.dispose(),this.material.map=this.loadTexture(),this.material.needsUpdate=!0},onLoaded:function(e){this.texture=e,this.resize(),this.$emit("loaded")},resize:function(){if(this.texture){var e,t,i=this.three.size,r=this.texture.image.width/this.texture.image.height;this.width&&this.height?(e=this.width*i.wWidth/i.width,t=this.height*i.wHeight/i.height):this.width?t=(e=this.width*i.wWidth/i.width)/r:this.height&&(e=(t=this.height*i.wHeight/i.height)*r),this.mesh.scale.x=e,this.mesh.scale.y=t}}},__hmrId:"Image"},$t={inject:["three","scene"],props:{materialId:String,count:Number,position:Object,castShadow:Boolean,receiveShadow:Boolean},provide:function(){return{mesh:this}},beforeMount:function(){this.$slots.default||console.error("Missing Geometry")},mounted:function(){this.initMesh()},unmounted:function(){this.scene.remove(this.mesh)},methods:{initMesh:function(){var e=this;!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new ae(this.geometry,this.material,this.count),Be(this,"position",this.mesh.position),Be(this,"rotation",this.mesh.rotation),Be(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach((function(t){e.mesh[t]=e[t],i((function(){return e[t]}),(function(){e.mesh[t]=e[t]}))})),this.scene.add(this.mesh)},setGeometry:function(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial:function(e){this.material=e,this.mesh&&(this.mesh.material=e)}},render:function(){return this.$slots.default()},__hmrId:"InstancedMesh"},Zt={extends:wt,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh:function(){var e=new ee(this.cubeRTSize,{format:te,generateMipmaps:!0,minFilter:ie});this.cubeCamera=new re(this.cubeCameraNear,this.cubeCameraFar,e),Be(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.needsUpdate=!0},updateCubeRT:function(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"MirrorMesh"},Wt={extends:wt,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh:function(){var e=new ee(this.cubeRTSize,{mapping:oe,format:te,generateMipmaps:!0,minFilter:ie});this.cubeCamera=new re(this.cubeCameraNear,this.cubeCameraFar,e),Be(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.refractionRatio=.95,this.material.needsUpdate=!0},updateCubeRT:function(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"RefractionMesh"},qt={emits:["ready","loaded"],inject:["three","scene"],props:{src:String,position:Object,scale:Object},mounted:function(){this.texture=(new g).load(this.src,this.onLoaded),this.material=new he({map:this.texture}),this.sprite=new ue(this.material),this.geometry=this.sprite.geometry,Be(this,"position",this.sprite.position),Be(this,"scale",this.sprite.scale),this.scene.add(this.sprite),this.$emit("ready")},unmounted:function(){this.texture.dispose(),this.material.dispose(),this.scene.remove(this.sprite)},methods:{onLoaded:function(){this.updateUV(),this.$emit("loaded")},updateUV:function(){this.iWidth=this.texture.image.width,this.iHeight=this.texture.image.height,this.iRatio=this.iWidth/this.iHeight;var e=.5,t=.5;this.iRatio>1?t=.5/this.iRatio:e=.5/this.iRatio;var i=this.geometry.attributes.position.array;i[0]=-e,i[1]=-t,i[5]=e,i[6]=-t,i[10]=e,i[11]=t,i[15]=-e,i[16]=t,this.geometry.attributes.position.needsUpdate=!0}},render:function(){return[]},__hmrId:"Sprite"},Vt={setup:function(){return{passes:[]}},inject:["three"],provide:function(){return{passes:this.passes}},mounted:function(){var e=this;this.three.onAfterInit((function(){e.composer=new ge(e.three.renderer),e.three.renderer.autoClear=!1,e.passes.forEach((function(t){e.composer.addPass(t)})),e.three.composer=e.composer}))},render:function(){return this.$slots.default()},__hmrId:"EffectComposer"},Ht={inject:["three","passes"],beforeMount:function(){this.passes||console.error("Missing parent EffectComposer")},unmounted:function(){this.pass.dispose&&this.pass.dispose()},render:function(){return[]},__hmrId:"EffectPass"},Yt={extends:Ht,mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e=new ve(this.three.scene,this.three.camera);this.passes.push(e),this.pass=e},__hmrId:"RenderPass"},Xt={extends:Ht,props:{focus:{type:Number,default:1},aperture:{type:Number,default:.025},maxblur:{type:Number,default:.01}},watch:{focus:function(){this.pass.uniforms.focus.value=this.focus},aperture:function(){this.pass.uniforms.aperture.value=this.aperture},maxblur:function(){this.pass.uniforms.maxblur.value=this.maxblur}},mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e={focus:this.focus,aperture:this.aperture,maxblur:this.maxblur,width:this.three.size.width,height:this.three.size.height},t=new xe(this.three.scene,this.three.camera,e);this.passes.push(t),this.pass=t},__hmrId:"BokehPass"},Kt={extends:Ht,props:{noiseIntensity:{type:Number,default:.5},scanlinesIntensity:{type:Number,default:.05},scanlinesCount:{type:Number,default:4096},grayscale:{type:Number,default:0}},watch:{noiseIntensity:function(){this.pass.uniforms.nIntensity.value=this.noiseIntensity},scanlinesIntensity:function(){this.pass.uniforms.sIntensity.value=this.scanlinesIntensity},scanlinesCount:function(){this.pass.uniforms.sCount.value=this.scanlinesCount},grayscale:function(){this.pass.uniforms.grayscale.value=this.grayscale}},mounted:function(){var e=new be(this.noiseIntensity,this.scanlinesIntensity,this.scanlinesCount,this.grayscale);this.passes.push(e),this.pass=e},__hmrId:"FilmPass"},Jt={extends:Ht,props:{shape:{type:Number,default:1},radius:{type:Number,default:4},rotateR:{type:Number,default:Math.PI/12*1},rotateG:{type:Number,default:Math.PI/12*2},rotateB:{type:Number,default:Math.PI/12*3},scatter:{type:Number,default:0}},mounted:function(){var e=this,t=new Se(this.three.size.width,this.three.size.height,{});["shape","radius","rotateR","rotateG","rotateB","scatter"].forEach((function(r){t.uniforms[r].value=e[r],i((function(){return e[r]}),(function(){t.uniforms[r].value=e[r]}))})),this.passes.push(t),this.pass=t},__hmrId:"HalftonePass"},Qt={extends:Ht,props:{depthTexture:{type:Boolean,default:!1},useNormals:{type:Boolean,default:!1},resolution:Object},mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e=this.resolution?new u(this.resolution.x,this.resolution.y):new u(this.three.size.width,this.three.size.height),t=new we(this.three.scene,this.three.camera,this.depthTexture,this.useNormals,e);this.passes.push(t),this.pass=t},__hmrId:"SAOPass"},ei={extends:Ht,props:{strength:{type:Number,default:1.5},radius:{type:Number,default:0},threshold:{type:Number,default:0}},watch:{strength:function(){this.pass.strength=this.strength},radius:function(){this.pass.radius=this.radius},threshold:function(){this.pass.threshold=this.threshold}},mounted:function(){var e=new u(this.three.size.width,this.three.size.height),t=new Ne(e,this.strength,this.radius,this.threshold);this.passes.push(t),this.pass=t},__hmrId:"UnrealBloomPass"},ti="\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n",ii={extends:Ut,props:{widthSegments:{type:Number,default:20},heightSegments:{type:Number,default:20},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5},dispCoef:{type:Number,default:.05}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.zCoef};i((function(){return e.zCoef}),(function(e){r.value=e}));var n={value:e.dispCoef};return i((function(){return e.dispCoef}),(function(e){n.value=e})),{uTime:{value:0},uNoiseCoef:t,uZCoef:r,uDispCoef:n}},mounted:function(){this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{createGeometry:function(){this.geometry=new K(1,1,this.widthSegments,this.heightSegments)},createMaterial:function(){var e=this;this.material=new O({side:se,map:this.loadTexture()}),this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.uniforms.uDispCoef=e.uDispCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n "+ti+"\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <begin_vertex>"," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n vNoise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),t.fragmentShader="\n uniform float uDispCoef;\n varying float vNoise;\n "+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("#include <map_fragment>","\n vec4 texelColor = texture2D(map, vUv);\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\n texelColor.r = dispTexel.r;\n diffuseColor = texelColor;\n "),e.materialShader=t}},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyImage"},ri={extends:It,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.zCoef};return i((function(){return e.zCoef}),(function(e){r.value=e})),{uTime:{value:0},uNoiseCoef:t,uZCoef:r}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <begin_vertex>"," \n vec3 p = vec3(position * uNoiseCoef);\n vNoise = snoise(vec3(p.x, p.y, uTime));\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyPlane"},ni={extends:Bt,props:{radius:{type:Number,default:20},widthSegments:{type:Number,default:128},heightSegments:{type:Number,default:128},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.05},dispCoef:{type:Number,default:5}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.dispCoef};return i((function(){return e.dispCoef}),(function(e){r.value=e})),{uTime:{value:0},uNoiseCoef:t,uDispCoef:r}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uDispCoef=e.uDispCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uDispCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <begin_vertex>","\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\n vNoise = snoise(p);\n vec3 transformed = vec3(position);\n transformed += normalize(position) * vNoise * uDispCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisySphere"},si={extends:kt,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.015},zCoef:{type:Number,default:10}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.zCoef};return i((function(){return e.zCoef}),(function(e){r.value=e})),{uTime:{value:0},uNoiseCoef:t,uZCoef:r}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n "+ti+"\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <begin_vertex>"," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyText"},ai=function(e){var t=this;Object.entries(e).forEach((function(e){var i=e[0],r=e[1];t[i]=r})),this.o3d=new me,this.uProgress={value:0},this.uvScale=new u,this.initMaterial(),this.initPlane()};ai.prototype.initMaterial=function(){var e=this;this.material=new O({side:se,transparent:!0,map:this.texture,onBeforeCompile:function(t){t.uniforms.progress=e.uProgress,t.uniforms.uvScale={value:e.uvScale},t.vertexShader="\n uniform float progress;\n uniform vec2 uvScale;\n\n attribute vec3 offset;\n attribute vec3 rotation;\n attribute vec2 uvOffset;\n\n mat3 rotationMatrixXYZ(vec3 r)\n {\n float cx = cos(r.x);\n float sx = sin(r.x);\n float cy = cos(r.y);\n float sy = sin(r.y);\n float cz = cos(r.z);\n float sz = sin(r.z);\n\n return mat3(\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\n sy, -sx * cy, cx * cy\n );\n }\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include <uv_vertex>","\n #include <uv_vertex>\n vUv = vUv * uvScale + uvOffset;\n "),t.vertexShader=t.vertexShader.replace("#include <project_vertex>","\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\n transformed = rotMat * transformed;\n\n vec4 mvPosition = vec4(transformed, 1.0);\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n mvPosition.xyz += progress * offset;\n\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n ")}})},ai.prototype.initPlane=function(){var e=this.screen,t=e.width,i=e.wWidth,r=e.wHeight;this.wSize=this.size*i/t,this.nx=Math.ceil(i/this.wSize)+1,this.ny=Math.ceil(r/this.wSize)+1,this.icount=this.nx*this.ny,this.initGeometry(),this.initUV(),this.initAnimAttributes(),this.imesh&&this.o3d.remove(this.imesh),this.imesh=new ae(this.bGeometry,this.material,this.icount),this.o3d.add(this.imesh);for(var n=new me,s=0,a=-(i-(i-this.nx*this.wSize))/2+this.dx,o=0;o<this.nx;o++){for(var h=-(r-(r-this.ny*this.wSize))/2+this.dy,u=0;u<this.ny;u++)n.position.set(a,h,0),n.updateMatrix(),this.imesh.setMatrixAt(s++,n.matrix),h+=this.wSize;a+=this.wSize}},ai.prototype.initGeometry=function(){var e=new de;e.vertices.push(new m(0,0,0)),e.vertices.push(new m(this.wSize,0,0)),e.vertices.push(new m(0,this.wSize,0)),e.vertices.push(new m(this.wSize,this.wSize,0)),e.faces.push(new ce(0,2,1)),e.faces.push(new ce(2,3,1)),e.faceVertexUvs[0].push([new u(0,0),new u(0,1),new u(1,0)]),e.faceVertexUvs[0].push([new u(0,1),new u(1,1),new u(1,0)]),this.dx=this.wSize/2,this.dy=this.wSize/2,e.translate(-this.dx,-this.dy,0),this.bGeometry=(new fe).fromGeometry(e)},ai.prototype.initAnimAttributes=function(){for(var e=le.randFloat,t=le.randFloatSpread,i=new m,r=new Float32Array(3*this.icount),n=0;n<r.length;n+=3)1===this.anim?i.set(t(10),e(50,100),e(20,50)).toArray(r,n):i.set(t(20),t(20),e(20,200)).toArray(r,n);this.bGeometry.setAttribute("offset",new pe(r,3));for(var s=new Float32Array(3*this.icount),a=4*Math.PI,o=0;o<s.length;o+=3)s[o]=t(a),s[o+1]=t(a),s[o+2]=t(a);this.bGeometry.setAttribute("rotation",new pe(s,3))},ai.prototype.initUV=function(){var e=this.nx/this.ny,t=this.texture.image.width/this.texture.image.height;e>t?this.uvScale.set(1/this.nx,t/e/this.ny):this.uvScale.set(e/t/this.nx,1/this.ny);for(var i=this.uvScale.x*this.nx,r=this.uvScale.y*this.ny,n=new u,s=new Float32Array(2*this.icount),a=0;a<this.nx;a++)for(var o=0;o<this.ny;o++)n.set(this.uvScale.x*a+(1-i)/2,this.uvScale.y*o+(1-r)/2).toArray(s,2*(a*this.ny+o));this.bGeometry.setAttribute("uvOffset",new pe(s,2))},ai.prototype.setTexture=function(e){this.texture=e,this.material.map=e,this.initUV()},ai.prototype.resize=function(){this.initPlane()};var oi={props:{images:Array,events:{type:Object,default:function(){return{wheel:!0,click:!0,keyup:!0}}}},setup:function(){var e=function(){var e=new g,t=[],i=function(i,r){return new Promise((function(n){e.load(i.src,(function(e){t[r]=e,n(e)}))}))};return{textures:t,loadTextures:function(e,r){t.splice(0),Promise.all(e.map(i)).then(r)}}}();return{textures:e.textures,loadTextures:e.loadTextures,progress:0,targetProgress:0}},mounted:function(){this.three=this.$refs.renderer.three,this.images.length<2?console.error("This slider needs at least 2 images."):this.loadTextures(this.images,this.init)},unmounted:function(){document.removeEventListener("click",this.onClick),document.removeEventListener("keyup",this.onKeyup),window.removeEventListener("wheel",this.onWheel)},methods:{init:function(){this.initScene(),Ce.fromTo(this.plane1.uProgress,{value:-2},{value:0,duration:2.5,ease:ze.easeOut}),this.events.click&&document.addEventListener("click",this.onClick),this.events.keyup&&document.addEventListener("keyup",this.onKeyup),this.events.wheel&&window.addEventListener("wheel",this.onWheel),this.three.onBeforeRender(this.updateProgress),this.three.onAfterResize(this.onResize)},initScene:function(){var e=this.three.renderer,t=this.$refs.scene.scene;this.plane1=new ai({renderer:e,screen:this.three.size,size:10,anim:1,texture:this.textures[0]}),this.plane2=new ai({renderer:e,screen:this.three.size,size:10,anim:2,texture:this.textures[1]}),this.setPlanesProgress(0),this.planes=new me,this.planes.add(this.plane1.o3d),this.planes.add(this.plane2.o3d),t.add(this.planes)},onResize:function(){this.plane1.resize(),this.plane2.resize()},onWheel:function(e){e.deltaY>0?this.targetProgress=Ee(this.targetProgress+.05,0,this.images.length-1):this.targetProgress=Ee(this.targetProgress-.05,0,this.images.length-1)},onClick:function(e){e.clientY<this.three.size.height/2?this.navPrevious():this.navNext()},onKeyup:function(e){37===e.keyCode||38===e.keyCode?this.navPrevious():39!==e.keyCode&&40!==e.keyCode||this.navNext()},navNext:function(){Number.isInteger(this.targetProgress)?this.targetProgress+=1:this.targetProgress=Math.ceil(this.targetProgress),this.targetProgress=Ee(this.targetProgress,0,this.images.length-1)},navPrevious:function(){Number.isInteger(this.targetProgress)?this.targetProgress-=1:this.targetProgress=Math.floor(this.targetProgress),this.targetProgress=Ee(this.targetProgress,0,this.images.length-1)},updateProgress:function(){var e=Ie(this.progress,this.targetProgress,.1),t=e-this.progress;if(0!==t){var i=this.progress%1,r=e%1;if(t>0&&r<i||t<0&&i<r){var n=Math.floor(e);this.plane1.setTexture(this.textures[n]),this.plane2.setTexture(this.textures[n+1])}this.progress=e,this.setPlanesProgress(this.progress%1)}},setPlanesProgress:function(e){this.plane1.uProgress.value=e,this.plane2.uProgress.value=-1+e,this.plane1.material.opacity=1-e,this.plane2.material.opacity=e,this.plane1.o3d.position.z=e,this.plane2.o3d.position.z=e-1}}};oi.render=function(e,t,i,h,u,m){var d=r("Camera"),c=r("Scene"),f=r("Renderer");return n(),s(f,{ref:"renderer"},{default:a((function(){return[o(d,{ref:"camera",position:{z:150}},null,512),o(c,{ref:"scene"},null,512)]})),_:1},512)},oi.__file="src/components/sliders/Slider1.vue";var hi={props:{src:String,cameraPosition:Object},mounted:function(){var e=this;this.renderer=this.$refs.renderer,(new Me).load(this.src,(function(t){e.renderer.three.scene.add(t.scene)}))}};hi.render=function(e,t,i,u,m,d){var c=r("Camera"),f=r("Scene"),l=r("Renderer");return n(),s(l,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:a((function(){return[o(c,{ref:"camera",position:i.cameraPosition},null,8,["position"]),o(f,null,{default:a((function(){return[h(e.$slots,"default")]})),_:3})]})),_:1},512)},hi.__file="src/components/viewers/GLTFViewer.vue";var ui=Object.freeze({__proto__:null,Renderer:Te,PerspectiveCamera:je,Camera:je,Scene:Re,Texture:ke,CubeTexture:Ae,BoxGeometry:Oe,CircleGeometry:Fe,ConeGeometry:Ue,CylinderGeometry:$e,DodecahedronGeometry:Ze,IcosahedronGeometry:We,LatheGeometry:qe,OctahedronGeometry:Ve,PolyhedronGeometry:He,RingGeometry:Ye,SphereGeometry:Xe,TetrahedronGeometry:Ke,TorusGeometry:Je,TorusKnotGeometry:Qe,TubeGeometry:et,AmbientLight:it,DirectionalLight:rt,PointLight:nt,SpotLight:st,BasicMaterial:ot,LambertMaterial:ht,PhongMaterial:ut,PhysicalMaterial:dt,StandardMaterial:mt,SubSurfaceMaterial:vt,ToonMaterial:xt,Map:bt,EnvMap:St,Mesh:wt,Box:Nt,Circle:Ct,Cone:zt,Cylinder:Mt,Dodecahedron:_t,Icosahedron:Tt,Lathe:Gt,Octahedron:Pt,Plane:It,Polyhedron:Lt,Ring:Et,Sphere:Bt,Tetrahedron:jt,Text:kt,Torus:At,TorusKnot:Dt,Tube:Ot,Gem:Ft,Image:Ut,InstancedMesh:$t,MirrorMesh:Zt,RefractionMesh:Wt,Sprite:qt,EffectComposer:Vt,RenderPass:Yt,BokehPass:Xt,FilmPass:Kt,HalftonePass:Jt,SAOPass:Qt,UnrealBloomPass:ei,NoisyImage:ii,NoisyPlane:ri,NoisySphere:ni,NoisyText:si,Slider1:oi,GLTFViewer:hi,setFromProp:Ge,propsValues:Pe,lerp:Ie,lerpv3:Le,limit:Ee}),mi={install:function(e){["Camera","PerspectiveCamera","Renderer","Scene","BoxGeometry","CircleGeometry","ConeGeometry","CylinderGeometry","DodecahedronGeometry","IcosahedronGeometry","LatheGeometry","OctahedronGeometry","PolyhedronGeometry","RingGeometry","SphereGeometry","TetrahedronGeometry","TorusGeometry","TorusKnotGeometry","TubeGeometry","AmbientLight","DirectionalLight","PointLight","SpotLight","BasicMaterial","LambertMaterial","PhongMaterial","PhysicalMaterial","ShaderMaterial","StandardMaterial","SubSurfaceMaterial","ToonMaterial","Map","EnvMap","Box","Circle","Cone","Cylinder","Dodecahedron","Icosahedron","Mesh","Lathe","Octahedron","Plane","Polyhedron","Ring","Sphere","Tetrahedron","Text","Torus","TorusKnot","Tube","Gem","Image","InstancedMesh","MirrorMesh","RefractionMesh","Sprite","BokehPass","EffectComposer","FilmPass","HalftonePass","RenderPass","SAOPass","UnrealBloomPass","GLTFViewer"].forEach((function(t){e.component(t,ui[t])}))}};export{it as AmbientLight,ot as BasicMaterial,Xt as BokehPass,Nt as Box,Oe as BoxGeometry,je as Camera,Ct as Circle,Fe as CircleGeometry,zt as Cone,Ue as ConeGeometry,Ae as CubeTexture,Mt as Cylinder,$e as CylinderGeometry,rt as DirectionalLight,_t as Dodecahedron,Ze as DodecahedronGeometry,Vt as EffectComposer,St as EnvMap,Kt as FilmPass,hi as GLTFViewer,Ft as Gem,Jt as HalftonePass,Tt as Icosahedron,We as IcosahedronGeometry,Ut as Image,$t as InstancedMesh,ht as LambertMaterial,Gt as Lathe,qe as LatheGeometry,bt as Map,wt as Mesh,Zt as MirrorMesh,ii as NoisyImage,ri as NoisyPlane,ni as NoisySphere,si as NoisyText,Pt as Octahedron,Ve as OctahedronGeometry,je as PerspectiveCamera,ut as PhongMaterial,dt as PhysicalMaterial,It as Plane,nt as PointLight,Lt as Polyhedron,He as PolyhedronGeometry,Wt as RefractionMesh,Yt as RenderPass,Te as Renderer,Et as Ring,Ye as RingGeometry,Qt as SAOPass,Re as Scene,oi as Slider1,Bt as Sphere,Xe as SphereGeometry,st as SpotLight,qt as Sprite,mt as StandardMaterial,vt as SubSurfaceMaterial,jt as Tetrahedron,Ke as TetrahedronGeometry,kt as Text,ke as Texture,xt as ToonMaterial,At as Torus,Je as TorusGeometry,Dt as TorusKnot,Qe as TorusKnotGeometry,mi as TroisJSVuePlugin,Ot as Tube,et as TubeGeometry,ei as UnrealBloomPass,Ie as lerp,Le as lerpv3,Ee as limit,Pe as propsValues,Ge as setFromProp};
|
|
//# sourceMappingURL=trois.module.min.js.map
|