gl-draw 0.1.1 → 0.1.4
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/core/Pencil.d.ts +1 -0
- package/dist/core/Renderer.d.ts +2 -0
- package/dist/index.js +3 -3
- package/dist/index.module.js +3 -3
- package/package.json +1 -1
package/dist/core/Pencil.d.ts
CHANGED
package/dist/core/Renderer.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface RendererParams {
|
|
|
17
17
|
outputEncoding: THREE.TextureEncoding;
|
|
18
18
|
logarithmicDepthBuffer: boolean;
|
|
19
19
|
preserveDrawingBuffer: boolean;
|
|
20
|
+
context: WebGLRenderingContext | undefined;
|
|
20
21
|
}
|
|
21
22
|
export declare const defaultRendererParams: {
|
|
22
23
|
antialias: boolean;
|
|
@@ -28,6 +29,7 @@ export declare const defaultRendererParams: {
|
|
|
28
29
|
outputEncoding: THREE.TextureEncoding;
|
|
29
30
|
logarithmicDepthBuffer: boolean;
|
|
30
31
|
preserveDrawingBuffer: boolean;
|
|
32
|
+
context: null;
|
|
31
33
|
};
|
|
32
34
|
interface Options {
|
|
33
35
|
isdev: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(d,p,b){return Function.prototype.apply.call(d,p,b)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(d){return Object.getOwnPropertyNames(d).concat(Object.getOwnPropertySymbols(d))}:G=function(d){return Object.getOwnPropertyNames(d)};function z(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(d){return d!==d};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function q(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||E(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(d){if(typeof d!="number"||d<0||E(d))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+d+".");return this._maxListeners=d,this};function W(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(d){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var _=d==="error",L=this._events;if(L!==void 0)_=_&&L.error===void 0;else if(!_)return!1;if(_){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var I=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw I.context=j,I}var ae=L[d];if(ae===void 0)return!1;if(typeof ae=="function")C(ae,this,p);else for(var de=ae.length,he=oe(ae,de),b=0;b<de;++b)C(he[b],this,p);return!0};function U(f,d,p,b){var _,L,j;if(q(p),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",d,p.listener?p.listener:p),L=f._events),j=L[d]),j===void 0)j=L[d]=p,++f._eventsCount;else if(typeof j=="function"?j=L[d]=b?[p,j]:[j,p]:b?j.unshift(p):j.push(p),_=W(f),_>0&&j.length>_&&!j.warned){j.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(d)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=f,I.type=d,I.count=j.length,z(I)}return f}m.prototype.addListener=function(d,p){return U(this,d,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(d,p){return U(this,d,p,!0)};function X(){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,d,p){var b={fired:!1,wrapFn:void 0,target:f,type:d,listener:p},_=X.bind(b);return _.listener=p,b.wrapFn=_,_}m.prototype.once=function(d,p){return q(p),this.on(d,l(this,d,p)),this},m.prototype.prependOnceListener=function(d,p){return q(p),this.prependListener(d,l(this,d,p)),this},m.prototype.removeListener=function(d,p){var b,_,L,j,I;if(q(p),_=this._events,_===void 0)return this;if(b=_[d],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete _[d],_.removeListener&&this.emit("removeListener",d,b.listener||p));else if(typeof b!="function"){for(L=-1,j=b.length-1;j>=0;j--)if(b[j]===p||b[j].listener===p){I=b[j].listener,L=j;break}if(L<0)return this;L===0?b.shift():ie(b,L),b.length===1&&(_[d]=b[0]),_.removeListener!==void 0&&this.emit("removeListener",d,I||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(d){var p,b,_;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[d]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[d]),this;if(arguments.length===0){var L=Object.keys(b),j;for(_=0;_<L.length;++_)j=L[_],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[d],typeof p=="function")this.removeListener(d,p);else if(p!==void 0)for(_=p.length-1;_>=0;_--)this.removeListener(d,p[_]);return this};function Q(f,d,p){var b=f._events;if(b===void 0)return[];var _=b[d];return _===void 0?[]:typeof _=="function"?p?[_.listener||_]:[_]:p?V(_):oe(_,_.length)}m.prototype.listeners=function(d){return Q(this,d,!0)},m.prototype.rawListeners=function(d){return Q(this,d,!1)},m.listenerCount=function(f,d){return typeof f.listenerCount=="function"?f.listenerCount(d):ne.call(f,d)},m.prototype.listenerCount=ne;function ne(f){var d=this._events;if(d!==void 0){var p=d[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function oe(f,d){for(var p=new Array(d),b=0;b<d;++b)p[b]=f[b];return p}function ie(f,d){for(;d+1<f.length;d++)f[d]=f[d+1];f.pop()}function V(f){for(var d=new Array(f.length),p=0;p<d.length;++p)d[p]=f[p].listener||f[p];return d}function $(f,d){return new Promise(function(p,b){function _(j){f.removeListener(d,L),b(j)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",_),p([].slice.call(arguments))}F(f,d,L,{once:!0}),d!=="error"&&D(f,_,{once:!0})})}function D(f,d,p){typeof f.on=="function"&&F(f,"error",d,p)}function F(f,d,p,b){if(typeof f.on=="function")b.once?f.once(d,p):f.on(d,p);else if(typeof f.addEventListener=="function")f.addEventListener(d,function _(L){b.once&&f.removeEventListener(d,_),p(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(C){"use strict";var G=Object.prototype,z=G.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",q=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function U(v,c,g){return Object.defineProperty(v,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[c]}try{U({},"")}catch(v){U=function(c,g,O){return c[g]=O}}function X(v,c,g,O){var x=c&&c.prototype instanceof $?c:$,H=Object.create(x.prototype),ee=new he(O||[]);return H._invoke=j(v,g,ee),H}C.wrap=X;function l(v,c,g){try{return{type:"normal",arg:v.call(c,g)}}catch(O){return{type:"throw",arg:O}}}var Q="suspendedStart",ne="suspendedYield",oe="executing",ie="completed",V={};function $(){}function D(){}function F(){}var f={};U(f,B,function(){return this});var d=Object.getPrototypeOf,p=d&&d(d(ve([])));p&&p!==G&&z.call(p,B)&&(f=p);var b=F.prototype=$.prototype=Object.create(f);D.prototype=F,U(b,"constructor",F),U(F,"constructor",D),D.displayName=U(F,W,"GeneratorFunction");function _(v){["next","throw","return"].forEach(function(c){U(v,c,function(g){return this._invoke(c,g)})})}C.isGeneratorFunction=function(v){var c=typeof v=="function"&&v.constructor;return c?c===D||(c.displayName||c.name)==="GeneratorFunction":!1},C.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,F):(v.__proto__=F,U(v,W,"GeneratorFunction")),v.prototype=Object.create(b),v},C.awrap=function(v){return{__await:v}};function L(v,c){function g(H,ee,J,te){var Y=l(v[H],v,ee);if(Y.type==="throw")te(Y.arg);else{var pe=Y.arg,me=pe.value;return me&&typeof me=="object"&&z.call(me,"__await")?c.resolve(me.__await).then(function(fe){g("next",fe,J,te)},function(fe){g("throw",fe,J,te)}):c.resolve(me).then(function(fe){pe.value=fe,J(pe)},function(fe){return g("throw",fe,J,te)})}}var O;function x(H,ee){function J(){return new c(function(te,Y){g(H,ee,te,Y)})}return O=O?O.then(J,J):J()}this._invoke=x}_(L.prototype),U(L.prototype,q,function(){return this}),C.AsyncIterator=L,C.async=function(v,c,g,O,x){x===void 0&&(x=Promise);var H=new L(X(v,c,g,O),x);return C.isGeneratorFunction(c)?H:H.next().then(function(ee){return ee.done?ee.value:H.next()})};function j(v,c,g){var O=Q;return function(H,ee){if(O===oe)throw new Error("Generator is already running");if(O===ie){if(H==="throw")throw ee;return ce()}for(g.method=H,g.arg=ee;;){var J=g.delegate;if(J){var te=I(J,g);if(te){if(te===V)continue;return te}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===Q)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=oe;var Y=l(v,c,g);if(Y.type==="normal"){if(O=g.done?ie:ne,Y.arg===V)continue;return{value:Y.arg,done:g.done}}else Y.type==="throw"&&(O=ie,g.method="throw",g.arg=Y.arg)}}}function I(v,c){var g=v.iterator[c.method];if(g===E){if(c.delegate=null,c.method==="throw"){if(v.iterator.return&&(c.method="return",c.arg=E,I(v,c),c.method==="throw"))return V;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return V}var O=l(g,v.iterator,c.arg);if(O.type==="throw")return c.method="throw",c.arg=O.arg,c.delegate=null,V;var x=O.arg;if(!x)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,V;if(x.done)c[v.resultName]=x.value,c.next=v.nextLoc,c.method!=="return"&&(c.method="next",c.arg=E);else return x;return c.delegate=null,V}_(b),U(b,W,"Generator"),U(b,B,function(){return this}),U(b,"toString",function(){return"[object Generator]"});function ae(v){var c={tryLoc:v[0]};1 in v&&(c.catchLoc=v[1]),2 in v&&(c.finallyLoc=v[2],c.afterLoc=v[3]),this.tryEntries.push(c)}function de(v){var c=v.completion||{};c.type="normal",delete c.arg,v.completion=c}function he(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(ae,this),this.reset(!0)}C.keys=function(v){var c=[];for(var g in v)c.push(g);return c.reverse(),function O(){for(;c.length;){var x=c.pop();if(x in v)return O.value=x,O.done=!1,O}return O.done=!0,O}};function ve(v){if(v){var c=v[B];if(c)return c.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,O=function x(){for(;++g<v.length;)if(z.call(v,g))return x.value=v[g],x.done=!1,x;return x.value=E,x.done=!0,x};return O.next=O}}return{next:ce}}C.values=ve;function ce(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!v)for(var c in this)c.charAt(0)==="t"&&z.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=E)},stop:function(){this.done=!0;var v=this.tryEntries[0],c=v.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var c=this;function g(te,Y){return H.type="throw",H.arg=v,c.next=te,Y&&(c.method="next",c.arg=E),!!Y}for(var O=this.tryEntries.length-1;O>=0;--O){var x=this.tryEntries[O],H=x.completion;if(x.tryLoc==="root")return g("end");if(x.tryLoc<=this.prev){var ee=z.call(x,"catchLoc"),J=z.call(x,"finallyLoc");if(ee&&J){if(this.prev<x.catchLoc)return g(x.catchLoc,!0);if(this.prev<x.finallyLoc)return g(x.finallyLoc)}else if(ee){if(this.prev<x.catchLoc)return g(x.catchLoc,!0)}else if(J){if(this.prev<x.finallyLoc)return g(x.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,c){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&z.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var x=O;break}}x&&(v==="break"||v==="continue")&&x.tryLoc<=c&&c<=x.finallyLoc&&(x=null);var H=x?x.completion:{};return H.type=v,H.arg=c,x?(this.method="next",this.next=x.finallyLoc,V):this.complete(H)},complete:function(v,c){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&c&&(this.next=c),V},finish:function(v){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),de(g),V}},catch:function(v){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===v){var O=g.completion;if(O.type==="throw"){var x=O.arg;de(g)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(v,c,g){return this.delegate={iterator:ve(v),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=E),V}},C}(R.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(R,T,C){"use strict";C.d(T,{Z:function(){return G}});function G(z){if(z.geometry&&z.geometry.dispose(),z.material){var E=Array.isArray(z.material)?z.material:[z.material];E.forEach(function(m){var B,q,W,U,X,l,Q,ne,oe,ie,V,$,D;(B=m.map)===null||B===void 0||B.dispose(),(q=m.lightMap)===null||q===void 0||q.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(U=m.normalMap)===null||U===void 0||U.dispose(),(X=m.specularMap)===null||X===void 0||X.dispose(),(l=m.envMap)===null||l===void 0||l.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(ne=m.aoMap)===null||ne===void 0||ne.dispose(),(oe=m.displacementMap)===null||oe===void 0||oe.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(V=m.gradientMap)===null||V===void 0||V.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(D=m.roughnessMap)===null||D===void 0||D.dispose(),m.dispose()})}}},54:function(R,T,C){"use strict";C.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return W.Z}});var G=C(666),z=C.n(G),E=null,m=C(182),B=C(644);function q(V){if(V.material){var $=Array.isArray(V.material)?V.material:[V.material];$.forEach(function(D){var F,f;(F=D.color)===null||F===void 0||F.convertSRGBToLinear(),(f=D.emissive)===null||f===void 0||f.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=C(975),U=C(568),X=C(924),l=require("idb-keyval"),Q=C(620),ne=null,oe=null,ie=function(){var V=(0,U.Z)(z().mark(function $(D,F){var f,d,p,b,_,L;return z().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return f=F.version,I.next=4,(0,l.get)(D);case 4:if(p=I.sent,!(p&&p[f])){I.next=9;break}d=p[f],I.next=15;break;case 9:return I.next=11,(0,Q.Z)(fetch(D).then(function(ae){if(ae.ok)return ae.blob();throw new Error}));case 11:b=I.sent,_=b.res,L=b.err,L||(d=_,(0,l.set)(D,(0,X.Z)({},f,_)));case 15:return I.abrupt("return",d?{url:URL.createObjectURL(d)}:{url:D});case 16:case"end":return I.stop()}},$)}));return function(D,F){return V.apply(this,arguments)}}()},975:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function z(E){if(G(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},620:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});var G=C(42);function z(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.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)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});function G(E,m,B,q,W,U,X){try{var l=E[U](X),Q=l.value}catch(ne){B(ne);return}l.done?m(Q):Promise.resolve(Q).then(q,W)}function z(E){return function(){var m=this,B=arguments;return new Promise(function(q,W){var U=E.apply(m,B);function X(Q){G(U,q,W,X,l,"next",Q)}function l(Q){G(U,q,W,X,l,"throw",Q)}X(void 0)})}}},924:function(R,T,C){"use strict";C.d(T,{Z:function(){return G}});function G(z,E,m){return E in z?Object.defineProperty(z,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):z[E]=m,z}},42:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});var G=C(924);function z(E){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},q=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(q=q.concat(Object.getOwnPropertySymbols(B).filter(function(W){return Object.getOwnPropertyDescriptor(B,W).enumerable}))),q.forEach(function(W){(0,G.Z)(E,W,B[W])})}return E}}},Oe={};function K(R){var T=Oe[R];if(T!==void 0)return T.exports;var C=Oe[R]={exports:{}};return Be[R](C,C.exports,K),C.exports}(function(){K.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return K.d(T,{a:T}),T}})(),function(){K.d=function(R,T){for(var C in T)K.o(T,C)&&!K.o(R,C)&&Object.defineProperty(R,C,{enumerable:!0,get:T[C]})}}(),function(){K.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){K.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";K.r(Pe),K.d(Pe,{BaseObject:function(){return pt},GUIObject:function(){return F},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function C(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var G=K(42);function z(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return m(s)}function q(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function W(){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 U(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function X(s){return B(s)||q(s)||U(s)||W()}var l=K(644),Q=K(187),ne=require("deepmerge"),oe=K.n(ne),ie=require("three/examples/jsm/libs/stats.module"),V=K.n(ie),$=require("lil-gui"),D=K.n($),F=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,S=h.name,M=h.paramMap,A=h.items,Z=h.value,N=h.target,se=a.toLowerCase().indexOf("color")>-1,k,re=typeof Z=="undefined"&&N,ue=re?N():u[a],le=re?a:"value";A?k=o.add(ue,le,A):se?k=o.addColor(ue,le):k=o.add(ue,le),k=k.name(S||a),typeof w!="undefined"&&(k=k.min(w)),typeof P!="undefined"&&(k=k.max(P)),typeof y!="undefined"&&(k=k.step(y)),k=k.onChange(function(){t.setTargetValue(r,a,ue[le],M)}),re&&k.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var S=h();Array.isArray(S)||(S=[S]),S.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(A){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},d={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},p=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.alpha,u=r.devicePixelRatio,a=r.antialias,h=r.powerPreference,w=r.toneMapping,P=r.toneMappingExposure,y=r.outputEncoding,S=r.logarithmicDepthBuffer,M=r.preserveDrawingBuffer,A=new l.WebGLRenderer({alpha:o,antialias:a,powerPreference:h,logarithmicDepthBuffer:S,preserveDrawingBuffer:M});A.setSize(e,t),A.setPixelRatio(u),A.autoClear=!1,A.toneMapping=f[w],A.toneMappingExposure=P,A.outputEncoding=y,this.renderer=A}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new F({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),b={fov:45,near:1,far:1e3},_=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new F({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),L=K(54),j={background:null},I=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,L.disposeMesh)(t)})},s}(),ae=require("three/examples/jsm/controls/OrbitControls"),de={},he=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new ae.MapControls(e,o):new ae.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 i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,S=y===void 0?1/0:y,M=e.minY,A=M===void 0?-1/0:M,Z=this.limitPanV||new l.Vector3,N=this.control,se=this.options.camera,k=new l.Vector3(u,A,P),re=new l.Vector3(r,S,h);this.limitPanV=Z,Z.copy(N.target),N.target.clamp(k,re),Z.sub(N.target),se.position.sub(Z)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ve=require("three/examples/jsm/renderers/CSS3DRenderer"),ce=new l.Vector3,v=new l.Matrix4,c=new l.Matrix4,g=new l.Vector3,O=new l.Vector3,x=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,A){return g.setFromMatrixPosition(M.matrixWorld),O.setFromMatrixPosition(A.matrixWorld),g.distanceToSquared(O)},e=function(M){var A=[];return M.traverse(function(Z){Z.isCSS2DObject&&A.push(Z)}),A},t=function(M){for(var A=e(M).sort(function(re,ue){if(re.renderOrder!==ue.renderOrder)return ue.renderOrder-re.renderOrder;var le=w.objects.get(re).distanceToCameraSquared,ye=w.objects.get(ue).distanceToCameraSquared;return le-ye}),Z=A.length,N=0,se=A.length;N<se;N++){var k=A[N].userData.zIndexFix||0;A[N].element.style.zIndex=Z-N+k}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(S,M){S.autoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),v.copy(M.matrixWorldInverse),c.multiplyMatrices(M.projectionMatrix,v),y(S,S,M),t(S)},this.setSize=function(S,M){o=S,u=M,a=o/2,h=u/2,P.style.width="".concat(S,"px"),P.style.height="".concat(M,"px")};function y(S,M,A){if(S.isCSS2DObject){ce.setFromMatrixPosition(S.matrixWorld),ce.applyMatrix4(c);var Z=S.visible===!0&&ce.z>=-1&&ce.z<=1&&S.layers.test(A.layers)===!0;if(S.element.style.display=Z===!0?"":"none",Z===!0){S.onBeforeRender(r,M,A);var N=S.element;N.style.transform="translate(-50%,-50%) translate(".concat(ce.x*a+a,"px,").concat(-ce.y*h+h,"px)"),N.parentNode!==P&&P.appendChild(N),S.onAfterRender(r,M,A)}var se={distanceToCameraSquared:n(A,S)};w.objects.set(S,se)}for(var k=0,re=S.children.length;k<re;k++)y(S.children[k],M,A)}},H={zIndex:"auto"},ee=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new x:new ve.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),J=require("three/examples/jsm/postprocessing/EffectComposer"),te=require("three/examples/jsm/postprocessing/RenderPass"),Y=require("three/examples/jsm/postprocessing/ShaderPass"),pe=require("three/examples/jsm/shaders/CopyShader"),me=require("three/examples/jsm/shaders/GammaCorrectionShader"),fe=require("three/examples/jsm/postprocessing/SMAAPass"),Fe=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ue=require("three/examples/jsm/shaders/FXAAShader"),ke=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,Ve=1,ge=!1,Re=ke()!==!1,Ie=`varying vec2 vUv;
|
|
1
|
+
(function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(d,p,b){return Function.prototype.apply.call(d,p,b)},z;T&&typeof T.ownKeys=="function"?z=T.ownKeys:Object.getOwnPropertySymbols?z=function(d){return Object.getOwnPropertyNames(d).concat(Object.getOwnPropertySymbols(d))}:z=function(d){return Object.getOwnPropertyNames(d)};function D(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(d){return d!==d};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var F=10;function q(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 F},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");F=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(d){if(typeof d!="number"||d<0||E(d))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+d+".");return this._maxListeners=d,this};function H(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return H(this)},m.prototype.emit=function(d){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var _=d==="error",L=this._events;if(L!==void 0)_=_&&L.error===void 0;else if(!_)return!1;if(_){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var N=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw N.context=j,N}var ae=L[d];if(ae===void 0)return!1;if(typeof ae=="function")C(ae,this,p);else for(var de=ae.length,he=oe(ae,de),b=0;b<de;++b)C(he[b],this,p);return!0};function k(f,d,p,b){var _,L,j;if(q(p),L=f._events,L===void 0?(L=f._events=Object.create(null),f._eventsCount=0):(L.newListener!==void 0&&(f.emit("newListener",d,p.listener?p.listener:p),L=f._events),j=L[d]),j===void 0)j=L[d]=p,++f._eventsCount;else if(typeof j=="function"?j=L[d]=b?[p,j]:[j,p]:b?j.unshift(p):j.push(p),_=H(f),_>0&&j.length>_&&!j.warned){j.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(d)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=f,N.type=d,N.count=j.length,D(N)}return f}m.prototype.addListener=function(d,p){return k(this,d,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(d,p){return k(this,d,p,!0)};function X(){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,d,p){var b={fired:!1,wrapFn:void 0,target:f,type:d,listener:p},_=X.bind(b);return _.listener=p,b.wrapFn=_,_}m.prototype.once=function(d,p){return q(p),this.on(d,l(this,d,p)),this},m.prototype.prependOnceListener=function(d,p){return q(p),this.prependListener(d,l(this,d,p)),this},m.prototype.removeListener=function(d,p){var b,_,L,j,N;if(q(p),_=this._events,_===void 0)return this;if(b=_[d],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete _[d],_.removeListener&&this.emit("removeListener",d,b.listener||p));else if(typeof b!="function"){for(L=-1,j=b.length-1;j>=0;j--)if(b[j]===p||b[j].listener===p){N=b[j].listener,L=j;break}if(L<0)return this;L===0?b.shift():ie(b,L),b.length===1&&(_[d]=b[0]),_.removeListener!==void 0&&this.emit("removeListener",d,N||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(d){var p,b,_;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[d]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[d]),this;if(arguments.length===0){var L=Object.keys(b),j;for(_=0;_<L.length;++_)j=L[_],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[d],typeof p=="function")this.removeListener(d,p);else if(p!==void 0)for(_=p.length-1;_>=0;_--)this.removeListener(d,p[_]);return this};function Q(f,d,p){var b=f._events;if(b===void 0)return[];var _=b[d];return _===void 0?[]:typeof _=="function"?p?[_.listener||_]:[_]:p?I(_):oe(_,_.length)}m.prototype.listeners=function(d){return Q(this,d,!0)},m.prototype.rawListeners=function(d){return Q(this,d,!1)},m.listenerCount=function(f,d){return typeof f.listenerCount=="function"?f.listenerCount(d):ne.call(f,d)},m.prototype.listenerCount=ne;function ne(f){var d=this._events;if(d!==void 0){var p=d[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function oe(f,d){for(var p=new Array(d),b=0;b<d;++b)p[b]=f[b];return p}function ie(f,d){for(;d+1<f.length;d++)f[d]=f[d+1];f.pop()}function I(f){for(var d=new Array(f.length),p=0;p<d.length;++p)d[p]=f[p].listener||f[p];return d}function $(f,d){return new Promise(function(p,b){function _(j){f.removeListener(d,L),b(j)}function L(){typeof f.removeListener=="function"&&f.removeListener("error",_),p([].slice.call(arguments))}U(f,d,L,{once:!0}),d!=="error"&&A(f,_,{once:!0})})}function A(f,d,p){typeof f.on=="function"&&U(f,"error",d,p)}function U(f,d,p,b){if(typeof f.on=="function")b.once?f.once(d,p):f.on(d,p);else if(typeof f.addEventListener=="function")f.addEventListener(d,function _(L){b.once&&f.removeEventListener(d,_),p(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(C){"use strict";var z=Object.prototype,D=z.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},F=m.iterator||"@@iterator",q=m.asyncIterator||"@@asyncIterator",H=m.toStringTag||"@@toStringTag";function k(v,c,g){return Object.defineProperty(v,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[c]}try{k({},"")}catch(v){k=function(c,g,O){return c[g]=O}}function X(v,c,g,O){var x=c&&c.prototype instanceof $?c:$,Z=Object.create(x.prototype),ee=new he(O||[]);return Z._invoke=j(v,g,ee),Z}C.wrap=X;function l(v,c,g){try{return{type:"normal",arg:v.call(c,g)}}catch(O){return{type:"throw",arg:O}}}var Q="suspendedStart",ne="suspendedYield",oe="executing",ie="completed",I={};function $(){}function A(){}function U(){}var f={};k(f,F,function(){return this});var d=Object.getPrototypeOf,p=d&&d(d(ve([])));p&&p!==z&&D.call(p,F)&&(f=p);var b=U.prototype=$.prototype=Object.create(f);A.prototype=U,k(b,"constructor",U),k(U,"constructor",A),A.displayName=k(U,H,"GeneratorFunction");function _(v){["next","throw","return"].forEach(function(c){k(v,c,function(g){return this._invoke(c,g)})})}C.isGeneratorFunction=function(v){var c=typeof v=="function"&&v.constructor;return c?c===A||(c.displayName||c.name)==="GeneratorFunction":!1},C.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,U):(v.__proto__=U,k(v,H,"GeneratorFunction")),v.prototype=Object.create(b),v},C.awrap=function(v){return{__await:v}};function L(v,c){function g(Z,ee,J,te){var Y=l(v[Z],v,ee);if(Y.type==="throw")te(Y.arg);else{var pe=Y.arg,me=pe.value;return me&&typeof me=="object"&&D.call(me,"__await")?c.resolve(me.__await).then(function(fe){g("next",fe,J,te)},function(fe){g("throw",fe,J,te)}):c.resolve(me).then(function(fe){pe.value=fe,J(pe)},function(fe){return g("throw",fe,J,te)})}}var O;function x(Z,ee){function J(){return new c(function(te,Y){g(Z,ee,te,Y)})}return O=O?O.then(J,J):J()}this._invoke=x}_(L.prototype),k(L.prototype,q,function(){return this}),C.AsyncIterator=L,C.async=function(v,c,g,O,x){x===void 0&&(x=Promise);var Z=new L(X(v,c,g,O),x);return C.isGeneratorFunction(c)?Z:Z.next().then(function(ee){return ee.done?ee.value:Z.next()})};function j(v,c,g){var O=Q;return function(Z,ee){if(O===oe)throw new Error("Generator is already running");if(O===ie){if(Z==="throw")throw ee;return ce()}for(g.method=Z,g.arg=ee;;){var J=g.delegate;if(J){var te=N(J,g);if(te){if(te===I)continue;return te}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===Q)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=oe;var Y=l(v,c,g);if(Y.type==="normal"){if(O=g.done?ie:ne,Y.arg===I)continue;return{value:Y.arg,done:g.done}}else Y.type==="throw"&&(O=ie,g.method="throw",g.arg=Y.arg)}}}function N(v,c){var g=v.iterator[c.method];if(g===E){if(c.delegate=null,c.method==="throw"){if(v.iterator.return&&(c.method="return",c.arg=E,N(v,c),c.method==="throw"))return I;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return I}var O=l(g,v.iterator,c.arg);if(O.type==="throw")return c.method="throw",c.arg=O.arg,c.delegate=null,I;var x=O.arg;if(!x)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,I;if(x.done)c[v.resultName]=x.value,c.next=v.nextLoc,c.method!=="return"&&(c.method="next",c.arg=E);else return x;return c.delegate=null,I}_(b),k(b,H,"Generator"),k(b,F,function(){return this}),k(b,"toString",function(){return"[object Generator]"});function ae(v){var c={tryLoc:v[0]};1 in v&&(c.catchLoc=v[1]),2 in v&&(c.finallyLoc=v[2],c.afterLoc=v[3]),this.tryEntries.push(c)}function de(v){var c=v.completion||{};c.type="normal",delete c.arg,v.completion=c}function he(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(ae,this),this.reset(!0)}C.keys=function(v){var c=[];for(var g in v)c.push(g);return c.reverse(),function O(){for(;c.length;){var x=c.pop();if(x in v)return O.value=x,O.done=!1,O}return O.done=!0,O}};function ve(v){if(v){var c=v[F];if(c)return c.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,O=function x(){for(;++g<v.length;)if(D.call(v,g))return x.value=v[g],x.done=!1,x;return x.value=E,x.done=!0,x};return O.next=O}}return{next:ce}}C.values=ve;function ce(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!v)for(var c in this)c.charAt(0)==="t"&&D.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=E)},stop:function(){this.done=!0;var v=this.tryEntries[0],c=v.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var c=this;function g(te,Y){return Z.type="throw",Z.arg=v,c.next=te,Y&&(c.method="next",c.arg=E),!!Y}for(var O=this.tryEntries.length-1;O>=0;--O){var x=this.tryEntries[O],Z=x.completion;if(x.tryLoc==="root")return g("end");if(x.tryLoc<=this.prev){var ee=D.call(x,"catchLoc"),J=D.call(x,"finallyLoc");if(ee&&J){if(this.prev<x.catchLoc)return g(x.catchLoc,!0);if(this.prev<x.finallyLoc)return g(x.finallyLoc)}else if(ee){if(this.prev<x.catchLoc)return g(x.catchLoc,!0)}else if(J){if(this.prev<x.finallyLoc)return g(x.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,c){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&D.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var x=O;break}}x&&(v==="break"||v==="continue")&&x.tryLoc<=c&&c<=x.finallyLoc&&(x=null);var Z=x?x.completion:{};return Z.type=v,Z.arg=c,x?(this.method="next",this.next=x.finallyLoc,I):this.complete(Z)},complete:function(v,c){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&c&&(this.next=c),I},finish:function(v){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),de(g),I}},catch:function(v){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===v){var O=g.completion;if(O.type==="throw"){var x=O.arg;de(g)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(v,c,g){return this.delegate={iterator:ve(v),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=E),I}},C}(R.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});function z(D){if(D.geometry&&D.geometry.dispose(),D.material){var E=Array.isArray(D.material)?D.material:[D.material];E.forEach(function(m){var F,q,H,k,X,l,Q,ne,oe,ie,I,$,A;(F=m.map)===null||F===void 0||F.dispose(),(q=m.lightMap)===null||q===void 0||q.dispose(),(H=m.bumpMap)===null||H===void 0||H.dispose(),(k=m.normalMap)===null||k===void 0||k.dispose(),(X=m.specularMap)===null||X===void 0||X.dispose(),(l=m.envMap)===null||l===void 0||l.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(ne=m.aoMap)===null||ne===void 0||ne.dispose(),(oe=m.displacementMap)===null||oe===void 0||oe.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(I=m.gradientMap)===null||I===void 0||I.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(A=m.roughnessMap)===null||A===void 0||A.dispose(),m.dispose()})}}},54:function(R,T,C){"use strict";C.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return H.Z}});var z=C(666),D=C.n(z),E=null,m=C(182),F=C(644);function q(I){if(I.material){var $=Array.isArray(I.material)?I.material:[I.material];$.forEach(function(A){var U,f;(U=A.color)===null||U===void 0||U.convertSRGBToLinear(),(f=A.emissive)===null||f===void 0||f.convertSRGBToLinear(),A.map&&(A.map.encoding=THREE.sRGBEncoding),A.emissiveMap&&(A.emissiveMap.encoding=THREE.sRGBEncoding)})}}var H=C(975),k=C(568),X=C(924),l=require("idb-keyval"),Q=C(620),ne=null,oe=null,ie=function(){var I=(0,k.Z)(D().mark(function $(A,U){var f,d,p,b,_,L;return D().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return f=U.version,N.next=4,(0,l.get)(A);case 4:if(p=N.sent,!(p&&p[f])){N.next=9;break}d=p[f],N.next=15;break;case 9:return N.next=11,(0,Q.Z)(fetch(A).then(function(ae){if(ae.ok)return ae.blob();throw new Error}));case 11:b=N.sent,_=b.res,L=b.err,L||(d=_,(0,l.set)(A,(0,X.Z)({},f,_)));case 15:return N.abrupt("return",d?{url:URL.createObjectURL(d)}:{url:A});case 16:case"end":return N.stop()}},$)}));return function(A,U){return I.apply(this,arguments)}}()},975:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});function z(E){return Object.prototype.toString.call(E)==="[object Object]"}function D(E){if(z(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var F=m.prototype;return!(z(F)===!1||F.hasOwnProperty("isPrototypeOf")===!1)}},620:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});var z=C(42);function D(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(F){return(0,z.Z)({err:null,res:F},m)}).catch(function(F){return(0,z.Z)({err:F,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});function z(E,m,F,q,H,k,X){try{var l=E[k](X),Q=l.value}catch(ne){F(ne);return}l.done?m(Q):Promise.resolve(Q).then(q,H)}function D(E){return function(){var m=this,F=arguments;return new Promise(function(q,H){var k=E.apply(m,F);function X(Q){z(k,q,H,X,l,"next",Q)}function l(Q){z(k,q,H,X,l,"throw",Q)}X(void 0)})}}},924:function(R,T,C){"use strict";C.d(T,{Z:function(){return z}});function z(D,E,m){return E in D?Object.defineProperty(D,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):D[E]=m,D}},42:function(R,T,C){"use strict";C.d(T,{Z:function(){return D}});var z=C(924);function D(E){for(var m=1;m<arguments.length;m++){var F=arguments[m]!=null?arguments[m]:{},q=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(q=q.concat(Object.getOwnPropertySymbols(F).filter(function(H){return Object.getOwnPropertyDescriptor(F,H).enumerable}))),q.forEach(function(H){(0,z.Z)(E,H,F[H])})}return E}}},Oe={};function K(R){var T=Oe[R];if(T!==void 0)return T.exports;var C=Oe[R]={exports:{}};return Be[R](C,C.exports,K),C.exports}(function(){K.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return K.d(T,{a:T}),T}})(),function(){K.d=function(R,T){for(var C in T)K.o(T,C)&&!K.o(R,C)&&Object.defineProperty(R,C,{enumerable:!0,get:T[C]})}}(),function(){K.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){K.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var Pe={};(function(){"use strict";K.r(Pe),K.d(Pe,{BaseObject:function(){return pt},GUIObject:function(){return U},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function C(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var z=K(42);function D(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function F(s){if(Array.isArray(s))return m(s)}function q(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function H(){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 k(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function X(s){return F(s)||q(s)||k(s)||H()}var l=K(644),Q=K(187),ne=require("deepmerge"),oe=K.n(ne),ie=require("three/examples/jsm/libs/stats.module"),I=K.n(ie),$=require("lil-gui"),A=K.n($),U=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,S=h.name,M=h.paramMap,G=h.items,B=h.value,W=h.target,se=a.toLowerCase().indexOf("color")>-1,V,re=typeof B=="undefined"&&W,ue=re?W():u[a],le=re?a:"value";G?V=o.add(ue,le,G):se?V=o.addColor(ue,le):V=o.add(ue,le),V=V.name(S||a),typeof w!="undefined"&&(V=V.min(w)),typeof P!="undefined"&&(V=V.max(P)),typeof y!="undefined"&&(V=V.step(y)),V=V.onChange(function(){t.setTargetValue(r,a,ue[le],M)}),re&&V.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var S=h();Array.isArray(S)||(S=[S]),S.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(G){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),f={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},d={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},p=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.context,u=r.alpha,a=r.devicePixelRatio,h=r.antialias,w=r.powerPreference,P=r.toneMapping,y=r.toneMappingExposure,S=r.outputEncoding,M=r.logarithmicDepthBuffer,G=r.preserveDrawingBuffer,B=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:w,logarithmicDepthBuffer:M,preserveDrawingBuffer:G});B.setSize(e,t),B.setPixelRatio(a),B.autoClear=!1,B.toneMapping=f[P],B.toneMappingExposure=y,B.outputEncoding=S,this.renderer=B}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new U({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:f,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),b={fov:45,near:1,far:1e3},_=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof l.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new l.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new U({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),L=K(54),j={background:null},N=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new l.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,L.disposeMesh)(t)})},s}(),ae=require("three/examples/jsm/controls/OrbitControls"),de={},he=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new ae.MapControls(e,o):new ae.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 i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,S=y===void 0?1/0:y,M=e.minY,G=M===void 0?-1/0:M,B=this.limitPanV||new l.Vector3,W=this.control,se=this.options.camera,V=new l.Vector3(u,G,P),re=new l.Vector3(r,S,h);this.limitPanV=B,B.copy(W.target),W.target.clamp(V,re),B.sub(W.target),se.position.sub(B)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ve=require("three/examples/jsm/renderers/CSS3DRenderer"),ce=new l.Vector3,v=new l.Matrix4,c=new l.Matrix4,g=new l.Vector3,O=new l.Vector3,x=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,G){return g.setFromMatrixPosition(M.matrixWorld),O.setFromMatrixPosition(G.matrixWorld),g.distanceToSquared(O)},e=function(M){var G=[];return M.traverse(function(B){B.isCSS2DObject&&G.push(B)}),G},t=function(M){for(var G=e(M).sort(function(re,ue){if(re.renderOrder!==ue.renderOrder)return ue.renderOrder-re.renderOrder;var le=w.objects.get(re).distanceToCameraSquared,ye=w.objects.get(ue).distanceToCameraSquared;return le-ye}),B=G.length,W=0,se=G.length;W<se;W++){var V=G[W].userData.zIndexFix||0;G[W].element.style.zIndex=B-W+V}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(S,M){S.autoUpdate===!0&&S.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),v.copy(M.matrixWorldInverse),c.multiplyMatrices(M.projectionMatrix,v),y(S,S,M),t(S)},this.setSize=function(S,M){o=S,u=M,a=o/2,h=u/2,P.style.width="".concat(S,"px"),P.style.height="".concat(M,"px")};function y(S,M,G){if(S.isCSS2DObject){ce.setFromMatrixPosition(S.matrixWorld),ce.applyMatrix4(c);var B=S.visible===!0&&ce.z>=-1&&ce.z<=1&&S.layers.test(G.layers)===!0;if(S.element.style.display=B===!0?"":"none",B===!0){S.onBeforeRender(r,M,G);var W=S.element;W.style.transform="translate(-50%,-50%) translate(".concat(ce.x*a+a,"px,").concat(-ce.y*h+h,"px)"),W.parentNode!==P&&P.appendChild(W),S.onAfterRender(r,M,G)}var se={distanceToCameraSquared:n(G,S)};w.objects.set(S,se)}for(var V=0,re=S.children.length;V<re;V++)y(S.children[V],M,G)}},Z={zIndex:"auto"},ee=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new x:new ve.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),J=require("three/examples/jsm/postprocessing/EffectComposer"),te=require("three/examples/jsm/postprocessing/RenderPass"),Y=require("three/examples/jsm/postprocessing/ShaderPass"),pe=require("three/examples/jsm/shaders/CopyShader"),me=require("three/examples/jsm/shaders/GammaCorrectionShader"),fe=require("three/examples/jsm/postprocessing/SMAAPass"),Fe=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ue=require("three/examples/jsm/shaders/FXAAShader"),ke=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},bt=0,Ve=1,ge=!1,Re=ke()!==!1,Ie=`varying vec2 vUv;
|
|
2
2
|
|
|
3
3
|
void main() {
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ void main() {
|
|
|
15
15
|
|
|
16
16
|
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
17
|
|
|
18
|
-
}`;function Se(s,i){return Se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Se(s,i)}function Me(s,i){return Se(s,i)}function We(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Me(s,i)}function He(){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(s){return!1}}function _e(s){return _e=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},_e(s)}function Te(s){return _e(s)}function Ze(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function qe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function Xe(s,i){return i&&(qe(i)==="object"||typeof i=="function")?i:Ze(s)}function Qe(s){var i=He();return function(){var e=Te(s),t;if(i){var r=Te(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Xe(this,t)}}var je=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";We(n,s);var i=Qe(n);function n(t,r,o,u){R(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new l.Vector2(t.x,t.y):new l.Vector2(256,256),a.clearColor=new l.Color(0,0,0);var h={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(w,P,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var S=new l.WebGLRenderTarget(w,P,h);S.texture.name="UnrealBloomPass.h".concat(y),S.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(S);var M=new l.WebGLRenderTarget(w,P,h);M.texture.name="UnrealBloomPass.v".concat(y),M.texture.generateMipmaps=!1,a.renderTargetsVertical.push(M),w=Math.round(w/2),P=Math.round(P/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var
|
|
18
|
+
}`;function Se(s,i){return Se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Se(s,i)}function Me(s,i){return Se(s,i)}function We(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Me(s,i)}function He(){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(s){return!1}}function _e(s){return _e=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},_e(s)}function Te(s){return _e(s)}function Ze(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function qe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function Xe(s,i){return i&&(qe(i)==="object"||typeof i=="function")?i:Ze(s)}function Qe(s){var i=He();return function(){var e=Te(s),t;if(i){var r=Te(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Xe(this,t)}}var je=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";We(n,s);var i=Qe(n);function n(t,r,o,u){R(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new l.Vector2(t.x,t.y):new l.Vector2(256,256),a.clearColor=new l.Color(0,0,0);var h={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(w,P,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var S=new l.WebGLRenderTarget(w,P,h);S.texture.name="UnrealBloomPass.h".concat(y),S.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(S);var M=new l.WebGLRenderTarget(w,P,h);M.texture.name="UnrealBloomPass.v".concat(y),M.texture.generateMipmaps=!1,a.renderTargetsVertical.push(M),w=Math.round(w/2),P=Math.round(P/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var G=Ee.LuminosityHighPassShader;a.highPassUniforms=l.UniformsUtils.clone(G.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new l.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:G.vertexShader,fragmentShader:G.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var B=[3,5,7,9,11];w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);for(var W=0;W<a.nMips;W++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(B[W])),a.separableBlurMaterials[W].uniforms.texSize.value=new l.Vector2(w,P),w=Math.round(w/2),P=Math.round(P/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var se=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=se,a.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)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,pe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var V=pe.CopyShader;return a.copyUniforms=l.UniformsUtils.clone(V.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new l.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:V.vertexShader,fragmentShader:V.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new l.Color,a.oldClearAlpha=1,a.basic=new l.MeshBasicMaterial,a.fsQuad=new je.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new l.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var w=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var P=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),P=this.renderTargetsVertical[y];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,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=w},e.getSeperableBlurMaterial=function(r){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
19
|
void main() {
|
|
20
20
|
vUv = uv;
|
|
21
21
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -54,4 +54,4 @@ void main() {
|
|
|
54
54
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
55
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
56
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},n}(je.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var Ye={threshold:.2,strength:.5,radius:0},Ke=new l.MeshBasicMaterial({color:"black"}),$e=new l.SpriteMaterial({color:"#000"}),Je=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new J.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ve);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:Ie,fragmentShader:Ne,defines:{}}),S=new Y.ShaderPass(y,"baseTexture");S.needsSwap=!0,this.finalPass=S,o.addPass(S)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?$e:Ke)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new F({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),et=require("three/examples/jsm/postprocessing/OutlinePass"),tt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},rt=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new et.OutlinePass(new l.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new F({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}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function nt(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function it(s,i){if(s==null)return{};var n=nt(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var at=require("three/examples/jsm/postprocessing/SSRPass"),st=require("three/examples/jsm/objects/ReflectorForSSRPass"),ot={maxDistance:10,selects:!0},ut={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},lt=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new at.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ut,e),r=t.width,o=t.height,u=it(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new l.PlaneGeometry(r,o),y=new st.ReflectorForSSRPass(P,E((0,G.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new F({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(r){r?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]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),ct=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new J.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var w=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+l.REVISION>=138&&t>0){var P=new l.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=P}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new te.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new Y.ShaderPass(pe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new Y.ShaderPass(me.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new Y.ShaderPass(Ue.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new fe.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Fe.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new Je(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new rt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new lt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.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},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new l.Clock,this.options=oe()(s.options,n,{isMergeableObject:L.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(D());u.open(!1),this.gui=u}if(r){var a=new(V());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[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(X(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,S=P.height,M=new _({isdev:o,width:y,height:S,cameraParams:w});this.gui&&M.setGui(this.gui);var A=M.camera,Z=new I({camera:A,sceneParams:h}),N=Z.scene,se=new p({width:y,height:S,scene:N,camera:A,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var k=se.renderer;u&&Z.addAxesHelper(),this.sceneController=Z,this.rendererController=se,this.cameraController=M,r.appendChild(k.domElement);var re=new ResizeObserver(function(ue){var le=!0,ye=!1,De=void 0;try{for(var xe=ue[Symbol.iterator](),ze;!(le=(ze=xe.next()).done);le=!0){var mt=ze.value,Ge=mt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(gt){ye=!0,De=gt}finally{try{!le&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});re.observe(r),this.resizeObserver=re},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var S=new ct({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=S,y==="ssaa"&&S.addSSAAPass(),o&&S.addSSRPass(w),t&&S.addBloomPass(a),r&&S.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&S.addGammaCorrectionPass(),y==="fxaa"?S.addFXAAPass():y==="smaa"&&S.addSMAAPass(),S.checkCopyPass(),this.event.on("passcheck",function(){S.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new ee(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new he({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new l.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),S=P.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(A,Z){var N;(N=Z.update)===null||N===void 0||N.call(Z,y,S)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:S})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(s,[{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}}]),s}();Ce.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:E((0,G.Z)({},d),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:j,camera:b,bloom:!1,bloomParams:Ye,outline:!1,outlineParams:tt,css2DRenderer:!1,ssr:!1,ssrParams:ot,css2DRendererParams:(0,G.Z)({},H),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},H)};function ft(){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(s){return!1}}function be(s,i,n){return ft()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var dt=K(620);function ht(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,dt.Z)(n.promise,i)),n}var vt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,L.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},pt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ht(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Mesh,X(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Points,X(t)),this},i.createCSS2DObject=function(e){return this.object3d=new vt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ve.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ve.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,X(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,X(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},C(s,[{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})}}]),s}()})(),module.exports=Pe})();
|
|
57
|
+
}`})},n}(je.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var Ye={threshold:.2,strength:.5,radius:0},Ke=new l.MeshBasicMaterial({color:"black"}),$e=new l.SpriteMaterial({color:"#000"}),Je=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new J.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ve);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:Ie,fragmentShader:Ne,defines:{}}),S=new Y.ShaderPass(y,"baseTexture");S.needsSwap=!0,this.finalPass=S,o.addPass(S)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?$e:Ke)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new U({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),et=require("three/examples/jsm/postprocessing/OutlinePass"),tt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},rt=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new et.OutlinePass(new l.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new U({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}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function nt(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function it(s,i){if(s==null)return{};var n=nt(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var at=require("three/examples/jsm/postprocessing/SSRPass"),st=require("three/examples/jsm/objects/ReflectorForSSRPass"),ot={maxDistance:10,selects:!0},ut={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},lt=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new at.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,z.Z)({},ut,e),r=t.width,o=t.height,u=it(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new l.PlaneGeometry(r,o),y=new st.ReflectorForSSRPass(P,E((0,z.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new U({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(r){r?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]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),ct=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new J.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:r},h;if(+l.REVISION<138&&t>0){var w=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+l.REVISION>=138&&t>0){var P=new l.WebGLRenderTarget(u.width,u.height,E((0,z.Z)({},a),{samples:t}));h=P}else{var y=new l.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new te.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new Y.ShaderPass(pe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new Y.ShaderPass(me.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new Y.ShaderPass(Ue.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new fe.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Fe.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new Je(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new rt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new lt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.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},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new l.Clock,this.options=oe()(s.options,n,{isMergeableObject:L.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(A());u.open(!1),this.gui=u}if(r){var a=new(I());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[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(X(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,S=P.height,M=new _({isdev:o,width:y,height:S,cameraParams:w});this.gui&&M.setGui(this.gui);var G=M.camera,B=new N({camera:G,sceneParams:h}),W=B.scene,se=new p({width:y,height:S,scene:W,camera:G,isdev:o,rendererParams:E((0,z.Z)({},a),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var V=se.renderer;u&&B.addAxesHelper(),this.sceneController=B,this.rendererController=se,this.cameraController=M,r.appendChild(V.domElement);var re=new ResizeObserver(function(ue){var le=!0,ye=!1,De=void 0;try{for(var xe=ue[Symbol.iterator](),ze;!(le=(ze=xe.next()).done);le=!0){var mt=ze.value,Ge=mt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(gt){ye=!0,De=gt}finally{try{!le&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});re.observe(r),this.resizeObserver=re},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var S=new ct({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=S,y==="ssaa"&&S.addSSAAPass(),o&&S.addSSRPass(w),t&&S.addBloomPass(a),r&&S.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&S.addGammaCorrectionPass(),y==="fxaa"?S.addFXAAPass():y==="smaa"&&S.addSMAAPass(),S.checkCopyPass(),this.event.on("passcheck",function(){S.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new ee(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new he({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new l.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),S=P.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(G,B){var W;(W=B.update)===null||W===void 0||W.call(B,y,S)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:S})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(s,[{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}}]),s}();Ce.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:E((0,z.Z)({},d),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:j,camera:b,bloom:!1,bloomParams:Ye,outline:!1,outlineParams:tt,css2DRenderer:!1,ssr:!1,ssrParams:ot,css2DRendererParams:(0,z.Z)({},Z),css3DRenderer:!1,css3DRendererParams:(0,z.Z)({},Z)};function ft(){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(s){return!1}}function be(s,i,n){return ft()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var dt=K(620);function ht(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,dt.Z)(n.promise,i)),n}var vt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,L.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},pt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ht(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Mesh,X(t)),this},i.createGroup=function(){return this.object3d=new l.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(l.Points,X(t)),this},i.createCSS2DObject=function(e){return this.object3d=new vt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ve.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ve.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new l.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,X(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,X(t)),this},i.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},C(s,[{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})}}]),s}()})(),module.exports=Pe})();
|
package/dist/index.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as ke from"idb-keyval";import*as D from"three";import*as Vt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Xt from"lil-gui";import*as We from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ht from"three/examples/jsm/postprocessing/EffectComposer";import*as Zt from"three/examples/jsm/postprocessing/RenderPass";import*as Kt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as Ve from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ir from"three/examples/jsm/renderers/CSS2DRenderer";var ar={187:function(M){var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(c,h,_){return Function.prototype.apply.call(c,h,_)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function B(l){console&&console.warn&&console.warn(l)}var O=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}M.exports=m,M.exports.once=le,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var U=10;function H(l){if(typeof l!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof l)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return U},set:function(l){if(typeof l!="number"||l<0||O(l))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+l+".");U=l}}),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||O(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 W(l){return l._maxListeners===void 0?m.defaultMaxListeners:l._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var h=[],_=1;_<arguments.length;_++)h.push(arguments[_]);var S=c==="error",L=this._events;if(L!==void 0)S=S&&L.error===void 0;else if(!S)return!1;if(S){var R;if(h.length>0&&(R=h[0]),R instanceof Error)throw R;var J=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw J.context=R,J}var ue=L[c];if(ue===void 0)return!1;if(typeof ue=="function")C(ue,this,h);else for(var q=ue.length,ce=oe(ue,q),_=0;_<q;++_)C(ce[_],this,h);return!0};function F(l,c,h,_){var S,L,R;if(H(h),L=l._events,L===void 0?(L=l._events=Object.create(null),l._eventsCount=0):(L.newListener!==void 0&&(l.emit("newListener",c,h.listener?h.listener:h),L=l._events),R=L[c]),R===void 0)R=L[c]=h,++l._eventsCount;else if(typeof R=="function"?R=L[c]=_?[h,R]:[R,h]:_?R.unshift(h):R.push(h),S=W(l),S>0&&R.length>S&&!R.warned){R.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=l,J.type=c,J.count=R.length,B(J)}return l}m.prototype.addListener=function(c,h){return F(this,c,h,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,h){return F(this,c,h,!0)};function Z(){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 f(l,c,h){var _={fired:!1,wrapFn:void 0,target:l,type:c,listener:h},S=Z.bind(_);return S.listener=h,_.wrapFn=S,S}m.prototype.once=function(c,h){return H(h),this.on(c,f(this,c,h)),this},m.prototype.prependOnceListener=function(c,h){return H(h),this.prependListener(c,f(this,c,h)),this},m.prototype.removeListener=function(c,h){var _,S,L,R,J;if(H(h),S=this._events,S===void 0)return this;if(_=S[c],_===void 0)return this;if(_===h||_.listener===h)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,_.listener||h));else if(typeof _!="function"){for(L=-1,R=_.length-1;R>=0;R--)if(_[R]===h||_[R].listener===h){J=_[R].listener,L=R;break}if(L<0)return this;L===0?_.shift():ae(_,L),_.length===1&&(S[c]=_[0]),S.removeListener!==void 0&&this.emit("removeListener",c,J||h)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var h,_,S;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[c]),this;if(arguments.length===0){var L=Object.keys(_),R;for(S=0;S<L.length;++S)R=L[S],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(h=_[c],typeof h=="function")this.removeListener(c,h);else if(h!==void 0)for(S=h.length-1;S>=0;S--)this.removeListener(c,h[S]);return this};function $(l,c,h){var _=l._events;if(_===void 0)return[];var S=_[c];return S===void 0?[]:typeof S=="function"?h?[S.listener||S]:[S]:h?Y(S):oe(S,S.length)}m.prototype.listeners=function(c){return $(this,c,!0)},m.prototype.rawListeners=function(c){return $(this,c,!1)},m.listenerCount=function(l,c){return typeof l.listenerCount=="function"?l.listenerCount(c):re.call(l,c)},m.prototype.listenerCount=re;function re(l){var c=this._events;if(c!==void 0){var h=c[l];if(typeof h=="function")return 1;if(h!==void 0)return h.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function oe(l,c){for(var h=new Array(c),_=0;_<c;++_)h[_]=l[_];return h}function ae(l,c){for(;c+1<l.length;c++)l[c]=l[c+1];l.pop()}function Y(l){for(var c=new Array(l.length),h=0;h<c.length;++h)c[h]=l[h].listener||l[h];return c}function le(l,c){return new Promise(function(h,_){function S(R){l.removeListener(c,L),_(R)}function L(){typeof l.removeListener=="function"&&l.removeListener("error",S),h([].slice.call(arguments))}K(l,c,L,{once:!0}),c!=="error"&&V(l,S,{once:!0})})}function V(l,c,h){typeof l.on=="function"&&K(l,"error",c,h)}function K(l,c,h,_){if(typeof l.on=="function")_.once?l.once(c,h):l.on(c,h);else if(typeof l.addEventListener=="function")l.addEventListener(c,function S(L){_.once&&l.removeEventListener(c,S),h(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof l)}},666:function(M){var T=function(C){"use strict";var G=Object.prototype,B=G.hasOwnProperty,O,m=typeof Symbol=="function"?Symbol:{},U=m.iterator||"@@iterator",H=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function F(p,d,g){return Object.defineProperty(p,d,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{F({},"")}catch(p){F=function(d,g,E){return d[g]=E}}function Z(p,d,g,E){var w=d&&d.prototype instanceof le?d:le,I=Object.create(w.prototype),Q=new ce(E||[]);return I._invoke=R(p,g,Q),I}C.wrap=Z;function f(p,d,g){try{return{type:"normal",arg:p.call(d,g)}}catch(E){return{type:"throw",arg:E}}}var $="suspendedStart",re="suspendedYield",oe="executing",ae="completed",Y={};function le(){}function V(){}function K(){}var l={};F(l,U,function(){return this});var c=Object.getPrototypeOf,h=c&&c(c(me([])));h&&h!==G&&B.call(h,U)&&(l=h);var _=K.prototype=le.prototype=Object.create(l);V.prototype=K,F(_,"constructor",K),F(K,"constructor",V),V.displayName=F(K,W,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(d){F(p,d,function(g){return this._invoke(d,g)})})}C.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===V||(d.displayName||d.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,K):(p.__proto__=K,F(p,W,"GeneratorFunction")),p.prototype=Object.create(_),p},C.awrap=function(p){return{__await:p}};function L(p,d){function g(I,Q,ee,ne){var te=f(p[I],p,Q);if(te.type==="throw")ne(te.arg);else{var pe=te.arg,ve=pe.value;return ve&&typeof ve=="object"&&B.call(ve,"__await")?d.resolve(ve.__await).then(function(fe){g("next",fe,ee,ne)},function(fe){g("throw",fe,ee,ne)}):d.resolve(ve).then(function(fe){pe.value=fe,ee(pe)},function(fe){return g("throw",fe,ee,ne)})}}var E;function w(I,Q){function ee(){return new d(function(ne,te){g(I,Q,ne,te)})}return E=E?E.then(ee,ee):ee()}this._invoke=w}S(L.prototype),F(L.prototype,H,function(){return this}),C.AsyncIterator=L,C.async=function(p,d,g,E,w){w===void 0&&(w=Promise);var I=new L(Z(p,d,g,E),w);return C.isGeneratorFunction(d)?I:I.next().then(function(Q){return Q.done?Q.value:I.next()})};function R(p,d,g){var E=$;return function(I,Q){if(E===oe)throw new Error("Generator is already running");if(E===ae){if(I==="throw")throw Q;return Se()}for(g.method=I,g.arg=Q;;){var ee=g.delegate;if(ee){var ne=J(ee,g);if(ne){if(ne===Y)continue;return ne}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(E===$)throw E=ae,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);E=oe;var te=f(p,d,g);if(te.type==="normal"){if(E=g.done?ae:re,te.arg===Y)continue;return{value:te.arg,done:g.done}}else te.type==="throw"&&(E=ae,g.method="throw",g.arg=te.arg)}}}function J(p,d){var g=p.iterator[d.method];if(g===O){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=O,J(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var E=f(g,p.iterator,d.arg);if(E.type==="throw")return d.method="throw",d.arg=E.arg,d.delegate=null,Y;var w=E.arg;if(!w)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(w.done)d[p.resultName]=w.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=O);else return w;return d.delegate=null,Y}S(_),F(_,W,"Generator"),F(_,U,function(){return this}),F(_,"toString",function(){return"[object Generator]"});function ue(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function q(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ce(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ue,this),this.reset(!0)}C.keys=function(p){var d=[];for(var g in p)d.push(g);return d.reverse(),function E(){for(;d.length;){var w=d.pop();if(w in p)return E.value=w,E.done=!1,E}return E.done=!0,E}};function me(p){if(p){var d=p[U];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var g=-1,E=function w(){for(;++g<p.length;)if(B.call(p,g))return w.value=p[g],w.done=!1,w;return w.value=O,w.done=!0,w};return E.next=E}}return{next:Se}}C.values=me;function Se(){return{value:O,done:!0}}return ce.prototype={constructor:ce,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=O,this.done=!1,this.delegate=null,this.method="next",this.arg=O,this.tryEntries.forEach(q),!p)for(var d in this)d.charAt(0)==="t"&&B.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=O)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function g(ne,te){return I.type="throw",I.arg=p,d.next=ne,te&&(d.method="next",d.arg=O),!!te}for(var E=this.tryEntries.length-1;E>=0;--E){var w=this.tryEntries[E],I=w.completion;if(w.tryLoc==="root")return g("end");if(w.tryLoc<=this.prev){var Q=B.call(w,"catchLoc"),ee=B.call(w,"finallyLoc");if(Q&&ee){if(this.prev<w.catchLoc)return g(w.catchLoc,!0);if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else if(Q){if(this.prev<w.catchLoc)return g(w.catchLoc,!0)}else if(ee){if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var g=this.tryEntries.length-1;g>=0;--g){var E=this.tryEntries[g];if(E.tryLoc<=this.prev&&B.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var w=E;break}}w&&(p==="break"||p==="continue")&&w.tryLoc<=d&&d<=w.finallyLoc&&(w=null);var I=w?w.completion:{};return I.type=p,I.arg=d,w?(this.method="next",this.next=w.finallyLoc,Y):this.complete(I)},complete:function(p,d){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"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var g=this.tryEntries[d];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),q(g),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var g=this.tryEntries[d];if(g.tryLoc===p){var E=g.completion;if(E.type==="throw"){var w=E.arg;q(g)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,g){return this.delegate={iterator:me(p),resultName:d,nextLoc:g},this.method==="next"&&(this.arg=O),Y}},C}(M.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(M,T,C){C.d(T,{Z:function(){return G}});function G(B){if(B.geometry&&B.geometry.dispose(),B.material){var O=Array.isArray(B.material)?B.material:[B.material];O.forEach(function(m){var U,H,W,F,Z,f,$,re,oe,ae,Y,le,V;(U=m.map)===null||U===void 0||U.dispose(),(H=m.lightMap)===null||H===void 0||H.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(F=m.normalMap)===null||F===void 0||F.dispose(),(Z=m.specularMap)===null||Z===void 0||Z.dispose(),(f=m.envMap)===null||f===void 0||f.dispose(),($=m.alphaMap)===null||$===void 0||$.dispose(),(re=m.aoMap)===null||re===void 0||re.dispose(),(oe=m.displacementMap)===null||oe===void 0||oe.dispose(),(ae=m.emissiveMap)===null||ae===void 0||ae.dispose(),(Y=m.gradientMap)===null||Y===void 0||Y.dispose(),(le=m.metalnessMap)===null||le===void 0||le.dispose(),(V=m.roughnessMap)===null||V===void 0||V.dispose(),m.dispose()})}}},175:function(M,T,C){C.d(T,{wf:function(){return m.Z},PO:function(){return W.Z}});var G=C(666),B=C.n(G),O=null,m=C(182),U=C(949);function H(V){if(V.material){var K=Array.isArray(V.material)?V.material:[V.material];K.forEach(function(l){var c,h;(c=l.color)===null||c===void 0||c.convertSRGBToLinear(),(h=l.emissive)===null||h===void 0||h.convertSRGBToLinear(),l.map&&(l.map.encoding=THREE.sRGBEncoding),l.emissiveMap&&(l.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=C(975),F=C(568),Z=C(924),f=V=>{var K={};return C.d(K,V),K},$=V=>()=>V,re=f({get:()=>ke.get,set:()=>ke.set}),oe=C(620),ae=null,Y=null,le=function(){var V=(0,F.Z)(B().mark(function K(l,c){var h,_,S,L,R,J;return B().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return h=c.version,q.next=4,(0,re.get)(l);case 4:if(S=q.sent,!(S&&S[h])){q.next=9;break}_=S[h],q.next=15;break;case 9:return q.next=11,(0,oe.Z)(fetch(l).then(function(ce){if(ce.ok)return ce.blob();throw new Error}));case 11:L=q.sent,R=L.res,J=L.err,J||(_=R,(0,re.set)(l,(0,Z.Z)({},h,R)));case 15:return q.abrupt("return",_?{url:URL.createObjectURL(_)}:{url:l});case 16:case"end":return q.stop()}},K)}));return function(l,c){return V.apply(this,arguments)}}()},975:function(M,T,C){C.d(T,{Z:function(){return B}});function G(O){return Object.prototype.toString.call(O)==="[object Object]"}function B(O){if(G(O)===!1)return!1;var m=O.constructor;if(m===void 0)return!0;var U=m.prototype;return!(G(U)===!1||U.hasOwnProperty("isPrototypeOf")===!1)}},620:function(M,T,C){C.d(T,{Z:function(){return B}});var G=C(42);function B(O){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O.then(function(U){return(0,G.Z)({err:null,res:U},m)}).catch(function(U){return(0,G.Z)({err:U,res:void 0},m)})}},949:function(M,T,C){var G=O=>{var m={};return C.d(m,O),m},B=O=>()=>O;M.exports=G({ACESFilmicToneMapping:()=>D.ACESFilmicToneMapping,AdditiveBlending:()=>D.AdditiveBlending,AxesHelper:()=>D.AxesHelper,Box3:()=>D.Box3,Camera:()=>D.Camera,CineonToneMapping:()=>D.CineonToneMapping,Clock:()=>D.Clock,Color:()=>D.Color,Euler:()=>D.Euler,Group:()=>D.Group,Layers:()=>D.Layers,LinearEncoding:()=>D.LinearEncoding,LinearFilter:()=>D.LinearFilter,LinearToneMapping:()=>D.LinearToneMapping,Matrix4:()=>D.Matrix4,Mesh:()=>D.Mesh,MeshBasicMaterial:()=>D.MeshBasicMaterial,NoToneMapping:()=>D.NoToneMapping,PerspectiveCamera:()=>D.PerspectiveCamera,PlaneGeometry:()=>D.PlaneGeometry,Points:()=>D.Points,REVISION:()=>D.REVISION,RGBAFormat:()=>D.RGBAFormat,Raycaster:()=>D.Raycaster,ReinhardToneMapping:()=>D.ReinhardToneMapping,Scene:()=>D.Scene,ShaderMaterial:()=>D.ShaderMaterial,Sprite:()=>D.Sprite,SpriteMaterial:()=>D.SpriteMaterial,UniformsUtils:()=>D.UniformsUtils,UnsignedByteType:()=>D.UnsignedByteType,Vector2:()=>D.Vector2,Vector3:()=>D.Vector3,WebGLMultisampleRenderTarget:()=>D.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>D.WebGLRenderTarget,WebGLRenderer:()=>D.WebGLRenderer,sRGBEncoding:()=>D.sRGBEncoding})},568:function(M,T,C){C.d(T,{Z:function(){return B}});function G(O,m,U,H,W,F,Z){try{var f=O[F](Z),$=f.value}catch(re){U(re);return}f.done?m($):Promise.resolve($).then(H,W)}function B(O){return function(){var m=this,U=arguments;return new Promise(function(H,W){var F=O.apply(m,U);function Z($){G(F,H,W,Z,f,"next",$)}function f($){G(F,H,W,Z,f,"throw",$)}Z(void 0)})}}},924:function(M,T,C){C.d(T,{Z:function(){return G}});function G(B,O,m){return O in B?Object.defineProperty(B,O,{value:m,enumerable:!0,configurable:!0,writable:!0}):B[O]=m,B}},42:function(M,T,C){C.d(T,{Z:function(){return B}});var G=C(924);function B(O){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{},H=Object.keys(U);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(U).filter(function(W){return Object.getOwnPropertyDescriptor(U,W).enumerable}))),H.forEach(function(W){(0,G.Z)(O,W,U[W])})}return O}}},Ie={};function z(M){var T=Ie[M];if(T!==void 0)return T.exports;var C=Ie[M]={exports:{}};return ar[M](C,C.exports,z),C.exports}(function(){z.n=function(M){var T=M&&M.__esModule?function(){return M.default}:function(){return M};return z.d(T,{a:T}),T}})(),function(){z.d=function(M,T){for(var C in T)z.o(T,C)&&!z.o(M,C)&&Object.defineProperty(M,C,{enumerable:!0,get:T[C]})}}(),function(){z.o=function(M,T){return Object.prototype.hasOwnProperty.call(M,T)}}();var _e={};(function(){z.d(_e,{L6:function(){return Nt},sb:function(){return h},z:function(){return Re},ZP:function(){return Re}});function M(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function T(n,r){for(var a=0;a<r.length;a++){var e=r[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,r,a){return r&&T(n.prototype,r),a&&T(n,a),n}var G=z(42);function B(n,r){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);r&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),a.push.apply(a,e)}return a}function O(n,r){return r=r!=null?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a))}),n}function m(n,r){(r==null||r>n.length)&&(r=n.length);for(var a=0,e=new Array(r);a<r;a++)e[a]=n[a];return e}function U(n){if(Array.isArray(n))return m(n)}function H(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function W(){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,r){if(!!n){if(typeof n=="string")return m(n,r);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return m(n,r)}}function Z(n){return U(n)||H(n)||F(n)||W()}var f=z(949),$=z(187),re=n=>{var r={};return z.d(r,n),r},oe=n=>()=>n,ae=re({default:()=>Vt.default}),Y=n=>{var r={};return z.d(r,n),r},le=n=>()=>n,V=Y({default:()=>It.default}),K=n=>{var r={};return z.d(r,n),r},l=n=>()=>n,c=K({default:()=>Xt.default}),h=function(){"use strict";function n(a){M(this,n),this.guiParams={},a&&(this.guiParams=a)}var r=n.prototype;return r.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(i){var o=e.addFolder(i),u=t.guiParams[i];Object.keys(u).forEach(function(s){var v=u[s],x=v.min,P=v.max,b=v.step,y=v.name,A=v.paramMap,j=v.items,X=v.value,k=v.target,se=s.toLowerCase().indexOf("color")>-1,N,ie=typeof X=="undefined"&&k,de=ie?k():u[s],he=ie?s:"value";j?N=o.add(de,he,j):se?N=o.addColor(de,he):N=o.add(de,he),N=N.name(y||s),typeof x!="undefined"&&(N=N.min(x)),typeof P!="undefined"&&(N=N.max(P)),typeof b!="undefined"&&(N=N.step(b)),N=N.onChange(function(){t.setTargetValue(i,s,de[he],A)}),ie&&N.listen()})})},r.setTargetValue=function(e,t,i,o){var u=this.guiParams[e][t],s=u.onChange,v=u.target,x=u.value,P=t.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&v;if(v&&!b){var y=v();Array.isArray(y)||(y=[y]),y.forEach(function(A){if(!!A)if(P)try{A[o||t].set(i)}catch(j){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else A[o||t]=i})}s&&s(i)},r.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(i){var o=e.guiParams[t][i];typeof o.value!="undefined"&&e.setTargetValue(t,i,o.value,o.paramMap)})})},n}(),_={None:f.NoToneMapping,Linear:f.LinearToneMapping,Reinhard:f.ReinhardToneMapping,Cineon:f.CineonToneMapping,ACESFilmic:f.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:f.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},L=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.width,t=a.height,i=a.rendererParams,o=i.alpha,u=i.devicePixelRatio,s=i.antialias,v=i.powerPreference,x=i.toneMapping,P=i.toneMappingExposure,b=i.outputEncoding,y=i.logarithmicDepthBuffer,A=i.preserveDrawingBuffer,j=new f.WebGLRenderer({alpha:o,antialias:s,powerPreference:v,logarithmicDepthBuffer:y,preserveDrawingBuffer:A});j.setSize(e,t),j.setPixelRatio(u),j.autoClear=!1,j.toneMapping=_[x],j.toneMappingExposure=P,j.outputEncoding=b,this.renderer=j}var r=n.prototype;return r.setSize=function(e,t){this.renderer.setSize(e,t)},r.render=function(){var e=this.options,t=e.scene,i=e.camera;this.renderer.render(t,i)},r.setGui=function(e){var t=this,i=new h({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:_,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});i.showGui(e)},r.dispose=function(){var e,t,i;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},n}(),R={fov:45,near:1,far:1e3},J=function(){"use strict";function n(a){M(this,n),this.oldCameraPosition=new f.Vector3,this.oldCameraRotation=new f.Euler,this.customCamera=!1,this.options=a;var e=a.width,t=a.height,i=a.cameraParams;if(i instanceof f.Camera)this.camera=i,this.customCamera=!0;else{var o=i.fov,u=i.far,s=i.near,v=new f.PerspectiveCamera(o,e/t,s,u);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var r=n.prototype;return r.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},r.setSize=function(e,t){this.camera instanceof f.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},r.setGui=function(e){var t=this,i=new h({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof f.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),i.showGui(e)},n}(),ue=z(175),q={background:null},ce=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.camera,t=a.sceneParams,i=t.background,o=new f.Scene;i&&(o.background=i),o.add(e),this.scene=o}var r=n.prototype;return r.addAxesHelper=function(){var e,t=new f.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},r.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,ue.wf)(t)})},n}(),me=n=>{var r={};return z.d(r,n),r},Se=n=>()=>n,p=me({MapControls:()=>We.MapControls,OrbitControls:()=>We.OrbitControls}),d={},g=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.camera,t=a.controlParams,i=a.mapControl,o=t.domElement,u=i?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 r=n.prototype;return r.limitPan=function(e){var t=e.maxX,i=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,v=s===void 0?1/0:s,x=e.minZ,P=x===void 0?-1/0:x,b=e.maxY,y=b===void 0?1/0:b,A=e.minY,j=A===void 0?-1/0:A,X=this.limitPanV||new f.Vector3,k=this.control,se=this.options.camera,N=new f.Vector3(u,j,P),ie=new f.Vector3(i,y,v);this.limitPanV=X,X.copy(k.target),k.target.clamp(N,ie),X.sub(k.target),se.position.sub(X)},r.update=function(){this.control.update()},r.dispose=function(){this.control.dispose()},n}(),E=n=>{var r={};return z.d(r,n),r},w=n=>()=>n,I=E({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),Q=new f.Vector3,ee=new f.Matrix4,ne=new f.Matrix4,te=new f.Vector3,pe=new f.Vector3,ve=function n(){"use strict";var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,n);var a=function(A,j){return te.setFromMatrixPosition(A.matrixWorld),pe.setFromMatrixPosition(j.matrixWorld),te.distanceToSquared(pe)},e=function(A){var j=[];return A.traverse(function(X){X.isCSS2DObject&&j.push(X)}),j},t=function(A){for(var j=e(A).sort(function(ie,de){if(ie.renderOrder!==de.renderOrder)return de.renderOrder-ie.renderOrder;var he=x.objects.get(ie).distanceToCameraSquared,ye=x.objects.get(de).distanceToCameraSquared;return he-ye}),X=j.length,k=0,se=j.length;k<se;k++){var N=j[k].userData.zIndexFix||0;j[k].element.style.zIndex=X-k+N}},i=this,o,u,s,v,x={objects:new WeakMap},P=r.element!==void 0?r.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,A){y.autoUpdate===!0&&y.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld(),ee.copy(A.matrixWorldInverse),ne.multiplyMatrices(A.projectionMatrix,ee),b(y,y,A),t(y)},this.setSize=function(y,A){o=y,u=A,s=o/2,v=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(A,"px")};function b(y,A,j){if(y.isCSS2DObject){Q.setFromMatrixPosition(y.matrixWorld),Q.applyMatrix4(ne);var X=y.visible===!0&&Q.z>=-1&&Q.z<=1&&y.layers.test(j.layers)===!0;if(y.element.style.display=X===!0?"":"none",X===!0){y.onBeforeRender(i,A,j);var k=y.element;k.style.transform="translate(-50%,-50%) translate(".concat(Q.x*s+s,"px,").concat(-Q.y*v+v,"px)"),k.parentNode!==P&&P.appendChild(k),y.onAfterRender(i,A,j)}var se={distanceToCameraSquared:a(j,y)};x.objects.set(y,se)}for(var N=0,ie=y.children.length;N<ie;N++)b(y.children[N],A,j)}},fe={zIndex:"auto"},Xe=function(){"use strict";function n(a){M(this,n),this.container=a}var r=n.prototype;return r.addRenderer=function(e,t){var i=this.container,o=i.offsetWidth,u=i.offsetHeight,s=e==="css2d"?new ve:new I.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=t.zIndex,s.setSize(o,u),i.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},r.setSize=function(e,t){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},r.render=function(e,t){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},r.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),He=n=>{var r={};return z.d(r,n),r},cr=n=>()=>n,Te=He({EffectComposer:()=>Ht.EffectComposer}),Ze=n=>{var r={};return z.d(r,n),r},fr=n=>()=>n,Ke=Ze({RenderPass:()=>Zt.RenderPass}),Qe=n=>{var r={};return z.d(r,n),r},dr=n=>()=>n,be=Qe({ShaderPass:()=>Kt.ShaderPass}),Ye=n=>{var r={};return z.d(r,n),r},hr=n=>()=>n,Ce=Ye({CopyShader:()=>Qt.CopyShader}),$e=n=>{var r={};return z.d(r,n),r},vr=n=>()=>n,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=n=>{var r={};return z.d(r,n),r},pr=n=>()=>n,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=n=>{var r={};return z.d(r,n),r},mr=n=>()=>n,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=n=>{var r={};return z.d(r,n),r},gr=n=>()=>n,it=nt({FXAAShader:()=>qt.FXAAShader}),at=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(r){return!1}},_r=0,st=1,ge=!1,Ae=at()!==!1,ot=`varying vec2 vUv;
|
|
1
|
+
import*as ke from"idb-keyval";import*as j from"three";import*as Vt from"deepmerge";import*as It from"three/examples/jsm/libs/stats.module";import*as Xt from"lil-gui";import*as We from"three/examples/jsm/controls/OrbitControls";import*as Me from"three/examples/jsm/renderers/CSS3DRenderer";import*as Ht from"three/examples/jsm/postprocessing/EffectComposer";import*as Zt from"three/examples/jsm/postprocessing/RenderPass";import*as Kt from"three/examples/jsm/postprocessing/ShaderPass";import*as Qt from"three/examples/jsm/shaders/CopyShader";import*as Yt from"three/examples/jsm/shaders/GammaCorrectionShader";import*as $t from"three/examples/jsm/postprocessing/SMAAPass";import*as Jt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as qt from"three/examples/jsm/shaders/FXAAShader";import*as Ve from"three/examples/jsm/postprocessing/Pass";import*as er from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as tr from"three/examples/jsm/postprocessing/OutlinePass";import*as rr from"three/examples/jsm/postprocessing/SSRPass";import*as nr from"three/examples/jsm/objects/ReflectorForSSRPass";import*as ir from"three/examples/jsm/renderers/CSS2DRenderer";var ar={187:function(M){var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(c,h,_){return Function.prototype.apply.call(c,h,_)},B;T&&typeof T.ownKeys=="function"?B=T.ownKeys:Object.getOwnPropertySymbols?B=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:B=function(c){return Object.getOwnPropertyNames(c)};function D(l){console&&console.warn&&console.warn(l)}var O=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}M.exports=m,M.exports.once=le,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var F=10;function H(l){if(typeof l!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof l)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return F},set:function(l){if(typeof l!="number"||l<0||O(l))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+l+".");F=l}}),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||O(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 V(l){return l._maxListeners===void 0?m.defaultMaxListeners:l._maxListeners}m.prototype.getMaxListeners=function(){return V(this)},m.prototype.emit=function(c){for(var h=[],_=1;_<arguments.length;_++)h.push(arguments[_]);var S=c==="error",L=this._events;if(L!==void 0)S=S&&L.error===void 0;else if(!S)return!1;if(S){var R;if(h.length>0&&(R=h[0]),R instanceof Error)throw R;var J=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw J.context=R,J}var ue=L[c];if(ue===void 0)return!1;if(typeof ue=="function")C(ue,this,h);else for(var q=ue.length,ce=oe(ue,q),_=0;_<q;++_)C(ce[_],this,h);return!0};function N(l,c,h,_){var S,L,R;if(H(h),L=l._events,L===void 0?(L=l._events=Object.create(null),l._eventsCount=0):(L.newListener!==void 0&&(l.emit("newListener",c,h.listener?h.listener:h),L=l._events),R=L[c]),R===void 0)R=L[c]=h,++l._eventsCount;else if(typeof R=="function"?R=L[c]=_?[h,R]:[R,h]:_?R.unshift(h):R.push(h),S=V(l),S>0&&R.length>S&&!R.warned){R.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=l,J.type=c,J.count=R.length,D(J)}return l}m.prototype.addListener=function(c,h){return N(this,c,h,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,h){return N(this,c,h,!0)};function Z(){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 f(l,c,h){var _={fired:!1,wrapFn:void 0,target:l,type:c,listener:h},S=Z.bind(_);return S.listener=h,_.wrapFn=S,S}m.prototype.once=function(c,h){return H(h),this.on(c,f(this,c,h)),this},m.prototype.prependOnceListener=function(c,h){return H(h),this.prependListener(c,f(this,c,h)),this},m.prototype.removeListener=function(c,h){var _,S,L,R,J;if(H(h),S=this._events,S===void 0)return this;if(_=S[c],_===void 0)return this;if(_===h||_.listener===h)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,_.listener||h));else if(typeof _!="function"){for(L=-1,R=_.length-1;R>=0;R--)if(_[R]===h||_[R].listener===h){J=_[R].listener,L=R;break}if(L<0)return this;L===0?_.shift():ae(_,L),_.length===1&&(S[c]=_[0]),S.removeListener!==void 0&&this.emit("removeListener",c,J||h)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var h,_,S;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[c]),this;if(arguments.length===0){var L=Object.keys(_),R;for(S=0;S<L.length;++S)R=L[S],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(h=_[c],typeof h=="function")this.removeListener(c,h);else if(h!==void 0)for(S=h.length-1;S>=0;S--)this.removeListener(c,h[S]);return this};function $(l,c,h){var _=l._events;if(_===void 0)return[];var S=_[c];return S===void 0?[]:typeof S=="function"?h?[S.listener||S]:[S]:h?Y(S):oe(S,S.length)}m.prototype.listeners=function(c){return $(this,c,!0)},m.prototype.rawListeners=function(c){return $(this,c,!1)},m.listenerCount=function(l,c){return typeof l.listenerCount=="function"?l.listenerCount(c):re.call(l,c)},m.prototype.listenerCount=re;function re(l){var c=this._events;if(c!==void 0){var h=c[l];if(typeof h=="function")return 1;if(h!==void 0)return h.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function oe(l,c){for(var h=new Array(c),_=0;_<c;++_)h[_]=l[_];return h}function ae(l,c){for(;c+1<l.length;c++)l[c]=l[c+1];l.pop()}function Y(l){for(var c=new Array(l.length),h=0;h<c.length;++h)c[h]=l[h].listener||l[h];return c}function le(l,c){return new Promise(function(h,_){function S(R){l.removeListener(c,L),_(R)}function L(){typeof l.removeListener=="function"&&l.removeListener("error",S),h([].slice.call(arguments))}K(l,c,L,{once:!0}),c!=="error"&&I(l,S,{once:!0})})}function I(l,c,h){typeof l.on=="function"&&K(l,"error",c,h)}function K(l,c,h,_){if(typeof l.on=="function")_.once?l.once(c,h):l.on(c,h);else if(typeof l.addEventListener=="function")l.addEventListener(c,function S(L){_.once&&l.removeEventListener(c,S),h(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof l)}},666:function(M){var T=function(C){"use strict";var B=Object.prototype,D=B.hasOwnProperty,O,m=typeof Symbol=="function"?Symbol:{},F=m.iterator||"@@iterator",H=m.asyncIterator||"@@asyncIterator",V=m.toStringTag||"@@toStringTag";function N(p,d,g){return Object.defineProperty(p,d,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{N({},"")}catch(p){N=function(d,g,E){return d[g]=E}}function Z(p,d,g,E){var w=d&&d.prototype instanceof le?d:le,X=Object.create(w.prototype),Q=new ce(E||[]);return X._invoke=R(p,g,Q),X}C.wrap=Z;function f(p,d,g){try{return{type:"normal",arg:p.call(d,g)}}catch(E){return{type:"throw",arg:E}}}var $="suspendedStart",re="suspendedYield",oe="executing",ae="completed",Y={};function le(){}function I(){}function K(){}var l={};N(l,F,function(){return this});var c=Object.getPrototypeOf,h=c&&c(c(me([])));h&&h!==B&&D.call(h,F)&&(l=h);var _=K.prototype=le.prototype=Object.create(l);I.prototype=K,N(_,"constructor",K),N(K,"constructor",I),I.displayName=N(K,V,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(d){N(p,d,function(g){return this._invoke(d,g)})})}C.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===I||(d.displayName||d.name)==="GeneratorFunction":!1},C.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,K):(p.__proto__=K,N(p,V,"GeneratorFunction")),p.prototype=Object.create(_),p},C.awrap=function(p){return{__await:p}};function L(p,d){function g(X,Q,ee,ne){var te=f(p[X],p,Q);if(te.type==="throw")ne(te.arg);else{var pe=te.arg,ve=pe.value;return ve&&typeof ve=="object"&&D.call(ve,"__await")?d.resolve(ve.__await).then(function(fe){g("next",fe,ee,ne)},function(fe){g("throw",fe,ee,ne)}):d.resolve(ve).then(function(fe){pe.value=fe,ee(pe)},function(fe){return g("throw",fe,ee,ne)})}}var E;function w(X,Q){function ee(){return new d(function(ne,te){g(X,Q,ne,te)})}return E=E?E.then(ee,ee):ee()}this._invoke=w}S(L.prototype),N(L.prototype,H,function(){return this}),C.AsyncIterator=L,C.async=function(p,d,g,E,w){w===void 0&&(w=Promise);var X=new L(Z(p,d,g,E),w);return C.isGeneratorFunction(d)?X:X.next().then(function(Q){return Q.done?Q.value:X.next()})};function R(p,d,g){var E=$;return function(X,Q){if(E===oe)throw new Error("Generator is already running");if(E===ae){if(X==="throw")throw Q;return Se()}for(g.method=X,g.arg=Q;;){var ee=g.delegate;if(ee){var ne=J(ee,g);if(ne){if(ne===Y)continue;return ne}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(E===$)throw E=ae,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);E=oe;var te=f(p,d,g);if(te.type==="normal"){if(E=g.done?ae:re,te.arg===Y)continue;return{value:te.arg,done:g.done}}else te.type==="throw"&&(E=ae,g.method="throw",g.arg=te.arg)}}}function J(p,d){var g=p.iterator[d.method];if(g===O){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=O,J(p,d),d.method==="throw"))return Y;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var E=f(g,p.iterator,d.arg);if(E.type==="throw")return d.method="throw",d.arg=E.arg,d.delegate=null,Y;var w=E.arg;if(!w)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,Y;if(w.done)d[p.resultName]=w.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=O);else return w;return d.delegate=null,Y}S(_),N(_,V,"Generator"),N(_,F,function(){return this}),N(_,"toString",function(){return"[object Generator]"});function ue(p){var d={tryLoc:p[0]};1 in p&&(d.catchLoc=p[1]),2 in p&&(d.finallyLoc=p[2],d.afterLoc=p[3]),this.tryEntries.push(d)}function q(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function ce(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ue,this),this.reset(!0)}C.keys=function(p){var d=[];for(var g in p)d.push(g);return d.reverse(),function E(){for(;d.length;){var w=d.pop();if(w in p)return E.value=w,E.done=!1,E}return E.done=!0,E}};function me(p){if(p){var d=p[F];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var g=-1,E=function w(){for(;++g<p.length;)if(D.call(p,g))return w.value=p[g],w.done=!1,w;return w.value=O,w.done=!0,w};return E.next=E}}return{next:Se}}C.values=me;function Se(){return{value:O,done:!0}}return ce.prototype={constructor:ce,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=O,this.done=!1,this.delegate=null,this.method="next",this.arg=O,this.tryEntries.forEach(q),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=O)},stop:function(){this.done=!0;var p=this.tryEntries[0],d=p.completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function g(ne,te){return X.type="throw",X.arg=p,d.next=ne,te&&(d.method="next",d.arg=O),!!te}for(var E=this.tryEntries.length-1;E>=0;--E){var w=this.tryEntries[E],X=w.completion;if(w.tryLoc==="root")return g("end");if(w.tryLoc<=this.prev){var Q=D.call(w,"catchLoc"),ee=D.call(w,"finallyLoc");if(Q&&ee){if(this.prev<w.catchLoc)return g(w.catchLoc,!0);if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else if(Q){if(this.prev<w.catchLoc)return g(w.catchLoc,!0)}else if(ee){if(this.prev<w.finallyLoc)return g(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var g=this.tryEntries.length-1;g>=0;--g){var E=this.tryEntries[g];if(E.tryLoc<=this.prev&&D.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var w=E;break}}w&&(p==="break"||p==="continue")&&w.tryLoc<=d&&d<=w.finallyLoc&&(w=null);var X=w?w.completion:{};return X.type=p,X.arg=d,w?(this.method="next",this.next=w.finallyLoc,Y):this.complete(X)},complete:function(p,d){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"&&d&&(this.next=d),Y},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var g=this.tryEntries[d];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),q(g),Y}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var g=this.tryEntries[d];if(g.tryLoc===p){var E=g.completion;if(E.type==="throw"){var w=E.arg;q(g)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,g){return this.delegate={iterator:me(p),resultName:d,nextLoc:g},this.method==="next"&&(this.arg=O),Y}},C}(M.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},182:function(M,T,C){C.d(T,{Z:function(){return B}});function B(D){if(D.geometry&&D.geometry.dispose(),D.material){var O=Array.isArray(D.material)?D.material:[D.material];O.forEach(function(m){var F,H,V,N,Z,f,$,re,oe,ae,Y,le,I;(F=m.map)===null||F===void 0||F.dispose(),(H=m.lightMap)===null||H===void 0||H.dispose(),(V=m.bumpMap)===null||V===void 0||V.dispose(),(N=m.normalMap)===null||N===void 0||N.dispose(),(Z=m.specularMap)===null||Z===void 0||Z.dispose(),(f=m.envMap)===null||f===void 0||f.dispose(),($=m.alphaMap)===null||$===void 0||$.dispose(),(re=m.aoMap)===null||re===void 0||re.dispose(),(oe=m.displacementMap)===null||oe===void 0||oe.dispose(),(ae=m.emissiveMap)===null||ae===void 0||ae.dispose(),(Y=m.gradientMap)===null||Y===void 0||Y.dispose(),(le=m.metalnessMap)===null||le===void 0||le.dispose(),(I=m.roughnessMap)===null||I===void 0||I.dispose(),m.dispose()})}}},175:function(M,T,C){C.d(T,{wf:function(){return m.Z},PO:function(){return V.Z}});var B=C(666),D=C.n(B),O=null,m=C(182),F=C(949);function H(I){if(I.material){var K=Array.isArray(I.material)?I.material:[I.material];K.forEach(function(l){var c,h;(c=l.color)===null||c===void 0||c.convertSRGBToLinear(),(h=l.emissive)===null||h===void 0||h.convertSRGBToLinear(),l.map&&(l.map.encoding=THREE.sRGBEncoding),l.emissiveMap&&(l.emissiveMap.encoding=THREE.sRGBEncoding)})}}var V=C(975),N=C(568),Z=C(924),f=I=>{var K={};return C.d(K,I),K},$=I=>()=>I,re=f({get:()=>ke.get,set:()=>ke.set}),oe=C(620),ae=null,Y=null,le=function(){var I=(0,N.Z)(D().mark(function K(l,c){var h,_,S,L,R,J;return D().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return h=c.version,q.next=4,(0,re.get)(l);case 4:if(S=q.sent,!(S&&S[h])){q.next=9;break}_=S[h],q.next=15;break;case 9:return q.next=11,(0,oe.Z)(fetch(l).then(function(ce){if(ce.ok)return ce.blob();throw new Error}));case 11:L=q.sent,R=L.res,J=L.err,J||(_=R,(0,re.set)(l,(0,Z.Z)({},h,R)));case 15:return q.abrupt("return",_?{url:URL.createObjectURL(_)}:{url:l});case 16:case"end":return q.stop()}},K)}));return function(l,c){return I.apply(this,arguments)}}()},975:function(M,T,C){C.d(T,{Z:function(){return D}});function B(O){return Object.prototype.toString.call(O)==="[object Object]"}function D(O){if(B(O)===!1)return!1;var m=O.constructor;if(m===void 0)return!0;var F=m.prototype;return!(B(F)===!1||F.hasOwnProperty("isPrototypeOf")===!1)}},620:function(M,T,C){C.d(T,{Z:function(){return D}});var B=C(42);function D(O){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O.then(function(F){return(0,B.Z)({err:null,res:F},m)}).catch(function(F){return(0,B.Z)({err:F,res:void 0},m)})}},949:function(M,T,C){var B=O=>{var m={};return C.d(m,O),m},D=O=>()=>O;M.exports=B({ACESFilmicToneMapping:()=>j.ACESFilmicToneMapping,AdditiveBlending:()=>j.AdditiveBlending,AxesHelper:()=>j.AxesHelper,Box3:()=>j.Box3,Camera:()=>j.Camera,CineonToneMapping:()=>j.CineonToneMapping,Clock:()=>j.Clock,Color:()=>j.Color,Euler:()=>j.Euler,Group:()=>j.Group,Layers:()=>j.Layers,LinearEncoding:()=>j.LinearEncoding,LinearFilter:()=>j.LinearFilter,LinearToneMapping:()=>j.LinearToneMapping,Matrix4:()=>j.Matrix4,Mesh:()=>j.Mesh,MeshBasicMaterial:()=>j.MeshBasicMaterial,NoToneMapping:()=>j.NoToneMapping,PerspectiveCamera:()=>j.PerspectiveCamera,PlaneGeometry:()=>j.PlaneGeometry,Points:()=>j.Points,REVISION:()=>j.REVISION,RGBAFormat:()=>j.RGBAFormat,Raycaster:()=>j.Raycaster,ReinhardToneMapping:()=>j.ReinhardToneMapping,Scene:()=>j.Scene,ShaderMaterial:()=>j.ShaderMaterial,Sprite:()=>j.Sprite,SpriteMaterial:()=>j.SpriteMaterial,UniformsUtils:()=>j.UniformsUtils,UnsignedByteType:()=>j.UnsignedByteType,Vector2:()=>j.Vector2,Vector3:()=>j.Vector3,WebGLMultisampleRenderTarget:()=>j.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>j.WebGLRenderTarget,WebGLRenderer:()=>j.WebGLRenderer,sRGBEncoding:()=>j.sRGBEncoding})},568:function(M,T,C){C.d(T,{Z:function(){return D}});function B(O,m,F,H,V,N,Z){try{var f=O[N](Z),$=f.value}catch(re){F(re);return}f.done?m($):Promise.resolve($).then(H,V)}function D(O){return function(){var m=this,F=arguments;return new Promise(function(H,V){var N=O.apply(m,F);function Z($){B(N,H,V,Z,f,"next",$)}function f($){B(N,H,V,Z,f,"throw",$)}Z(void 0)})}}},924:function(M,T,C){C.d(T,{Z:function(){return B}});function B(D,O,m){return O in D?Object.defineProperty(D,O,{value:m,enumerable:!0,configurable:!0,writable:!0}):D[O]=m,D}},42:function(M,T,C){C.d(T,{Z:function(){return D}});var B=C(924);function D(O){for(var m=1;m<arguments.length;m++){var F=arguments[m]!=null?arguments[m]:{},H=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(F).filter(function(V){return Object.getOwnPropertyDescriptor(F,V).enumerable}))),H.forEach(function(V){(0,B.Z)(O,V,F[V])})}return O}}},Ie={};function G(M){var T=Ie[M];if(T!==void 0)return T.exports;var C=Ie[M]={exports:{}};return ar[M](C,C.exports,G),C.exports}(function(){G.n=function(M){var T=M&&M.__esModule?function(){return M.default}:function(){return M};return G.d(T,{a:T}),T}})(),function(){G.d=function(M,T){for(var C in T)G.o(T,C)&&!G.o(M,C)&&Object.defineProperty(M,C,{enumerable:!0,get:T[C]})}}(),function(){G.o=function(M,T){return Object.prototype.hasOwnProperty.call(M,T)}}();var _e={};(function(){G.d(_e,{L6:function(){return Nt},sb:function(){return h},z:function(){return Re},ZP:function(){return Re}});function M(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function T(n,r){for(var a=0;a<r.length;a++){var e=r[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function C(n,r,a){return r&&T(n.prototype,r),a&&T(n,a),n}var B=G(42);function D(n,r){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);r&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),a.push.apply(a,e)}return a}function O(n,r){return r=r!=null?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a))}),n}function m(n,r){(r==null||r>n.length)&&(r=n.length);for(var a=0,e=new Array(r);a<r;a++)e[a]=n[a];return e}function F(n){if(Array.isArray(n))return m(n)}function H(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function V(){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 N(n,r){if(!!n){if(typeof n=="string")return m(n,r);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return m(n,r)}}function Z(n){return F(n)||H(n)||N(n)||V()}var f=G(949),$=G(187),re=n=>{var r={};return G.d(r,n),r},oe=n=>()=>n,ae=re({default:()=>Vt.default}),Y=n=>{var r={};return G.d(r,n),r},le=n=>()=>n,I=Y({default:()=>It.default}),K=n=>{var r={};return G.d(r,n),r},l=n=>()=>n,c=K({default:()=>Xt.default}),h=function(){"use strict";function n(a){M(this,n),this.guiParams={},a&&(this.guiParams=a)}var r=n.prototype;return r.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(i){var o=e.addFolder(i),u=t.guiParams[i];Object.keys(u).forEach(function(s){var v=u[s],x=v.min,P=v.max,b=v.step,y=v.name,A=v.paramMap,z=v.items,U=v.value,W=v.target,se=s.toLowerCase().indexOf("color")>-1,k,ie=typeof U=="undefined"&&W,de=ie?W():u[s],he=ie?s:"value";z?k=o.add(de,he,z):se?k=o.addColor(de,he):k=o.add(de,he),k=k.name(y||s),typeof x!="undefined"&&(k=k.min(x)),typeof P!="undefined"&&(k=k.max(P)),typeof b!="undefined"&&(k=k.step(b)),k=k.onChange(function(){t.setTargetValue(i,s,de[he],A)}),ie&&k.listen()})})},r.setTargetValue=function(e,t,i,o){var u=this.guiParams[e][t],s=u.onChange,v=u.target,x=u.value,P=t.toLowerCase().indexOf("color")>-1,b=typeof x=="undefined"&&v;if(v&&!b){var y=v();Array.isArray(y)||(y=[y]),y.forEach(function(A){if(!!A)if(P)try{A[o||t].set(i)}catch(z){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else A[o||t]=i})}s&&s(i)},r.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(i){var o=e.guiParams[t][i];typeof o.value!="undefined"&&e.setTargetValue(t,i,o.value,o.paramMap)})})},n}(),_={None:f.NoToneMapping,Linear:f.LinearToneMapping,Reinhard:f.ReinhardToneMapping,Cineon:f.CineonToneMapping,ACESFilmic:f.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:f.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},L=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.width,t=a.height,i=a.rendererParams,o=i.context,u=i.alpha,s=i.devicePixelRatio,v=i.antialias,x=i.powerPreference,P=i.toneMapping,b=i.toneMappingExposure,y=i.outputEncoding,A=i.logarithmicDepthBuffer,z=i.preserveDrawingBuffer,U=new f.WebGLRenderer({context:o,alpha:u,antialias:v,powerPreference:x,logarithmicDepthBuffer:A,preserveDrawingBuffer:z});U.setSize(e,t),U.setPixelRatio(s),U.autoClear=!1,U.toneMapping=_[P],U.toneMappingExposure=b,U.outputEncoding=y,this.renderer=U}var r=n.prototype;return r.setSize=function(e,t){this.renderer.setSize(e,t)},r.render=function(){var e=this.options,t=e.scene,i=e.camera;this.renderer.render(t,i)},r.setGui=function(e){var t=this,i=new h({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:_,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});i.showGui(e)},r.dispose=function(){var e,t,i;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},n}(),R={fov:45,near:1,far:1e3},J=function(){"use strict";function n(a){M(this,n),this.oldCameraPosition=new f.Vector3,this.oldCameraRotation=new f.Euler,this.customCamera=!1,this.options=a;var e=a.width,t=a.height,i=a.cameraParams;if(i instanceof f.Camera)this.camera=i,this.customCamera=!0;else{var o=i.fov,u=i.far,s=i.near,v=new f.PerspectiveCamera(o,e/t,s,u);v.position.set(0,0,400),v.lookAt(0,0,0),this.camera=v}}var r=n.prototype;return r.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},r.setSize=function(e,t){this.camera instanceof f.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},r.setGui=function(e){var t=this,i=new h({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return t.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}}});this.camera instanceof f.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),i.showGui(e)},n}(),ue=G(175),q={background:null},ce=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.camera,t=a.sceneParams,i=t.background,o=new f.Scene;i&&(o.background=i),o.add(e),this.scene=o}var r=n.prototype;return r.addAxesHelper=function(){var e,t=new f.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},r.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,ue.wf)(t)})},n}(),me=n=>{var r={};return G.d(r,n),r},Se=n=>()=>n,p=me({MapControls:()=>We.MapControls,OrbitControls:()=>We.OrbitControls}),d={},g=function(){"use strict";function n(a){M(this,n),this.options=a;var e=a.camera,t=a.controlParams,i=a.mapControl,o=t.domElement,u=i?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 r=n.prototype;return r.limitPan=function(e){var t=e.maxX,i=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,v=s===void 0?1/0:s,x=e.minZ,P=x===void 0?-1/0:x,b=e.maxY,y=b===void 0?1/0:b,A=e.minY,z=A===void 0?-1/0:A,U=this.limitPanV||new f.Vector3,W=this.control,se=this.options.camera,k=new f.Vector3(u,z,P),ie=new f.Vector3(i,y,v);this.limitPanV=U,U.copy(W.target),W.target.clamp(k,ie),U.sub(W.target),se.position.sub(U)},r.update=function(){this.control.update()},r.dispose=function(){this.control.dispose()},n}(),E=n=>{var r={};return G.d(r,n),r},w=n=>()=>n,X=E({CSS3DObject:()=>Me.CSS3DObject,CSS3DRenderer:()=>Me.CSS3DRenderer,CSS3DSprite:()=>Me.CSS3DSprite}),Q=new f.Vector3,ee=new f.Matrix4,ne=new f.Matrix4,te=new f.Vector3,pe=new f.Vector3,ve=function n(){"use strict";var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,n);var a=function(A,z){return te.setFromMatrixPosition(A.matrixWorld),pe.setFromMatrixPosition(z.matrixWorld),te.distanceToSquared(pe)},e=function(A){var z=[];return A.traverse(function(U){U.isCSS2DObject&&z.push(U)}),z},t=function(A){for(var z=e(A).sort(function(ie,de){if(ie.renderOrder!==de.renderOrder)return de.renderOrder-ie.renderOrder;var he=x.objects.get(ie).distanceToCameraSquared,ye=x.objects.get(de).distanceToCameraSquared;return he-ye}),U=z.length,W=0,se=z.length;W<se;W++){var k=z[W].userData.zIndexFix||0;z[W].element.style.zIndex=U-W+k}},i=this,o,u,s,v,x={objects:new WeakMap},P=r.element!==void 0?r.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,A){y.autoUpdate===!0&&y.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld(),ee.copy(A.matrixWorldInverse),ne.multiplyMatrices(A.projectionMatrix,ee),b(y,y,A),t(y)},this.setSize=function(y,A){o=y,u=A,s=o/2,v=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(A,"px")};function b(y,A,z){if(y.isCSS2DObject){Q.setFromMatrixPosition(y.matrixWorld),Q.applyMatrix4(ne);var U=y.visible===!0&&Q.z>=-1&&Q.z<=1&&y.layers.test(z.layers)===!0;if(y.element.style.display=U===!0?"":"none",U===!0){y.onBeforeRender(i,A,z);var W=y.element;W.style.transform="translate(-50%,-50%) translate(".concat(Q.x*s+s,"px,").concat(-Q.y*v+v,"px)"),W.parentNode!==P&&P.appendChild(W),y.onAfterRender(i,A,z)}var se={distanceToCameraSquared:a(z,y)};x.objects.set(y,se)}for(var k=0,ie=y.children.length;k<ie;k++)b(y.children[k],A,z)}},fe={zIndex:"auto"},Xe=function(){"use strict";function n(a){M(this,n),this.container=a}var r=n.prototype;return r.addRenderer=function(e,t){var i=this.container,o=i.offsetWidth,u=i.offsetHeight,s=e==="css2d"?new ve:new X.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=t.zIndex,s.setSize(o,u),i.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},r.setSize=function(e,t){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},r.render=function(e,t){var i,o;(i=this.css2Drenderer)===null||i===void 0||i.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},r.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),He=n=>{var r={};return G.d(r,n),r},cr=n=>()=>n,Te=He({EffectComposer:()=>Ht.EffectComposer}),Ze=n=>{var r={};return G.d(r,n),r},fr=n=>()=>n,Ke=Ze({RenderPass:()=>Zt.RenderPass}),Qe=n=>{var r={};return G.d(r,n),r},dr=n=>()=>n,be=Qe({ShaderPass:()=>Kt.ShaderPass}),Ye=n=>{var r={};return G.d(r,n),r},hr=n=>()=>n,Ce=Ye({CopyShader:()=>Qt.CopyShader}),$e=n=>{var r={};return G.d(r,n),r},vr=n=>()=>n,Je=$e({GammaCorrectionShader:()=>Yt.GammaCorrectionShader}),qe=n=>{var r={};return G.d(r,n),r},pr=n=>()=>n,et=qe({SMAAPass:()=>$t.SMAAPass}),tt=n=>{var r={};return G.d(r,n),r},mr=n=>()=>n,rt=tt({SSAARenderPass:()=>Jt.SSAARenderPass}),nt=n=>{var r={};return G.d(r,n),r},gr=n=>()=>n,it=nt({FXAAShader:()=>qt.FXAAShader}),at=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(r){return!1}},_r=0,st=1,ge=!1,Ae=at()!==!1,ot=`varying vec2 vUv;
|
|
2
2
|
|
|
3
3
|
void main() {
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ void main() {
|
|
|
15
15
|
|
|
16
16
|
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
17
|
|
|
18
|
-
}`;function xe(n,r){return xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xe(n,r)}function Le(n,r){return xe(n,r)}function lt(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),r&&Le(n,r)}function ct(){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 we(n){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},we(n)}function je(n){return we(n)}function ft(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dt(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ht(n,r){return r&&(dt(r)==="object"||typeof r=="function")?r:ft(n)}function vt(n){var r=ct();return function(){var e=je(n),t;if(r){var i=je(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return ht(this,t)}}var pt=n=>{var r={};return
|
|
18
|
+
}`;function xe(n,r){return xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xe(n,r)}function Le(n,r){return xe(n,r)}function lt(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),r&&Le(n,r)}function ct(){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 we(n){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},we(n)}function je(n){return we(n)}function ft(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dt(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ht(n,r){return r&&(dt(r)==="object"||typeof r=="function")?r:ft(n)}function vt(n){var r=ct();return function(){var e=je(n),t;if(r){var i=je(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return ht(this,t)}}var pt=n=>{var r={};return G.d(r,n),r},br=n=>()=>n,De=pt({FullScreenQuad:()=>Ve.FullScreenQuad,Pass:()=>Ve.Pass}),mt=n=>{var r={};return G.d(r,n),r},Pr=n=>()=>n,Be=mt({LuminosityHighPassShader:()=>er.LuminosityHighPassShader}),Ee=function(n){"use strict";lt(a,n);var r=vt(a);function a(t,i,o,u){M(this,a);var s;s=r.call(this),s.strength=i!==void 0?i:1,s.radius=o,s.threshold=u,s.resolution=t!==void 0?new f.Vector2(t.x,t.y):new f.Vector2(256,256),s.clearColor=new f.Color(0,0,0);var v={minFilter:f.LinearFilter,magFilter:f.LinearFilter,format:f.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var x=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new f.WebGLRenderTarget(x,P,v),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var y=new f.WebGLRenderTarget(x,P,v);y.texture.name="UnrealBloomPass.h".concat(b),y.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(y);var A=new f.WebGLRenderTarget(x,P,v);A.texture.name="UnrealBloomPass.v".concat(b),A.texture.generateMipmaps=!1,s.renderTargetsVertical.push(A),x=Math.round(x/2),P=Math.round(P/2)}Be.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var z=Be.LuminosityHighPassShader;s.highPassUniforms=f.UniformsUtils.clone(z.uniforms),s.highPassUniforms.luminosityThreshold.value=u,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new f.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:z.vertexShader,fragmentShader:z.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var U=[3,5,7,9,11];x=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var W=0;W<s.nMips;W++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(U[W])),s.separableBlurMaterials[W].uniforms.texSize.value=new f.Vector2(x,P),x=Math.round(x/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=i,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var se=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=se,s.bloomTintColors=[new f.Vector3(1,1,1),new f.Vector3(1,1,1),new f.Vector3(1,1,1),new f.Vector3(1,1,1),new f.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,Ce.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var k=Ce.CopyShader;return s.copyUniforms=f.UniformsUtils.clone(k.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new f.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:k.vertexShader,fragmentShader:k.fragmentShader,blending:f.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new f.Color,s.oldClearAlpha=1,s.basic=new f.MeshBasicMaterial,s.fsQuad=new De.FullScreenQuad(void 0),s}var e=a.prototype;return e.dispose=function(){for(var i=0;i<this.renderTargetsHorizontal.length;i++)this.renderTargetsHorizontal[i].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(i,o){var u=Math.round(i/2),s=Math.round(o/2);this.renderTargetBright.setSize(u,s);for(var v=0;v<this.nMips;v++)this.renderTargetsHorizontal[v].setSize(u,s),this.renderTargetsVertical[v].setSize(u,s),this.separableBlurMaterials[v].uniforms.texSize.value=new f.Vector2(u,s),u=Math.round(u/2),s=Math.round(s/2)},e.render=function(i,o,u,s,v){i.getClearColor(this._oldClearColor),this.oldClearAlpha=i.getClearAlpha();var x=i.autoClear;i.autoClear=!1,i.setClearColor(this.clearColor,0),v&&i.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,i.setRenderTarget(null),i.clear(),this.fsQuad.render(i)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,i.setRenderTarget(this.renderTargetBright),i.clear(),this.fsQuad.render(i);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=a.BlurDirectionX,i.setRenderTarget(this.renderTargetsHorizontal[b]),i.clear(),this.fsQuad.render(i),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=a.BlurDirectionY,i.setRenderTarget(this.renderTargetsVertical[b]),i.clear(),this.fsQuad.render(i),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,i.setRenderTarget(this.renderTargetsHorizontal[0]),i.clear(),this.fsQuad.render(i),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,v&&i.state.buffers.stencil.setTest(!0),this.renderToScreen?(i.setRenderTarget(null),this.fsQuad.render(i)):(i.setRenderTarget(u),this.fsQuad.render(i)),i.setClearColor(this._oldClearColor,this.oldClearAlpha),i.autoClear=x},e.getSeperableBlurMaterial=function(i){return new f.ShaderMaterial({defines:{KERNEL_RADIUS:i,SIGMA:i},uniforms:{colorTexture:{value:null},texSize:{value:new f.Vector2(.5,.5)},direction:{value:new f.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
19
|
void main() {
|
|
20
20
|
vUv = uv;
|
|
21
21
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -54,4 +54,4 @@ void main() {
|
|
|
54
54
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
55
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
56
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},a}(De.Pass);Ee.BlurDirectionX=new f.Vector2(1,0),Ee.BlurDirectionY=new f.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new f.MeshBasicMaterial({color:"black"}),bt=new f.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function n(a,e){M(this,n),this.materials={},this.bloomLayer=new f.Layers,this.active=!0,this.composerController=a,this.options=e;var t=a.renderer,i=a.renderPass,o=a.finalComposer,u=a.getSize(),s=u.width,v=u.height,x=new Ee(new f.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=x;var P=new Te.EffectComposer(t);P.renderToScreen=!1,P.addPass(i),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(st);var b=new f.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),y=new be.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var r=n.prototype;return r.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},r.render=function(e){if(!!this.active){var t=this,i=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(u[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),i.render(),e.traverse(function(s){var v=s;u[v.uuid]&&(v.material=u[v.uuid],delete u[v.uuid])})}},r.setSize=function(e,t){this.bloomComposer.setSize(e,t)},r.setGui=function(e){var t=this,i=new h({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});i.showGui(e)},r.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),yt=n=>{var r={};return z.d(r,n),r},yr=n=>()=>n,St=yt({OutlinePass:()=>tr.OutlinePass}),Ct={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},xt=function(){"use strict";function n(a,e){M(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,i=a.camera,o=a.finalComposer,u=a.getSize(),s=u.width,v=u.height,x=new St.OutlinePass(new f.Vector2(s,v),t,i);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var r=n.prototype;return r.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},r.setGui=function(){var e=this,t=new h({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}}}});t.setTargetValueByParams(),this.outlineGui=t},r.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function wt(n,r){if(n==null)return{};var a={},e=Object.keys(n),t,i;for(i=0;i<e.length;i++)t=e[i],!(r.indexOf(t)>=0)&&(a[t]=n[t]);return a}function Et(n,r){if(n==null)return{};var a=wt(n,r),e,t;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(t=0;t<i.length;t++)e=i[t],!(r.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(a[e]=n[e]))}return a}var Rt=n=>{var r={};return z.d(r,n),r},Sr=n=>()=>n,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=n=>{var r={};return z.d(r,n),r},Cr=n=>()=>n,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),At={maxDistance:10,selects:!0},Lt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function n(a,e){M(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,i=a.camera,o=a.renderer,u=a.finalComposer,s=a.getSize(),v=s.width,x=s.height,P=new Ot.SSRPass({renderer:o,scene:t,camera:i,width:v,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var r=n.prototype;return r.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},Lt,e),i=t.width,o=t.height,u=Et(t,["width","height"]),s=this.composerController,v=s.scene,x=s.getSize(),P=new f.PlaneGeometry(i,o),b=new Tt.ReflectorForSSRPass(P,O((0,G.Z)({},u),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},r.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},r.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},r.setSize=function(e,t){var i=this.groundReflector;i&&(i.getRenderTarget().setSize(e,t),i.resolution.set(e,t))},r.setGui=function(){var e=this,t=new h({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(i){i?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]}}}});t.setTargetValueByParams(),this.ssrGui=t},r.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Dt=function(){"use strict";function n(a){M(this,n),this.active=!0,this.options=a;var e=a.renderer,t=a.scene,i=a.camera,o=this.createRenderTarget(),u=new Te.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=i}var r=n.prototype;return r.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,i=e.type,o=e.encoding,u=this.getSize(),s={minFilter:f.LinearFilter,magFilter:f.LinearFilter,format:f.RGBAFormat,encoding:o,type:i},v;if(+f.REVISION<138&&t>0){var x=new f.WebGLMultisampleRenderTarget(u.width,u.height,s);x.samples=t,v=x}else if(+f.REVISION>=138&&t>0){var P=new f.WebGLRenderTarget(u.width,u.height,O((0,G.Z)({},s),{samples:t}));v=P}else{var b=new f.WebGLRenderTarget(u.width,u.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},r.addRenderPasss=function(){var e=this.options,t=e.scene,i=e.camera,o=new Ke.RenderPass(t,i);this.finalComposer.addPass(o),this.renderPass=o},r.addCopyPass=function(){var e=new be.ShaderPass(Ce.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},r.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},r.addFXAAPass=function(){var e=this.getSize(),t=e.width,i=e.height,o=new be.ShaderPass(it.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,i)},r.addSMAAPass=function(){var e=this.getSize(),t=e.width,i=e.height,o=this.options.renderer,u=new et.SMAAPass(t*o.getPixelRatio(),i*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},r.addSSAAPass=function(){var e=this.options,t=e.scene,i=e.camera,o=new rt.SSAARenderPass(t,i,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},r.addBloomPass=function(e){var t=new Pt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},r.addOutlinePass=function(e){var t=new xt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},r.addSSRPass=function(e){var t=new jt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},r.getSize=function(){var e=this.options.renderer;return e.getSize(new f.Vector2)},r.enable=function(){this.active||(this.active=!0)},r.disable=function(){!this.active||(this.active=!1)},r.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(i){return i!==e.renderPass&&i!==e.copyPass?i.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},r.setSize=function(e,t){var i,o;this.finalComposer.setSize(e,t),(i=this.bloomController)===null||i===void 0||i.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},r.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var i=this.options.renderer,o=i.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},r.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},r.dispose=function(){var e,t,i;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(i=this.ssrController)===null||i===void 0||i.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,v;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.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}(),Re=function(){"use strict";function n(a){M(this,n),this.raycaster=new f.Raycaster,this.installPlugins=new Map,this.event=new $.EventEmitter,this.clock=new f.Clock,this.options=(0,ae.default)(n.options,a,{isMergeableObject:ue.PO});var e=this.options,t=e.container,i=e.stats,o=e.gui;if(o){var u=new c.default;u.open(!1),this.gui=u}if(i){var s=new V.default;s.showPanel(0),s.dom.style.position="absolute",t.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var r=n.prototype;return r.use=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[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(Z(i))),this.installPlugins.set(e,!0)}},r.init=function(){var e=this,t=this.options,i=t.container,o=t.isdev,u=t.axesHelper,s=t.renderer,v=t.scene,x=t.camera,P=this.getSize(),b=P.width,y=P.height,A=new J({isdev:o,width:b,height:y,cameraParams:x});this.gui&&A.setGui(this.gui);var j=A.camera,X=new ce({camera:j,sceneParams:v}),k=X.scene,se=new L({width:b,height:y,scene:k,camera:j,isdev:o,rendererParams:O((0,G.Z)({},s),{outputEncoding:f.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var N=se.renderer;u&&X.addAxesHelper(),this.sceneController=X,this.rendererController=se,this.cameraController=A,i.appendChild(N.domElement);var ie=new ResizeObserver(function(de){var he=!0,ye=!1,Ue=void 0;try{for(var Oe=de[Symbol.iterator](),Fe;!(he=(Fe=Oe.next()).done);he=!0){var kt=Fe.value,Ne=kt.contentRect;e.handeleResize(Ne.width,Ne.height)}}catch(Wt){ye=!0,Ue=Wt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});ie.observe(i),this.resizeObserver=ie},r.initComposer=function(){var e=this.options,t=e.bloom,i=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,v=e.outlineParams,x=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!Ae&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:f.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(x),t&&y.addBloomPass(s),i&&y.addOutlinePass(v),u.outputEncoding===f.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},r.initCSSRenderer=function(){var e=this.options,t=e.container,i=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(i||o){var v=new Xe(t);i&&v.addRenderer("css2d",u),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},r.initControl=function(){var e=this.options,t=e.control,i=e.mapControl,o=e.controlParams;if(t){var u=new g({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:i});this.controlController=u}},r.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},r.handeleResize=function(e,t){var i=this,o=i.rendererController,u=i.cameraController,s=i.composerController,v=i.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),s==null||s.setSize(e,t),v==null||v.setSize(e,t),this.installPlugins.forEach(function(x,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},r.pick=function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,v=s.container,x=new f.Vector2,P=v.getBoundingClientRect();if(x.x=(e.clientX-P.left)/(P.right-P.left)*2-1,x.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(x,this.camera);var b=u.intersectObjects(t||this.scene.children,i);if(b.length)return{object:b[0].object,intersects:b}}},r.render=function(){var e,t,i,o,u=this,s=u.renderer,v=u.scene,x=u.camera,P=u.clock;if(!(!s||!v||!x||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(j,X){var k;(k=X.update)===null||k===void 0||k.call(X,b,y)}),!((t=this.composerController)===null||t===void 0)&&t.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(v,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},r.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},r.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},r.dispose=function(){var e,t,i,o,u,s,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(i=this.cssRendererController)===null||i===void 0||i.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,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(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}();Re.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:O((0,G.Z)({},S),{antialias:Ae?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:q,camera:R,bloom:!1,bloomParams:gt,outline:!1,outlineParams:Ct,css2DRenderer:!1,ssr:!1,ssrParams:At,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Bt(){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,r,a){return Bt()?Pe=Reflect.construct:Pe=function(t,i,o){var u=[null];u.push.apply(u,i);var s=Function.bind.apply(t,u),v=new s;return o&&Le(v,o.prototype),v},Pe.apply(null,arguments)}function Ge(n,r,a){return Pe.apply(null,arguments)}var Gt=z(620);function zt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(e,t){a.resolve=e,a.reject=t}),n&&(a.promise=(0,Gt.Z)(a.promise,r)),a}var Ut=n=>{var r={};return z.d(r,n),r},xr=n=>()=>n,Ft=Ut({CSS2DObject:()=>ir.CSS2DObject}),ze=function(n){n&&((0,ue.wf)(n),n.children.forEach(function(r){r.userData.BaseObject_||ze(r)}))},Nt=function(){"use strict";function n(){M(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=zt(),this.visible=!1}var r=n.prototype;return r.init=function(){},r.create=function(){},r.render=function(){},r.update=function(e,t){},r.resize=function(e,t){},r.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},r.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},r.isVisible=function(){return this.visible},r.createMesh=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.object3d=Ge(f.Mesh,Z(t)),this},r.createGroup=function(){return this.object3d=new f.Group,this},r.createPoints=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.object3d=Ge(f.Points,Z(t)),this},r.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},r.createCSS3DObject=function(e){return this.object3d=new I.CSS3DObject(e),this},r.createCSS3DSprite=function(e){return this.object3d=new I.CSS3DSprite(e),this},r.createSprite=function(e){return this.object3d=new f.Sprite(e),this},r.add=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o;return(o=this.object3d).add.apply(o,Z(t)),this},r.remove=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o;return(o=this.object3d).remove.apply(o,Z(t)),this},r.getSize=function(){var e=new f.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new f.Vector3)}},r.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},r.dispose=function(){ze(this.object3d)},C(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 sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
|
|
57
|
+
}`})},a}(De.Pass);Ee.BlurDirectionX=new f.Vector2(1,0),Ee.BlurDirectionY=new f.Vector2(0,1);var gt={threshold:.2,strength:.5,radius:0},_t=new f.MeshBasicMaterial({color:"black"}),bt=new f.SpriteMaterial({color:"#000"}),Pt=function(){"use strict";function n(a,e){M(this,n),this.materials={},this.bloomLayer=new f.Layers,this.active=!0,this.composerController=a,this.options=e;var t=a.renderer,i=a.renderPass,o=a.finalComposer,u=a.getSize(),s=u.width,v=u.height,x=new Ee(new f.Vector2(s,v),e.strength,e.radius,e.threshold);this.bloomPass=x;var P=new Te.EffectComposer(t);P.renderToScreen=!1,P.addPass(i),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(st);var b=new f.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:ot,fragmentShader:ut,defines:{}}),y=new be.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var r=n.prototype;return r.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},r.render=function(e){if(!!this.active){var t=this,i=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(s){var v=s;v.material&&o.test(v.layers)===!1&&(u[v.uuid]=v.material,v.material=v.isSprite?bt:_t)}),i.render(),e.traverse(function(s){var v=s;u[v.uuid]&&(v.material=u[v.uuid],delete u[v.uuid])})}},r.setSize=function(e,t){this.bloomComposer.setSize(e,t)},r.setGui=function(e){var t=this,i=new h({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});i.showGui(e)},r.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),yt=n=>{var r={};return G.d(r,n),r},yr=n=>()=>n,St=yt({OutlinePass:()=>tr.OutlinePass}),Ct={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},xt=function(){"use strict";function n(a,e){M(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,i=a.camera,o=a.finalComposer,u=a.getSize(),s=u.width,v=u.height,x=new St.OutlinePass(new f.Vector2(s,v),t,i);x.selectedObjects=this.selectedObjects,this.outlinePass=x,o.addPass(x),this.setGui()}var r=n.prototype;return r.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},r.setGui=function(){var e=this,t=new h({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}}}});t.setTargetValueByParams(),this.outlineGui=t},r.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function wt(n,r){if(n==null)return{};var a={},e=Object.keys(n),t,i;for(i=0;i<e.length;i++)t=e[i],!(r.indexOf(t)>=0)&&(a[t]=n[t]);return a}function Et(n,r){if(n==null)return{};var a=wt(n,r),e,t;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(t=0;t<i.length;t++)e=i[t],!(r.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(a[e]=n[e]))}return a}var Rt=n=>{var r={};return G.d(r,n),r},Sr=n=>()=>n,Ot=Rt({SSRPass:()=>rr.SSRPass}),Mt=n=>{var r={};return G.d(r,n),r},Cr=n=>()=>n,Tt=Mt({ReflectorForSSRPass:()=>nr.ReflectorForSSRPass}),At={maxDistance:10,selects:!0},Lt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},jt=function(){"use strict";function n(a,e){M(this,n),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,i=a.camera,o=a.renderer,u=a.finalComposer,s=a.getSize(),v=s.width,x=s.height,P=new Ot.SSRPass({renderer:o,scene:t,camera:i,width:v,height:x,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var r=n.prototype;return r.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,B.Z)({},Lt,e),i=t.width,o=t.height,u=Et(t,["width","height"]),s=this.composerController,v=s.scene,x=s.getSize(),P=new f.PlaneGeometry(i,o),b=new Tt.ReflectorForSSRPass(P,O((0,B.Z)({},u),{textureWidth:x.width,textureHeight:x.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,v.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},r.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},r.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},r.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},r.setSize=function(e,t){var i=this.groundReflector;i&&(i.getRenderTarget().setSize(e,t),i.resolution.set(e,t))},r.setGui=function(){var e=this,t=new h({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(i){i?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]}}}});t.setTargetValueByParams(),this.ssrGui=t},r.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Dt=function(){"use strict";function n(a){M(this,n),this.active=!0,this.options=a;var e=a.renderer,t=a.scene,i=a.camera,o=this.createRenderTarget(),u=new Te.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=i}var r=n.prototype;return r.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,i=e.type,o=e.encoding,u=this.getSize(),s={minFilter:f.LinearFilter,magFilter:f.LinearFilter,format:f.RGBAFormat,encoding:o,type:i},v;if(+f.REVISION<138&&t>0){var x=new f.WebGLMultisampleRenderTarget(u.width,u.height,s);x.samples=t,v=x}else if(+f.REVISION>=138&&t>0){var P=new f.WebGLRenderTarget(u.width,u.height,O((0,B.Z)({},s),{samples:t}));v=P}else{var b=new f.WebGLRenderTarget(u.width,u.height,s);v=b}return v.texture.name="EffectComposer.rt1",v},r.addRenderPasss=function(){var e=this.options,t=e.scene,i=e.camera,o=new Ke.RenderPass(t,i);this.finalComposer.addPass(o),this.renderPass=o},r.addCopyPass=function(){var e=new be.ShaderPass(Ce.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},r.addGammaCorrectionPass=function(){var e=new be.ShaderPass(Je.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},r.addFXAAPass=function(){var e=this.getSize(),t=e.width,i=e.height,o=new be.ShaderPass(it.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,i)},r.addSMAAPass=function(){var e=this.getSize(),t=e.width,i=e.height,o=this.options.renderer,u=new et.SMAAPass(t*o.getPixelRatio(),i*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},r.addSSAAPass=function(){var e=this.options,t=e.scene,i=e.camera,o=new rt.SSAARenderPass(t,i,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},r.addBloomPass=function(e){var t=new Pt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},r.addOutlinePass=function(e){var t=new xt(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},r.addSSRPass=function(e){var t=new jt(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},r.getSize=function(){var e=this.options.renderer;return e.getSize(new f.Vector2)},r.enable=function(){this.active||(this.active=!0)},r.disable=function(){!this.active||(this.active=!1)},r.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(i){return i!==e.renderPass&&i!==e.copyPass?i.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},r.setSize=function(e,t){var i,o;this.finalComposer.setSize(e,t),(i=this.bloomController)===null||i===void 0||i.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},r.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var i=this.options.renderer,o=i.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},r.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},r.dispose=function(){var e,t,i;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(i=this.ssrController)===null||i===void 0||i.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,v;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(v=s.material)===null||v===void 0||v.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}(),Re=function(){"use strict";function n(a){M(this,n),this.raycaster=new f.Raycaster,this.installPlugins=new Map,this.event=new $.EventEmitter,this.clock=new f.Clock,this.options=(0,ae.default)(n.options,a,{isMergeableObject:ue.PO});var e=this.options,t=e.container,i=e.stats,o=e.gui;if(o){var u=new c.default;u.open(!1),this.gui=u}if(i){var s=new I.default;s.showPanel(0),s.dom.style.position="absolute",t.appendChild(s.dom),this.stats=s}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var r=n.prototype;return r.use=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[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(Z(i))),this.installPlugins.set(e,!0)}},r.init=function(){var e=this,t=this.options,i=t.container,o=t.isdev,u=t.axesHelper,s=t.renderer,v=t.scene,x=t.camera,P=this.getSize(),b=P.width,y=P.height,A=new J({isdev:o,width:b,height:y,cameraParams:x});this.gui&&A.setGui(this.gui);var z=A.camera,U=new ce({camera:z,sceneParams:v}),W=U.scene,se=new L({width:b,height:y,scene:W,camera:z,isdev:o,rendererParams:O((0,B.Z)({},s),{outputEncoding:f.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var k=se.renderer;u&&U.addAxesHelper(),this.sceneController=U,this.rendererController=se,this.cameraController=A,i.appendChild(k.domElement);var ie=new ResizeObserver(function(de){var he=!0,ye=!1,Ue=void 0;try{for(var Oe=de[Symbol.iterator](),Fe;!(he=(Fe=Oe.next()).done);he=!0){var kt=Fe.value,Ne=kt.contentRect;e.handeleResize(Ne.width,Ne.height)}}catch(Wt){ye=!0,Ue=Wt}finally{try{!he&&Oe.return!=null&&Oe.return()}finally{if(ye)throw Ue}}});ie.observe(i),this.resizeObserver=ie},r.initComposer=function(){var e=this.options,t=e.bloom,i=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,v=e.outlineParams,x=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!Ae&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:f.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(x),t&&y.addBloomPass(s),i&&y.addOutlinePass(v),u.outputEncoding===f.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},r.initCSSRenderer=function(){var e=this.options,t=e.container,i=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(i||o){var v=new Xe(t);i&&v.addRenderer("css2d",u),o&&v.addRenderer("css3d",s),this.cssRendererController=v}},r.initControl=function(){var e=this.options,t=e.control,i=e.mapControl,o=e.controlParams;if(t){var u=new g({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:i});this.controlController=u}},r.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},r.handeleResize=function(e,t){var i=this,o=i.rendererController,u=i.cameraController,s=i.composerController,v=i.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),s==null||s.setSize(e,t),v==null||v.setSize(e,t),this.installPlugins.forEach(function(x,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},r.pick=function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,v=s.container,x=new f.Vector2,P=v.getBoundingClientRect();if(x.x=(e.clientX-P.left)/(P.right-P.left)*2-1,x.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(x,this.camera);var b=u.intersectObjects(t||this.scene.children,i);if(b.length)return{object:b[0].object,intersects:b}}},r.render=function(){var e,t,i,o,u=this,s=u.renderer,v=u.scene,x=u.camera,P=u.clock;if(!(!s||!v||!x||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(z,U){var W;(W=U.update)===null||W===void 0||W.call(U,b,y)}),!((t=this.composerController)===null||t===void 0)&&t.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(v,x),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},r.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},r.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},r.dispose=function(){var e,t,i,o,u,s,v;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(x,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(i=this.cssRendererController)===null||i===void 0||i.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,(v=this.gui)===null||v===void 0||v.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(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}();Re.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,renderer:O((0,B.Z)({},S),{antialias:Ae?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:q,camera:R,bloom:!1,bloomParams:gt,outline:!1,outlineParams:Ct,css2DRenderer:!1,ssr:!1,ssrParams:At,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function Bt(){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,r,a){return Bt()?Pe=Reflect.construct:Pe=function(t,i,o){var u=[null];u.push.apply(u,i);var s=Function.bind.apply(t,u),v=new s;return o&&Le(v,o.prototype),v},Pe.apply(null,arguments)}function Ge(n,r,a){return Pe.apply(null,arguments)}var Gt=G(620);function zt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(e,t){a.resolve=e,a.reject=t}),n&&(a.promise=(0,Gt.Z)(a.promise,r)),a}var Ut=n=>{var r={};return G.d(r,n),r},xr=n=>()=>n,Ft=Ut({CSS2DObject:()=>ir.CSS2DObject}),ze=function(n){n&&((0,ue.wf)(n),n.children.forEach(function(r){r.userData.BaseObject_||ze(r)}))},Nt=function(){"use strict";function n(){M(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=zt(),this.visible=!1}var r=n.prototype;return r.init=function(){},r.create=function(){},r.render=function(){},r.update=function(e,t){},r.resize=function(e,t){},r.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},r.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},r.isVisible=function(){return this.visible},r.createMesh=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.object3d=Ge(f.Mesh,Z(t)),this},r.createGroup=function(){return this.object3d=new f.Group,this},r.createPoints=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.object3d=Ge(f.Points,Z(t)),this},r.createCSS2DObject=function(e){return this.object3d=new Ft.CSS2DObject(e),this},r.createCSS3DObject=function(e){return this.object3d=new X.CSS3DObject(e),this},r.createCSS3DSprite=function(e){return this.object3d=new X.CSS3DSprite(e),this},r.createSprite=function(e){return this.object3d=new f.Sprite(e),this},r.add=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o;return(o=this.object3d).add.apply(o,Z(t)),this},r.remove=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o;return(o=this.object3d).remove.apply(o,Z(t)),this},r.getSize=function(){var e=new f.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new f.Vector3)}},r.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},r.dispose=function(){ze(this.object3d)},C(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 sr=_e.L6,or=_e.sb,ur=_e.z,lr=_e.ZP;export{sr as BaseObject,or as GUIObject,ur as Pencil,lr as default};
|