gl-draw 0.6.6 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.ts +0 -1
- package/dist/core/Composer.d.ts +20 -28
- package/dist/core/Pencil.d.ts +9 -28
- package/dist/core/Renderer.d.ts +6 -0
- package/dist/effect/index.d.ts +1 -3
- package/dist/effect/index.js +4 -4
- package/dist/effect/index.module.js +13 -13
- package/dist/index.js +1 -57
- package/dist/index.module.js +1 -57
- package/dist/objects/image/index.d.ts +1 -1
- package/package.json +5 -4
- package/dist/core/pass/bloom/UnrealBloomPass.d.ts +0 -46
- package/dist/core/pass/bloom/index.d.ts +0 -33
- package/dist/core/pass/outline/index.d.ts +0 -37
- package/dist/core/pass/ssr/index.d.ts +0 -38
- package/dist/effect/outline.d.ts +0 -15
- package/dist/effect/ssr.d.ts +0 -15
package/dist/index.module.js
CHANGED
|
@@ -1,57 +1 @@
|
|
|
1
|
-
import*as Be from"idb-keyval";import*as U from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(A){var D=typeof Reflect=="object"?Reflect:null,x=D&&typeof D.apply=="function"?D.apply:function(c,v,g){return Function.prototype.apply.call(c,v,g)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function j(f){console&&console.warn&&console.warn(f)}var R=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}A.exports=m,A.exports.once=q,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function X(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||R(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||R(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function O(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return O(this)},m.prototype.emit=function(c){for(var v=[],g=1;g<arguments.length;g++)v.push(arguments[g]);var S=c==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var M;if(v.length>0&&(M=v[0]),M instanceof Error)throw M;var ee=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw ee.context=M,ee}var V=w[c];if(V===void 0)return!1;if(typeof V=="function")x(V,this,v);else for(var K=V.length,de=se(V,K),g=0;g<K;++g)x(de[g],this,v);return!0};function F(f,c,v,g){var S,w,M;if(X(v),w=f._events,w===void 0?(w=f._events=Object.create(null),f._eventsCount=0):(w.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),w=f._events),M=w[c]),M===void 0)M=w[c]=v,++f._eventsCount;else if(typeof M=="function"?M=w[c]=g?[v,M]:[M,v]:g?M.unshift(v):M.push(v),S=O(f),S>0&&M.length>S&&!M.warned){M.warned=!0;var ee=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");ee.name="MaxListenersExceededWarning",ee.emitter=f,ee.type=c,ee.count=M.length,j(ee)}return f}m.prototype.addListener=function(c,v){return F(this,c,v,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,v){return F(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var g={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},S=k.bind(g);return S.listener=v,g.wrapFn=S,S}m.prototype.once=function(c,v){return X(v),this.on(c,l(this,c,v)),this},m.prototype.prependOnceListener=function(c,v){return X(v),this.prependListener(c,l(this,c,v)),this},m.prototype.removeListener=function(c,v){var g,S,w,M,ee;if(X(v),S=this._events,S===void 0)return this;if(g=S[c],g===void 0)return this;if(g===v||g.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,g.listener||v));else if(typeof g!="function"){for(w=-1,M=g.length-1;M>=0;M--)if(g[M]===v||g[M].listener===v){ee=g[M].listener,w=M;break}if(w<0)return this;w===0?g.shift():ne(g,w),g.length===1&&(S[c]=g[0]),S.removeListener!==void 0&&this.emit("removeListener",c,ee||v)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var v,g,S;if(g=this._events,g===void 0)return this;if(g.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):g[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete g[c]),this;if(arguments.length===0){var w=Object.keys(g),M;for(S=0;S<w.length;++S)M=w[S],M!=="removeListener"&&this.removeAllListeners(M);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=g[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(c,v[S]);return this};function Q(f,c,v){var g=f._events;if(g===void 0)return[];var S=g[c];return S===void 0?[]:typeof S=="function"?v?[S.listener||S]:[S]:v?$(S):se(S,S.length)}m.prototype.listeners=function(c){return Q(this,c,!0)},m.prototype.rawListeners=function(c){return Q(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):re.call(f,c)},m.prototype.listenerCount=re;function re(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var v=new Array(c),g=0;g<c;++g)v[g]=f[g];return v}function ne(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function $(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function q(f,c){return new Promise(function(v,g){function S(M){f.removeListener(c,w),g(M)}function w(){typeof f.removeListener=="function"&&f.removeListener("error",S),v([].slice.call(arguments))}z(f,c,w,{once:!0}),c!=="error"&&Z(f,S,{once:!0})})}function Z(f,c,v){typeof f.on=="function"&&z(f,"error",c,v)}function z(f,c,v,g){if(typeof f.on=="function")g.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(w){g.once&&f.removeEventListener(c,S),v(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(A){var D=function(x){"use strict";var G=Object.prototype,j=G.hasOwnProperty,R,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",X=m.asyncIterator||"@@asyncIterator",O=m.toStringTag||"@@toStringTag";function F(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{F({},"")}catch(p){F=function(h,_,T){return h[_]=T}}function k(p,h,_,T){var E=h&&h.prototype instanceof q?h:q,J=Object.create(E.prototype),te=new de(T||[]);return J._invoke=M(p,_,te),J}x.wrap=k;function l(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(T){return{type:"throw",arg:T}}}var Q="suspendedStart",re="suspendedYield",se="executing",ne="completed",$={};function q(){}function Z(){}function z(){}var f={};F(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(oe([])));v&&v!==G&&j.call(v,B)&&(f=v);var g=z.prototype=q.prototype=Object.create(f);Z.prototype=z,F(g,"constructor",z),F(z,"constructor",Z),Z.displayName=F(z,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(h){F(p,h,function(_){return this._invoke(h,_)})})}x.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===Z||(h.displayName||h.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,z):(p.__proto__=z,F(p,O,"GeneratorFunction")),p.prototype=Object.create(g),p},x.awrap=function(p){return{__await:p}};function w(p,h){function _(J,te,ae,ue){var ie=l(p[J],p,te);if(ie.type==="throw")ue(ie.arg);else{var me=ie.arg,ve=me.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?h.resolve(ve.__await).then(function(fe){_("next",fe,ae,ue)},function(fe){_("throw",fe,ae,ue)}):h.resolve(ve).then(function(fe){me.value=fe,ae(me)},function(fe){return _("throw",fe,ae,ue)})}}var T;function E(J,te){function ae(){return new h(function(ue,ie){_(J,te,ue,ie)})}return T=T?T.then(ae,ae):ae()}this._invoke=E}S(w.prototype),F(w.prototype,X,function(){return this}),x.AsyncIterator=w,x.async=function(p,h,_,T,E){E===void 0&&(E=Promise);var J=new w(k(p,h,_,T),E);return x.isGeneratorFunction(h)?J:J.next().then(function(te){return te.done?te.value:J.next()})};function M(p,h,_){var T=Q;return function(J,te){if(T===se)throw new Error("Generator is already running");if(T===ne){if(J==="throw")throw te;return pe()}for(_.method=J,_.arg=te;;){var ae=_.delegate;if(ae){var ue=ee(ae,_);if(ue){if(ue===$)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(T===Q)throw T=ne,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);T=se;var ie=l(p,h,_);if(ie.type==="normal"){if(T=_.done?ne:re,ie.arg===$)continue;return{value:ie.arg,done:_.done}}else ie.type==="throw"&&(T=ne,_.method="throw",_.arg=ie.arg)}}}function ee(p,h){var _=p.iterator[h.method];if(_===R){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=R,ee(p,h),h.method==="throw"))return $;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var T=l(_,p.iterator,h.arg);if(T.type==="throw")return h.method="throw",h.arg=T.arg,h.delegate=null,$;var E=T.arg;if(!E)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,$;if(E.done)h[p.resultName]=E.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=R);else return E;return h.delegate=null,$}S(g),F(g,O,"Generator"),F(g,B,function(){return this}),F(g,"toString",function(){return"[object Generator]"});function V(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function K(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function de(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}x.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function T(){for(;h.length;){var E=h.pop();if(E in p)return T.value=E,T.done=!1,T}return T.done=!0,T}};function oe(p){if(p){var h=p[B];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,T=function E(){for(;++_<p.length;)if(j.call(p,_))return E.value=p[_],E.done=!1,E;return E.value=R,E.done=!0,E};return T.next=T}}return{next:pe}}x.values=oe;function pe(){return{value:R,done:!0}}return de.prototype={constructor:de,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(K),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=R)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,ie){return J.type="throw",J.arg=p,h.next=ue,ie&&(h.method="next",h.arg=R),!!ie}for(var T=this.tryEntries.length-1;T>=0;--T){var E=this.tryEntries[T],J=E.completion;if(E.tryLoc==="root")return _("end");if(E.tryLoc<=this.prev){var te=j.call(E,"catchLoc"),ae=j.call(E,"finallyLoc");if(te&&ae){if(this.prev<E.catchLoc)return _(E.catchLoc,!0);if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else if(te){if(this.prev<E.catchLoc)return _(E.catchLoc,!0)}else if(ae){if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.tryLoc<=this.prev&&j.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var E=T;break}}E&&(p==="break"||p==="continue")&&E.tryLoc<=h&&h<=E.finallyLoc&&(E=null);var J=E?E.completion:{};return J.type=p,J.arg=h,E?(this.method="next",this.next=E.finallyLoc,$):this.complete(J)},complete:function(p,h){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&h&&(this.next=h),$},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),$}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var T=_.completion;if(T.type==="throw"){var E=T.arg;K(_)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:oe(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=R),$}},x}(A.exports);try{regeneratorRuntime=D}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(A,D,x){x.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var R=Array.isArray(j.material)?j.material:[j.material];R.forEach(function(m){var B,X,O,F,k,l,Q,re,se,ne,$,q,Z;(B=m.map)===null||B===void 0||B.dispose(),(X=m.lightMap)===null||X===void 0||X.dispose(),(O=m.bumpMap)===null||O===void 0||O.dispose(),(F=m.normalMap)===null||F===void 0||F.dispose(),(k=m.specularMap)===null||k===void 0||k.dispose(),(l=m.envMap)===null||l===void 0||l.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(re=m.aoMap)===null||re===void 0||re.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ne=m.emissiveMap)===null||ne===void 0||ne.dispose(),($=m.gradientMap)===null||$===void 0||$.dispose(),(q=m.metalnessMap)===null||q===void 0||q.dispose(),(Z=m.roughnessMap)===null||Z===void 0||Z.dispose(),m.dispose()})}}},584:function(A,D,x){x.d(D,{wf:function(){return m.Z},PO:function(){return O.Z}});var G=x(666),j=x.n(G),R=null,m=x(695),B=x(949);function X(q){if(q.material){var Z=Array.isArray(q.material)?q.material:[q.material];Z.forEach(function(z){var f,c;(f=z.color)===null||f===void 0||f.convertSRGBToLinear(),(c=z.emissive)===null||c===void 0||c.convertSRGBToLinear(),z.map&&(z.map.encoding=THREE.sRGBEncoding),z.emissiveMap&&(z.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=x(738),F=x(568),k=x(924),l=x(77),Q=x(484),re=null,se=null,ne=function(){var q=(0,F.Z)(j().mark(function Z(z,f){var c,v,g,S,w,M,ee,V,K;return j().wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return c=f.type,v=c===void 0?"blob":c,g=f.version,S=g===void 0?"1":g,oe.next=4,(0,l.get)(z);case 4:if(M=oe.sent,!(M&&M[S])){oe.next=9;break}w=M[S],oe.next=15;break;case 9:return oe.next=11,(0,Q.Z)(fetch(z).then(function(pe){if(pe.ok)return pe[v]();throw new Error}));case 11:ee=oe.sent,V=ee.res,K=ee.err,K||(w=V,(0,l.set)(z,(0,k.Z)({},S,V)));case 15:return oe.abrupt("return",w?{url:v==="json"?z:URL.createObjectURL(w),store:w}:{url:z});case 16:case"end":return oe.stop()}},Z)}));return function(z,f){return q.apply(this,arguments)}}(),$=x(705)},738:function(A,D,x){x.d(D,{Z:function(){return j}});function G(R){return Object.prototype.toString.call(R)==="[object Object]"}function j(R){if(G(R)===!1)return!1;var m=R.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(A,D,x){x.d(D,{Z:function(){return j}});var G=x(42);function j(R){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},705:function(A,D,x){var G=x(949),j=new Map,R=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,F,k,l){var Q=O[F*3],re=O[F*3+1],se=O[k*3],ne=O[k*3+1],$=O[l*3],q=O[l*3+1],Z;if(j.has(X))Z=j.get(X);else{var z=B.box3||new THREE.Box3;if(!B.box3){var f=X.parameters.shapes.getPoints();z.setFromArray(f.map(function(w){return[w.x,w.y,0]}).flat())}var c=z.getSize(new THREE.Vector3);B.split&&(c.y/=B.split),Z={box:z,size:c},j.set(X,Z)}var v=Z.box,g=Z.size,S=B.split?1-B.split:0;return[new THREE.Vector2((Q-v.min.x)/g.x,(re-v.min.y)/g.y+S),new THREE.Vector2((se-v.min.x)/g.x,(ne-v.min.y)/g.y+S),new THREE.Vector2(($-v.min.x)/g.x,(q-v.min.y)/g.y+S)]},generateSideWallUV:function(X,O,F,k,l,Q){var re=O[F*3],se=O[F*3+1],ne=O[F*3+2],$=O[k*3],q=O[k*3+1],Z=O[k*3+2],z=O[l*3],f=O[l*3+1],c=O[l*3+2],v=O[Q*3],g=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var M=new THREE.Box3;M.setFromArray(O);var ee=M.getSize(new THREE.Vector3);B.split&&(ee.z/=1-B.split),w={box:M,size:ee},j.set(O,w)}var V=w.box,K=w.size;return Math.abs(se-q)<Math.abs(re-$)?[new THREE.Vector2((re-V.min.x)/K.x,(ne-V.min.z)/K.z),new THREE.Vector2(($-V.min.x)/K.x,(Z-V.min.z)/K.z),new THREE.Vector2((z-V.min.x)/K.x,(c-V.min.z)/K.z),new THREE.Vector2((v-V.min.x)/K.x,(S-V.min.z)/K.z)]:[new THREE.Vector2((se-V.min.y)/K.y,(ne-V.min.z)/K.z),new THREE.Vector2((q-V.min.y)/K.y,(Z-V.min.z)/K.z),new THREE.Vector2((f-V.min.y)/K.y,(c-V.min.z)/K.z),new THREE.Vector2((g-V.min.y)/K.y,(S-V.min.z)/K.z)]}}},m=function(){j.clear()}},77:function(A,D,x){var G=R=>{var m={};return x.d(m,R),m},j=R=>()=>R;A.exports=G({get:()=>Be.get,set:()=>Be.set})},949:function(A,D,x){var G=R=>{var m={};return x.d(m,R),m},j=R=>()=>R;A.exports=G({ACESFilmicToneMapping:()=>U.ACESFilmicToneMapping,AdditiveBlending:()=>U.AdditiveBlending,AxesHelper:()=>U.AxesHelper,Box3:()=>U.Box3,Camera:()=>U.Camera,CineonToneMapping:()=>U.CineonToneMapping,Clock:()=>U.Clock,Color:()=>U.Color,Euler:()=>U.Euler,Group:()=>U.Group,Layers:()=>U.Layers,LinearEncoding:()=>U.LinearEncoding,LinearFilter:()=>U.LinearFilter,LinearToneMapping:()=>U.LinearToneMapping,Matrix4:()=>U.Matrix4,Mesh:()=>U.Mesh,MeshBasicMaterial:()=>U.MeshBasicMaterial,NoToneMapping:()=>U.NoToneMapping,PerspectiveCamera:()=>U.PerspectiveCamera,PlaneGeometry:()=>U.PlaneGeometry,Points:()=>U.Points,REVISION:()=>U.REVISION,RGBAFormat:()=>U.RGBAFormat,Raycaster:()=>U.Raycaster,ReinhardToneMapping:()=>U.ReinhardToneMapping,Scene:()=>U.Scene,ShaderMaterial:()=>U.ShaderMaterial,Sprite:()=>U.Sprite,SpriteMaterial:()=>U.SpriteMaterial,UniformsUtils:()=>U.UniformsUtils,UnsignedByteType:()=>U.UnsignedByteType,Vector2:()=>U.Vector2,Vector3:()=>U.Vector3,WebGLMultisampleRenderTarget:()=>U.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>U.WebGLRenderTarget,WebGLRenderer:()=>U.WebGLRenderer,sRGBEncoding:()=>U.sRGBEncoding})},568:function(A,D,x){x.d(D,{Z:function(){return j}});function G(R,m,B,X,O,F,k){try{var l=R[F](k),Q=l.value}catch(re){B(re);return}l.done?m(Q):Promise.resolve(Q).then(X,O)}function j(R){return function(){var m=this,B=arguments;return new Promise(function(X,O){var F=R.apply(m,B);function k(Q){G(F,X,O,k,l,"next",Q)}function l(Q){G(F,X,O,k,l,"throw",Q)}k(void 0)})}}},924:function(A,D,x){x.d(D,{Z:function(){return G}});function G(j,R,m){return R in j?Object.defineProperty(j,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):j[R]=m,j}},42:function(A,D,x){x.d(D,{Z:function(){return j}});var G=x(924);function j(R){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},X=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(B).filter(function(O){return Object.getOwnPropertyDescriptor(B,O).enumerable}))),X.forEach(function(O){(0,G.Z)(R,O,B[O])})}return R}}},Fe={};function W(A){var D=Fe[A];if(D!==void 0)return D.exports;var x=Fe[A]={exports:{}};return qt[A](x,x.exports,W),x.exports}(function(){W.n=function(A){var D=A&&A.__esModule?function(){return A.default}:function(){return A};return W.d(D,{a:D}),D}})(),function(){W.d=function(A,D){for(var x in D)W.o(D,x)&&!W.o(A,x)&&Object.defineProperty(A,x,{enumerable:!0,get:D[x]})}}(),function(){W.o=function(A,D){return Object.prototype.hasOwnProperty.call(A,D)}}();var be={};(function(){W.d(be,{L6:function(){return zt},sb:function(){return v},z:function(){return Ee},ZP:function(){return Ee}});function A(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=W(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function R(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function m(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function B(n){if(Array.isArray(n))return m(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(n,t){if(!!n){if(typeof n=="string")return m(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return m(n,t)}}function k(n){return B(n)||X(n)||F(n)||O()}var l=W(949),Q=W(187),re=n=>{var t={};return W.d(t,n),t},se=n=>()=>n,ne=re({default:()=>Gt.default}),$=n=>{var t={};return W.d(t,n),t},q=n=>()=>n,Z=$({default:()=>Ut.default}),z=n=>{var t={};return W.d(t,n),t},f=n=>()=>n,c=z({default:()=>Ft.default}),v=function(){"use strict";function n(i){A(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),u=r.guiParams[a];Object.keys(u).forEach(function(s){var d=u[s],C=d.min,P=d.max,b=d.step,y=d.name,L=d.paramMap,N=d.items,I=d.value,H=d.target,le=s.toLowerCase().indexOf("color")>-1,Y,ce=typeof I=="undefined"&&H,he=ce?H():u[s],ge=ce?s:"value";N?Y=o.add(he,ge,N):le?Y=o.addColor(he,ge):Y=o.add(he,ge),Y=Y.name(y||s),typeof C!="undefined"&&(Y=Y.min(C)),typeof P!="undefined"&&(Y=Y.max(P)),typeof b!="undefined"&&(Y=Y.step(b)),Y=Y.onChange(function(){r.setTargetValue(a,s,he[ge],L)}),ce&&Y.listen()})})},t.setTargetValue=function(e,r,a,o){var u=this.guiParams[e][r],s=u.onChange,d=u.target,C=u.value,P=r.toLowerCase().indexOf("color")>-1,b=typeof C=="undefined"&&d;if(d&&!b){var y=d();Array.isArray(y)||(y=[y]),y.forEach(function(L){if(!!L)if(P)try{L[o||r].set(a)}catch(N){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else L[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,a,o.value,o.paramMap)})})},n}(),g={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},w=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,u=a.alpha,s=a.devicePixelRatio,d=a.antialias,C=a.powerPreference,P=a.toneMapping,b=a.toneMappingExposure,y=a.outputEncoding,L=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,I=new l.WebGLRenderer({context:o,alpha:u,antialias:d,powerPreference:C,logarithmicDepthBuffer:L,preserveDrawingBuffer:N});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=g[P],I.toneMappingExposure=b,I.outputEncoding=y,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new v({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:g,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),M={fov:45,near:1,far:1e3},ee=function(){"use strict";function n(i){A(this,n),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,a=i.cameraParams;if(a instanceof l.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,u=a.far,s=a.near,d=new l.PerspectiveCamera(o,e/r,s,u);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var t=n.prototype;return t.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},t.setSize=function(e,r){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new v({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),V=W(584),K={background:null},de=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new l.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,V.wf)(r)})},n}(),oe=n=>{var t={};return W.d(t,n),t},pe=n=>()=>n,p=oe({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),h={},_=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.domElement,u=a?new p.MapControls(e,o):new p.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,d=s===void 0?1/0:s,C=e.minZ,P=C===void 0?-1/0:C,b=e.maxY,y=b===void 0?1/0:b,L=e.minY,N=L===void 0?-1/0:L,I=this.limitPanV||new l.Vector3,H=this.control,le=this.options.camera,Y=new l.Vector3(u,N,P),ce=new l.Vector3(a,y,d);this.limitPanV=I,I.copy(H.target),H.target.clamp(Y,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),T=n=>{var t={};return W.d(t,n),t},E=n=>()=>n,J=T({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),te=new l.Vector3,ae=new l.Matrix4,ue=new l.Matrix4,ie=new l.Vector3,me=new l.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,n);var i=function(L,N){return ie.setFromMatrixPosition(L.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),ie.distanceToSquared(me)},e=function(L){var N=[];return L.traverse(function(I){I.isCSS2DObject&&N.push(I)}),N},r=function(L){for(var N=e(L).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var ge=C.objects.get(ce).distanceToCameraSquared,Bt=C.objects.get(he).distanceToCameraSquared;return ge-Bt}),I=N.length,H=0,le=N.length;H<le;H++){var Y=N[H].userData.zIndexFix||0;N[H].element.style.zIndex=I-H+Y}},a=this,o,u,s,d,C={objects:new WeakMap},P=t.element!==void 0?t.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,L){+l.REVISION<144?(y.autoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.updateMatrixWorld()):(y.matrixWorldAutoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld()),ae.copy(L.matrixWorldInverse),ue.multiplyMatrices(L.projectionMatrix,ae),b(y,y,L),r(y)},this.setSize=function(y,L){o=y,u=L,s=o/2,d=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(L,"px")};function b(y,L,N){if(y.isCSS2DObject){te.setFromMatrixPosition(y.matrixWorld),te.applyMatrix4(ue);var I=y.visible===!0&&te.z>=-1&&te.z<=1&&y.layers.test(N.layers)===!0;if(y.element.style.display=I===!0?"":"none",I===!0){y.onBeforeRender(a,L,N);var H=y.element;H.style.transform="translate(-50%,-50%) translate(".concat(te.x*s+s,"px,").concat(-te.y*d+d,"px)"),H.parentNode!==P&&P.appendChild(H),y.onAfterRender(a,L,N)}var le={distanceToCameraSquared:i(N,y)};C.objects.set(y,le)}for(var Y=0,ce=y.children.length;Y<ce;Y++)b(y.children[Y],L,N)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){A(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,u=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,u),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return W.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return W.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return W.d(t,n),t},sr=n=>()=>n,ye=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return W.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return W.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return W.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return W.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return W.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,_e=!1,Me=et()!==!1,rt=`varying vec2 vUv;
|
|
2
|
-
|
|
3
|
-
void main() {
|
|
4
|
-
|
|
5
|
-
vUv = uv;
|
|
6
|
-
|
|
7
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8
|
-
|
|
9
|
-
}`,nt=`uniform sampler2D baseTexture;
|
|
10
|
-
uniform sampler2D bloomTexture;
|
|
11
|
-
|
|
12
|
-
varying vec2 vUv;
|
|
13
|
-
|
|
14
|
-
void main() {
|
|
15
|
-
|
|
16
|
-
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
|
-
|
|
18
|
-
}`;function xe(n,t){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(n,t)}function Te(n,t){return xe(n,t)}function at(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&Te(n,t)}function it(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ce(n){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},Ce(n)}function Ae(n){return Ce(n)}function st(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ot(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ut(n,t){return t&&(ot(t)==="object"||typeof t=="function")?t:st(n)}function lt(n){var t=it();return function(){var e=Ae(n),r;if(t){var a=Ae(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return ut(this,r)}}var ct=n=>{var t={};return W.d(t,n),t},hr=n=>()=>n,Le=ct({FullScreenQuad:()=>Ue.FullScreenQuad,Pass:()=>Ue.Pass}),ft=n=>{var t={};return W.d(t,n),t},vr=n=>()=>n,je=ft({LuminosityHighPassShader:()=>Zt.LuminosityHighPassShader}),we=function(n){"use strict";at(i,n);var t=lt(i);function i(r,a,o,u){A(this,i);var s;s=t.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=u,s.resolution=r!==void 0?new l.Vector2(r.x,r.y):new l.Vector2(256,256),s.clearColor=new l.Color(0,0,0);var d={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new l.WebGLRenderTarget(C,P,d),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var y=new l.WebGLRenderTarget(C,P,d);y.texture.name="UnrealBloomPass.h".concat(b),y.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(y);var L=new l.WebGLRenderTarget(C,P,d);L.texture.name="UnrealBloomPass.v".concat(b),L.texture.generateMipmaps=!1,s.renderTargetsVertical.push(L),C=Math.round(C/2),P=Math.round(P/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var N=je.LuminosityHighPassShader;s.highPassUniforms=l.UniformsUtils.clone(N.uniforms),s.highPassUniforms.luminosityThreshold.value=u,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new l.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var I=[3,5,7,9,11];C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var H=0;H<s.nMips;H++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(I[H])),s.separableBlurMaterials[H].uniforms.texSize.value=new l.Vector2(C,P),C=Math.round(C/2),P=Math.round(P/2);s.compositeMaterial=s.getCompositeMaterial(s.nMips),s.compositeMaterial.uniforms.blurTexture1.value=s.renderTargetsVertical[0].texture,s.compositeMaterial.uniforms.blurTexture2.value=s.renderTargetsVertical[1].texture,s.compositeMaterial.uniforms.blurTexture3.value=s.renderTargetsVertical[2].texture,s.compositeMaterial.uniforms.blurTexture4.value=s.renderTargetsVertical[3].texture,s.compositeMaterial.uniforms.blurTexture5.value=s.renderTargetsVertical[4].texture,s.compositeMaterial.uniforms.bloomStrength.value=a,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var le=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=le,s.bloomTintColors=[new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,Se.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Y=Se.CopyShader;return s.copyUniforms=l.UniformsUtils.clone(Y.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new l.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:Y.vertexShader,fragmentShader:Y.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new l.Color,s.oldClearAlpha=1,s.basic=new l.MeshBasicMaterial,s.fsQuad=new Le.FullScreenQuad(void 0),s}var e=i.prototype;return e.dispose=function(){for(var a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(a,o){var u=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(u,s);for(var d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(u,s),this.renderTargetsVertical[d].setSize(u,s),this.separableBlurMaterials[d].uniforms.texSize.value=new l.Vector2(u,s),u=Math.round(u/2),s=Math.round(s/2)},e.render=function(a,o,u,s,d){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var C=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),d&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this.fsQuad.render(a);for(var P=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this.fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this.fsQuad.render(a),P=this.renderTargetsVertical[b];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this.fsQuad.render(a),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,d&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(u),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=C},e.getSeperableBlurMaterial=function(a){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
|
-
void main() {
|
|
20
|
-
vUv = uv;
|
|
21
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
22
|
-
}`,fragmentShader:`#include <common>
|
|
23
|
-
varying vec2 vUv;
|
|
24
|
-
uniform sampler2D colorTexture;
|
|
25
|
-
uniform vec2 texSize;
|
|
26
|
-
uniform vec2 direction;
|
|
27
|
-
float gaussianPdf(in float x, in float sigma) {
|
|
28
|
-
return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
|
|
29
|
-
}
|
|
30
|
-
void main() {
|
|
31
|
-
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
32
|
-
}`})},e.getCompositeMaterial=function(a){return new l.ShaderMaterial({defines:{NUM_MIPS:a},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;
|
|
33
|
-
void main() {
|
|
34
|
-
vUv = uv;
|
|
35
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
36
|
-
}`,fragmentShader:`varying vec2 vUv;
|
|
37
|
-
uniform sampler2D blurTexture1;
|
|
38
|
-
uniform sampler2D blurTexture2;
|
|
39
|
-
uniform sampler2D blurTexture3;
|
|
40
|
-
uniform sampler2D blurTexture4;
|
|
41
|
-
uniform sampler2D blurTexture5;
|
|
42
|
-
uniform sampler2D dirtTexture;
|
|
43
|
-
uniform float bloomStrength;
|
|
44
|
-
uniform float bloomRadius;
|
|
45
|
-
uniform float bloomFactors[NUM_MIPS];
|
|
46
|
-
uniform vec3 bloomTintColors[NUM_MIPS];
|
|
47
|
-
float lerpBloomFactor(const in float factor) {
|
|
48
|
-
float mirrorFactor = 1.2 - factor;
|
|
49
|
-
return mix(factor, mirrorFactor, bloomRadius);
|
|
50
|
-
}
|
|
51
|
-
void main() {
|
|
52
|
-
gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
|
|
53
|
-
lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
|
|
54
|
-
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
|
-
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
|
-
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},i}(Le.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new l.MeshBasicMaterial({color:"black"}),vt=new l.SpriteMaterial({color:"#000"}),pt=function(){"use strict";function n(i,e){A(this,n),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,a=i.renderPass,o=i.finalComposer,u=i.getSize(),s=u.width,d=u.height,C=new we(new l.Vector2(s,d),e.strength,e.radius,e.threshold);this.bloomPass=C;var P=new Oe.EffectComposer(r);P.renderToScreen=!1,P.addPass(a),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(tt);var b=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),y=new ye.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,u=r.materials;e.traverse(function(s){var d=s;d.material&&o.test(d.layers)===!1&&(u[d.uuid]=d.material,d.material=d.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var d=s;u[d.uuid]&&(d.material=u[d.uuid],delete u[d.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new v({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return W.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){A(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,u=i.getSize(),s=u.width,d=u.height,C=new gt.OutlinePass(new l.Vector2(s,d),r,a);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new v({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function yt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function Pt(n,t){if(n==null)return{};var i=yt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return W.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return W.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){A(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,u=i.finalComposer,s=i.getSize(),d=s.width,C=s.height,P=new xt.SSRPass({renderer:o,scene:r,camera:a,width:d,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,u=Pt(r,["width","height"]),s=this.composerController,d=s.scene,C=s.getSize(),P=new l.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(P,R((0,G.Z)({},u),{textureWidth:C.width,textureHeight:C.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,d.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=new v({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){A(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),u=new Oe.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,a=e.type,o=e.encoding,u=this.getSize(),s={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:a},d;if(+l.REVISION<138&&r>0){var C=new l.WebGLMultisampleRenderTarget(u.width,u.height,s);C.samples=r,d=C}else if(+l.REVISION>=138&&r>0){var P=new l.WebGLRenderTarget(u.width,u.height,R((0,G.Z)({},s),{samples:r}));d=P}else{var b=new l.WebGLRenderTarget(u.width,u.height,s);d=b}return d.texture.name="EffectComposer.rt1",d},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new ye.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new ye.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new ye.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,u=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,d;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(d=s.material)===null||d===void 0||d.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Ee=function(){"use strict";function n(i){A(this,n),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new l.Clock,this.options=(0,ne.default)(n.options,i,{isMergeableObject:V.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui,u=e.resizeObserver;if(o){var s=new c.default;s.open(!1),this.gui=s}if(a){var d=new Z.default;d.showPanel(0),d.dom.style.position="absolute",r.appendChild(d.dom),this.stats=d}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,u=e.renderer,s=e.scene,d=e.camera,C=this.getSize(),P=C.width,b=C.height,y=new ee({isdev:a,width:P,height:b,cameraParams:d});this.gui&&y.setGui(this.gui);var L=y.camera,N=new de({camera:L,sceneParams:s}),I=N.scene,H=new w({width:P,height:b,scene:I,camera:L,isdev:a,rendererParams:R((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&N.addAxesHelper(),this.sceneController=N,this.rendererController=H,this.cameraController=y,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,d=e.outlineParams,C=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(C),r&&y.addBloomPass(s),a&&y.addOutlinePass(d),u.outputEncoding===l.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var d=new Ve(r);a&&d.addRenderer("css2d",u),o&&d.addRenderer("css3d",s),this.cssRendererController=d}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var u=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=u}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var u=!0,s=!1,d=void 0;try{for(var C=o[Symbol.iterator](),P;!(u=(P=C.next()).done);u=!0){var b=P.value,y=b.contentRect;e.handeleResize(y.width,y.height),e.render()}}catch(L){s=!0,d=L}finally{try{!u&&C.return!=null&&C.return()}finally{if(s)throw d}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,u=a.cameraController,s=a.composerController,d=a.cssRendererController;u==null||u.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(C,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,d=s.container,C=new l.Vector2,P=d.getBoundingClientRect();if(C.x=(e.clientX-P.left)/(P.right-P.left)*2-1,C.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(C,this.camera);var b=u.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,u=this,s=u.renderer,d=u.scene,C=u.camera,P=u.clock;if(!(!s||!d||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),y=P.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(N,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,y)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var L;(L=this.rendererController)===null||L===void 0||L.render()}(a=this.cssRendererController)===null||a===void 0||a.render(d,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,u,s,d;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(r=this.controlController)===null||r===void 0||r.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(d=this.gui)===null||d===void 0||d.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Ee.options={isdev:_e,stats:_e,gui:_e,axesHelper:_e,control:_e,resizeObserver:!0,renderer:R((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:M,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function Pe(n,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var u=[null];u.push.apply(u,a);var s=Function.bind.apply(r,u),d=new s;return o&&Te(d,o.prototype),d},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=W(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return W.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,V.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){A(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(l.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new l.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(l.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new l.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(this.object3d)},x(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var er=be.L6,tr=be.sb,rr=be.z,nr=be.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
|
|
1
|
+
import*as Re from"idb-keyval";import*as $ from"three";import*as Ue from"deepmerge";import*as Ze from"three/examples/jsm/libs/stats.module";import*as Xe from"lil-gui";import*as Me from"three/examples/jsm/controls/OrbitControls";import*as xe from"three/examples/jsm/renderers/CSS3DRenderer";import*as me from"postprocessing";import*as Ke from"three/examples/jsm/renderers/CSS2DRenderer";var Ye={187:function(j){var R=typeof Reflect=="object"?Reflect:null,b=R&&typeof R.apply=="function"?R.apply:function(a,c,h){return Function.prototype.apply.call(a,c,h)},z;R&&typeof R.ownKeys=="function"?z=R.ownKeys:Object.getOwnPropertySymbols?z=function(a){return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a))}:z=function(a){return Object.getOwnPropertyNames(a)};function L(s){console&&console.warn&&console.warn(s)}var S=Number.isNaN||function(a){return a!==a};function d(){d.init.call(this)}j.exports=d,j.exports.once=J,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var T=10;function W(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return T},set:function(s){if(typeof s!="number"||s<0||S(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");T=s}}),d.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},d.prototype.setMaxListeners=function(a){if(typeof a!="number"||a<0||S(a))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+a+".");return this._maxListeners=a,this};function E(s){return s._maxListeners===void 0?d.defaultMaxListeners:s._maxListeners}d.prototype.getMaxListeners=function(){return E(this)},d.prototype.emit=function(a){for(var c=[],h=1;h<arguments.length;h++)c.push(arguments[h]);var y=a==="error",w=this._events;if(w!==void 0)y=y&&w.error===void 0;else if(!y)return!1;if(y){var P;if(c.length>0&&(P=c[0]),P instanceof Error)throw P;var Q=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw Q.context=P,Q}var G=w[a];if(G===void 0)return!1;if(typeof G=="function")b(G,this,c);else for(var F=G.length,he=ae(G,F),h=0;h<F;++h)b(he[h],this,c);return!0};function B(s,a,c,h){var y,w,P;if(W(c),w=s._events,w===void 0?(w=s._events=Object.create(null),s._eventsCount=0):(w.newListener!==void 0&&(s.emit("newListener",a,c.listener?c.listener:c),w=s._events),P=w[a]),P===void 0)P=w[a]=c,++s._eventsCount;else if(typeof P=="function"?P=w[a]=h?[c,P]:[P,c]:h?P.unshift(c):P.push(c),y=E(s),y>0&&P.length>y&&!P.warned){P.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=s,Q.type=a,Q.count=P.length,L(Q)}return s}d.prototype.addListener=function(a,c){return B(this,a,c,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(a,c){return B(this,a,c,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(s,a,c){var h={fired:!1,wrapFn:void 0,target:s,type:a,listener:c},y=I.bind(h);return y.listener=c,h.wrapFn=y,y}d.prototype.once=function(a,c){return W(c),this.on(a,_(this,a,c)),this},d.prototype.prependOnceListener=function(a,c){return W(c),this.prependListener(a,_(this,a,c)),this},d.prototype.removeListener=function(a,c){var h,y,w,P,Q;if(W(c),y=this._events,y===void 0)return this;if(h=y[a],h===void 0)return this;if(h===c||h.listener===c)--this._eventsCount===0?this._events=Object.create(null):(delete y[a],y.removeListener&&this.emit("removeListener",a,h.listener||c));else if(typeof h!="function"){for(w=-1,P=h.length-1;P>=0;P--)if(h[P]===c||h[P].listener===c){Q=h[P].listener,w=P;break}if(w<0)return this;w===0?h.shift():ne(h,w),h.length===1&&(y[a]=h[0]),y.removeListener!==void 0&&this.emit("removeListener",a,Q||c)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(a){var c,h,y;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[a]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[a]),this;if(arguments.length===0){var w=Object.keys(h),P;for(y=0;y<w.length;++y)P=w[y],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(c=h[a],typeof c=="function")this.removeListener(a,c);else if(c!==void 0)for(y=c.length-1;y>=0;y--)this.removeListener(a,c[y]);return this};function Z(s,a,c){var h=s._events;if(h===void 0)return[];var y=h[a];return y===void 0?[]:typeof y=="function"?c?[y.listener||y]:[y]:c?K(y):ae(y,y.length)}d.prototype.listeners=function(a){return Z(this,a,!0)},d.prototype.rawListeners=function(a){return Z(this,a,!1)},d.listenerCount=function(s,a){return typeof s.listenerCount=="function"?s.listenerCount(a):re.call(s,a)},d.prototype.listenerCount=re;function re(s){var a=this._events;if(a!==void 0){var c=a[s];if(typeof c=="function")return 1;if(c!==void 0)return c.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function ae(s,a){for(var c=new Array(a),h=0;h<a;++h)c[h]=s[h];return c}function ne(s,a){for(;a+1<s.length;a++)s[a]=s[a+1];s.pop()}function K(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}function J(s,a){return new Promise(function(c,h){function y(P){s.removeListener(a,w),h(P)}function w(){typeof s.removeListener=="function"&&s.removeListener("error",y),c([].slice.call(arguments))}M(s,a,w,{once:!0}),a!=="error"&&U(s,y,{once:!0})})}function U(s,a,c){typeof s.on=="function"&&M(s,"error",a,c)}function M(s,a,c,h){if(typeof s.on=="function")h.once?s.once(a,c):s.on(a,c);else if(typeof s.addEventListener=="function")s.addEventListener(a,function y(w){h.once&&s.removeEventListener(a,y),c(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof s)}},666:function(j){var R=function(b){"use strict";var z=Object.prototype,L=z.hasOwnProperty,S,d=typeof Symbol=="function"?Symbol:{},T=d.iterator||"@@iterator",W=d.asyncIterator||"@@asyncIterator",E=d.toStringTag||"@@toStringTag";function B(f,u,v){return Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{B({},"")}catch(f){B=function(u,v,O){return u[v]=O}}function I(f,u,v,O){var C=u&&u.prototype instanceof J?u:J,Y=Object.create(C.prototype),q=new he(O||[]);return Y._invoke=P(f,v,q),Y}b.wrap=I;function _(f,u,v){try{return{type:"normal",arg:f.call(u,v)}}catch(O){return{type:"throw",arg:O}}}var Z="suspendedStart",re="suspendedYield",ae="executing",ne="completed",K={};function J(){}function U(){}function M(){}var s={};B(s,T,function(){return this});var a=Object.getPrototypeOf,c=a&&a(a(se([])));c&&c!==z&&L.call(c,T)&&(s=c);var h=M.prototype=J.prototype=Object.create(s);U.prototype=M,B(h,"constructor",M),B(M,"constructor",U),U.displayName=B(M,E,"GeneratorFunction");function y(f){["next","throw","return"].forEach(function(u){B(f,u,function(v){return this._invoke(u,v)})})}b.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===U||(u.displayName||u.name)==="GeneratorFunction":!1},b.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,M):(f.__proto__=M,B(f,E,"GeneratorFunction")),f.prototype=Object.create(h),f},b.awrap=function(f){return{__await:f}};function w(f,u){function v(Y,q,ie,ue){var oe=_(f[Y],f,q);if(oe.type==="throw")ue(oe.arg);else{var _e=oe.arg,ve=_e.value;return ve&&typeof ve=="object"&&L.call(ve,"__await")?u.resolve(ve.__await).then(function(fe){v("next",fe,ie,ue)},function(fe){v("throw",fe,ie,ue)}):u.resolve(ve).then(function(fe){_e.value=fe,ie(_e)},function(fe){return v("throw",fe,ie,ue)})}}var O;function C(Y,q){function ie(){return new u(function(ue,oe){v(Y,q,ue,oe)})}return O=O?O.then(ie,ie):ie()}this._invoke=C}y(w.prototype),B(w.prototype,W,function(){return this}),b.AsyncIterator=w,b.async=function(f,u,v,O,C){C===void 0&&(C=Promise);var Y=new w(I(f,u,v,O),C);return b.isGeneratorFunction(u)?Y:Y.next().then(function(q){return q.done?q.value:Y.next()})};function P(f,u,v){var O=Z;return function(Y,q){if(O===ae)throw new Error("Generator is already running");if(O===ne){if(Y==="throw")throw q;return ge()}for(v.method=Y,v.arg=q;;){var ie=v.delegate;if(ie){var ue=Q(ie,v);if(ue){if(ue===K)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===Z)throw O=ne,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ae;var oe=_(f,u,v);if(oe.type==="normal"){if(O=v.done?ne:re,oe.arg===K)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(O=ne,v.method="throw",v.arg=oe.arg)}}}function Q(f,u){var v=f.iterator[u.method];if(v===S){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=S,Q(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var O=_(v,f.iterator,u.arg);if(O.type==="throw")return u.method="throw",u.arg=O.arg,u.delegate=null,K;var C=O.arg;if(!C)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(C.done)u[f.resultName]=C.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=S);else return C;return u.delegate=null,K}y(h),B(h,E,"Generator"),B(h,T,function(){return this}),B(h,"toString",function(){return"[object Generator]"});function G(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function F(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function he(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(G,this),this.reset(!0)}b.keys=function(f){var u=[];for(var v in f)u.push(v);return u.reverse(),function O(){for(;u.length;){var C=u.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function se(f){if(f){var u=f[T];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(L.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=S,C.done=!0,C};return O.next=O}}return{next:ge}}b.values=se;function ge(){return{value:S,done:!0}}return he.prototype={constructor:he,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(F),!f)for(var u in this)u.charAt(0)==="t"&&L.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=S)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function v(ue,oe){return Y.type="throw",Y.arg=f,u.next=ue,oe&&(u.method="next",u.arg=S),!!oe}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],Y=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var q=L.call(C,"catchLoc"),ie=L.call(C,"finallyLoc");if(q&&ie){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(q){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(ie){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&L.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=u&&u<=C.finallyLoc&&(C=null);var Y=C?C.completion:{};return Y.type=f,Y.arg=u,C?(this.method="next",this.next=C.finallyLoc,K):this.complete(Y)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,v){return this.delegate={iterator:se(f),resultName:u,nextLoc:v},this.method==="next"&&(this.arg=S),K}},b}(j.exports);try{regeneratorRuntime=R}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(j,R,b){b.d(R,{Z:function(){return z}});function z(L){if(L.geometry&&L.geometry.dispose(),L.material){var S=Array.isArray(L.material)?L.material:[L.material];S.forEach(function(d){var T,W,E,B,I,_,Z,re,ae,ne,K,J,U;(T=d.map)===null||T===void 0||T.dispose(),(W=d.lightMap)===null||W===void 0||W.dispose(),(E=d.bumpMap)===null||E===void 0||E.dispose(),(B=d.normalMap)===null||B===void 0||B.dispose(),(I=d.specularMap)===null||I===void 0||I.dispose(),(_=d.envMap)===null||_===void 0||_.dispose(),(Z=d.alphaMap)===null||Z===void 0||Z.dispose(),(re=d.aoMap)===null||re===void 0||re.dispose(),(ae=d.displacementMap)===null||ae===void 0||ae.dispose(),(ne=d.emissiveMap)===null||ne===void 0||ne.dispose(),(K=d.gradientMap)===null||K===void 0||K.dispose(),(J=d.metalnessMap)===null||J===void 0||J.dispose(),(U=d.roughnessMap)===null||U===void 0||U.dispose(),d.dispose()})}}},584:function(j,R,b){b.d(R,{wf:function(){return d.Z},PO:function(){return E.Z}});var z=b(666),L=b.n(z),S=null,d=b(695),T=b(949);function W(J){if(J.material){var U=Array.isArray(J.material)?J.material:[J.material];U.forEach(function(M){var s,a;(s=M.color)===null||s===void 0||s.convertSRGBToLinear(),(a=M.emissive)===null||a===void 0||a.convertSRGBToLinear(),M.map&&(M.map.encoding=THREE.sRGBEncoding),M.emissiveMap&&(M.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=b(738),B=b(568),I=b(924),_=b(77),Z=b(484),re=null,ae=null,ne=function(){var J=(0,B.Z)(L().mark(function U(M,s){var a,c,h,y,w,P,Q,G,F;return L().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return a=s.type,c=a===void 0?"blob":a,h=s.version,y=h===void 0?"1":h,se.next=4,(0,_.get)(M);case 4:if(P=se.sent,!(P&&P[y])){se.next=9;break}w=P[y],se.next=15;break;case 9:return se.next=11,(0,Z.Z)(fetch(M).then(function(ge){if(ge.ok)return ge[c]();throw new Error}));case 11:Q=se.sent,G=Q.res,F=Q.err,F||(w=G,(0,_.set)(M,(0,I.Z)({},y,G)));case 15:return se.abrupt("return",w?{url:c==="json"?M:URL.createObjectURL(w),store:w}:{url:M});case 16:case"end":return se.stop()}},U)}));return function(M,s){return J.apply(this,arguments)}}(),K=b(705)},738:function(j,R,b){b.d(R,{Z:function(){return L}});function z(S){return Object.prototype.toString.call(S)==="[object Object]"}function L(S){if(z(S)===!1)return!1;var d=S.constructor;if(d===void 0)return!0;var T=d.prototype;return!(z(T)===!1||T.hasOwnProperty("isPrototypeOf")===!1)}},484:function(j,R,b){b.d(R,{Z:function(){return L}});var z=b(42);function L(S){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return S.then(function(T){return(0,z.Z)({err:null,res:T},d)}).catch(function(T){return(0,z.Z)({err:T,res:void 0},d)})}},705:function(j,R,b){var z=b(949),L=new Map,S=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(W,E,B,I,_){var Z=E[B*3],re=E[B*3+1],ae=E[I*3],ne=E[I*3+1],K=E[_*3],J=E[_*3+1],U;if(L.has(W))U=L.get(W);else{var M=T.box3||new THREE.Box3;if(!T.box3){var s=W.parameters.shapes.getPoints();M.setFromArray(s.map(function(w){return[w.x,w.y,0]}).flat())}var a=M.getSize(new THREE.Vector3);T.split&&(a.y/=T.split),U={box:M,size:a},L.set(W,U)}var c=U.box,h=U.size,y=T.split?1-T.split:0;return[new THREE.Vector2((Z-c.min.x)/h.x,(re-c.min.y)/h.y+y),new THREE.Vector2((ae-c.min.x)/h.x,(ne-c.min.y)/h.y+y),new THREE.Vector2((K-c.min.x)/h.x,(J-c.min.y)/h.y+y)]},generateSideWallUV:function(W,E,B,I,_,Z){var re=E[B*3],ae=E[B*3+1],ne=E[B*3+2],K=E[I*3],J=E[I*3+1],U=E[I*3+2],M=E[_*3],s=E[_*3+1],a=E[_*3+2],c=E[Z*3],h=E[Z*3+1],y=E[Z*3+2],w;if(L.has(E))w=L.get(E);else{var P=new THREE.Box3;P.setFromArray(E);var Q=P.getSize(new THREE.Vector3);T.split&&(Q.z/=1-T.split),w={box:P,size:Q},L.set(E,w)}var G=w.box,F=w.size;return Math.abs(ae-J)<Math.abs(re-K)?[new THREE.Vector2((re-G.min.x)/F.x,(ne-G.min.z)/F.z),new THREE.Vector2((K-G.min.x)/F.x,(U-G.min.z)/F.z),new THREE.Vector2((M-G.min.x)/F.x,(a-G.min.z)/F.z),new THREE.Vector2((c-G.min.x)/F.x,(y-G.min.z)/F.z)]:[new THREE.Vector2((ae-G.min.y)/F.y,(ne-G.min.z)/F.z),new THREE.Vector2((J-G.min.y)/F.y,(U-G.min.z)/F.z),new THREE.Vector2((s-G.min.y)/F.y,(a-G.min.z)/F.z),new THREE.Vector2((h-G.min.y)/F.y,(y-G.min.z)/F.z)]}}},d=function(){L.clear()}},77:function(j,R,b){var z=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=z({get:()=>Re.get,set:()=>Re.set})},949:function(j,R,b){var z=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=z({ACESFilmicToneMapping:()=>$.ACESFilmicToneMapping,AxesHelper:()=>$.AxesHelper,Box3:()=>$.Box3,Camera:()=>$.Camera,CineonToneMapping:()=>$.CineonToneMapping,Clock:()=>$.Clock,Euler:()=>$.Euler,Group:()=>$.Group,LinearEncoding:()=>$.LinearEncoding,LinearToneMapping:()=>$.LinearToneMapping,Matrix4:()=>$.Matrix4,Mesh:()=>$.Mesh,NoToneMapping:()=>$.NoToneMapping,PerspectiveCamera:()=>$.PerspectiveCamera,Points:()=>$.Points,REVISION:()=>$.REVISION,Raycaster:()=>$.Raycaster,ReinhardToneMapping:()=>$.ReinhardToneMapping,Scene:()=>$.Scene,Sprite:()=>$.Sprite,UnsignedByteType:()=>$.UnsignedByteType,Vector2:()=>$.Vector2,Vector3:()=>$.Vector3,WebGLRenderer:()=>$.WebGLRenderer})},568:function(j,R,b){b.d(R,{Z:function(){return L}});function z(S,d,T,W,E,B,I){try{var _=S[B](I),Z=_.value}catch(re){T(re);return}_.done?d(Z):Promise.resolve(Z).then(W,E)}function L(S){return function(){var d=this,T=arguments;return new Promise(function(W,E){var B=S.apply(d,T);function I(Z){z(B,W,E,I,_,"next",Z)}function _(Z){z(B,W,E,I,_,"throw",Z)}I(void 0)})}}},924:function(j,R,b){b.d(R,{Z:function(){return z}});function z(L,S,d){return S in L?Object.defineProperty(L,S,{value:d,enumerable:!0,configurable:!0,writable:!0}):L[S]=d,L}},42:function(j,R,b){b.d(R,{Z:function(){return L}});var z=b(924);function L(S){for(var d=1;d<arguments.length;d++){var T=arguments[d]!=null?arguments[d]:{},W=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(W=W.concat(Object.getOwnPropertySymbols(T).filter(function(E){return Object.getOwnPropertyDescriptor(T,E).enumerable}))),W.forEach(function(E){(0,z.Z)(S,E,T[E])})}return S}}},je={};function te(j){var R=je[j];if(R!==void 0)return R.exports;var b=je[j]={exports:{}};return Ye[j](b,b.exports,te),b.exports}(function(){te.n=function(j){var R=j&&j.__esModule?function(){return j.default}:function(){return j};return te.d(R,{a:R}),R}})(),function(){te.d=function(j,R){for(var b in R)te.o(R,b)&&!te.o(j,b)&&Object.defineProperty(j,b,{enumerable:!0,get:R[b]})}}(),function(){te.o=function(j,R){return Object.prototype.hasOwnProperty.call(j,R)}}();var we={};(function(){te.d(we,{L6:function(){return Fe},sb:function(){return c},z:function(){return Ee},ZP:function(){return Ee}});function j(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function R(o,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}function b(o,n,t){return n&&R(o.prototype,n),t&&R(o,t),o}var z=te(42);function L(o,n){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,e)}return t}function S(o,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(n,t))}),o}function d(o,n){(n==null||n>o.length)&&(n=o.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=o[t];return e}function T(o){if(Array.isArray(o))return d(o)}function W(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(o,n){if(!!o){if(typeof o=="string")return d(o,n);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(o,n)}}function I(o){return T(o)||W(o)||B(o)||E()}var _=te(949),Z=te(187),re=o=>{var n={};return te.d(n,o),n},ae=o=>()=>o,ne=re({default:()=>Ue.default}),K=o=>{var n={};return te.d(n,o),n},J=o=>()=>o,U=K({default:()=>Ze.default}),M=o=>{var n={};return te.d(n,o),n},s=o=>()=>o,a=M({default:()=>Xe.default}),c=function(){"use strict";function o(t){j(this,o),this.guiParams={},t&&(this.guiParams=t)}var n=o.prototype;return n.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(i){var l=e.addFolder(i),p=r.guiParams[i];Object.keys(p).forEach(function(g){var m=p[g],V=m.min,D=m.max,k=m.step,x=m.name,A=m.paramMap,H=m.items,ee=m.value,X=m.target,ce=g.toLowerCase().indexOf("color")>-1,N,le=typeof ee=="undefined"&&X,pe=le?X():p[g],ye=le?g:"value";H?N=l.add(pe,ye,H):ce?N=l.addColor(pe,ye):N=l.add(pe,ye),N=N.name(x||g),typeof V!="undefined"&&(N=N.min(V)),typeof D!="undefined"&&(N=N.max(D)),typeof k!="undefined"&&(N=N.step(k)),N=N.onChange(function(){r.setTargetValue(i,g,pe[ye],A)}),le&&N.listen()})})},n.setTargetValue=function(e,r,i,l){var p=this.guiParams[e][r],g=p.onChange,m=p.target,V=p.value,D=r.toLowerCase().indexOf("color")>-1,k=typeof V=="undefined"&&m;if(m&&!k){var x=m();Array.isArray(x)||(x=[x]),x.forEach(function(A){if(!!A)if(D)try{A[l||r].set(i)}catch(H){r!=="color"&&!l&&console.warn("".concat(r," is not a color,set paramMap"))}else A[l||r]=i})}g&&g(i)},n.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(i){var l=e.guiParams[r][i];typeof l.value!="undefined"&&e.setTargetValue(r,i,l.value,l.paramMap)})})},o}(),h={None:_.NoToneMapping,Linear:_.LinearToneMapping,Reinhard:_.ReinhardToneMapping,Cineon:_.CineonToneMapping,ACESFilmic:_.ACESFilmicToneMapping},y={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:_.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},w=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.width,r=t.height,i=t.rendererParams,l=i.context,p=i.alpha,g=i.devicePixelRatio,m=i.antialias,V=i.powerPreference,D=i.toneMapping,k=i.toneMappingExposure,x=i.outputEncoding,A=i.logarithmicDepthBuffer,H=i.preserveDrawingBuffer,ee=i.stencil,X=i.depth,ce=i.physicallyCorrectLights,N=new _.WebGLRenderer({context:l,alpha:p,antialias:m,powerPreference:V,logarithmicDepthBuffer:A,preserveDrawingBuffer:H,stencil:ee,depth:X});N.setSize(e,r),N.setPixelRatio(g),N.toneMapping=h[D],N.toneMappingExposure=k,N.outputEncoding=x,N.physicallyCorrectLights=ce,this.renderer=N}var n=o.prototype;return n.setSize=function(e,r){this.renderer.setSize(e,r)},n.render=function(){var e=this.options,r=e.scene,i=e.camera;this.renderer.render(r,i)},n.setGui=function(e){var r=this,i=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:h,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});i.showGui(e)},n.dispose=function(){var e,r,i;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},o}(),P={fov:45,near:1,far:1e3},Q=function(){"use strict";function o(t){j(this,o),this.oldCameraPosition=new _.Vector3,this.oldCameraRotation=new _.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,i=t.cameraParams;if(i instanceof _.Camera)this.camera=i,this.customCamera=!0;else{var l=i.fov,p=i.far,g=i.near,m=new _.PerspectiveCamera(l,e/r,g,p);m.position.set(0,0,400),m.lookAt(0,0,0),this.camera=m}}var n=o.prototype;return n.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},n.setSize=function(e,r){this.camera instanceof _.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},n.setGui=function(e){var r=this,i=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}}});this.camera instanceof _.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}),i.showGui(e)},o}(),G=te(584),F={background:null},he=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.sceneParams,i=r.background,l=new _.Scene;i&&(l.background=i),l.add(e),this.scene=l}var n=o.prototype;return n.addAxesHelper=function(){var e,r=new _.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},n.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,G.wf)(r)})},o}(),se=o=>{var n={};return te.d(n,o),n},ge=o=>()=>o,f=se({MapControls:()=>Me.MapControls,OrbitControls:()=>Me.OrbitControls}),u={},v=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.controlParams,i=t.mapControl,l=r.domElement,p=i?new f.MapControls(e,l):new f.OrbitControls(e,l);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var n=o.prototype;return n.limitPan=function(e){var r=e.maxX,i=r===void 0?1/0:r,l=e.minX,p=l===void 0?-1/0:l,g=e.maxZ,m=g===void 0?1/0:g,V=e.minZ,D=V===void 0?-1/0:V,k=e.maxY,x=k===void 0?1/0:k,A=e.minY,H=A===void 0?-1/0:A,ee=this.limitPanV||new _.Vector3,X=this.control,ce=this.options.camera,N=new _.Vector3(p,H,D),le=new _.Vector3(i,x,m);this.limitPanV=ee,ee.copy(X.target),X.target.clamp(N,le),ee.sub(X.target),ce.position.sub(ee)},n.update=function(){this.control.update()},n.dispose=function(){this.control.dispose()},o}(),O=o=>{var n={};return te.d(n,o),n},C=o=>()=>o,Y=O({CSS3DObject:()=>xe.CSS3DObject,CSS3DRenderer:()=>xe.CSS3DRenderer,CSS3DSprite:()=>xe.CSS3DSprite}),q=new _.Vector3,ie=new _.Matrix4,ue=new _.Matrix4,oe=new _.Vector3,_e=new _.Vector3,ve=function o(){"use strict";var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,o);var t=function(A,H){return oe.setFromMatrixPosition(A.matrixWorld),_e.setFromMatrixPosition(H.matrixWorld),oe.distanceToSquared(_e)},e=function(A){var H=[];return A.traverse(function(ee){ee.isCSS2DObject&&H.push(ee)}),H},r=function(A){for(var H=e(A).sort(function(le,pe){if(le.renderOrder!==pe.renderOrder)return pe.renderOrder-le.renderOrder;var ye=V.objects.get(le).distanceToCameraSquared,He=V.objects.get(pe).distanceToCameraSquared;return ye-He}),ee=H.length,X=0,ce=H.length;X<ce;X++){var N=H[X].userData.zIndexFix||0;H[X].element.style.zIndex=ee-X+N}},i=this,l,p,g,m,V={objects:new WeakMap},D=n.element!==void 0?n.element:document.createElement("div");D.style.overflow="hidden",this.domElement=D,this.getSize=function(){return{width:l,height:p}},this.render=function(x,A){+_.REVISION<144?(x.autoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),ie.copy(A.matrixWorldInverse),ue.multiplyMatrices(A.projectionMatrix,ie),k(x,x,A),r(x)},this.setSize=function(x,A){l=x,p=A,g=l/2,m=p/2,D.style.width="".concat(x,"px"),D.style.height="".concat(A,"px")};function k(x,A,H){if(x.isCSS2DObject){q.setFromMatrixPosition(x.matrixWorld),q.applyMatrix4(ue);var ee=x.visible===!0&&q.z>=-1&&q.z<=1&&x.layers.test(H.layers)===!0;if(x.element.style.display=ee===!0?"":"none",ee===!0){x.onBeforeRender(i,A,H);var X=x.element;X.style.transform="translate(-50%,-50%) translate(".concat(q.x*g+g,"px,").concat(-q.y*m+m,"px)"),X.parentNode!==D&&D.appendChild(X),x.onAfterRender(i,A,H)}var ce={distanceToCameraSquared:t(H,x)};V.objects.set(x,ce)}for(var N=0,le=x.children.length;N<le;N++)k(x.children[N],A,H)}},fe={zIndex:"auto"},Ae=function(){"use strict";function o(t){j(this,o),this.container=t}var n=o.prototype;return n.addRenderer=function(e,r){var i=this.container,l=i.offsetWidth,p=i.offsetHeight,g=e==="css2d"?new ve:new Y.CSS3DRenderer;g.domElement.style.position="absolute",g.domElement.style.top="0",g.domElement.style.pointerEvents="none",g.domElement.style.zIndex=r.zIndex,g.setSize(l,p),i.appendChild(g.domElement),e==="css2d"?this.css2Drenderer=g:e==="css3d"&&(this.css3Drenderer=g)},n.setSize=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,r),(l=this.css3Drenderer)===null||l===void 0||l.setSize(e,r)},n.render=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.render(e,r),(l=this.css3Drenderer)===null||l===void 0||l.render(e,r)},n.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},o}(),Te=o=>{var n={};return te.d(n,o),n},et=o=>()=>o,de=Te({BlendFunction:()=>me.BlendFunction,CopyPass:()=>me.CopyPass,EffectComposer:()=>me.EffectComposer,EffectPass:()=>me.EffectPass,FXAAEffect:()=>me.FXAAEffect,RenderPass:()=>me.RenderPass,SelectiveBloomEffect:()=>me.SelectiveBloomEffect}),De={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},ze=function(){"use strict";function o(t){j(this,o),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,i=t.camera,l=t.composerParams,p=l.multisampling,g=e.capabilities.maxSamples,m=new de.EffectComposer(e,{multisampling:Math.min(p,g)});m.addPass(new de.RenderPass(r,i)),this.finalComposer=m,this.renderer=e,this.scene=r,this.camera=i}var n=o.prototype;return n.addCopyPass=function(){var e=new de.CopyPass;this.finalComposer.addPass(e),this.copyPass=e},n.addFXAAPass=function(){var e=this.camera,r=new de.FXAAEffect({blendFunction:de.BlendFunction.NORMAL}),i=new de.EffectPass(e,r);this.finalComposer.addPass(i),this.fxaaPass=i},n.addBloomPass=function(e){var r=this,i=r.camera,l=r.scene,p=new de.SelectiveBloomEffect(l,i,(0,z.Z)({},e));p.inverted=!0;var g=new de.EffectPass(i,p);this.finalComposer.addPass(g),this.bloomPass=g,this.bloomEffect=p},n.addBloomGui=function(e){var r=this,i=new c({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(l){r.bloomEffect.luminancePass.enabled=l}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});i.showGui(e)},n.toggleBloomSelection=function(e){this.bloomEffect.selection.toggle(e)},n.getSize=function(){var e=this.options.renderer;return e.getSize(new _.Vector2)},n.enable=function(){this.active||(this.active=!0)},n.disable=function(){!this.active||(this.active=!1)},n.checkCopyPass=function(){var e=this.finalComposer.passes.some(function(r){return r instanceof de.RenderPass||r instanceof de.CopyPass?!1:r.enabled});e&&this.copyPass?this.copyPass.enabled=!1:!e&&this.copyPass?this.copyPass.enabled=!0:!e&&!this.copyPass&&this.addCopyPass()},n.setSize=function(e,r){this.finalComposer.setSize(e,r)},n.render=function(){!this.active||this.finalComposer.render()},n.dispose=function(){this.finalComposer.dispose()},o}(),Be=function(){try{var o=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&o.getContext("webgl2"))}catch(n){return!1}},tt=0,be=!1,Se=Be()!==!1,Ee=function(){"use strict";function o(t){j(this,o),this.raycaster=new _.Raycaster,this.installPlugins=new Map,this.event=new Z.EventEmitter,this.clock=new _.Clock,this.options=(0,ne.default)(o.options,t,{isMergeableObject:G.PO});var e=this.options,r=e.container,i=e.stats,l=e.gui,p=e.resizeObserver;if(l){var g=new a.default;g.open(!1),this.gui=g}if(i){var m=new U.default;m.showPanel(0),m.dom.style.position="absolute",r.appendChild(m.dom),this.stats=m}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var n=o.prototype;return n.use=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(I(i))),this.installPlugins.set(e,!0)}},n.init=function(){var e=this.options,r=e.container,i=e.isdev,l=e.axesHelper,p=e.renderer,g=e.scene,m=e.camera,V=this.getSize(),D=V.width,k=V.height,x=new Q({isdev:i,width:D,height:k,cameraParams:m});this.gui&&x.setGui(this.gui);var A=x.camera,H=new he({camera:A,sceneParams:g}),ee=H.scene,X=new w({width:D,height:k,scene:ee,camera:A,isdev:i,rendererParams:S((0,z.Z)({},p),{antialias:!1})});this.gui&&X.setGui(this.gui);var ce=X.renderer;l&&H.addAxesHelper(),this.sceneController=H,this.rendererController=X,this.cameraController=x,r.appendChild(ce.domElement)},n.initComposer=function(){var e=this.options,r=e.bloom,i=e.bloomParams,l=e.renderer,p=e.multisampling,g=l.antialias;g==="msaa"&&!Se&&(g=!1,console.warn("MSAA is not supported on this browser"));var m=new ze({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:g==="msaa"?p:0,type:_.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=m,r&&(m.addBloomPass(i),this.gui&&m.addBloomGui(this.gui)),g==="fxaa"&&m.addFXAAPass(),m.checkCopyPass(),this.event.on("passcheck",function(){m.checkCopyPass()})},n.initCSSRenderer=function(){var e=this.options,r=e.container,i=e.css2DRenderer,l=e.css3DRenderer,p=e.css2DRendererParams,g=e.css3DRendererParams;if(i||l){var m=new Ae(r);i&&m.addRenderer("css2d",p),l&&m.addRenderer("css3d",g),this.cssRendererController=m}},n.initControl=function(){var e=this.options,r=e.control,i=e.mapControl,l=e.controlParams;if(r){var p=new v({camera:this.camera,controlParams:{domElement:(l==null?void 0:l.domElement)||this.renderer.domElement},mapControl:i});this.controlController=p}},n.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},n.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var i=new ResizeObserver(function(l){var p=!0,g=!1,m=void 0;try{for(var V=l[Symbol.iterator](),D;!(p=(D=V.next()).done);p=!0){var k=D.value,x=k.contentRect;e.handeleResize(x.width,x.height),e.render()}}catch(A){g=!0,m=A}finally{try{!p&&V.return!=null&&V.return()}finally{if(g)throw m}}});i.observe(r),this.resizeObserver=i}},n.handeleResize=function(e,r){var i=this,l=i.rendererController,p=i.cameraController,g=i.composerController,m=i.cssRendererController;p==null||p.setSize(e,r),l==null||l.setSize(e,r),g==null||g.setSize(e,r),m==null||m.setSize(e,r),this.installPlugins.forEach(function(V,D){var k;(k=D.resize)===null||k===void 0||k.call(D,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},n.pick=function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=this,p=l.raycaster,g=l.options,m=g.container,V=new _.Vector2,D=m.getBoundingClientRect();if(V.x=(e.clientX-D.left)/(D.right-D.left)*2-1,V.y=-((e.clientY-D.top)/(D.bottom-D.top))*2+1,this.camera&&this.scene){p.setFromCamera(V,this.camera);var k=p.intersectObjects(r||this.scene.children,i);if(k.length)return{object:k[0].object,intersects:k}}},n.render=function(){var e,r,i,l,p=this,g=p.renderer,m=p.scene,V=p.camera,D=p.clock;if(!(!g||!m||!V||this.options.staticRender&&!this.cameraController.checkCameraChange())){var k=D.getDelta(),x=D.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,ee){var X;(X=ee.update)===null||X===void 0||X.call(ee,k,x)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(i=this.cssRendererController)===null||i===void 0||i.render(m,V),(l=this.stats)===null||l===void 0||l.update(),this.event.emit("render",{delta:k,elapsed:x})}},n.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},n.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},n.dispose=function(){var e,r,i,l,p,g,m;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(V,D){var k;(k=D.dispose)===null||k===void 0||k.call(D)}),(r=this.controlController)===null||r===void 0||r.dispose(),(i=this.cssRendererController)===null||i===void 0||i.dispose(),(l=this.sceneController)===null||l===void 0||l.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(g=this.rendererController)===null||g===void 0||g.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(m=this.gui)===null||m===void 0||m.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},b(o,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),o}();Ee.options={isdev:be,stats:be,gui:be,axesHelper:be,control:be,resizeObserver:!0,renderer:S((0,z.Z)({},y),{antialias:Se?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:F,camera:P,bloom:!1,bloomParams:De,css2DRenderer:!1,css2DRendererParams:(0,z.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,z.Z)({},fe)};function Pe(o,n){return Pe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Pe(o,n)}function Ge(o,n){return Pe(o,n)}function ke(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function Ce(o,n,t){return ke()?Ce=Reflect.construct:Ce=function(r,i,l){var p=[null];p.push.apply(p,i);var g=Function.bind.apply(r,p),m=new g;return l&&Ge(m,l.prototype),m},Ce.apply(null,arguments)}function Oe(o,n,t){return Ce.apply(null,arguments)}var Ne=te(484);function Ie(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),o&&(t.promise=(0,Ne.Z)(t.promise,n)),t}var Ve=o=>{var n={};return te.d(n,o),n},rt=o=>()=>o,We=Ve({CSS2DObject:()=>Ke.CSS2DObject}),Le=function(o){o&&((0,G.wf)(o),o.children.forEach(function(n){n.userData.BaseObject_||Le(n)}))},Fe=function(){"use strict";function o(){j(this,o),this.objecttype__="BaseObject",this.userData={},this.pm=Ie(),this.visible=!1}var n=o.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,r){},n.resize=function(e,r){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(_.Mesh,I(r)),this},n.createGroup=function(){return this.object3d=new _.Group,this},n.createPoints=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(_.Points,I(r)),this},n.createCSS2DObject=function(e){return this.object3d=new We.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new Y.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new Y.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new _.Sprite(e),this},n.add=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).add.apply(l,I(r)),this},n.remove=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).remove.apply(l,I(r)),this},n.getSize=function(){var e=new _.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new _.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},n.dispose=function(){Le(this.object3d)},b(o,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),o}()})();var $e=we.L6,Je=we.sb,Qe=we.z,qe=we.ZP;export{$e as BaseObject,Je as GUIObject,Qe as Pencil,qe as default};
|
|
@@ -17,7 +17,7 @@ export default class extends BaseObject {
|
|
|
17
17
|
options: Options;
|
|
18
18
|
texture: THREE.Texture;
|
|
19
19
|
constructor(options: Options);
|
|
20
|
-
getMaterial(): Promise<THREE.
|
|
20
|
+
getMaterial(): Promise<THREE.SpriteMaterial | THREE.MeshBasicMaterial>;
|
|
21
21
|
create(): Promise<void>;
|
|
22
22
|
setScale(n: number): void;
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gl-draw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"author": "gitplus <hstits@gmail.com>",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "PORT=3003 bundler-dev",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"stylelint-config-prettier": "^9.0.3",
|
|
68
68
|
"stylelint-config-standard": "^25.0.0",
|
|
69
69
|
"tailwind-config-bundler": "^0.1.5",
|
|
70
|
+
"three": "^0.136.0",
|
|
70
71
|
"tsc-alias": "^1.6.11",
|
|
71
72
|
"vue": "^3.2.31",
|
|
72
73
|
"vue-auto-routing": "^1.0.1",
|
|
73
74
|
"vue-bundler": "^0.1.56",
|
|
74
|
-
"vue-router": "^4.0.14"
|
|
75
|
-
"three": "^0.136.0"
|
|
75
|
+
"vue-router": "^4.0.14"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@turf/boolean-clockwise": "^6.5.0",
|
|
@@ -86,7 +86,8 @@
|
|
|
86
86
|
"earcut": "2",
|
|
87
87
|
"idb-keyval": "^6.1.0",
|
|
88
88
|
"lil-gui": "^0.17.0",
|
|
89
|
-
"popmotion": "^11.0.5"
|
|
89
|
+
"popmotion": "^11.0.5",
|
|
90
|
+
"postprocessing": "^6.28.7"
|
|
90
91
|
},
|
|
91
92
|
"msw": {
|
|
92
93
|
"workerDirectory": "public"
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Color, MeshBasicMaterial, ShaderMaterial, Texture, Vector2, Vector3, WebGLRenderer, WebGLRenderTarget } from 'three';
|
|
2
|
-
import { Pass, FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass';
|
|
3
|
-
/**
|
|
4
|
-
* Thanks to https://github.com/mrdoob/three.js/issues/14104#issuecomment-429664412 for this fragmentShaderfix
|
|
5
|
-
*
|
|
6
|
-
* UnrealBloomPass is inspired by the bloom pass of Unreal Engine. It creates a
|
|
7
|
-
* mip map chain of bloom textures and blurs them with different radii. Because
|
|
8
|
-
* of the weighted combination of mips, and because larger blurs are done on
|
|
9
|
-
* higher mips, this effect provides good quality and performance.
|
|
10
|
-
*
|
|
11
|
-
* Reference:
|
|
12
|
-
* - https://docs.unrealengine.com/latest/INT/Engine/Rendering/PostProcessEffects/Bloom/
|
|
13
|
-
*/
|
|
14
|
-
declare class UnrealBloomPass extends Pass {
|
|
15
|
-
strength: number;
|
|
16
|
-
radius: number;
|
|
17
|
-
threshold: number;
|
|
18
|
-
resolution: Vector2;
|
|
19
|
-
clearColor: Color;
|
|
20
|
-
renderTargetsHorizontal: any[];
|
|
21
|
-
renderTargetsVertical: any[];
|
|
22
|
-
nMips: number;
|
|
23
|
-
renderTargetBright: WebGLRenderTarget;
|
|
24
|
-
highPassUniforms: any;
|
|
25
|
-
materialHighPassFilter: ShaderMaterial;
|
|
26
|
-
separableBlurMaterials: any[];
|
|
27
|
-
compositeMaterial: ShaderMaterial;
|
|
28
|
-
bloomTintColors: Vector3[];
|
|
29
|
-
copyUniforms: any;
|
|
30
|
-
materialCopy: ShaderMaterial;
|
|
31
|
-
_oldClearColor: Color;
|
|
32
|
-
oldClearAlpha: number;
|
|
33
|
-
basic: MeshBasicMaterial;
|
|
34
|
-
fsQuad: FullScreenQuad;
|
|
35
|
-
static BlurDirectionX: any;
|
|
36
|
-
static BlurDirectionY: any;
|
|
37
|
-
constructor(resolution: Vector2, strength: number, radius: number, threshold: number);
|
|
38
|
-
dispose(): void;
|
|
39
|
-
setSize(width: number, height: number): void;
|
|
40
|
-
render(renderer: WebGLRenderer, writeBuffer: any, readBuffer: {
|
|
41
|
-
texture: Texture;
|
|
42
|
-
}, deltaTime: any, maskActive: any): void;
|
|
43
|
-
getSeperableBlurMaterial(kernelRadius: number): ShaderMaterial;
|
|
44
|
-
getCompositeMaterial(nMips: number): ShaderMaterial;
|
|
45
|
-
}
|
|
46
|
-
export { UnrealBloomPass };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
|
|
3
|
-
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer';
|
|
4
|
-
import GUI from 'lil-gui';
|
|
5
|
-
import ComposerController from '../../../core/Composer';
|
|
6
|
-
import { UnrealBloomPass } from './UnrealBloomPass';
|
|
7
|
-
export interface BloomParams {
|
|
8
|
-
threshold: number;
|
|
9
|
-
strength: number;
|
|
10
|
-
radius: number;
|
|
11
|
-
}
|
|
12
|
-
export declare const defaultBloomParams: {
|
|
13
|
-
threshold: number;
|
|
14
|
-
strength: number;
|
|
15
|
-
radius: number;
|
|
16
|
-
};
|
|
17
|
-
export default class {
|
|
18
|
-
composerController: ComposerController;
|
|
19
|
-
bloomComposer: EffectComposer;
|
|
20
|
-
bloomPass: UnrealBloomPass;
|
|
21
|
-
finalPass: ShaderPass;
|
|
22
|
-
options: BloomParams;
|
|
23
|
-
materials: Record<string, any>;
|
|
24
|
-
bloomLayer: THREE.Layers;
|
|
25
|
-
active: boolean;
|
|
26
|
-
constructor(composerController: ComposerController, options: BloomParams);
|
|
27
|
-
enable(): void;
|
|
28
|
-
disable(): void;
|
|
29
|
-
render(scene: THREE.Scene): void;
|
|
30
|
-
setSize(width: number, height: number): void;
|
|
31
|
-
setGui(gui: GUI): void;
|
|
32
|
-
dispose(): void;
|
|
33
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass';
|
|
3
|
-
import GUIObject from '../../../core/GUIObject';
|
|
4
|
-
import ComposerController from '../../../core/Composer';
|
|
5
|
-
export interface OutlineParams {
|
|
6
|
-
edgeStrength: number;
|
|
7
|
-
edgeGlow: number;
|
|
8
|
-
edgeThickness: number;
|
|
9
|
-
pulsePeriod: number;
|
|
10
|
-
rotate: boolean;
|
|
11
|
-
usePatternTexture: boolean;
|
|
12
|
-
visibleEdgeColor: string;
|
|
13
|
-
hiddenEdgeColor: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const defaultOutlineParams: {
|
|
16
|
-
edgeStrength: number;
|
|
17
|
-
edgeGlow: number;
|
|
18
|
-
edgeThickness: number;
|
|
19
|
-
pulsePeriod: number;
|
|
20
|
-
rotate: boolean;
|
|
21
|
-
usePatternTexture: boolean;
|
|
22
|
-
visibleEdgeColor: string;
|
|
23
|
-
hiddenEdgeColor: string;
|
|
24
|
-
};
|
|
25
|
-
export default class {
|
|
26
|
-
composerController: ComposerController;
|
|
27
|
-
outlinePass: OutlinePass;
|
|
28
|
-
options: OutlineParams;
|
|
29
|
-
selectedObjects: THREE.Mesh[];
|
|
30
|
-
active: boolean;
|
|
31
|
-
outlineGui: GUIObject;
|
|
32
|
-
constructor(composerController: ComposerController, options: OutlineParams);
|
|
33
|
-
enable(): void;
|
|
34
|
-
disable(): void;
|
|
35
|
-
setGui(): void;
|
|
36
|
-
dispose(): void;
|
|
37
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { SSRPass } from 'three/examples/jsm/postprocessing/SSRPass';
|
|
3
|
-
import { ReflectorForSSRPass } from 'three/examples/jsm/objects/ReflectorForSSRPass';
|
|
4
|
-
import ComposerController from '../../../core/Composer';
|
|
5
|
-
import GUIObject from '../../../core/GUIObject';
|
|
6
|
-
export interface SSRParams {
|
|
7
|
-
maxDistance: number;
|
|
8
|
-
selects: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const defaultSSRParams: {
|
|
11
|
-
maxDistance: number;
|
|
12
|
-
selects: boolean;
|
|
13
|
-
};
|
|
14
|
-
interface GroundReflectorParams {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
clipBias: number;
|
|
18
|
-
color: number;
|
|
19
|
-
useDepthTexture: boolean;
|
|
20
|
-
}
|
|
21
|
-
export default class {
|
|
22
|
-
composerController: ComposerController;
|
|
23
|
-
ssrPass: SSRPass;
|
|
24
|
-
options: SSRParams;
|
|
25
|
-
selectedObjects: THREE.Mesh[];
|
|
26
|
-
groundReflector?: ReflectorForSSRPass;
|
|
27
|
-
ssrGui: GUIObject;
|
|
28
|
-
active: boolean;
|
|
29
|
-
constructor(composerController: ComposerController, options: SSRParams);
|
|
30
|
-
addGroundReflector(options?: Partial<GroundReflectorParams>): void;
|
|
31
|
-
removeaGroundReflector(): void;
|
|
32
|
-
enable(): void;
|
|
33
|
-
disable(): void;
|
|
34
|
-
setSize(width: number, height: number): void;
|
|
35
|
-
setGui(): void;
|
|
36
|
-
dispose(): void;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
package/dist/effect/outline.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import type { IBaseObject } from '../core/BaseObject';
|
|
3
|
-
interface Options {
|
|
4
|
-
exclude?: THREE.Mesh[];
|
|
5
|
-
include?: THREE.Mesh[];
|
|
6
|
-
}
|
|
7
|
-
export default class {
|
|
8
|
-
object: IBaseObject;
|
|
9
|
-
options: Options;
|
|
10
|
-
constructor(object: IBaseObject, options?: Options);
|
|
11
|
-
private check;
|
|
12
|
-
enable(): void;
|
|
13
|
-
disable(): void;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
package/dist/effect/ssr.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import type { IBaseObject } from '../core/BaseObject';
|
|
3
|
-
interface Options {
|
|
4
|
-
exclude?: THREE.Mesh[];
|
|
5
|
-
include?: THREE.Mesh[];
|
|
6
|
-
}
|
|
7
|
-
export default class {
|
|
8
|
-
object: IBaseObject;
|
|
9
|
-
options: Options;
|
|
10
|
-
constructor(object: IBaseObject, options?: Options);
|
|
11
|
-
private check;
|
|
12
|
-
enable(): void;
|
|
13
|
-
disable(): void;
|
|
14
|
-
}
|
|
15
|
-
export {};
|