gl-draw 0.6.1 → 0.6.2
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/package.json +4 -4
- package/dist/constants.d.ts +0 -4
- package/dist/core/BaseObject.d.ts +0 -45
- package/dist/core/CSSRenderer/CSS2DRenderer.d.ts +0 -17
- package/dist/core/CSSRenderer/index.d.ts +0 -19
- package/dist/core/Camera.d.ts +0 -30
- package/dist/core/Composer.d.ts +0 -60
- package/dist/core/Control.d.ts +0 -28
- package/dist/core/GUIObject.d.ts +0 -24
- package/dist/core/Pencil.d.ts +0 -146
- package/dist/core/Renderer.d.ts +0 -51
- package/dist/core/Scene.d.ts +0 -19
- package/dist/core/pass/bloom/UnrealBloomPass.d.ts +0 -46
- package/dist/core/pass/bloom/index.d.ts +0 -33
- package/dist/core/pass/outline/index.d.ts +0 -37
- package/dist/core/pass/ssr/index.d.ts +0 -38
- package/dist/effect/bloom.d.ts +0 -14
- package/dist/effect/index.d.ts +0 -5
- package/dist/effect/index.js +0 -160
- package/dist/effect/index.module.js +0 -160
- package/dist/effect/outline.d.ts +0 -15
- package/dist/effect/scan.d.ts +0 -39
- package/dist/effect/scan2.d.ts +0 -28
- package/dist/effect/ssr.d.ts +0 -15
- package/dist/geojson/china.json +0 -103310
- package/dist/geojson/countries.json +0 -27483
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -57
- package/dist/index.module.js +0 -57
- package/dist/objects/conicPolygon/geometry/index.d.ts +0 -32
- package/dist/objects/conicPolygon/geometry/triangulate.d.ts +0 -11
- package/dist/objects/conicPolygon/index.d.ts +0 -19
- package/dist/objects/extrudePolygon/coords2Vector.d.ts +0 -7
- package/dist/objects/extrudePolygon/createGeometry.d.ts +0 -8
- package/dist/objects/extrudePolygon/getWorkerGeometry.d.ts +0 -16
- package/dist/objects/extrudePolygon/index.d.ts +0 -37
- package/dist/objects/extrudePolygon/w.d.ts +0 -1
- package/dist/objects/fix.d.ts +0 -2
- package/dist/objects/image/index.d.ts +0 -24
- package/dist/objects/index.d.ts +0 -10
- package/dist/objects/index.js +0 -132
- package/dist/objects/index.module.js +0 -132
- package/dist/objects/line/coords2Vector.d.ts +0 -7
- package/dist/objects/line/createGeometry.d.ts +0 -8
- package/dist/objects/line/getWorkerGeometry.d.ts +0 -15
- package/dist/objects/line/index.d.ts +0 -44
- package/dist/objects/line/meshLine/index.d.ts +0 -89
- package/dist/objects/line/meshLine/shader/fragment.d.ts +0 -2
- package/dist/objects/line/meshLine/shader/vertex.d.ts +0 -2
- package/dist/objects/line/w.d.ts +0 -1
- package/dist/objects/node/index.d.ts +0 -30
- package/dist/objects/text/index.d.ts +0 -23
- package/dist/objects/video/index.d.ts +0 -31
- package/dist/plugins/Cache.d.ts +0 -8
- package/dist/plugins/Data.d.ts +0 -8
- package/dist/plugins/Draw.d.ts +0 -35
- package/dist/plugins/Worker.d.ts +0 -31
- package/dist/plugins/index.d.ts +0 -4
- package/dist/plugins/index.js +0 -1
- package/dist/plugins/index.module.js +0 -1
- package/dist/shims.d.ts +0 -5
- package/dist/utils/chain.d.ts +0 -23
- package/dist/utils/colorCorrection.d.ts +0 -2
- package/dist/utils/disposeMesh.d.ts +0 -2
- package/dist/utils/exception.d.ts +0 -26
- package/dist/utils/getCache.d.ts +0 -13
- package/dist/utils/getElementView.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.module.js +0 -1
- package/dist/utils/isPlainObject.d.ts +0 -1
- package/dist/utils/makePromiseCreator.d.ts +0 -6
- package/dist/utils/polar2Cartesian.d.ts +0 -1
- package/dist/utils/timer.d.ts +0 -9
- package/dist/utils/to.d.ts +0 -8
- package/dist/utils/uvGenerator.d.ts +0 -9
- package/dist/workers/extrudePolygon.js +0 -3046
- package/dist/workers/line.js +0 -3177
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
(function(){var Le={187:function(M){"use strict";var A=typeof Reflect=="object"?Reflect:null,x=A&&typeof A.apply=="function"?A.apply:function(c,v,m){return Function.prototype.apply.call(c,v,m)},G;A&&typeof A.ownKeys=="function"?G=A.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function D(f){console&&console.warn&&console.warn(f)}var j=Number.isNaN||function(c){return c!==c};function g(){g.init.call(this)}M.exports=g,M.exports.once=Q,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var V=10;function U(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return V},set:function(f){if(typeof f!="number"||f<0||j(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");V=f}}),g.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},g.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||j(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 F(f){return f._maxListeners===void 0?g.defaultMaxListeners:f._maxListeners}g.prototype.getMaxListeners=function(){return F(this)},g.prototype.emit=function(c){for(var v=[],m=1;m<arguments.length;m++)v.push(arguments[m]);var w=c==="error",E=this._events;if(E!==void 0)w=w&&E.error===void 0;else if(!w)return!1;if(w){var C;if(v.length>0&&(C=v[0]),C instanceof Error)throw C;var Y=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw Y.context=C,Y}var ae=E[c];if(ae===void 0)return!1;if(typeof ae=="function")x(ae,this,v);else for(var W=ae.length,q=ie(ae,W),m=0;m<W;++m)x(q[m],this,v);return!0};function O(f,c,v,m){var w,E,C;if(U(v),E=f._events,E===void 0?(E=f._events=Object.create(null),f._eventsCount=0):(E.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),E=f._events),C=E[c]),C===void 0)C=E[c]=v,++f._eventsCount;else if(typeof C=="function"?C=E[c]=m?[v,C]:[C,v]:m?C.unshift(v):C.push(v),w=F(f),w>0&&C.length>w&&!C.warned){C.warned=!0;var Y=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");Y.name="MaxListenersExceededWarning",Y.emitter=f,Y.type=c,Y.count=C.length,D(Y)}return f}g.prototype.addListener=function(c,v){return O(this,c,v,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(c,v){return O(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var m={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},w=k.bind(m);return w.listener=v,m.wrapFn=w,w}g.prototype.once=function(c,v){return U(v),this.on(c,l(this,c,v)),this},g.prototype.prependOnceListener=function(c,v){return U(v),this.prependListener(c,l(this,c,v)),this},g.prototype.removeListener=function(c,v){var m,w,E,C,Y;if(U(v),w=this._events,w===void 0)return this;if(m=w[c],m===void 0)return this;if(m===v||m.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete w[c],w.removeListener&&this.emit("removeListener",c,m.listener||v));else if(typeof m!="function"){for(E=-1,C=m.length-1;C>=0;C--)if(m[C]===v||m[C].listener===v){Y=m[C].listener,E=C;break}if(E<0)return this;E===0?m.shift():re(m,E),m.length===1&&(w[c]=m[0]),w.removeListener!==void 0&&this.emit("removeListener",c,Y||v)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(c){var v,m,w;if(m=this._events,m===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[c]),this;if(arguments.length===0){var E=Object.keys(m),C;for(w=0;w<E.length;++w)C=E[w],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=m[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(w=v.length-1;w>=0;w--)this.removeListener(c,v[w]);return this};function N(f,c,v){var m=f._events;if(m===void 0)return[];var w=m[c];return w===void 0?[]:typeof w=="function"?v?[w.listener||w]:[w]:v?X(w):ie(w,w.length)}g.prototype.listeners=function(c){return N(this,c,!0)},g.prototype.rawListeners=function(c){return N(this,c,!1)},g.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):J.call(f,c)},g.prototype.listenerCount=J;function J(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ie(f,c){for(var v=new Array(c),m=0;m<c;++m)v[m]=f[m];return v}function re(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function X(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function Q(f,c){return new Promise(function(v,m){function w(C){f.removeListener(c,E),m(C)}function E(){typeof f.removeListener=="function"&&f.removeListener("error",w),v([].slice.call(arguments))}R(f,c,E,{once:!0}),c!=="error"&&K(f,w,{once:!0})})}function K(f,c,v){typeof f.on=="function"&&R(f,"error",c,v)}function R(f,c,v,m){if(typeof f.on=="function")m.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function w(E){m.once&&f.removeEventListener(c,w),v(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(M){var A=function(x){"use strict";var G=Object.prototype,D=G.hasOwnProperty,j,g=typeof Symbol=="function"?Symbol:{},V=g.iterator||"@@iterator",U=g.asyncIterator||"@@asyncIterator",F=g.toStringTag||"@@toStringTag";function O(p,d,b){return Object.defineProperty(p,d,{value:b,enumerable:!0,configurable:!0,writable:!0}),p[d]}try{O({},"")}catch(p){O=function(d,b,L){return d[b]=L}}function k(p,d,b,L){var T=d&&d.prototype instanceof Q?d:Q,$=Object.create(T.prototype),oe=new q(L||[]);return $._invoke=C(p,b,oe),$}x.wrap=k;function l(p,d,b){try{return{type:"normal",arg:p.call(d,b)}}catch(L){return{type:"throw",arg:L}}}var N="suspendedStart",J="suspendedYield",ie="executing",re="completed",X={};function Q(){}function K(){}function R(){}var f={};O(f,V,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(ne([])));v&&v!==G&&D.call(v,V)&&(f=v);var m=R.prototype=Q.prototype=Object.create(f);K.prototype=R,O(m,"constructor",R),O(R,"constructor",K),K.displayName=O(R,F,"GeneratorFunction");function w(p){["next","throw","return"].forEach(function(d){O(p,d,function(b){return this._invoke(d,b)})})}x.isGeneratorFunction=function(p){var d=typeof p=="function"&&p.constructor;return d?d===K||(d.displayName||d.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,R):(p.__proto__=R,O(p,F,"GeneratorFunction")),p.prototype=Object.create(m),p},x.awrap=function(p){return{__await:p}};function E(p,d){function b($,oe,se,ue){var ee=l(p[$],p,oe);if(ee.type==="throw")ue(ee.arg);else{var ve=ee.arg,pe=ve.value;return pe&&typeof pe=="object"&&D.call(pe,"__await")?d.resolve(pe.__await).then(function(de){b("next",de,se,ue)},function(de){b("throw",de,se,ue)}):d.resolve(pe).then(function(de){ve.value=de,se(ve)},function(de){return b("throw",de,se,ue)})}}var L;function T($,oe){function se(){return new d(function(ue,ee){b($,oe,ue,ee)})}return L=L?L.then(se,se):se()}this._invoke=T}w(E.prototype),O(E.prototype,U,function(){return this}),x.AsyncIterator=E,x.async=function(p,d,b,L,T){T===void 0&&(T=Promise);var $=new E(k(p,d,b,L),T);return x.isGeneratorFunction(d)?$:$.next().then(function(oe){return oe.done?oe.value:$.next()})};function C(p,d,b){var L=N;return function($,oe){if(L===ie)throw new Error("Generator is already running");if(L===re){if($==="throw")throw oe;return le()}for(b.method=$,b.arg=oe;;){var se=b.delegate;if(se){var ue=Y(se,b);if(ue){if(ue===X)continue;return ue}}if(b.method==="next")b.sent=b._sent=b.arg;else if(b.method==="throw"){if(L===N)throw L=re,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);L=ie;var ee=l(p,d,b);if(ee.type==="normal"){if(L=b.done?re:J,ee.arg===X)continue;return{value:ee.arg,done:b.done}}else ee.type==="throw"&&(L=re,b.method="throw",b.arg=ee.arg)}}}function Y(p,d){var b=p.iterator[d.method];if(b===j){if(d.delegate=null,d.method==="throw"){if(p.iterator.return&&(d.method="return",d.arg=j,Y(p,d),d.method==="throw"))return X;d.method="throw",d.arg=new TypeError("The iterator does not provide a 'throw' method")}return X}var L=l(b,p.iterator,d.arg);if(L.type==="throw")return d.method="throw",d.arg=L.arg,d.delegate=null,X;var T=L.arg;if(!T)return d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,X;if(T.done)d[p.resultName]=T.value,d.next=p.nextLoc,d.method!=="return"&&(d.method="next",d.arg=j);else return T;return d.delegate=null,X}w(m),O(m,F,"Generator"),O(m,V,function(){return this}),O(m,"toString",function(){return"[object Generator]"});function ae(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 W(p){var d=p.completion||{};d.type="normal",delete d.arg,p.completion=d}function q(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ae,this),this.reset(!0)}x.keys=function(p){var d=[];for(var b in p)d.push(b);return d.reverse(),function L(){for(;d.length;){var T=d.pop();if(T in p)return L.value=T,L.done=!1,L}return L.done=!0,L}};function ne(p){if(p){var d=p[V];if(d)return d.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var b=-1,L=function T(){for(;++b<p.length;)if(D.call(p,b))return T.value=p[b],T.done=!1,T;return T.value=j,T.done=!0,T};return L.next=L}}return{next:le}}x.values=ne;function le(){return{value:j,done:!0}}return q.prototype={constructor:q,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(W),!p)for(var d in this)d.charAt(0)==="t"&&D.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=j)},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 b(ue,ee){return $.type="throw",$.arg=p,d.next=ue,ee&&(d.method="next",d.arg=j),!!ee}for(var L=this.tryEntries.length-1;L>=0;--L){var T=this.tryEntries[L],$=T.completion;if(T.tryLoc==="root")return b("end");if(T.tryLoc<=this.prev){var oe=D.call(T,"catchLoc"),se=D.call(T,"finallyLoc");if(oe&&se){if(this.prev<T.catchLoc)return b(T.catchLoc,!0);if(this.prev<T.finallyLoc)return b(T.finallyLoc)}else if(oe){if(this.prev<T.catchLoc)return b(T.catchLoc,!0)}else if(se){if(this.prev<T.finallyLoc)return b(T.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,d){for(var b=this.tryEntries.length-1;b>=0;--b){var L=this.tryEntries[b];if(L.tryLoc<=this.prev&&D.call(L,"finallyLoc")&&this.prev<L.finallyLoc){var T=L;break}}T&&(p==="break"||p==="continue")&&T.tryLoc<=d&&d<=T.finallyLoc&&(T=null);var $=T?T.completion:{};return $.type=p,$.arg=d,T?(this.method="next",this.next=T.finallyLoc,X):this.complete($)},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),X},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.finallyLoc===p)return this.complete(b.completion,b.afterLoc),W(b),X}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var b=this.tryEntries[d];if(b.tryLoc===p){var L=b.completion;if(L.type==="throw"){var T=L.arg;W(b)}return T}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,b){return this.delegate={iterator:ne(p),resultName:d,nextLoc:b},this.method==="next"&&(this.arg=j),X}},x}(M.exports);try{regeneratorRuntime=A}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=A:Function("r","regeneratorRuntime = r")(A)}},695:function(M,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D){if(D.geometry&&D.geometry.dispose(),D.material){var j=Array.isArray(D.material)?D.material:[D.material];j.forEach(function(g){var V,U,F,O,k,l,N,J,ie,re,X,Q,K;(V=g.map)===null||V===void 0||V.dispose(),(U=g.lightMap)===null||U===void 0||U.dispose(),(F=g.bumpMap)===null||F===void 0||F.dispose(),(O=g.normalMap)===null||O===void 0||O.dispose(),(k=g.specularMap)===null||k===void 0||k.dispose(),(l=g.envMap)===null||l===void 0||l.dispose(),(N=g.alphaMap)===null||N===void 0||N.dispose(),(J=g.aoMap)===null||J===void 0||J.dispose(),(ie=g.displacementMap)===null||ie===void 0||ie.dispose(),(re=g.emissiveMap)===null||re===void 0||re.dispose(),(X=g.gradientMap)===null||X===void 0||X.dispose(),(Q=g.metalnessMap)===null||Q===void 0||Q.dispose(),(K=g.roughnessMap)===null||K===void 0||K.dispose(),g.dispose()})}}},584:function(M,A,x){"use strict";x.d(A,{disposeMesh:function(){return g.Z},isPlainObject:function(){return F.Z}});var G=x(666),D=x.n(G),j=null,g=x(695),V=x(644);function U(Q){if(Q.material){var K=Array.isArray(Q.material)?Q.material:[Q.material];K.forEach(function(R){var f,c;(f=R.color)===null||f===void 0||f.convertSRGBToLinear(),(c=R.emissive)===null||c===void 0||c.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var F=x(738),O=x(568),k=x(924),l=x(360),N=x(484),J=null,ie=null,re=function(){var Q=(0,O.Z)(D().mark(function K(R,f){var c,v,m,w,E,C,Y,ae,W;return D().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return c=f.type,v=c===void 0?"blob":c,m=f.version,w=m===void 0?"1":m,ne.next=4,(0,l.get)(R);case 4:if(C=ne.sent,!(C&&C[w])){ne.next=9;break}E=C[w],ne.next=15;break;case 9:return ne.next=11,(0,N.Z)(fetch(R).then(function(le){if(le.ok)return le[v]();throw new Error}));case 11:Y=ne.sent,ae=Y.res,W=Y.err,W||(E=ae,(0,l.set)(R,(0,k.Z)({},w,ae)));case 15:return ne.abrupt("return",E?{url:v==="json"?R:URL.createObjectURL(E),store:E}:{url:R});case 16:case"end":return ne.stop()}},K)}));return function(R,f){return Q.apply(this,arguments)}}(),X=x(705)},738:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(j){return Object.prototype.toString.call(j)==="[object Object]"}function D(j){if(G(j)===!1)return!1;var g=j.constructor;if(g===void 0)return!0;var V=g.prototype;return!(G(V)===!1||V.hasOwnProperty("isPrototypeOf")===!1)}},484:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(42);function D(j){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(V){return(0,G.Z)({err:null,res:V},g)}).catch(function(V){return(0,G.Z)({err:V,res:void 0},g)})}},705:function(M,A,x){"use strict";var G=x(644),D=x.n(G),j=new Map,g=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,O,k,l,N){var J=O[k*3],ie=O[k*3+1],re=O[l*3],X=O[l*3+1],Q=O[N*3],K=O[N*3+1],R;if(j.has(F))R=j.get(F);else{var f=U.box3||new THREE.Box3;if(!U.box3){var c=F.parameters.shapes.getPoints();f.setFromArray(c.map(function(C){return[C.x,C.y,0]}).flat())}var v=f.getSize(new THREE.Vector3);U.split&&(v.y/=U.split),R={box:f,size:v},j.set(F,R)}var m=R.box,w=R.size,E=U.split?1-U.split:0;return[new THREE.Vector2((J-m.min.x)/w.x,(ie-m.min.y)/w.y+E),new THREE.Vector2((re-m.min.x)/w.x,(X-m.min.y)/w.y+E),new THREE.Vector2((Q-m.min.x)/w.x,(K-m.min.y)/w.y+E)]},generateSideWallUV:function(F,O,k,l,N,J){var ie=O[k*3],re=O[k*3+1],X=O[k*3+2],Q=O[l*3],K=O[l*3+1],R=O[l*3+2],f=O[N*3],c=O[N*3+1],v=O[N*3+2],m=O[J*3],w=O[J*3+1],E=O[J*3+2],C;if(j.has(O))C=j.get(O);else{var Y=new THREE.Box3;Y.setFromArray(O);var ae=Y.getSize(new THREE.Vector3);U.split&&(ae.z/=1-U.split),C={box:Y,size:ae},j.set(O,C)}var W=C.box,q=C.size;return Math.abs(re-K)<Math.abs(ie-Q)?[new THREE.Vector2((ie-W.min.x)/q.x,(X-W.min.z)/q.z),new THREE.Vector2((Q-W.min.x)/q.x,(R-W.min.z)/q.z),new THREE.Vector2((f-W.min.x)/q.x,(v-W.min.z)/q.z),new THREE.Vector2((m-W.min.x)/q.x,(E-W.min.z)/q.z)]:[new THREE.Vector2((re-W.min.y)/q.y,(X-W.min.z)/q.z),new THREE.Vector2((K-W.min.y)/q.y,(R-W.min.z)/q.z),new THREE.Vector2((c-W.min.y)/q.y,(v-W.min.z)/q.z),new THREE.Vector2((w-W.min.y)/q.y,(E-W.min.z)/q.z)]}}},V=function(){j.clear()}},360:function(M){"use strict";M.exports=require("idb-keyval")},644:function(M){"use strict";M.exports=require("three")},568:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});function G(j,g,V,U,F,O,k){try{var l=j[O](k),N=l.value}catch(J){V(J);return}l.done?g(N):Promise.resolve(N).then(U,F)}function D(j){return function(){var g=this,V=arguments;return new Promise(function(U,F){var O=j.apply(g,V);function k(N){G(O,U,F,k,l,"next",N)}function l(N){G(O,U,F,k,l,"throw",N)}k(void 0)})}}},924:function(M,A,x){"use strict";x.d(A,{Z:function(){return G}});function G(D,j,g){return j in D?Object.defineProperty(D,j,{value:g,enumerable:!0,configurable:!0,writable:!0}):D[j]=g,D}},42:function(M,A,x){"use strict";x.d(A,{Z:function(){return D}});var G=x(924);function D(j){for(var g=1;g<arguments.length;g++){var V=arguments[g]!=null?arguments[g]:{},U=Object.keys(V);typeof Object.getOwnPropertySymbols=="function"&&(U=U.concat(Object.getOwnPropertySymbols(V).filter(function(F){return Object.getOwnPropertyDescriptor(V,F).enumerable}))),U.forEach(function(F){(0,G.Z)(j,F,V[F])})}return j}}},xe={};function te(M){var A=xe[M];if(A!==void 0)return A.exports;var x=xe[M]={exports:{}};return Le[M](x,x.exports,te),x.exports}(function(){te.n=function(M){var A=M&&M.__esModule?function(){return M.default}:function(){return M};return te.d(A,{a:A}),A}})(),function(){te.d=function(M,A){for(var x in A)te.o(A,x)&&!te.o(M,x)&&Object.defineProperty(M,x,{enumerable:!0,get:A[x]})}}(),function(){te.o=function(M,A){return Object.prototype.hasOwnProperty.call(M,A)}}(),function(){te.r=function(M){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(M,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";te.r(ye),te.d(ye,{BaseObject:function(){return ct},GUIObject:function(){return R},Pencil:function(){return Se},default:function(){return Se}});function M(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function A(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 x(s,i,n){return i&&A(s.prototype,i),n&&A(s,n),s}var G=te(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 j(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 g(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 V(s){if(Array.isArray(s))return g(s)}function U(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function F(){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 O(s,i){if(!!s){if(typeof s=="string")return g(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 g(s,i)}}function k(s){return V(s)||U(s)||O(s)||F()}var l=te(644),N=te(187),J=require("deepmerge"),ie=te.n(J),re=require("three/examples/jsm/libs/stats.module"),X=te.n(re),Q=require("lil-gui"),K=te.n(Q),R=function(){"use strict";function s(n){M(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],S=h.min,_=h.max,y=h.step,P=h.name,z=h.paramMap,B=h.items,I=h.value,H=h.target,ce=a.toLowerCase().indexOf("color")>-1,Z,fe=typeof I=="undefined"&&H,he=fe?H():u[a],me=fe?a:"value";B?Z=o.add(he,me,B):ce?Z=o.addColor(he,me):Z=o.add(he,me),Z=Z.name(P||a),typeof S!="undefined"&&(Z=Z.min(S)),typeof _!="undefined"&&(Z=Z.max(_)),typeof y!="undefined"&&(Z=Z.step(y)),Z=Z.onChange(function(){t.setTargetValue(r,a,he[me],z)}),fe&&Z.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,S=u.value,_=t.toLowerCase().indexOf("color")>-1,y=typeof S=="undefined"&&h;if(h&&!y){var P=h();Array.isArray(P)||(P=[P]),P.forEach(function(z){if(!!z)if(_)try{z[o||t].set(r)}catch(B){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else z[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},c={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},v=function(){"use strict";function s(n){M(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,S=r.powerPreference,_=r.toneMapping,y=r.toneMappingExposure,P=r.outputEncoding,z=r.logarithmicDepthBuffer,B=r.preserveDrawingBuffer,I=new l.WebGLRenderer({context:o,alpha:u,antialias:h,powerPreference:S,logarithmicDepthBuffer:z,preserveDrawingBuffer:B});I.setSize(e,t),I.setPixelRatio(a),I.autoClear=!1,I.toneMapping=f[_],I.toneMappingExposure=y,I.outputEncoding=P,this.renderer=I}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 R({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}(),m={fov:45,near:1,far:1e3},w=function(){"use strict";function s(n){M(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 R({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}(),E=te(584),C={background:null},Y=function(){"use strict";function s(n){M(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,E.disposeMesh)(t)})},s}(),ae=require("three/examples/jsm/controls/OrbitControls"),W={},q=function(){"use strict";function s(n){M(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,S=e.minZ,_=S===void 0?-1/0:S,y=e.maxY,P=y===void 0?1/0:y,z=e.minY,B=z===void 0?-1/0:z,I=this.limitPanV||new l.Vector3,H=this.control,ce=this.options.camera,Z=new l.Vector3(u,B,_),fe=new l.Vector3(r,P,h);this.limitPanV=I,I.copy(H.target),H.target.clamp(Z,fe),I.sub(H.target),ce.position.sub(I)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),ne=require("three/examples/jsm/renderers/CSS3DRenderer"),le=new l.Vector3,p=new l.Matrix4,d=new l.Matrix4,b=new l.Vector3,L=new l.Vector3,T=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,s);var n=function(z,B){return b.setFromMatrixPosition(z.matrixWorld),L.setFromMatrixPosition(B.matrixWorld),b.distanceToSquared(L)},e=function(z){var B=[];return z.traverse(function(I){I.isCSS2DObject&&B.push(I)}),B},t=function(z){for(var B=e(z).sort(function(fe,he){if(fe.renderOrder!==he.renderOrder)return he.renderOrder-fe.renderOrder;var me=S.objects.get(fe).distanceToCameraSquared,ft=S.objects.get(he).distanceToCameraSquared;return me-ft}),I=B.length,H=0,ce=B.length;H<ce;H++){var Z=B[H].userData.zIndexFix||0;B[H].element.style.zIndex=I-H+Z}},r=this,o,u,a,h,S={objects:new WeakMap},_=i.element!==void 0?i.element:document.createElement("div");_.style.overflow="hidden",this.domElement=_,this.getSize=function(){return{width:o,height:u}},this.render=function(P,z){+l.REVISION<144?(P.autoUpdate===!0&&P.updateMatrixWorld(),z.parent===null&&z.updateMatrixWorld()):(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld()),p.copy(z.matrixWorldInverse),d.multiplyMatrices(z.projectionMatrix,p),y(P,P,z),t(P)},this.setSize=function(P,z){o=P,u=z,a=o/2,h=u/2,_.style.width="".concat(P,"px"),_.style.height="".concat(z,"px")};function y(P,z,B){if(P.isCSS2DObject){le.setFromMatrixPosition(P.matrixWorld),le.applyMatrix4(d);var I=P.visible===!0&&le.z>=-1&&le.z<=1&&P.layers.test(B.layers)===!0;if(P.element.style.display=I===!0?"":"none",I===!0){P.onBeforeRender(r,z,B);var H=P.element;H.style.transform="translate(-50%,-50%) translate(".concat(le.x*a+a,"px,").concat(-le.y*h+h,"px)"),H.parentNode!==_&&_.appendChild(H),P.onAfterRender(r,z,B)}var ce={distanceToCameraSquared:n(B,P)};S.objects.set(P,ce)}for(var Z=0,fe=P.children.length;Z<fe;Z++)y(P.children[Z],z,B)}},$={zIndex:"auto"},oe=function(){"use strict";function s(n){M(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 T:new ne.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}(),se=require("three/examples/jsm/postprocessing/EffectComposer"),ue=require("three/examples/jsm/postprocessing/RenderPass"),ee=require("three/examples/jsm/postprocessing/ShaderPass"),ve=require("three/examples/jsm/shaders/CopyShader"),pe=require("three/examples/jsm/shaders/GammaCorrectionShader"),de=require("three/examples/jsm/postprocessing/SMAAPass"),ze=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ae=require("three/examples/jsm/shaders/FXAAShader"),De=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},dt=0,Ge=1,ge=!1,Ce=De()!==!1,Be=`varying vec2 vUv;
|
|
2
|
-
|
|
3
|
-
void main() {
|
|
4
|
-
|
|
5
|
-
vUv = uv;
|
|
6
|
-
|
|
7
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8
|
-
|
|
9
|
-
}`,Ve=`uniform sampler2D baseTexture;
|
|
10
|
-
uniform sampler2D bloomTexture;
|
|
11
|
-
|
|
12
|
-
varying vec2 vUv;
|
|
13
|
-
|
|
14
|
-
void main() {
|
|
15
|
-
|
|
16
|
-
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
|
-
|
|
18
|
-
}`;function Pe(s,i){return Pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pe(s,i)}function Oe(s,i){return Pe(s,i)}function Ue(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&&Oe(s,i)}function Fe(){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 Re(s){return _e(s)}function ke(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Ie(s){return s&&s.constructor===Symbol?"symbol":typeof s}function He(s,i){return i&&(Ie(i)==="object"||typeof i=="function")?i:ke(s)}function Ne(s){var i=Fe();return function(){var e=Re(s),t;if(i){var r=Re(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return He(this,t)}}var Te=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";Ue(n,s);var i=Ne(n);function n(t,r,o,u){M(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 S=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);a.renderTargetBright=new l.WebGLRenderTarget(S,_,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var P=new l.WebGLRenderTarget(S,_,h);P.texture.name="UnrealBloomPass.h".concat(y),P.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(P);var z=new l.WebGLRenderTarget(S,_,h);z.texture.name="UnrealBloomPass.v".concat(y),z.texture.generateMipmaps=!1,a.renderTargetsVertical.push(z),S=Math.round(S/2),_=Math.round(_/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var B=Ee.LuminosityHighPassShader;a.highPassUniforms=l.UniformsUtils.clone(B.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new l.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:B.vertexShader,fragmentShader:B.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var I=[3,5,7,9,11];S=Math.round(a.resolution.x/2),_=Math.round(a.resolution.y/2);for(var H=0;H<a.nMips;H++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(I[H])),a.separableBlurMaterials[H].uniforms.texSize.value=new l.Vector2(S,_),S=Math.round(S/2),_=Math.round(_/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 ce=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=ce,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,ve.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Z=ve.CopyShader;return a.copyUniforms=l.UniformsUtils.clone(Z.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new l.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:Z.vertexShader,fragmentShader:Z.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 Te.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 S=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 _=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=_.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),_=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=S},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
|
-
void main() {
|
|
20
|
-
vUv = uv;
|
|
21
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
22
|
-
}`,fragmentShader:`#include <common>
|
|
23
|
-
varying vec2 vUv;
|
|
24
|
-
uniform sampler2D colorTexture;
|
|
25
|
-
uniform vec2 texSize;
|
|
26
|
-
uniform vec2 direction;
|
|
27
|
-
float gaussianPdf(in float x, in float sigma) {
|
|
28
|
-
return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
|
|
29
|
-
}
|
|
30
|
-
void main() {
|
|
31
|
-
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
32
|
-
}`})},e.getCompositeMaterial=function(r){return new l.ShaderMaterial({defines:{NUM_MIPS:r},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
|
|
33
|
-
void main() {
|
|
34
|
-
vUv = uv;
|
|
35
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
36
|
-
}`,fragmentShader:`varying vec2 vUv;
|
|
37
|
-
uniform sampler2D blurTexture1;
|
|
38
|
-
uniform sampler2D blurTexture2;
|
|
39
|
-
uniform sampler2D blurTexture3;
|
|
40
|
-
uniform sampler2D blurTexture4;
|
|
41
|
-
uniform sampler2D blurTexture5;
|
|
42
|
-
uniform sampler2D dirtTexture;
|
|
43
|
-
uniform float bloomStrength;
|
|
44
|
-
uniform float bloomRadius;
|
|
45
|
-
uniform float bloomFactors[NUM_MIPS];
|
|
46
|
-
uniform vec3 bloomTintColors[NUM_MIPS];
|
|
47
|
-
float lerpBloomFactor(const in float factor) {
|
|
48
|
-
float mirrorFactor = 1.2 - factor;
|
|
49
|
-
return mix(factor, mirrorFactor, bloomRadius);
|
|
50
|
-
}
|
|
51
|
-
void main() {
|
|
52
|
-
gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
|
|
53
|
-
lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
|
|
54
|
-
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
|
-
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
|
-
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},n}(Te.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var We={threshold:.2,strength:.5,radius:0},Ze=new l.MeshBasicMaterial({color:"black"}),Xe=new l.SpriteMaterial({color:"#000"}),qe=function(){"use strict";function s(n,e){M(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,S=new we(new l.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=S;var _=new se.EffectComposer(t);_.renderToScreen=!1,_.addPass(r),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(Ge);var y=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:Be,fragmentShader:Ve,defines:{}}),P=new ee.ShaderPass(y,"baseTexture");P.needsSwap=!0,this.finalPass=P,o.addPass(P)}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?Xe:Ze)}),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 R({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}(),Qe=require("three/examples/jsm/postprocessing/OutlinePass"),Ye={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Ke=function(){"use strict";function s(n,e){M(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,S=new Qe.OutlinePass(new l.Vector2(a,h),t,r);S.selectedObjects=this.selectedObjects,this.outlinePass=S,o.addPass(S),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 R({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 $e(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 Je(s,i){if(s==null)return{};var n=$e(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 et=require("three/examples/jsm/postprocessing/SSRPass"),tt=require("three/examples/jsm/objects/ReflectorForSSRPass"),rt={maxDistance:10,selects:!0},nt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},it=function(){"use strict";function s(n,e){M(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,S=a.height,_=new et.SSRPass({renderer:o,scene:t,camera:r,width:h,height:S,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,u.addPass(_),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)({},nt,e),r=t.width,o=t.height,u=Je(t,["width","height"]),a=this.composerController,h=a.scene,S=a.getSize(),_=new l.PlaneGeometry(r,o),y=new tt.ReflectorForSSRPass(_,j((0,G.Z)({},u),{textureWidth:S.width,textureHeight:S.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 R({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}(),at=function(){"use strict";function s(n){M(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new se.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 S=new l.WebGLMultisampleRenderTarget(u.width,u.height,a);S.samples=t,h=S}else if(+l.REVISION>=138&&t>0){var _=new l.WebGLRenderTarget(u.width,u.height,j((0,G.Z)({},a),{samples:t}));h=_}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 ue.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new ee.ShaderPass(ve.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new ee.ShaderPass(pe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new ee.ShaderPass(Ae.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 de.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 ze.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 qe(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new Ke(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new it(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}(),Se=function(){"use strict";function s(n){M(this,s),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new N.EventEmitter,this.clock=new l.Clock,this.options=ie()(s.options,n,{isMergeableObject:E.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui,u=e.resizeObserver;if(o){var a=new(K());a.open(!1),this.gui=a}if(r){var h=new(X());h.showPanel(0),h.dom.style.position="absolute",t.appendChild(h.dom),this.stats=h}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),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(k(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,t=e.container,r=e.isdev,o=e.axesHelper,u=e.renderer,a=e.scene,h=e.camera,S=this.getSize(),_=S.width,y=S.height,P=new w({isdev:r,width:_,height:y,cameraParams:h});this.gui&&P.setGui(this.gui);var z=P.camera,B=new Y({camera:z,sceneParams:a}),I=B.scene,H=new v({width:_,height:y,scene:I,camera:z,isdev:r,rendererParams:j((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var ce=H.renderer;o&&B.addAxesHelper(),this.sceneController=B,this.rendererController=H,this.cameraController=P,t.appendChild(ce.domElement)},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,S=e.ssrParams,_=e.multisampling,y=u.antialias;y==="msaa"&&!Ce&&(y=!1,console.warn("MSAA is not supported on this browser"));var P=new at({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?_:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=P,y==="ssaa"&&P.addSSAAPass(),o&&P.addSSRPass(S),t&&P.addBloomPass(a),r&&P.addOutlinePass(h),u.outputEncoding===l.sRGBEncoding&&P.addGammaCorrectionPass(),y==="fxaa"?P.addFXAAPass():y==="smaa"&&P.addSMAAPass(),P.checkCopyPass(),this.event.on("passcheck",function(){P.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 oe(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 q({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.initResizeObserver=function(){var e=this,t=this.options.container;if(!this.resizeObserver){var r=new ResizeObserver(function(o){var u=!0,a=!1,h=void 0;try{for(var S=o[Symbol.iterator](),_;!(u=(_=S.next()).done);u=!0){var y=_.value,P=y.contentRect;e.handeleResize(P.width,P.height),e.render()}}catch(z){a=!0,h=z}finally{try{!u&&S.return!=null&&S.return()}finally{if(a)throw h}}});r.observe(t),this.resizeObserver=r}},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(S,_){var y;(y=_.resize)===null||y===void 0||y.call(_,{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,S=new l.Vector2,_=h.getBoundingClientRect();if(S.x=(e.clientX-_.left)/(_.right-_.left)*2-1,S.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){u.setFromCamera(S,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,S=u.camera,_=u.clock;if(!(!a||!h||!S||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=_.getDelta(),P=_.getElapsedTime();if(a.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(B,I){var H;(H=I.update)===null||H===void 0||H.call(I,y,P)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var z;(z=this.rendererController)===null||z===void 0||z.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,S),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:P})}},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(S,_){var y;(y=_.dispose)===null||y===void 0||y.call(_)}),(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()},x(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}();Se.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:j((0,G.Z)({},c),{antialias:Ce?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:C,camera:m,bloom:!1,bloomParams:We,outline:!1,outlineParams:Ye,css2DRenderer:!1,ssr:!1,ssrParams:rt,css2DRendererParams:(0,G.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},$)};function st(){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 st()?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&&Oe(h,o.prototype),h},be.apply(null,arguments)}function Me(s,i,n){return be.apply(null,arguments)}var ot=te(484);function ut(){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,ot.Z)(n.promise,i)),n}var lt=require("three/examples/jsm/renderers/CSS2DRenderer"),je=function(s){s&&((0,E.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||je(i)}))},ct=function(){"use strict";function s(){M(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=ut(),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=Me(l.Mesh,k(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=Me(l.Points,k(t)),this},i.createCSS2DObject=function(e){return this.object3d=new lt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ne.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ne.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,k(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,k(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(){je(this.object3d)},x(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=ye})();
|
package/dist/index.module.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import*as Be from"idb-keyval";import*as U from"three";import*as Gt from"deepmerge";import*as Ut from"three/examples/jsm/libs/stats.module";import*as Ft from"lil-gui";import*as Ge from"three/examples/jsm/controls/OrbitControls";import*as Re from"three/examples/jsm/renderers/CSS3DRenderer";import*as Vt from"three/examples/jsm/postprocessing/EffectComposer";import*as Nt from"three/examples/jsm/postprocessing/RenderPass";import*as Wt from"three/examples/jsm/postprocessing/ShaderPass";import*as kt from"three/examples/jsm/shaders/CopyShader";import*as It from"three/examples/jsm/shaders/GammaCorrectionShader";import*as Ht from"three/examples/jsm/postprocessing/SMAAPass";import*as Xt from"three/examples/jsm/postprocessing/SSAARenderPass";import*as Kt from"three/examples/jsm/shaders/FXAAShader";import*as Ue from"three/examples/jsm/postprocessing/Pass";import*as Zt from"three/examples/jsm/shaders/LuminosityHighPassShader";import*as Qt from"three/examples/jsm/postprocessing/OutlinePass";import*as Yt from"three/examples/jsm/postprocessing/SSRPass";import*as $t from"three/examples/jsm/objects/ReflectorForSSRPass";import*as Jt from"three/examples/jsm/renderers/CSS2DRenderer";var qt={187:function(A){var D=typeof Reflect=="object"?Reflect:null,x=D&&typeof D.apply=="function"?D.apply:function(c,v,g){return Function.prototype.apply.call(c,v,g)},G;D&&typeof D.ownKeys=="function"?G=D.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function j(f){console&&console.warn&&console.warn(f)}var R=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}A.exports=m,A.exports.once=q,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function X(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||R(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||R(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function O(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return O(this)},m.prototype.emit=function(c){for(var v=[],g=1;g<arguments.length;g++)v.push(arguments[g]);var S=c==="error",w=this._events;if(w!==void 0)S=S&&w.error===void 0;else if(!S)return!1;if(S){var M;if(v.length>0&&(M=v[0]),M instanceof Error)throw M;var ee=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw ee.context=M,ee}var V=w[c];if(V===void 0)return!1;if(typeof V=="function")x(V,this,v);else for(var K=V.length,de=se(V,K),g=0;g<K;++g)x(de[g],this,v);return!0};function F(f,c,v,g){var S,w,M;if(X(v),w=f._events,w===void 0?(w=f._events=Object.create(null),f._eventsCount=0):(w.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),w=f._events),M=w[c]),M===void 0)M=w[c]=v,++f._eventsCount;else if(typeof M=="function"?M=w[c]=g?[v,M]:[M,v]:g?M.unshift(v):M.push(v),S=O(f),S>0&&M.length>S&&!M.warned){M.warned=!0;var ee=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");ee.name="MaxListenersExceededWarning",ee.emitter=f,ee.type=c,ee.count=M.length,j(ee)}return f}m.prototype.addListener=function(c,v){return F(this,c,v,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,v){return F(this,c,v,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(f,c,v){var g={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},S=k.bind(g);return S.listener=v,g.wrapFn=S,S}m.prototype.once=function(c,v){return X(v),this.on(c,l(this,c,v)),this},m.prototype.prependOnceListener=function(c,v){return X(v),this.prependListener(c,l(this,c,v)),this},m.prototype.removeListener=function(c,v){var g,S,w,M,ee;if(X(v),S=this._events,S===void 0)return this;if(g=S[c],g===void 0)return this;if(g===v||g.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,g.listener||v));else if(typeof g!="function"){for(w=-1,M=g.length-1;M>=0;M--)if(g[M]===v||g[M].listener===v){ee=g[M].listener,w=M;break}if(w<0)return this;w===0?g.shift():ne(g,w),g.length===1&&(S[c]=g[0]),S.removeListener!==void 0&&this.emit("removeListener",c,ee||v)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var v,g,S;if(g=this._events,g===void 0)return this;if(g.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):g[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete g[c]),this;if(arguments.length===0){var w=Object.keys(g),M;for(S=0;S<w.length;++S)M=w[S],M!=="removeListener"&&this.removeAllListeners(M);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=g[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(c,v[S]);return this};function Q(f,c,v){var g=f._events;if(g===void 0)return[];var S=g[c];return S===void 0?[]:typeof S=="function"?v?[S.listener||S]:[S]:v?$(S):se(S,S.length)}m.prototype.listeners=function(c){return Q(this,c,!0)},m.prototype.rawListeners=function(c){return Q(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):re.call(f,c)},m.prototype.listenerCount=re;function re(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var v=new Array(c),g=0;g<c;++g)v[g]=f[g];return v}function ne(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function $(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function q(f,c){return new Promise(function(v,g){function S(M){f.removeListener(c,w),g(M)}function w(){typeof f.removeListener=="function"&&f.removeListener("error",S),v([].slice.call(arguments))}z(f,c,w,{once:!0}),c!=="error"&&Z(f,S,{once:!0})})}function Z(f,c,v){typeof f.on=="function"&&z(f,"error",c,v)}function z(f,c,v,g){if(typeof f.on=="function")g.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(w){g.once&&f.removeEventListener(c,S),v(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(A){var D=function(x){"use strict";var G=Object.prototype,j=G.hasOwnProperty,R,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",X=m.asyncIterator||"@@asyncIterator",O=m.toStringTag||"@@toStringTag";function F(p,h,_){return Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}),p[h]}try{F({},"")}catch(p){F=function(h,_,T){return h[_]=T}}function k(p,h,_,T){var E=h&&h.prototype instanceof q?h:q,J=Object.create(E.prototype),te=new de(T||[]);return J._invoke=M(p,_,te),J}x.wrap=k;function l(p,h,_){try{return{type:"normal",arg:p.call(h,_)}}catch(T){return{type:"throw",arg:T}}}var Q="suspendedStart",re="suspendedYield",se="executing",ne="completed",$={};function q(){}function Z(){}function z(){}var f={};F(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(oe([])));v&&v!==G&&j.call(v,B)&&(f=v);var g=z.prototype=q.prototype=Object.create(f);Z.prototype=z,F(g,"constructor",z),F(z,"constructor",Z),Z.displayName=F(z,O,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(h){F(p,h,function(_){return this._invoke(h,_)})})}x.isGeneratorFunction=function(p){var h=typeof p=="function"&&p.constructor;return h?h===Z||(h.displayName||h.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,z):(p.__proto__=z,F(p,O,"GeneratorFunction")),p.prototype=Object.create(g),p},x.awrap=function(p){return{__await:p}};function w(p,h){function _(J,te,ae,ue){var ie=l(p[J],p,te);if(ie.type==="throw")ue(ie.arg);else{var me=ie.arg,ve=me.value;return ve&&typeof ve=="object"&&j.call(ve,"__await")?h.resolve(ve.__await).then(function(fe){_("next",fe,ae,ue)},function(fe){_("throw",fe,ae,ue)}):h.resolve(ve).then(function(fe){me.value=fe,ae(me)},function(fe){return _("throw",fe,ae,ue)})}}var T;function E(J,te){function ae(){return new h(function(ue,ie){_(J,te,ue,ie)})}return T=T?T.then(ae,ae):ae()}this._invoke=E}S(w.prototype),F(w.prototype,X,function(){return this}),x.AsyncIterator=w,x.async=function(p,h,_,T,E){E===void 0&&(E=Promise);var J=new w(k(p,h,_,T),E);return x.isGeneratorFunction(h)?J:J.next().then(function(te){return te.done?te.value:J.next()})};function M(p,h,_){var T=Q;return function(J,te){if(T===se)throw new Error("Generator is already running");if(T===ne){if(J==="throw")throw te;return pe()}for(_.method=J,_.arg=te;;){var ae=_.delegate;if(ae){var ue=ee(ae,_);if(ue){if(ue===$)continue;return ue}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(T===Q)throw T=ne,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);T=se;var ie=l(p,h,_);if(ie.type==="normal"){if(T=_.done?ne:re,ie.arg===$)continue;return{value:ie.arg,done:_.done}}else ie.type==="throw"&&(T=ne,_.method="throw",_.arg=ie.arg)}}}function ee(p,h){var _=p.iterator[h.method];if(_===R){if(h.delegate=null,h.method==="throw"){if(p.iterator.return&&(h.method="return",h.arg=R,ee(p,h),h.method==="throw"))return $;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var T=l(_,p.iterator,h.arg);if(T.type==="throw")return h.method="throw",h.arg=T.arg,h.delegate=null,$;var E=T.arg;if(!E)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,$;if(E.done)h[p.resultName]=E.value,h.next=p.nextLoc,h.method!=="return"&&(h.method="next",h.arg=R);else return E;return h.delegate=null,$}S(g),F(g,O,"Generator"),F(g,B,function(){return this}),F(g,"toString",function(){return"[object Generator]"});function V(p){var h={tryLoc:p[0]};1 in p&&(h.catchLoc=p[1]),2 in p&&(h.finallyLoc=p[2],h.afterLoc=p[3]),this.tryEntries.push(h)}function K(p){var h=p.completion||{};h.type="normal",delete h.arg,p.completion=h}function de(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}x.keys=function(p){var h=[];for(var _ in p)h.push(_);return h.reverse(),function T(){for(;h.length;){var E=h.pop();if(E in p)return T.value=E,T.done=!1,T}return T.done=!0,T}};function oe(p){if(p){var h=p[B];if(h)return h.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var _=-1,T=function E(){for(;++_<p.length;)if(j.call(p,_))return E.value=p[_],E.done=!1,E;return E.value=R,E.done=!0,E};return T.next=T}}return{next:pe}}x.values=oe;function pe(){return{value:R,done:!0}}return de.prototype={constructor:de,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(K),!p)for(var h in this)h.charAt(0)==="t"&&j.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=R)},stop:function(){this.done=!0;var p=this.tryEntries[0],h=p.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var h=this;function _(ue,ie){return J.type="throw",J.arg=p,h.next=ue,ie&&(h.method="next",h.arg=R),!!ie}for(var T=this.tryEntries.length-1;T>=0;--T){var E=this.tryEntries[T],J=E.completion;if(E.tryLoc==="root")return _("end");if(E.tryLoc<=this.prev){var te=j.call(E,"catchLoc"),ae=j.call(E,"finallyLoc");if(te&&ae){if(this.prev<E.catchLoc)return _(E.catchLoc,!0);if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else if(te){if(this.prev<E.catchLoc)return _(E.catchLoc,!0)}else if(ae){if(this.prev<E.finallyLoc)return _(E.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,h){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.tryLoc<=this.prev&&j.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var E=T;break}}E&&(p==="break"||p==="continue")&&E.tryLoc<=h&&h<=E.finallyLoc&&(E=null);var J=E?E.completion:{};return J.type=p,J.arg=h,E?(this.method="next",this.next=E.finallyLoc,$):this.complete(J)},complete:function(p,h){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&h&&(this.next=h),$},finish:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),K(_),$}},catch:function(p){for(var h=this.tryEntries.length-1;h>=0;--h){var _=this.tryEntries[h];if(_.tryLoc===p){var T=_.completion;if(T.type==="throw"){var E=T.arg;K(_)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(p,h,_){return this.delegate={iterator:oe(p),resultName:h,nextLoc:_},this.method==="next"&&(this.arg=R),$}},x}(A.exports);try{regeneratorRuntime=D}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=D:Function("r","regeneratorRuntime = r")(D)}},695:function(A,D,x){x.d(D,{Z:function(){return G}});function G(j){if(j.geometry&&j.geometry.dispose(),j.material){var R=Array.isArray(j.material)?j.material:[j.material];R.forEach(function(m){var B,X,O,F,k,l,Q,re,se,ne,$,q,Z;(B=m.map)===null||B===void 0||B.dispose(),(X=m.lightMap)===null||X===void 0||X.dispose(),(O=m.bumpMap)===null||O===void 0||O.dispose(),(F=m.normalMap)===null||F===void 0||F.dispose(),(k=m.specularMap)===null||k===void 0||k.dispose(),(l=m.envMap)===null||l===void 0||l.dispose(),(Q=m.alphaMap)===null||Q===void 0||Q.dispose(),(re=m.aoMap)===null||re===void 0||re.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ne=m.emissiveMap)===null||ne===void 0||ne.dispose(),($=m.gradientMap)===null||$===void 0||$.dispose(),(q=m.metalnessMap)===null||q===void 0||q.dispose(),(Z=m.roughnessMap)===null||Z===void 0||Z.dispose(),m.dispose()})}}},584:function(A,D,x){x.d(D,{wf:function(){return m.Z},PO:function(){return O.Z}});var G=x(666),j=x.n(G),R=null,m=x(695),B=x(949);function X(q){if(q.material){var Z=Array.isArray(q.material)?q.material:[q.material];Z.forEach(function(z){var f,c;(f=z.color)===null||f===void 0||f.convertSRGBToLinear(),(c=z.emissive)===null||c===void 0||c.convertSRGBToLinear(),z.map&&(z.map.encoding=THREE.sRGBEncoding),z.emissiveMap&&(z.emissiveMap.encoding=THREE.sRGBEncoding)})}}var O=x(738),F=x(568),k=x(924),l=x(77),Q=x(484),re=null,se=null,ne=function(){var q=(0,F.Z)(j().mark(function Z(z,f){var c,v,g,S,w,M,ee,V,K;return j().wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return c=f.type,v=c===void 0?"blob":c,g=f.version,S=g===void 0?"1":g,oe.next=4,(0,l.get)(z);case 4:if(M=oe.sent,!(M&&M[S])){oe.next=9;break}w=M[S],oe.next=15;break;case 9:return oe.next=11,(0,Q.Z)(fetch(z).then(function(pe){if(pe.ok)return pe[v]();throw new Error}));case 11:ee=oe.sent,V=ee.res,K=ee.err,K||(w=V,(0,l.set)(z,(0,k.Z)({},S,V)));case 15:return oe.abrupt("return",w?{url:v==="json"?z:URL.createObjectURL(w),store:w}:{url:z});case 16:case"end":return oe.stop()}},Z)}));return function(z,f){return q.apply(this,arguments)}}(),$=x(705)},738:function(A,D,x){x.d(D,{Z:function(){return j}});function G(R){return Object.prototype.toString.call(R)==="[object Object]"}function j(R){if(G(R)===!1)return!1;var m=R.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(A,D,x){x.d(D,{Z:function(){return j}});var G=x(42);function j(R){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},705:function(A,D,x){var G=x(949),j=new Map,R=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,O,F,k,l){var Q=O[F*3],re=O[F*3+1],se=O[k*3],ne=O[k*3+1],$=O[l*3],q=O[l*3+1],Z;if(j.has(X))Z=j.get(X);else{var z=B.box3||new THREE.Box3;if(!B.box3){var f=X.parameters.shapes.getPoints();z.setFromArray(f.map(function(w){return[w.x,w.y,0]}).flat())}var c=z.getSize(new THREE.Vector3);B.split&&(c.y/=B.split),Z={box:z,size:c},j.set(X,Z)}var v=Z.box,g=Z.size,S=B.split?1-B.split:0;return[new THREE.Vector2((Q-v.min.x)/g.x,(re-v.min.y)/g.y+S),new THREE.Vector2((se-v.min.x)/g.x,(ne-v.min.y)/g.y+S),new THREE.Vector2(($-v.min.x)/g.x,(q-v.min.y)/g.y+S)]},generateSideWallUV:function(X,O,F,k,l,Q){var re=O[F*3],se=O[F*3+1],ne=O[F*3+2],$=O[k*3],q=O[k*3+1],Z=O[k*3+2],z=O[l*3],f=O[l*3+1],c=O[l*3+2],v=O[Q*3],g=O[Q*3+1],S=O[Q*3+2],w;if(j.has(O))w=j.get(O);else{var M=new THREE.Box3;M.setFromArray(O);var ee=M.getSize(new THREE.Vector3);B.split&&(ee.z/=1-B.split),w={box:M,size:ee},j.set(O,w)}var V=w.box,K=w.size;return Math.abs(se-q)<Math.abs(re-$)?[new THREE.Vector2((re-V.min.x)/K.x,(ne-V.min.z)/K.z),new THREE.Vector2(($-V.min.x)/K.x,(Z-V.min.z)/K.z),new THREE.Vector2((z-V.min.x)/K.x,(c-V.min.z)/K.z),new THREE.Vector2((v-V.min.x)/K.x,(S-V.min.z)/K.z)]:[new THREE.Vector2((se-V.min.y)/K.y,(ne-V.min.z)/K.z),new THREE.Vector2((q-V.min.y)/K.y,(Z-V.min.z)/K.z),new THREE.Vector2((f-V.min.y)/K.y,(c-V.min.z)/K.z),new THREE.Vector2((g-V.min.y)/K.y,(S-V.min.z)/K.z)]}}},m=function(){j.clear()}},77:function(A,D,x){var G=R=>{var m={};return x.d(m,R),m},j=R=>()=>R;A.exports=G({get:()=>Be.get,set:()=>Be.set})},949:function(A,D,x){var G=R=>{var m={};return x.d(m,R),m},j=R=>()=>R;A.exports=G({ACESFilmicToneMapping:()=>U.ACESFilmicToneMapping,AdditiveBlending:()=>U.AdditiveBlending,AxesHelper:()=>U.AxesHelper,Box3:()=>U.Box3,Camera:()=>U.Camera,CineonToneMapping:()=>U.CineonToneMapping,Clock:()=>U.Clock,Color:()=>U.Color,Euler:()=>U.Euler,Group:()=>U.Group,Layers:()=>U.Layers,LinearEncoding:()=>U.LinearEncoding,LinearFilter:()=>U.LinearFilter,LinearToneMapping:()=>U.LinearToneMapping,Matrix4:()=>U.Matrix4,Mesh:()=>U.Mesh,MeshBasicMaterial:()=>U.MeshBasicMaterial,NoToneMapping:()=>U.NoToneMapping,PerspectiveCamera:()=>U.PerspectiveCamera,PlaneGeometry:()=>U.PlaneGeometry,Points:()=>U.Points,REVISION:()=>U.REVISION,RGBAFormat:()=>U.RGBAFormat,Raycaster:()=>U.Raycaster,ReinhardToneMapping:()=>U.ReinhardToneMapping,Scene:()=>U.Scene,ShaderMaterial:()=>U.ShaderMaterial,Sprite:()=>U.Sprite,SpriteMaterial:()=>U.SpriteMaterial,UniformsUtils:()=>U.UniformsUtils,UnsignedByteType:()=>U.UnsignedByteType,Vector2:()=>U.Vector2,Vector3:()=>U.Vector3,WebGLMultisampleRenderTarget:()=>U.WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>U.WebGLRenderTarget,WebGLRenderer:()=>U.WebGLRenderer,sRGBEncoding:()=>U.sRGBEncoding})},568:function(A,D,x){x.d(D,{Z:function(){return j}});function G(R,m,B,X,O,F,k){try{var l=R[F](k),Q=l.value}catch(re){B(re);return}l.done?m(Q):Promise.resolve(Q).then(X,O)}function j(R){return function(){var m=this,B=arguments;return new Promise(function(X,O){var F=R.apply(m,B);function k(Q){G(F,X,O,k,l,"next",Q)}function l(Q){G(F,X,O,k,l,"throw",Q)}k(void 0)})}}},924:function(A,D,x){x.d(D,{Z:function(){return G}});function G(j,R,m){return R in j?Object.defineProperty(j,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):j[R]=m,j}},42:function(A,D,x){x.d(D,{Z:function(){return j}});var G=x(924);function j(R){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},X=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(B).filter(function(O){return Object.getOwnPropertyDescriptor(B,O).enumerable}))),X.forEach(function(O){(0,G.Z)(R,O,B[O])})}return R}}},Fe={};function W(A){var D=Fe[A];if(D!==void 0)return D.exports;var x=Fe[A]={exports:{}};return qt[A](x,x.exports,W),x.exports}(function(){W.n=function(A){var D=A&&A.__esModule?function(){return A.default}:function(){return A};return W.d(D,{a:D}),D}})(),function(){W.d=function(A,D){for(var x in D)W.o(D,x)&&!W.o(A,x)&&Object.defineProperty(A,x,{enumerable:!0,get:D[x]})}}(),function(){W.o=function(A,D){return Object.prototype.hasOwnProperty.call(A,D)}}();var be={};(function(){W.d(be,{L6:function(){return zt},sb:function(){return v},z:function(){return Ee},ZP:function(){return Ee}});function A(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,t,i){return t&&D(n.prototype,t),i&&D(n,i),n}var G=W(42);function j(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),i.push.apply(i,e)}return i}function R(n,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))}),n}function m(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=n[i];return e}function B(n){if(Array.isArray(n))return m(n)}function X(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function O(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(n,t){if(!!n){if(typeof n=="string")return m(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return m(n,t)}}function k(n){return B(n)||X(n)||F(n)||O()}var l=W(949),Q=W(187),re=n=>{var t={};return W.d(t,n),t},se=n=>()=>n,ne=re({default:()=>Gt.default}),$=n=>{var t={};return W.d(t,n),t},q=n=>()=>n,Z=$({default:()=>Ut.default}),z=n=>{var t={};return W.d(t,n),t},f=n=>()=>n,c=z({default:()=>Ft.default}),v=function(){"use strict";function n(i){A(this,n),this.guiParams={},i&&(this.guiParams=i)}var t=n.prototype;return t.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(a){var o=e.addFolder(a),u=r.guiParams[a];Object.keys(u).forEach(function(s){var d=u[s],C=d.min,P=d.max,b=d.step,y=d.name,L=d.paramMap,N=d.items,I=d.value,H=d.target,le=s.toLowerCase().indexOf("color")>-1,Y,ce=typeof I=="undefined"&&H,he=ce?H():u[s],ge=ce?s:"value";N?Y=o.add(he,ge,N):le?Y=o.addColor(he,ge):Y=o.add(he,ge),Y=Y.name(y||s),typeof C!="undefined"&&(Y=Y.min(C)),typeof P!="undefined"&&(Y=Y.max(P)),typeof b!="undefined"&&(Y=Y.step(b)),Y=Y.onChange(function(){r.setTargetValue(a,s,he[ge],L)}),ce&&Y.listen()})})},t.setTargetValue=function(e,r,a,o){var u=this.guiParams[e][r],s=u.onChange,d=u.target,C=u.value,P=r.toLowerCase().indexOf("color")>-1,b=typeof C=="undefined"&&d;if(d&&!b){var y=d();Array.isArray(y)||(y=[y]),y.forEach(function(L){if(!!L)if(P)try{L[o||r].set(a)}catch(N){r!=="color"&&!o&&console.warn("".concat(r," is not a color,set paramMap"))}else L[o||r]=a})}s&&s(a)},t.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(a){var o=e.guiParams[r][a];typeof o.value!="undefined"&&e.setTargetValue(r,a,o.value,o.paramMap)})})},n}(),g={None:l.NoToneMapping,Linear:l.LinearToneMapping,Reinhard:l.ReinhardToneMapping,Cineon:l.CineonToneMapping,ACESFilmic:l.ACESFilmicToneMapping},S={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:l.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null},w=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.width,r=i.height,a=i.rendererParams,o=a.context,u=a.alpha,s=a.devicePixelRatio,d=a.antialias,C=a.powerPreference,P=a.toneMapping,b=a.toneMappingExposure,y=a.outputEncoding,L=a.logarithmicDepthBuffer,N=a.preserveDrawingBuffer,I=new l.WebGLRenderer({context:o,alpha:u,antialias:d,powerPreference:C,logarithmicDepthBuffer:L,preserveDrawingBuffer:N});I.setSize(e,r),I.setPixelRatio(s),I.autoClear=!1,I.toneMapping=g[P],I.toneMappingExposure=b,I.outputEncoding=y,this.renderer=I}var t=n.prototype;return t.setSize=function(e,r){this.renderer.setSize(e,r)},t.render=function(){var e=this.options,r=e.scene,a=e.camera;this.renderer.render(r,a)},t.setGui=function(e){var r=this,a=new v({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:g,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});a.showGui(e)},t.dispose=function(){var e,r,a;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(a=this.renderer)===null||a===void 0||a.renderLists.dispose()},n}(),M={fov:45,near:1,far:1e3},ee=function(){"use strict";function n(i){A(this,n),this.oldCameraPosition=new l.Vector3,this.oldCameraRotation=new l.Euler,this.customCamera=!1,this.options=i;var e=i.width,r=i.height,a=i.cameraParams;if(a instanceof l.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,u=a.far,s=a.near,d=new l.PerspectiveCamera(o,e/r,s,u);d.position.set(0,0,400),d.lookAt(0,0,0),this.camera=d}}var t=n.prototype;return t.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},t.setSize=function(e,r){this.camera instanceof l.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},t.setGui=function(e){var r=this,a=new v({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof l.PerspectiveCamera&&(a.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),a.showGui(e)},n}(),V=W(584),K={background:null},de=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.camera,r=i.sceneParams,a=r.background,o=new l.Scene;a&&(o.background=a),o.add(e),this.scene=o}var t=n.prototype;return t.addAxesHelper=function(){var e,r=new l.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},t.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,V.wf)(r)})},n}(),oe=n=>{var t={};return W.d(t,n),t},pe=n=>()=>n,p=oe({MapControls:()=>Ge.MapControls,OrbitControls:()=>Ge.OrbitControls}),h={},_=function(){"use strict";function n(i){A(this,n),this.options=i;var e=i.camera,r=i.controlParams,a=i.mapControl,o=r.domElement,u=a?new p.MapControls(e,o):new p.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var t=n.prototype;return t.limitPan=function(e){var r=e.maxX,a=r===void 0?1/0:r,o=e.minX,u=o===void 0?-1/0:o,s=e.maxZ,d=s===void 0?1/0:s,C=e.minZ,P=C===void 0?-1/0:C,b=e.maxY,y=b===void 0?1/0:b,L=e.minY,N=L===void 0?-1/0:L,I=this.limitPanV||new l.Vector3,H=this.control,le=this.options.camera,Y=new l.Vector3(u,N,P),ce=new l.Vector3(a,y,d);this.limitPanV=I,I.copy(H.target),H.target.clamp(Y,ce),I.sub(H.target),le.position.sub(I)},t.update=function(){this.control.update()},t.dispose=function(){this.control.dispose()},n}(),T=n=>{var t={};return W.d(t,n),t},E=n=>()=>n,J=T({CSS3DObject:()=>Re.CSS3DObject,CSS3DRenderer:()=>Re.CSS3DRenderer,CSS3DSprite:()=>Re.CSS3DSprite}),te=new l.Vector3,ae=new l.Matrix4,ue=new l.Matrix4,ie=new l.Vector3,me=new l.Vector3,ve=function n(){"use strict";var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,n);var i=function(L,N){return ie.setFromMatrixPosition(L.matrixWorld),me.setFromMatrixPosition(N.matrixWorld),ie.distanceToSquared(me)},e=function(L){var N=[];return L.traverse(function(I){I.isCSS2DObject&&N.push(I)}),N},r=function(L){for(var N=e(L).sort(function(ce,he){if(ce.renderOrder!==he.renderOrder)return he.renderOrder-ce.renderOrder;var ge=C.objects.get(ce).distanceToCameraSquared,Bt=C.objects.get(he).distanceToCameraSquared;return ge-Bt}),I=N.length,H=0,le=N.length;H<le;H++){var Y=N[H].userData.zIndexFix||0;N[H].element.style.zIndex=I-H+Y}},a=this,o,u,s,d,C={objects:new WeakMap},P=t.element!==void 0?t.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(y,L){+l.REVISION<144?(y.autoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.updateMatrixWorld()):(y.matrixWorldAutoUpdate===!0&&y.updateMatrixWorld(),L.parent===null&&L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld()),ae.copy(L.matrixWorldInverse),ue.multiplyMatrices(L.projectionMatrix,ae),b(y,y,L),r(y)},this.setSize=function(y,L){o=y,u=L,s=o/2,d=u/2,P.style.width="".concat(y,"px"),P.style.height="".concat(L,"px")};function b(y,L,N){if(y.isCSS2DObject){te.setFromMatrixPosition(y.matrixWorld),te.applyMatrix4(ue);var I=y.visible===!0&&te.z>=-1&&te.z<=1&&y.layers.test(N.layers)===!0;if(y.element.style.display=I===!0?"":"none",I===!0){y.onBeforeRender(a,L,N);var H=y.element;H.style.transform="translate(-50%,-50%) translate(".concat(te.x*s+s,"px,").concat(-te.y*d+d,"px)"),H.parentNode!==P&&P.appendChild(H),y.onAfterRender(a,L,N)}var le={distanceToCameraSquared:i(N,y)};C.objects.set(y,le)}for(var Y=0,ce=y.children.length;Y<ce;Y++)b(y.children[Y],L,N)}},fe={zIndex:"auto"},Ve=function(){"use strict";function n(i){A(this,n),this.container=i}var t=n.prototype;return t.addRenderer=function(e,r){var a=this.container,o=a.offsetWidth,u=a.offsetHeight,s=e==="css2d"?new ve:new J.CSS3DRenderer;s.domElement.style.position="absolute",s.domElement.style.top="0",s.domElement.style.pointerEvents="none",s.domElement.style.zIndex=r.zIndex,s.setSize(o,u),a.appendChild(s.domElement),e==="css2d"?this.css2Drenderer=s:e==="css3d"&&(this.css3Drenderer=s)},t.setSize=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},t.render=function(e,r){var a,o;(a=this.css2Drenderer)===null||a===void 0||a.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},t.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},n}(),Ne=n=>{var t={};return W.d(t,n),t},ar=n=>()=>n,Oe=Ne({EffectComposer:()=>Vt.EffectComposer}),We=n=>{var t={};return W.d(t,n),t},ir=n=>()=>n,ke=We({RenderPass:()=>Nt.RenderPass}),Ie=n=>{var t={};return W.d(t,n),t},sr=n=>()=>n,ye=Ie({ShaderPass:()=>Wt.ShaderPass}),He=n=>{var t={};return W.d(t,n),t},or=n=>()=>n,Se=He({CopyShader:()=>kt.CopyShader}),Xe=n=>{var t={};return W.d(t,n),t},ur=n=>()=>n,Ke=Xe({GammaCorrectionShader:()=>It.GammaCorrectionShader}),Ze=n=>{var t={};return W.d(t,n),t},lr=n=>()=>n,Qe=Ze({SMAAPass:()=>Ht.SMAAPass}),Ye=n=>{var t={};return W.d(t,n),t},cr=n=>()=>n,$e=Ye({SSAARenderPass:()=>Xt.SSAARenderPass}),Je=n=>{var t={};return W.d(t,n),t},fr=n=>()=>n,qe=Je({FXAAShader:()=>Kt.FXAAShader}),et=function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch(t){return!1}},dr=0,tt=1,_e=!1,Me=et()!==!1,rt=`varying vec2 vUv;
|
|
2
|
-
|
|
3
|
-
void main() {
|
|
4
|
-
|
|
5
|
-
vUv = uv;
|
|
6
|
-
|
|
7
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8
|
-
|
|
9
|
-
}`,nt=`uniform sampler2D baseTexture;
|
|
10
|
-
uniform sampler2D bloomTexture;
|
|
11
|
-
|
|
12
|
-
varying vec2 vUv;
|
|
13
|
-
|
|
14
|
-
void main() {
|
|
15
|
-
|
|
16
|
-
gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
|
|
17
|
-
|
|
18
|
-
}`;function xe(n,t){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(n,t)}function Te(n,t){return xe(n,t)}function at(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&Te(n,t)}function it(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function Ce(n){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},Ce(n)}function Ae(n){return Ce(n)}function st(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ot(n){return n&&n.constructor===Symbol?"symbol":typeof n}function ut(n,t){return t&&(ot(t)==="object"||typeof t=="function")?t:st(n)}function lt(n){var t=it();return function(){var e=Ae(n),r;if(t){var a=Ae(this).constructor;r=Reflect.construct(e,arguments,a)}else r=e.apply(this,arguments);return ut(this,r)}}var ct=n=>{var t={};return W.d(t,n),t},hr=n=>()=>n,Le=ct({FullScreenQuad:()=>Ue.FullScreenQuad,Pass:()=>Ue.Pass}),ft=n=>{var t={};return W.d(t,n),t},vr=n=>()=>n,je=ft({LuminosityHighPassShader:()=>Zt.LuminosityHighPassShader}),we=function(n){"use strict";at(i,n);var t=lt(i);function i(r,a,o,u){A(this,i);var s;s=t.call(this),s.strength=a!==void 0?a:1,s.radius=o,s.threshold=u,s.resolution=r!==void 0?new l.Vector2(r.x,r.y):new l.Vector2(256,256),s.clearColor=new l.Color(0,0,0);var d={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat};s.renderTargetsHorizontal=[],s.renderTargetsVertical=[],s.nMips=5;var C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);s.renderTargetBright=new l.WebGLRenderTarget(C,P,d),s.renderTargetBright.texture.name="UnrealBloomPass.bright",s.renderTargetBright.texture.generateMipmaps=!1;for(var b=0;b<s.nMips;b++){var y=new l.WebGLRenderTarget(C,P,d);y.texture.name="UnrealBloomPass.h".concat(b),y.texture.generateMipmaps=!1,s.renderTargetsHorizontal.push(y);var L=new l.WebGLRenderTarget(C,P,d);L.texture.name="UnrealBloomPass.v".concat(b),L.texture.generateMipmaps=!1,s.renderTargetsVertical.push(L),C=Math.round(C/2),P=Math.round(P/2)}je.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var N=je.LuminosityHighPassShader;s.highPassUniforms=l.UniformsUtils.clone(N.uniforms),s.highPassUniforms.luminosityThreshold.value=u,s.highPassUniforms.smoothWidth.value=.01,s.materialHighPassFilter=new l.ShaderMaterial({uniforms:s.highPassUniforms,vertexShader:N.vertexShader,fragmentShader:N.fragmentShader,defines:{}}),s.separableBlurMaterials=[];var I=[3,5,7,9,11];C=Math.round(s.resolution.x/2),P=Math.round(s.resolution.y/2);for(var H=0;H<s.nMips;H++)s.separableBlurMaterials.push(s.getSeperableBlurMaterial(I[H])),s.separableBlurMaterials[H].uniforms.texSize.value=new l.Vector2(C,P),C=Math.round(C/2),P=Math.round(P/2);s.compositeMaterial=s.getCompositeMaterial(s.nMips),s.compositeMaterial.uniforms.blurTexture1.value=s.renderTargetsVertical[0].texture,s.compositeMaterial.uniforms.blurTexture2.value=s.renderTargetsVertical[1].texture,s.compositeMaterial.uniforms.blurTexture3.value=s.renderTargetsVertical[2].texture,s.compositeMaterial.uniforms.blurTexture4.value=s.renderTargetsVertical[3].texture,s.compositeMaterial.uniforms.blurTexture5.value=s.renderTargetsVertical[4].texture,s.compositeMaterial.uniforms.bloomStrength.value=a,s.compositeMaterial.uniforms.bloomRadius.value=.1,s.compositeMaterial.needsUpdate=!0;var le=[1,.8,.6,.4,.2];s.compositeMaterial.uniforms.bloomFactors.value=le,s.bloomTintColors=[new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1),new l.Vector3(1,1,1)],s.compositeMaterial.uniforms.bloomTintColors.value=s.bloomTintColors,Se.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var Y=Se.CopyShader;return s.copyUniforms=l.UniformsUtils.clone(Y.uniforms),s.copyUniforms.opacity.value=1,s.materialCopy=new l.ShaderMaterial({uniforms:s.copyUniforms,vertexShader:Y.vertexShader,fragmentShader:Y.fragmentShader,blending:l.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),s.enabled=!0,s.needsSwap=!1,s._oldClearColor=new l.Color,s.oldClearAlpha=1,s.basic=new l.MeshBasicMaterial,s.fsQuad=new Le.FullScreenQuad(void 0),s}var e=i.prototype;return e.dispose=function(){for(var a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(a,o){var u=Math.round(a/2),s=Math.round(o/2);this.renderTargetBright.setSize(u,s);for(var d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(u,s),this.renderTargetsVertical[d].setSize(u,s),this.separableBlurMaterials[d].uniforms.texSize.value=new l.Vector2(u,s),u=Math.round(u/2),s=Math.round(s/2)},e.render=function(a,o,u,s,d){a.getClearColor(this._oldClearColor),this.oldClearAlpha=a.getClearAlpha();var C=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),d&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,a.setRenderTarget(null),a.clear(),this.fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this.fsQuad.render(a);for(var P=this.renderTargetBright,b=0;b<this.nMips;b++)this.fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this.fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=i.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this.fsQuad.render(a),P=this.renderTargetsVertical[b];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this.fsQuad.render(a),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,d&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?(a.setRenderTarget(null),this.fsQuad.render(a)):(a.setRenderTarget(u),this.fsQuad.render(a)),a.setClearColor(this._oldClearColor,this.oldClearAlpha),a.autoClear=C},e.getSeperableBlurMaterial=function(a){return new l.ShaderMaterial({defines:{KERNEL_RADIUS:a,SIGMA:a},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
19
|
-
void main() {
|
|
20
|
-
vUv = uv;
|
|
21
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
22
|
-
}`,fragmentShader:`#include <common>
|
|
23
|
-
varying vec2 vUv;
|
|
24
|
-
uniform sampler2D colorTexture;
|
|
25
|
-
uniform vec2 texSize;
|
|
26
|
-
uniform vec2 direction;
|
|
27
|
-
float gaussianPdf(in float x, in float sigma) {
|
|
28
|
-
return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
|
|
29
|
-
}
|
|
30
|
-
void main() {
|
|
31
|
-
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
32
|
-
}`})},e.getCompositeMaterial=function(a){return new l.ShaderMaterial({defines:{NUM_MIPS:a},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
|
|
33
|
-
void main() {
|
|
34
|
-
vUv = uv;
|
|
35
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
36
|
-
}`,fragmentShader:`varying vec2 vUv;
|
|
37
|
-
uniform sampler2D blurTexture1;
|
|
38
|
-
uniform sampler2D blurTexture2;
|
|
39
|
-
uniform sampler2D blurTexture3;
|
|
40
|
-
uniform sampler2D blurTexture4;
|
|
41
|
-
uniform sampler2D blurTexture5;
|
|
42
|
-
uniform sampler2D dirtTexture;
|
|
43
|
-
uniform float bloomStrength;
|
|
44
|
-
uniform float bloomRadius;
|
|
45
|
-
uniform float bloomFactors[NUM_MIPS];
|
|
46
|
-
uniform vec3 bloomTintColors[NUM_MIPS];
|
|
47
|
-
float lerpBloomFactor(const in float factor) {
|
|
48
|
-
float mirrorFactor = 1.2 - factor;
|
|
49
|
-
return mix(factor, mirrorFactor, bloomRadius);
|
|
50
|
-
}
|
|
51
|
-
void main() {
|
|
52
|
-
gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
|
|
53
|
-
lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
|
|
54
|
-
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
55
|
-
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
56
|
-
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
57
|
-
}`})},i}(Le.Pass);we.BlurDirectionX=new l.Vector2(1,0),we.BlurDirectionY=new l.Vector2(0,1);var dt={threshold:.2,strength:.5,radius:0},ht=new l.MeshBasicMaterial({color:"black"}),vt=new l.SpriteMaterial({color:"#000"}),pt=function(){"use strict";function n(i,e){A(this,n),this.materials={},this.bloomLayer=new l.Layers,this.active=!0,this.composerController=i,this.options=e;var r=i.renderer,a=i.renderPass,o=i.finalComposer,u=i.getSize(),s=u.width,d=u.height,C=new we(new l.Vector2(s,d),e.strength,e.radius,e.threshold);this.bloomPass=C;var P=new Oe.EffectComposer(r);P.renderToScreen=!1,P.addPass(a),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(tt);var b=new l.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:rt,fragmentShader:nt,defines:{}}),y=new ye.ShaderPass(b,"baseTexture");y.needsSwap=!0,this.finalPass=y,o.addPass(y)}var t=n.prototype;return t.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},t.render=function(e){if(!!this.active){var r=this,a=r.bloomComposer,o=r.bloomLayer,u=r.materials;e.traverse(function(s){var d=s;d.material&&o.test(d.layers)===!1&&(u[d.uuid]=d.material,d.material=d.isSprite?vt:ht)}),a.render(),e.traverse(function(s){var d=s;u[d.uuid]&&(d.material=u[d.uuid],delete u[d.uuid])})}},t.setSize=function(e,r){this.bloomComposer.setSize(e,r)},t.setGui=function(e){var r=this,a=new v({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});a.showGui(e)},t.dispose=function(){this.bloomPass.dispose(),this.materials={}},n}(),mt=n=>{var t={};return W.d(t,n),t},pr=n=>()=>n,gt=mt({OutlinePass:()=>Qt.OutlinePass}),_t={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},bt=function(){"use strict";function n(i,e){A(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.finalComposer,u=i.getSize(),s=u.width,d=u.height,C=new gt.OutlinePass(new l.Vector2(s,d),r,a);C.selectedObjects=this.selectedObjects,this.outlinePass=C,o.addPass(C),this.setGui()}var t=n.prototype;return t.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},t.setGui=function(){var e=this,r=new v({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},t.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},n}();function yt(n,t){if(n==null)return{};var i={},e=Object.keys(n),r,a;for(a=0;a<e.length;a++)r=e[a],!(t.indexOf(r)>=0)&&(i[r]=n[r]);return i}function Pt(n,t){if(n==null)return{};var i=yt(n,t),e,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,e)||(i[e]=n[e]))}return i}var St=n=>{var t={};return W.d(t,n),t},mr=n=>()=>n,xt=St({SSRPass:()=>Yt.SSRPass}),Ct=n=>{var t={};return W.d(t,n),t},gr=n=>()=>n,wt=Ct({ReflectorForSSRPass:()=>$t.ReflectorForSSRPass}),Et={maxDistance:10,selects:!0},Rt={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Ot=function(){"use strict";function n(i,e){A(this,n),this.selectedObjects=[],this.active=!0,this.composerController=i,this.options=e;var r=i.scene,a=i.camera,o=i.renderer,u=i.finalComposer,s=i.getSize(),d=s.width,C=s.height,P=new xt.SSRPass({renderer:o,scene:r,camera:a,width:d,height:C,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var t=n.prototype;return t.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},Rt,e),a=r.width,o=r.height,u=Pt(r,["width","height"]),s=this.composerController,d=s.scene,C=s.getSize(),P=new l.PlaneGeometry(a,o),b=new wt.ReflectorForSSRPass(P,R((0,G.Z)({},u),{textureWidth:C.width,textureHeight:C.height}));b.material.depthWrite=!1,b.rotation.x=-Math.PI/2,b.visible=!1,d.add(b),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=b},t.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},t.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},t.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},t.setSize=function(e,r){var a=this.groundReflector;a&&(a.getRenderTarget().setSize(e,r),a.resolution.set(e,r))},t.setGui=function(){var e=this,r=new v({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(a){a?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},t.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},n}(),Mt=function(){"use strict";function n(i){A(this,n),this.active=!0,this.options=i;var e=i.renderer,r=i.scene,a=i.camera,o=this.createRenderTarget(),u=new Oe.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=a}var t=n.prototype;return t.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,a=e.type,o=e.encoding,u=this.getSize(),s={minFilter:l.LinearFilter,magFilter:l.LinearFilter,format:l.RGBAFormat,encoding:o,type:a},d;if(+l.REVISION<138&&r>0){var C=new l.WebGLMultisampleRenderTarget(u.width,u.height,s);C.samples=r,d=C}else if(+l.REVISION>=138&&r>0){var P=new l.WebGLRenderTarget(u.width,u.height,R((0,G.Z)({},s),{samples:r}));d=P}else{var b=new l.WebGLRenderTarget(u.width,u.height,s);d=b}return d.texture.name="EffectComposer.rt1",d},t.addRenderPasss=function(){var e=this.options,r=e.scene,a=e.camera,o=new ke.RenderPass(r,a);this.finalComposer.addPass(o),this.renderPass=o},t.addCopyPass=function(){var e=new ye.ShaderPass(Se.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},t.addGammaCorrectionPass=function(){var e=new ye.ShaderPass(Ke.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},t.addFXAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=new ye.ShaderPass(qe.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,a)},t.addSMAAPass=function(){var e=this.getSize(),r=e.width,a=e.height,o=this.options.renderer,u=new Qe.SMAAPass(r*o.getPixelRatio(),a*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},t.addSSAAPass=function(){var e=this.options,r=e.scene,a=e.camera,o=new $e.SSAARenderPass(r,a,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},t.addBloomPass=function(e){var r=new pt(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},t.addOutlinePass=function(e){var r=new bt(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},t.addSSRPass=function(e){var r=new Ot(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},t.getSize=function(){var e=this.options.renderer;return e.getSize(new l.Vector2)},t.enable=function(){this.active||(this.active=!0)},t.disable=function(){!this.active||(this.active=!1)},t.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(a){return a!==e.renderPass&&a!==e.copyPass?a.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},t.setSize=function(e,r){var a,o;this.finalComposer.setSize(e,r),(a=this.bloomController)===null||a===void 0||a.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},t.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var a=this.options.renderer,o=a.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},t.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},t.dispose=function(){var e,r,a;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(a=this.ssrController)===null||a===void 0||a.dispose(),this.finalComposer.passes.forEach(function(o){var u,s,d;(u=o.fsQuad)===null||u===void 0||u.dispose(),(s=o.fsQuad)===null||s===void 0||(d=s.material)===null||d===void 0||d.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},n}(),Ee=function(){"use strict";function n(i){A(this,n),this.raycaster=new l.Raycaster,this.installPlugins=new Map,this.event=new Q.EventEmitter,this.clock=new l.Clock,this.options=(0,ne.default)(n.options,i,{isMergeableObject:V.PO});var e=this.options,r=e.container,a=e.stats,o=e.gui,u=e.resizeObserver;if(o){var s=new c.default;s.open(!1),this.gui=s}if(a){var d=new Z.default;d.showPanel(0),d.dom.style.position="absolute",r.appendChild(d.dom),this.stats=d}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),u&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var t=n.prototype;return t.use=function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(k(a))),this.installPlugins.set(e,!0)}},t.init=function(){var e=this.options,r=e.container,a=e.isdev,o=e.axesHelper,u=e.renderer,s=e.scene,d=e.camera,C=this.getSize(),P=C.width,b=C.height,y=new ee({isdev:a,width:P,height:b,cameraParams:d});this.gui&&y.setGui(this.gui);var L=y.camera,N=new de({camera:L,sceneParams:s}),I=N.scene,H=new w({width:P,height:b,scene:I,camera:L,isdev:a,rendererParams:R((0,G.Z)({},u),{outputEncoding:l.LinearEncoding,antialias:!1})});this.gui&&H.setGui(this.gui);var le=H.renderer;o&&N.addAxesHelper(),this.sceneController=N,this.rendererController=H,this.cameraController=y,r.appendChild(le.domElement)},t.initComposer=function(){var e=this.options,r=e.bloom,a=e.outline,o=e.ssr,u=e.renderer,s=e.bloomParams,d=e.outlineParams,C=e.ssrParams,P=e.multisampling,b=u.antialias;b==="msaa"&&!Me&&(b=!1,console.warn("MSAA is not supported on this browser"));var y=new Mt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:b==="msaa"?P:0,type:l.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=y,b==="ssaa"&&y.addSSAAPass(),o&&y.addSSRPass(C),r&&y.addBloomPass(s),a&&y.addOutlinePass(d),u.outputEncoding===l.sRGBEncoding&&y.addGammaCorrectionPass(),b==="fxaa"?y.addFXAAPass():b==="smaa"&&y.addSMAAPass(),y.checkCopyPass(),this.event.on("passcheck",function(){y.checkCopyPass()})},t.initCSSRenderer=function(){var e=this.options,r=e.container,a=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,s=e.css3DRendererParams;if(a||o){var d=new Ve(r);a&&d.addRenderer("css2d",u),o&&d.addRenderer("css3d",s),this.cssRendererController=d}},t.initControl=function(){var e=this.options,r=e.control,a=e.mapControl,o=e.controlParams;if(r){var u=new _({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:a});this.controlController=u}},t.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},t.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var a=new ResizeObserver(function(o){var u=!0,s=!1,d=void 0;try{for(var C=o[Symbol.iterator](),P;!(u=(P=C.next()).done);u=!0){var b=P.value,y=b.contentRect;e.handeleResize(y.width,y.height),e.render()}}catch(L){s=!0,d=L}finally{try{!u&&C.return!=null&&C.return()}finally{if(s)throw d}}});a.observe(r),this.resizeObserver=a}},t.handeleResize=function(e,r){var a=this,o=a.rendererController,u=a.cameraController,s=a.composerController,d=a.cssRendererController;u==null||u.setSize(e,r),o==null||o.setSize(e,r),s==null||s.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(C,P){var b;(b=P.resize)===null||b===void 0||b.call(P,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},t.pick=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,s=o.options,d=s.container,C=new l.Vector2,P=d.getBoundingClientRect();if(C.x=(e.clientX-P.left)/(P.right-P.left)*2-1,C.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(C,this.camera);var b=u.intersectObjects(r||this.scene.children,a);if(b.length)return{object:b[0].object,intersects:b}}},t.render=function(){var e,r,a,o,u=this,s=u.renderer,d=u.scene,C=u.camera,P=u.clock;if(!(!s||!d||!C||this.options.staticRender&&!this.cameraController.checkCameraChange())){var b=P.getDelta(),y=P.getElapsedTime();if(s.clear(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(N,I){var H;(H=I.update)===null||H===void 0||H.call(I,b,y)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var L;(L=this.rendererController)===null||L===void 0||L.render()}(a=this.cssRendererController)===null||a===void 0||a.render(d,C),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:b,elapsed:y})}},t.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},t.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},t.dispose=function(){var e,r,a,o,u,s,d;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(C,P){var b;(b=P.dispose)===null||b===void 0||b.call(P)}),(r=this.controlController)===null||r===void 0||r.dispose(),(a=this.cssRendererController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(s=this.rendererController)===null||s===void 0||s.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(d=this.gui)===null||d===void 0||d.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(n,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),n}();Ee.options={isdev:_e,stats:_e,gui:_e,axesHelper:_e,control:_e,resizeObserver:!0,renderer:R((0,G.Z)({},S),{antialias:Me?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:K,camera:M,bloom:!1,bloomParams:dt,outline:!1,outlineParams:_t,css2DRenderer:!1,ssr:!1,ssrParams:Et,css2DRendererParams:(0,G.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},fe)};function Tt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function Pe(n,t,i){return Tt()?Pe=Reflect.construct:Pe=function(r,a,o){var u=[null];u.push.apply(u,a);var s=Function.bind.apply(r,u),d=new s;return o&&Te(d,o.prototype),d},Pe.apply(null,arguments)}function De(n,t,i){return Pe.apply(null,arguments)}var At=W(484);function Lt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i={};return i.promise=new Promise(function(e,r){i.resolve=e,i.reject=r}),n&&(i.promise=(0,At.Z)(i.promise,t)),i}var jt=n=>{var t={};return W.d(t,n),t},_r=n=>()=>n,Dt=jt({CSS2DObject:()=>Jt.CSS2DObject}),ze=function(n){n&&((0,V.wf)(n),n.children.forEach(function(t){t.userData.BaseObject_||ze(t)}))},zt=function(){"use strict";function n(){A(this,n),this.objecttype__="BaseObject",this.userData={},this.pm=Lt(),this.visible=!1}var t=n.prototype;return t.init=function(){},t.create=function(){},t.render=function(){},t.update=function(e,r){},t.resize=function(e,r){},t.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},t.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},t.isVisible=function(){return this.visible},t.createMesh=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(l.Mesh,k(r)),this},t.createGroup=function(){return this.object3d=new l.Group,this},t.createPoints=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return this.object3d=De(l.Points,k(r)),this},t.createCSS2DObject=function(e){return this.object3d=new Dt.CSS2DObject(e),this},t.createCSS3DObject=function(e){return this.object3d=new J.CSS3DObject(e),this},t.createCSS3DSprite=function(e){return this.object3d=new J.CSS3DSprite(e),this},t.createSprite=function(e){return this.object3d=new l.Sprite(e),this},t.add=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).add.apply(o,k(r)),this},t.remove=function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o;return(o=this.object3d).remove.apply(o,k(r)),this},t.getSize=function(){var e=new l.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new l.Vector3)}},t.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},t.dispose=function(){ze(this.object3d)},x(n,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),n}()})();var er=be.L6,tr=be.sb,rr=be.z,nr=be.ZP;export{er as BaseObject,tr as GUIObject,rr as Pencil,nr as default};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {BufferGeometry} from 'three';
|
|
2
|
-
|
|
3
|
-
type PolygonCoords = number[][][];
|
|
4
|
-
|
|
5
|
-
type Parameters = {
|
|
6
|
-
polygonGeoJson: PolygonCoords;
|
|
7
|
-
startHeight: number;
|
|
8
|
-
endHeight: number;
|
|
9
|
-
closedBottom: boolean;
|
|
10
|
-
closedTop: boolean;
|
|
11
|
-
includeSides: boolean;
|
|
12
|
-
curvatureResolution: number;
|
|
13
|
-
cartesian: boolean;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default class PolygonGeometry extends BufferGeometry {
|
|
17
|
-
constructor(
|
|
18
|
-
polygonGeoJson: PolygonCoords,
|
|
19
|
-
parameters?: {
|
|
20
|
-
startHeight?: number;
|
|
21
|
-
endHeight?: number;
|
|
22
|
-
closedBottom?: boolean;
|
|
23
|
-
closedTop?: boolean;
|
|
24
|
-
includeSides?: boolean;
|
|
25
|
-
curvatureResolution?: number;
|
|
26
|
-
cartesian?: boolean;
|
|
27
|
-
userDataRsoOffset?: number;
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
parameters: Parameters;
|
|
32
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import BaseObject from '../../core/BaseObject';
|
|
3
|
-
interface Options {
|
|
4
|
-
geojson: number[][][];
|
|
5
|
-
material: THREE.Material | THREE.Material[];
|
|
6
|
-
startHeight?: number;
|
|
7
|
-
height?: number;
|
|
8
|
-
closedBottom?: boolean;
|
|
9
|
-
closedTop?: boolean;
|
|
10
|
-
curvatureResolution?: number;
|
|
11
|
-
cartesian?: boolean;
|
|
12
|
-
userDataRsoOffset?: number;
|
|
13
|
-
}
|
|
14
|
-
export default class extends BaseObject {
|
|
15
|
-
options: Required<Options>;
|
|
16
|
-
constructor(options: Options);
|
|
17
|
-
create(): void;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GeoProjection } from 'd3-geo';
|
|
2
|
-
import * as THREE from 'three';
|
|
3
|
-
export declare const getProjection: (options: {
|
|
4
|
-
center: [number, number];
|
|
5
|
-
scale: number;
|
|
6
|
-
}) => GeoProjection;
|
|
7
|
-
export declare const coords2Vector: (projection: GeoProjection, coords: [number, number][]) => THREE.Vector2[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import type WorkerController from '../../plugins/Worker';
|
|
3
|
-
declare type Coordinate = [number, number];
|
|
4
|
-
declare const _default: (options: {
|
|
5
|
-
worker: WorkerController;
|
|
6
|
-
workerKey?: string | undefined;
|
|
7
|
-
coordinatesArr: Coordinate[][];
|
|
8
|
-
depth: number[];
|
|
9
|
-
projection: {
|
|
10
|
-
center: [number, number];
|
|
11
|
-
scale: number;
|
|
12
|
-
};
|
|
13
|
-
split?: number | undefined;
|
|
14
|
-
cacheVersion?: string | undefined;
|
|
15
|
-
}) => Promise<THREE.BufferGeometry>;
|
|
16
|
-
export default _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import BaseObject from '../../core/BaseObject';
|
|
3
|
-
import Cache from '../../plugins/Cache';
|
|
4
|
-
interface Options {
|
|
5
|
-
points?: THREE.Vector2[];
|
|
6
|
-
pointsArr?: THREE.Vector2[][];
|
|
7
|
-
material?: THREE.Material | THREE.Material[];
|
|
8
|
-
geometry?: THREE.BufferGeometry;
|
|
9
|
-
geometryArr?: THREE.BufferGeometry[];
|
|
10
|
-
materialOptions?: MaterialOptions;
|
|
11
|
-
depth?: number | number[];
|
|
12
|
-
cache?: Cache;
|
|
13
|
-
useGroups?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface MaterialOptions {
|
|
16
|
-
type?: 'MeshBasicMaterial' | 'MeshStandardMaterial' | 'MeshPhongMaterial';
|
|
17
|
-
parameters?: Record<string, any>;
|
|
18
|
-
topColor?: string;
|
|
19
|
-
sideColor?: string;
|
|
20
|
-
sideMap?: string;
|
|
21
|
-
split?: number;
|
|
22
|
-
createCanvasObjectURL?: boolean;
|
|
23
|
-
maxAnisotropy?: number;
|
|
24
|
-
}
|
|
25
|
-
export default class extends BaseObject {
|
|
26
|
-
options: Omit<Options, 'materialOptions'> & {
|
|
27
|
-
depth: number | number[];
|
|
28
|
-
materialOptions: Omit<MaterialOptions, 'split'> & {
|
|
29
|
-
split: number;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
constructor(options: Options);
|
|
33
|
-
create(): Promise<void>;
|
|
34
|
-
getMaterial(materialOptions: MaterialOptions): Promise<THREE.Material | THREE.Material[]>;
|
|
35
|
-
setMaterialColor(options: Pick<MaterialOptions, 'topColor' | 'sideColor'>): Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/objects/fix.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import BaseObject from '../../core/BaseObject';
|
|
3
|
-
import Cache from '../../plugins/Cache';
|
|
4
|
-
interface Options {
|
|
5
|
-
src: string;
|
|
6
|
-
scale?: number;
|
|
7
|
-
position?: THREE.Vector3;
|
|
8
|
-
transparent?: boolean;
|
|
9
|
-
blending?: THREE.Blending;
|
|
10
|
-
cache?: Cache;
|
|
11
|
-
depthWrite?: boolean;
|
|
12
|
-
alphaTest?: number;
|
|
13
|
-
sprite?: boolean;
|
|
14
|
-
sizeAttenuation?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export default class extends BaseObject {
|
|
17
|
-
options: Options;
|
|
18
|
-
texture: THREE.Texture;
|
|
19
|
-
constructor(options: Options);
|
|
20
|
-
getMaterial(): Promise<THREE.MeshBasicMaterial | THREE.SpriteMaterial>;
|
|
21
|
-
create(): Promise<void>;
|
|
22
|
-
setScale(n: number): void;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
package/dist/objects/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as Text } from './text';
|
|
2
|
-
export { default as Image } from './image';
|
|
3
|
-
export { default as Video } from './video';
|
|
4
|
-
export { default as Node } from './node';
|
|
5
|
-
export { MeshLine, MeshLineMaterial, MeshLineRaycast } from './line/meshLine';
|
|
6
|
-
export { default as Line } from './line';
|
|
7
|
-
export { default as getLineGeometry } from './line/getWorkerGeometry';
|
|
8
|
-
export { default as ConicPolygon } from './conicPolygon';
|
|
9
|
-
export { default as ExtrudePolygon } from './extrudePolygon';
|
|
10
|
-
export { default as getExtrudePolygonGeometry } from './extrudePolygon/getWorkerGeometry';
|