diff --git a/app/dist/.DS_Store b/app/dist/.DS_Store new file mode 100644 index 0000000..d0da439 Binary files /dev/null and b/app/dist/.DS_Store differ diff --git a/app/dist/assets/index-B5Qt9EMX.js b/app/dist/assets/index-B5Qt9EMX.js deleted file mode 100644 index 3e0a78a..0000000 --- a/app/dist/assets/index-B5Qt9EMX.js +++ /dev/null @@ -1 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})(); diff --git a/app/dist/assets/index-BPBuaX9T.css b/app/dist/assets/index-BPBuaX9T.css new file mode 100644 index 0000000..72be973 --- /dev/null +++ b/app/dist/assets/index-BPBuaX9T.css @@ -0,0 +1 @@ +*{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;overflow:hidden;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#000;color:#fff}#app{width:100vw;height:100vh;position:relative}.logo{position:absolute;top:2rem;left:2rem;z-index:100;font-size:1.5rem;font-weight:600;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,.5);letter-spacing:.5px;-webkit-user-select:none;user-select:none}#three-canvas{width:100%;height:100%;display:block;cursor:crosshair}.home-button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100;background:#ffffff1a;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.2);border-radius:12px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:1rem;font-weight:1000;color:#fff;letter-spacing:1px;padding:1rem 2rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .3s cubic-bezier(.4,0,.2,1);border:none;outline:none}.home-button:hover{background:#ffffff26;border:1px solid rgba(255,255,255,.3);transform:translate(-50%,-50%) translateY(-1px);box-shadow:0 4px 20px #00000026}.home-button:active{transform:translate(-50%,-50%) translateY(0);background:#fff3}.home-button span{display:block;position:relative;color:#ffffff26;filter:blur(.3px);-webkit-filter:blur(.3px)}@media (max-width: 768px){.logo{top:1rem;left:1rem;font-size:1.25rem}.home-button{padding:1.5rem 3rem;font-size:1.5rem;letter-spacing:3px}} diff --git a/app/dist/assets/index-kpuvI5CD.js b/app/dist/assets/index-kpuvI5CD.js new file mode 100644 index 0000000..cbb8e0a --- /dev/null +++ b/app/dist/assets/index-kpuvI5CD.js @@ -0,0 +1,4221 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const ms="178",wh=0,Cc=1,bh=2,Su=1,Tu=2,Xn=3,Dn=0,Ot=1,jt=2,St=0,es=1,Rc=2,Dc=3,Ic=4,Ch=5,Si=100,Rh=101,Dh=102,Ih=103,Ph=104,Lh=200,Bh=201,Nh=202,Uh=203,Jo=204,$o=205,Fh=206,Oh=207,zh=208,Hh=209,kh=210,Gh=211,Vh=212,Wh=213,Xh=214,ea=0,ta=1,na=2,rs=3,ia=4,sa=5,ra=6,oa=7,wu=0,Yh=1,qh=2,ui=0,Kh=1,Qh=2,jh=3,bu=4,Zh=5,Jh=6,$h=7,Pc="attached",ed="detached",Cu=300,os=301,as=302,aa=303,ca=304,Qr=306,Ii=1e3,li=1001,Vr=1002,Tt=1003,Ru=1004,Us=1005,Pt=1006,Ur=1007,Kn=1008,Mt=1009,Du=1010,Iu=1011,Gs=1012,Ya=1013,hi=1014,dn=1015,qs=1016,qa=1017,Ka=1018,cs=1020,Pu=35902,Lu=1021,Bu=1022,Zt=1023,Vs=1026,ls=1027,Ks=1028,Qa=1029,ja=1030,Za=1031,Ja=1033,Fr=33776,Or=33777,zr=33778,Hr=33779,la=35840,ua=35841,ha=35842,da=35843,fa=36196,pa=37492,ma=37496,ga=37808,va=37809,xa=37810,Aa=37811,_a=37812,ya=37813,Ma=37814,Ea=37815,Sa=37816,Ta=37817,wa=37818,ba=37819,Ca=37820,Ra=37821,kr=36492,Da=36494,Ia=36495,Nu=36283,Pa=36284,La=36285,Ba=36286,Ws=2300,Xs=2301,so=2302,Lc=2400,Bc=2401,Nc=2402,td=2500,nd=0,Uu=1,Na=2,on=3200,id=3201,$a=0,sd=1,Rn="",Ve="srgb",Ht="srgb-linear",Wr="linear",ct="srgb",Li=7680,Uc=519,rd=512,od=513,ad=514,Fu=515,cd=516,ld=517,ud=518,hd=519,Ua=35044,Fc="300 es",Qn=2e3,Xr=2001;class Jn{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const s=n[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let r=0,o=s.length;r>8&255]+kt[i>>16&255]+kt[i>>24&255]+"-"+kt[e&255]+kt[e>>8&255]+"-"+kt[e>>16&15|64]+kt[e>>24&255]+"-"+kt[t&63|128]+kt[t>>8&255]+"-"+kt[t>>16&255]+kt[t>>24&255]+kt[n&255]+kt[n>>8&255]+kt[n>>16&255]+kt[n>>24&255]).toLowerCase()}function Xe(i,e,t){return Math.max(e,Math.min(t,i))}function ec(i,e){return(i%e+e)%e}function dd(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function fd(i,e,t){return i!==e?(t-i)/(e-i):0}function Hs(i,e,t){return(1-t)*i+t*e}function pd(i,e,t,n){return Hs(i,e,1-Math.exp(-t*n))}function md(i,e=1){return e-Math.abs(ec(i,e*2)-e)}function gd(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function vd(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function xd(i,e){return i+Math.floor(Math.random()*(e-i+1))}function Ad(i,e){return i+Math.random()*(e-i)}function _d(i){return i*(.5-Math.random())}function yd(i){i!==void 0&&(Oc=i);let e=Oc+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Md(i){return i*zs}function Ed(i){return i*us}function Sd(i){return(i&i-1)===0&&i!==0}function Td(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function wd(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function bd(i,e,t,n,s){const r=Math.cos,o=Math.sin,a=r(t/2),c=o(t/2),l=r((e+n)/2),u=o((e+n)/2),h=r((e-n)/2),d=o((e-n)/2),f=r((n-e)/2),g=o((n-e)/2);switch(s){case"XYX":i.set(a*u,c*h,c*d,a*l);break;case"YZY":i.set(c*d,a*u,c*h,a*l);break;case"ZXZ":i.set(c*h,c*d,a*u,a*l);break;case"XZX":i.set(a*u,c*g,c*f,a*l);break;case"YXY":i.set(c*f,a*u,c*g,a*l);break;case"ZYZ":i.set(c*g,c*f,a*u,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function xn(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function rt(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const Cd={DEG2RAD:zs,RAD2DEG:us,generateUUID:yn,clamp:Xe,euclideanModulo:ec,mapLinear:dd,inverseLerp:fd,lerp:Hs,damp:pd,pingpong:md,smoothstep:gd,smootherstep:vd,randInt:xd,randFloat:Ad,randFloatSpread:_d,seededRandom:yd,degToRad:Md,radToDeg:Ed,isPowerOfTwo:Sd,ceilPowerOfTwo:Td,floorPowerOfTwo:wd,setQuaternionFromProperEuler:bd,normalize:rt,denormalize:xn};class Ae{constructor(e=0,t=0){Ae.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Xe(this.x,e.x,t.x),this.y=Xe(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Xe(this.x,e,t),this.y=Xe(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xe(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xe(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*n-o*s+e.x,this.y=r*s+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}let di=class{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,r,o,a){let c=n[s+0],l=n[s+1],u=n[s+2],h=n[s+3];const d=r[o+0],f=r[o+1],g=r[o+2],v=r[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=d,e[t+1]=f,e[t+2]=g,e[t+3]=v;return}if(h!==v||c!==d||l!==f||u!==g){let m=1-a;const p=c*d+l*f+u*g+h*v,x=p>=0?1:-1,_=1-p*p;if(_>Number.EPSILON){const b=Math.sqrt(_),w=Math.atan2(b,p*x);m=Math.sin(m*w)/b,a=Math.sin(a*w)/b}const A=a*x;if(c=c*m+d*A,l=l*m+f*A,u=u*m+g*A,h=h*m+v*A,m===1-a){const b=1/Math.sqrt(c*c+l*l+u*u+h*h);c*=b,l*=b,u*=b,h*=b}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,s,r,o){const a=n[s],c=n[s+1],l=n[s+2],u=n[s+3],h=r[o],d=r[o+1],f=r[o+2],g=r[o+3];return e[t]=a*g+u*h+c*f-l*d,e[t+1]=c*g+u*d+l*h-a*f,e[t+2]=l*g+u*f+a*d-c*h,e[t+3]=u*g-a*h-c*d-l*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(n/2),u=a(s/2),h=a(r/2),d=c(n/2),f=c(s/2),g=c(r/2);switch(o){case"XYZ":this._x=d*u*h+l*f*g,this._y=l*f*h-d*u*g,this._z=l*u*g+d*f*h,this._w=l*u*h-d*f*g;break;case"YXZ":this._x=d*u*h+l*f*g,this._y=l*f*h-d*u*g,this._z=l*u*g-d*f*h,this._w=l*u*h+d*f*g;break;case"ZXY":this._x=d*u*h-l*f*g,this._y=l*f*h+d*u*g,this._z=l*u*g+d*f*h,this._w=l*u*h-d*f*g;break;case"ZYX":this._x=d*u*h-l*f*g,this._y=l*f*h+d*u*g,this._z=l*u*g-d*f*h,this._w=l*u*h+d*f*g;break;case"YZX":this._x=d*u*h+l*f*g,this._y=l*f*h+d*u*g,this._z=l*u*g-d*f*h,this._w=l*u*h-d*f*g;break;case"XZY":this._x=d*u*h-l*f*g,this._y=l*f*h-d*u*g,this._z=l*u*g+d*f*h,this._w=l*u*h+d*f*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],r=t[8],o=t[1],a=t[5],c=t[9],l=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-c)*f,this._y=(r-l)*f,this._z=(o-s)*f}else if(n>a&&n>h){const f=2*Math.sqrt(1+n-a-h);this._w=(u-c)/f,this._x=.25*f,this._y=(s+o)/f,this._z=(r+l)/f}else if(a>h){const f=2*Math.sqrt(1+a-n-h);this._w=(r-l)/f,this._x=(s+o)/f,this._y=.25*f,this._z=(c+u)/f}else{const f=2*Math.sqrt(1+h-n-a);this._w=(o-s)/f,this._x=(r+l)/f,this._y=(c+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Xe(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,r=e._z,o=e._w,a=t._x,c=t._y,l=t._z,u=t._w;return this._x=n*u+o*a+s*l-r*c,this._y=s*u+o*c+r*a-n*l,this._z=r*u+o*l+n*c-s*a,this._w=o*u-n*a-s*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+n*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=s,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*s+t*this._y,this._z=f*r+t*this._z,this.normalize(),this}const l=Math.sqrt(c),u=Math.atan2(l,a),h=Math.sin((1-t)*u)/l,d=Math.sin(t*u)/l;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=s*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};class U{constructor(e=0,t=0,n=0){U.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(zc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(zc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*s,this.y=r[1]*t+r[4]*n+r[7]*s,this.z=r[2]*t+r[5]*n+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*n+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*n+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,r=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*s-a*n),u=2*(a*t-r*s),h=2*(r*n-o*t);return this.x=t+c*l+o*h-a*u,this.y=n+c*u+a*l-r*h,this.z=s+c*h+r*u-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s,this.y=r[1]*t+r[5]*n+r[9]*s,this.z=r[2]*t+r[6]*n+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Xe(this.x,e.x,t.x),this.y=Xe(this.y,e.y,t.y),this.z=Xe(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Xe(this.x,e,t),this.y=Xe(this.y,e,t),this.z=Xe(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xe(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,r=e.z,o=t.x,a=t.y,c=t.z;return this.x=s*c-r*a,this.y=r*o-n*c,this.z=n*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ro.copy(this).projectOnVector(e),this.sub(ro)}reflect(e){return this.sub(ro.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xe(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ro=new U,zc=new di;class He{constructor(e,t,n,s,r,o,a,c,l){He.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,o,a,c,l)}set(e,t,n,s,r,o,a,c,l){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=c,u[6]=n,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],u=n[4],h=n[7],d=n[2],f=n[5],g=n[8],v=s[0],m=s[3],p=s[6],x=s[1],_=s[4],A=s[7],b=s[2],w=s[5],C=s[8];return r[0]=o*v+a*x+c*b,r[3]=o*m+a*_+c*w,r[6]=o*p+a*A+c*C,r[1]=l*v+u*x+h*b,r[4]=l*m+u*_+h*w,r[7]=l*p+u*A+h*C,r[2]=d*v+f*x+g*b,r[5]=d*m+f*_+g*w,r[8]=d*p+f*A+g*C,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return t*o*u-t*a*l-n*r*u+n*a*c+s*r*l-s*o*c}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=u*o-a*l,d=a*c-u*r,f=l*r-o*c,g=t*h+n*d+s*f;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=h*v,e[1]=(s*l-u*n)*v,e[2]=(a*n-s*o)*v,e[3]=d*v,e[4]=(u*t-s*c)*v,e[5]=(s*r-a*t)*v,e[6]=f*v,e[7]=(n*c-l*t)*v,e[8]=(o*t-n*r)*v,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,r,o,a){const c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*o+l*a)+o+e,-s*l,s*c,-s*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(oo.makeScale(e,t)),this}rotate(e){return this.premultiply(oo.makeRotation(-e)),this}translate(e,t){return this.premultiply(oo.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const oo=new He;function Ou(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function Ys(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Rd(){const i=Ys("canvas");return i.style.display="block",i}const Hc={};function ts(i){i in Hc||(Hc[i]=!0,console.warn(i))}function Dd(i,e,t){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function Id(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Pd(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const kc=new He().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Gc=new He().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Ld(){const i={enabled:!0,workingColorSpace:Ht,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===ct&&(s.r=Zn(s.r),s.g=Zn(s.g),s.b=Zn(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===ct&&(s.r=ns(s.r),s.g=ns(s.g),s.b=ns(s.b))),s},workingToColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},colorSpaceToWorking:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Rn?Wr:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,r){return ts("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(s,r)},toWorkingColorSpace:function(s,r){return ts("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(s,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Ht]:{primaries:e,whitePoint:n,transfer:Wr,toXYZ:kc,fromXYZ:Gc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ve},outputColorSpaceConfig:{drawingBufferColorSpace:Ve}},[Ve]:{primaries:e,whitePoint:n,transfer:ct,toXYZ:kc,fromXYZ:Gc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ve}}}),i}const Qe=Ld();function Zn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function ns(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let Bi;class Bd{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Bi===void 0&&(Bi=Ys("canvas")),Bi.width=e.width,Bi.height=e.height;const s=Bi.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=Bi}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ys("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(co).x}get height(){return this.source.getSize(co).y}get depth(){return this.source.getSize(co).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Cu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ii:e.x=e.x-Math.floor(e.x);break;case li:e.x=e.x<0?0:1;break;case Vr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ii:e.y=e.y-Math.floor(e.y);break;case li:e.y=e.y<0?0:1;break;case Vr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}yt.DEFAULT_IMAGE=null;yt.DEFAULT_MAPPING=Cu;yt.DEFAULT_ANISOTROPY=1;class je{constructor(e=0,t=0,n=0,s=1){je.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*n+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*n+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*n+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,r;const c=e.elements,l=c[0],u=c[4],h=c[8],d=c[1],f=c[5],g=c[9],v=c[2],m=c[6],p=c[10];if(Math.abs(u-d)<.01&&Math.abs(h-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+v)<.1&&Math.abs(g+m)<.1&&Math.abs(l+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(l+1)/2,A=(f+1)/2,b=(p+1)/2,w=(u+d)/4,C=(h+v)/4,P=(g+m)/4;return _>A&&_>b?_<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(_),s=w/n,r=C/n):A>b?A<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(A),n=w/s,r=P/s):b<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(b),n=C/r,s=P/r),this.set(n,s,r,t),this}let x=Math.sqrt((m-g)*(m-g)+(h-v)*(h-v)+(d-u)*(d-u));return Math.abs(x)<.001&&(x=1),this.x=(m-g)/x,this.y=(h-v)/x,this.z=(d-u)/x,this.w=Math.acos((l+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Xe(this.x,e.x,t.x),this.y=Xe(this.y,e.y,t.y),this.z=Xe(this.z,e.z,t.z),this.w=Xe(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Xe(this.x,e,t),this.y=Xe(this.y,e,t),this.z=Xe(this.z,e,t),this.w=Xe(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xe(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Fd extends Jn{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Pt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new je(0,0,e,t),this.scissorTest=!1,this.viewport=new je(0,0,e,t);const s={width:e,height:t,depth:n.depth},r=new yt(s);this.textures=[];const o=n.count;for(let a=0;a1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,pn),pn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ms),sr.subVectors(this.max,Ms),Ni.subVectors(e.a,Ms),Ui.subVectors(e.b,Ms),Fi.subVectors(e.c,Ms),$n.subVectors(Ui,Ni),ei.subVectors(Fi,Ui),mi.subVectors(Ni,Fi);let t=[0,-$n.z,$n.y,0,-ei.z,ei.y,0,-mi.z,mi.y,$n.z,0,-$n.x,ei.z,0,-ei.x,mi.z,0,-mi.x,-$n.y,$n.x,0,-ei.y,ei.x,0,-mi.y,mi.x,0];return!lo(t,Ni,Ui,Fi,sr)||(t=[1,0,0,0,1,0,0,0,1],!lo(t,Ni,Ui,Fi,sr))?!1:(rr.crossVectors($n,ei),t=[rr.x,rr.y,rr.z],lo(t,Ni,Ui,Fi,sr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,pn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(pn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nn),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Nn=[new U,new U,new U,new U,new U,new U,new U,new U],pn=new U,ir=new En,Ni=new U,Ui=new U,Fi=new U,$n=new U,ei=new U,mi=new U,Ms=new U,sr=new U,rr=new U,gi=new U;function lo(i,e,t,n,s){for(let r=0,o=i.length-3;r<=o;r+=3){gi.fromArray(i,r);const a=s.x*Math.abs(gi.x)+s.y*Math.abs(gi.y)+s.z*Math.abs(gi.z),c=e.dot(gi),l=t.dot(gi),u=n.dot(gi);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>a)return!1}return!0}const zd=new En,Es=new U,uo=new U;let Pn=class{constructor(e=new U,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):zd.setFromPoints(e).getCenter(n);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Es.subVectors(e,this.center);const t=Es.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(Es,s/n),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(uo.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Es.copy(e.center).add(uo)),this.expandByPoint(Es.copy(e.center).sub(uo))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const Un=new U,ho=new U,or=new U,ti=new U,fo=new U,ar=new U,po=new U;let Qs=class{constructor(e=new U,t=new U(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Un)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Un.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Un.copy(this.origin).addScaledVector(this.direction,t),Un.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){ho.copy(e).add(t).multiplyScalar(.5),or.copy(t).sub(e).normalize(),ti.copy(this.origin).sub(ho);const r=e.distanceTo(t)*.5,o=-this.direction.dot(or),a=ti.dot(this.direction),c=-ti.dot(or),l=ti.lengthSq(),u=Math.abs(1-o*o);let h,d,f,g;if(u>0)if(h=o*c-a,d=o*a-c,g=r*u,h>=0)if(d>=-g)if(d<=g){const v=1/u;h*=v,d*=v,f=h*(h+o*d+2*a)+d*(o*h+d+2*c)+l}else d=r,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*c)+l;else d=-r,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*c)+l;else d<=-g?(h=Math.max(0,-(-o*r+a)),d=h>0?-r:Math.min(Math.max(-r,-c),r),f=-h*h+d*(d+2*c)+l):d<=g?(h=0,d=Math.min(Math.max(-r,-c),r),f=d*(d+2*c)+l):(h=Math.max(0,-(o*r+a)),d=h>0?r:Math.min(Math.max(-r,-c),r),f=-h*h+d*(d+2*c)+l);else d=o>0?-r:r,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(ho).addScaledVector(or,d),f}intersectSphere(e,t){Un.subVectors(e.center,this.origin);const n=Un.dot(this.direction),s=Un.dot(Un)-n*n,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=n-o,c=n+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,r,o,a,c;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,s=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,s=(e.min.x-d.x)*l),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||r>s||((r>n||isNaN(n))&&(n=r),(o=0?(a=(e.min.z-d.z)*h,c=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,c=(e.min.z-d.z)*h),n>c||a>s)||((a>n||n!==n)&&(n=a),(c=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,Un)!==null}intersectTriangle(e,t,n,s,r){fo.subVectors(t,e),ar.subVectors(n,e),po.crossVectors(fo,ar);let o=this.direction.dot(po),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ti.subVectors(this.origin,e);const c=a*this.direction.dot(ar.crossVectors(ti,ar));if(c<0)return null;const l=a*this.direction.dot(fo.cross(ti));if(l<0||c+l>o)return null;const u=-a*ti.dot(po);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class Fe{constructor(e,t,n,s,r,o,a,c,l,u,h,d,f,g,v,m){Fe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,o,a,c,l,u,h,d,f,g,v,m)}set(e,t,n,s,r,o,a,c,l,u,h,d,f,g,v,m){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=s,p[1]=r,p[5]=o,p[9]=a,p[13]=c,p[2]=l,p[6]=u,p[10]=h,p[14]=d,p[3]=f,p[7]=g,p[11]=v,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Fe().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/Oi.setFromMatrixColumn(e,0).length(),r=1/Oi.setFromMatrixColumn(e,1).length(),o=1/Oi.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,r=e.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(s),l=Math.sin(s),u=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const d=o*u,f=o*h,g=a*u,v=a*h;t[0]=c*u,t[4]=-c*h,t[8]=l,t[1]=f+g*l,t[5]=d-v*l,t[9]=-a*c,t[2]=v-d*l,t[6]=g+f*l,t[10]=o*c}else if(e.order==="YXZ"){const d=c*u,f=c*h,g=l*u,v=l*h;t[0]=d+v*a,t[4]=g*a-f,t[8]=o*l,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-g,t[6]=v+d*a,t[10]=o*c}else if(e.order==="ZXY"){const d=c*u,f=c*h,g=l*u,v=l*h;t[0]=d-v*a,t[4]=-o*h,t[8]=g+f*a,t[1]=f+g*a,t[5]=o*u,t[9]=v-d*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const d=o*u,f=o*h,g=a*u,v=a*h;t[0]=c*u,t[4]=g*l-f,t[8]=d*l+v,t[1]=c*h,t[5]=v*l+d,t[9]=f*l-g,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const d=o*c,f=o*l,g=a*c,v=a*l;t[0]=c*u,t[4]=v-d*h,t[8]=g*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-l*u,t[6]=f*h+g,t[10]=d-v*h}else if(e.order==="XZY"){const d=o*c,f=o*l,g=a*c,v=a*l;t[0]=c*u,t[4]=-h,t[8]=l*u,t[1]=d*h+v,t[5]=o*u,t[9]=f*h-g,t[2]=g*h-f,t[6]=a*u,t[10]=v*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Hd,e,kd)}lookAt(e,t,n){const s=this.elements;return nn.subVectors(e,t),nn.lengthSq()===0&&(nn.z=1),nn.normalize(),ni.crossVectors(n,nn),ni.lengthSq()===0&&(Math.abs(n.z)===1?nn.x+=1e-4:nn.z+=1e-4,nn.normalize(),ni.crossVectors(n,nn)),ni.normalize(),cr.crossVectors(nn,ni),s[0]=ni.x,s[4]=cr.x,s[8]=nn.x,s[1]=ni.y,s[5]=cr.y,s[9]=nn.y,s[2]=ni.z,s[6]=cr.z,s[10]=nn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],u=n[1],h=n[5],d=n[9],f=n[13],g=n[2],v=n[6],m=n[10],p=n[14],x=n[3],_=n[7],A=n[11],b=n[15],w=s[0],C=s[4],P=s[8],S=s[12],y=s[1],I=s[5],k=s[9],R=s[13],F=s[2],O=s[6],B=s[10],q=s[14],G=s[3],Z=s[7],oe=s[11],fe=s[15];return r[0]=o*w+a*y+c*F+l*G,r[4]=o*C+a*I+c*O+l*Z,r[8]=o*P+a*k+c*B+l*oe,r[12]=o*S+a*R+c*q+l*fe,r[1]=u*w+h*y+d*F+f*G,r[5]=u*C+h*I+d*O+f*Z,r[9]=u*P+h*k+d*B+f*oe,r[13]=u*S+h*R+d*q+f*fe,r[2]=g*w+v*y+m*F+p*G,r[6]=g*C+v*I+m*O+p*Z,r[10]=g*P+v*k+m*B+p*oe,r[14]=g*S+v*R+m*q+p*fe,r[3]=x*w+_*y+A*F+b*G,r[7]=x*C+_*I+A*O+b*Z,r[11]=x*P+_*k+A*B+b*oe,r[15]=x*S+_*R+A*q+b*fe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],r=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],h=e[6],d=e[10],f=e[14],g=e[3],v=e[7],m=e[11],p=e[15];return g*(+r*c*h-s*l*h-r*a*d+n*l*d+s*a*f-n*c*f)+v*(+t*c*f-t*l*d+r*o*d-s*o*f+s*l*u-r*c*u)+m*(+t*l*h-t*a*f-r*o*h+n*o*f+r*a*u-n*l*u)+p*(-s*a*u-t*c*h+t*a*d+s*o*h-n*o*d+n*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],d=e[10],f=e[11],g=e[12],v=e[13],m=e[14],p=e[15],x=h*m*l-v*d*l+v*c*f-a*m*f-h*c*p+a*d*p,_=g*d*l-u*m*l-g*c*f+o*m*f+u*c*p-o*d*p,A=u*v*l-g*h*l+g*a*f-o*v*f-u*a*p+o*h*p,b=g*h*c-u*v*c-g*a*d+o*v*d+u*a*m-o*h*m,w=t*x+n*_+s*A+r*b;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/w;return e[0]=x*C,e[1]=(v*d*r-h*m*r-v*s*f+n*m*f+h*s*p-n*d*p)*C,e[2]=(a*m*r-v*c*r+v*s*l-n*m*l-a*s*p+n*c*p)*C,e[3]=(h*c*r-a*d*r-h*s*l+n*d*l+a*s*f-n*c*f)*C,e[4]=_*C,e[5]=(u*m*r-g*d*r+g*s*f-t*m*f-u*s*p+t*d*p)*C,e[6]=(g*c*r-o*m*r-g*s*l+t*m*l+o*s*p-t*c*p)*C,e[7]=(o*d*r-u*c*r+u*s*l-t*d*l-o*s*f+t*c*f)*C,e[8]=A*C,e[9]=(g*h*r-u*v*r-g*n*f+t*v*f+u*n*p-t*h*p)*C,e[10]=(o*v*r-g*a*r+g*n*l-t*v*l-o*n*p+t*a*p)*C,e[11]=(u*a*r-o*h*r-u*n*l+t*h*l+o*n*f-t*a*f)*C,e[12]=b*C,e[13]=(u*v*s-g*h*s+g*n*d-t*v*d-u*n*m+t*h*m)*C,e[14]=(g*a*s-o*v*s-g*n*c+t*v*c+o*n*m-t*a*m)*C,e[15]=(o*h*s-u*a*s+u*n*c-t*h*c-o*n*d+t*a*d)*C,this}scale(e){const t=this.elements,n=e.x,s=e.y,r=e.z;return t[0]*=n,t[4]*=s,t[8]*=r,t[1]*=n,t[5]*=s,t[9]*=r,t[2]*=n,t[6]*=s,t[10]*=r,t[3]*=n,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),r=1-n,o=e.x,a=e.y,c=e.z,l=r*o,u=r*a;return this.set(l*o+n,l*a-s*c,l*c+s*a,0,l*a+s*c,u*a+n,u*c-s*o,0,l*c-s*a,u*c+s*o,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,r,o){return this.set(1,n,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,r=t._x,o=t._y,a=t._z,c=t._w,l=r+r,u=o+o,h=a+a,d=r*l,f=r*u,g=r*h,v=o*u,m=o*h,p=a*h,x=c*l,_=c*u,A=c*h,b=n.x,w=n.y,C=n.z;return s[0]=(1-(v+p))*b,s[1]=(f+A)*b,s[2]=(g-_)*b,s[3]=0,s[4]=(f-A)*w,s[5]=(1-(d+p))*w,s[6]=(m+x)*w,s[7]=0,s[8]=(g+_)*C,s[9]=(m-x)*C,s[10]=(1-(d+v))*C,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let r=Oi.set(s[0],s[1],s[2]).length();const o=Oi.set(s[4],s[5],s[6]).length(),a=Oi.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],mn.copy(this);const l=1/r,u=1/o,h=1/a;return mn.elements[0]*=l,mn.elements[1]*=l,mn.elements[2]*=l,mn.elements[4]*=u,mn.elements[5]*=u,mn.elements[6]*=u,mn.elements[8]*=h,mn.elements[9]*=h,mn.elements[10]*=h,t.setFromRotationMatrix(mn),n.x=r,n.y=o,n.z=a,this}makePerspective(e,t,n,s,r,o,a=Qn){const c=this.elements,l=2*r/(t-e),u=2*r/(n-s),h=(t+e)/(t-e),d=(n+s)/(n-s);let f,g;if(a===Qn)f=-(o+r)/(o-r),g=-2*o*r/(o-r);else if(a===Xr)f=-o/(o-r),g=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=l,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=u,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=g,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,s,r,o,a=Qn){const c=this.elements,l=1/(t-e),u=1/(n-s),h=1/(o-r),d=(t+e)*l,f=(n+s)*u;let g,v;if(a===Qn)g=(o+r)*h,v=-2*h;else if(a===Xr)g=r*h,v=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=v,c[14]=-g,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Oi=new U,mn=new Fe,Hd=new U(0,0,0),kd=new U(1,1,1),ni=new U,cr=new U,nn=new U,Vc=new Fe,Wc=new di;class In{constructor(e=0,t=0,n=0,s=In.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],c=s[1],l=s[5],u=s[9],h=s[2],d=s[6],f=s[10];switch(t){case"XYZ":this._y=Math.asin(Xe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Xe(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Xe(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-Xe(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Xe(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Xe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Vc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Vc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Wc.setFromEuler(this),this.setFromQuaternion(Wc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}In.DEFAULT_ORDER="XYZ";class nc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(a=>({...a})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function r(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let l=0,u=c.length;l0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(n.geometries=a),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),g.length>0&&(n.nodes=g)}return n.object=s,n;function o(a){const c=[];for(const l in a){const u=a[l];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,n,s,r){gn.subVectors(s,t),On.subVectors(n,t),go.subVectors(e,t);const o=gn.dot(gn),a=gn.dot(On),c=gn.dot(go),l=On.dot(On),u=On.dot(go),h=o*l-a*a;if(h===0)return r.set(0,0,0),null;const d=1/h,f=(l*c-a*u)*d,g=(o*u-a*c)*d;return r.set(1-f-g,g,f)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,zn)===null?!1:zn.x>=0&&zn.y>=0&&zn.x+zn.y<=1}static getInterpolation(e,t,n,s,r,o,a,c){return this.getBarycoord(e,t,n,s,zn)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,zn.x),c.addScaledVector(o,zn.y),c.addScaledVector(a,zn.z),c)}static getInterpolatedAttribute(e,t,n,s,r,o){return _o.setScalar(0),yo.setScalar(0),Mo.setScalar(0),_o.fromBufferAttribute(e,t),yo.fromBufferAttribute(e,n),Mo.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(_o,r.x),o.addScaledVector(yo,r.y),o.addScaledVector(Mo,r.z),o}static isFrontFacing(e,t,n,s){return gn.subVectors(n,t),On.subVectors(e,t),gn.cross(On).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return gn.subVectors(this.c,this.b),On.subVectors(this.a,this.b),gn.cross(On).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return An.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return An.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,r){return An.getInterpolation(e,this.a,this.b,this.c,t,n,s,r)}containsPoint(e){return An.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return An.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,r=this.c;let o,a;ki.subVectors(s,n),Gi.subVectors(r,n),vo.subVectors(e,n);const c=ki.dot(vo),l=Gi.dot(vo);if(c<=0&&l<=0)return t.copy(n);xo.subVectors(e,s);const u=ki.dot(xo),h=Gi.dot(xo);if(u>=0&&h<=u)return t.copy(s);const d=c*h-u*l;if(d<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(n).addScaledVector(ki,o);Ao.subVectors(e,r);const f=ki.dot(Ao),g=Gi.dot(Ao);if(g>=0&&f<=g)return t.copy(r);const v=f*l-c*g;if(v<=0&&l>=0&&g<=0)return a=l/(l-g),t.copy(n).addScaledVector(Gi,a);const m=u*g-f*h;if(m<=0&&h-u>=0&&f-g>=0)return jc.subVectors(r,s),a=(h-u)/(h-u+(f-g)),t.copy(s).addScaledVector(jc,a);const p=1/(m+v+d);return o=v*p,a=d*p,t.copy(n).addScaledVector(ki,o).addScaledVector(Gi,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Hu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ii={h:0,s:0,l:0},ur={h:0,s:0,l:0};function Eo(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Be{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ve){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Qe.colorSpaceToWorking(this,t),this}setRGB(e,t,n,s=Qe.workingColorSpace){return this.r=e,this.g=t,this.b=n,Qe.colorSpaceToWorking(this,s),this}setHSL(e,t,n,s=Qe.workingColorSpace){if(e=ec(e,1),t=Xe(t,0,1),n=Xe(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,o=2*n-r;this.r=Eo(o,r,e+1/3),this.g=Eo(o,r,e),this.b=Eo(o,r,e-1/3)}return Qe.colorSpaceToWorking(this,s),this}setStyle(e,t=Ve){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ve){const n=Hu[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Zn(e.r),this.g=Zn(e.g),this.b=Zn(e.b),this}copyLinearToSRGB(e){return this.r=ns(e.r),this.g=ns(e.g),this.b=ns(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ve){return Qe.workingToColorSpace(Gt.copy(this),e),Math.round(Xe(Gt.r*255,0,255))*65536+Math.round(Xe(Gt.g*255,0,255))*256+Math.round(Xe(Gt.b*255,0,255))}getHexString(e=Ve){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Qe.workingColorSpace){Qe.workingToColorSpace(Gt.copy(this),t);const n=Gt.r,s=Gt.g,r=Gt.b,o=Math.max(n,s,r),a=Math.min(n,s,r);let c,l;const u=(a+o)/2;if(a===o)c=0,l=0;else{const h=o-a;switch(l=u<=.5?h/(o+a):h/(2-o-a),o){case n:c=(s-r)/h+(s0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==es&&(n.blending=this.blending),this.side!==Dn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Jo&&(n.blendSrc=this.blendSrc),this.blendDst!==$o&&(n.blendDst=this.blendDst),this.blendEquation!==Si&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==rs&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Uc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Li&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Li&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Li&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){const o=[];for(const a in r){const c=r[a];delete c.metadata,o.push(c)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const s=t.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};class bi extends rn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new In,this.combine=wu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const wt=new U,hr=new Ae;let qd=0;class Lt{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:qd++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Ua,this.updateRanges=[],this.gpuType=dn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,r=this.itemSize;st.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new En);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n){const l=n[c];e.data.attributes[c]=l.toJSON(e.data)}const s={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],u=[];for(let h=0,d=l.length;h0&&(s[c]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const s=e.attributes;for(const l in s){const u=s[l];this.setAttribute(l,u.clone(t))}const r=e.morphAttributes;for(const l in r){const u=[],h=r[l];for(let d=0,f=h.length;d0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(Zc.copy(r).invert(),vi.copy(e.ray).applyMatrix4(Zc),!(n.boundingBox!==null&&vi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,vi)))}_computeIntersections(e,t,n){let s;const r=this.geometry,o=this.material,a=r.index,c=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,d=r.groups,f=r.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=d.length;gt.far?null:{distance:l,point:vr.clone(),object:i}}function xr(i,e,t,n,s,r,o,a,c,l){i.getVertexPosition(a,fr),i.getVertexPosition(c,pr),i.getVertexPosition(l,mr);const u=Qd(i,e,t,n,fr,pr,mr,$c);if(u){const h=new U;An.getBarycoord($c,fr,pr,mr,h),s&&(u.uv=An.getInterpolatedAttribute(s,a,c,l,h,new Ae)),r&&(u.uv1=An.getInterpolatedAttribute(r,a,c,l,h,new Ae)),o&&(u.normal=An.getInterpolatedAttribute(o,a,c,l,h,new U),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:c,c:l,normal:new U,materialIndex:0};An.getNormal(fr,pr,mr,d.normal),u.face=d,u.barycoord=h}return u}class gs extends Jt{constructor(e=1,t=1,n=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const c=[],l=[],u=[],h=[];let d=0,f=0;g("z","y","x",-1,-1,n,t,e,o,r,0),g("z","y","x",1,-1,n,t,-e,o,r,1),g("x","z","y",1,1,e,n,t,s,o,2),g("x","z","y",1,-1,e,n,-t,s,o,3),g("x","y","z",1,-1,e,t,n,s,r,4),g("x","y","z",-1,-1,e,t,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new qt(l,3)),this.setAttribute("normal",new qt(u,3)),this.setAttribute("uv",new qt(h,2));function g(v,m,p,x,_,A,b,w,C,P,S){const y=A/C,I=b/P,k=A/2,R=b/2,F=w/2,O=C+1,B=P+1;let q=0,G=0;const Z=new U;for(let oe=0;oe0?1:-1,u.push(Z.x,Z.y,Z.z),h.push(ie/C),h.push(1-oe/P),q+=1}}for(let oe=0;oe0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ic extends xt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Fe,this.projectionMatrix=new Fe,this.projectionMatrixInverse=new Fe,this.coordinateSystem=Qn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const si=new U,el=new Ae,tl=new Ae;class Ft extends ic{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=us*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(zs*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return us*2*Math.atan(Math.tan(zs*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){si.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(si.x,si.y).multiplyScalar(-e/si.z),si.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(si.x,si.y).multiplyScalar(-e/si.z)}getViewSize(e,t){return this.getViewBounds(e,el,tl),t.subVectors(tl,el)}setViewOffset(e,t,n,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(zs*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,l=o.fullHeight;r+=o.offsetX*s/c,t-=o.offsetY*n/l,s*=o.width/c,n*=o.height/l}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Wi=-90,Xi=1;class ef extends xt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Ft(Wi,Xi,e,t);s.layers=this.layers,this.add(s);const r=new Ft(Wi,Xi,e,t);r.layers=this.layers,this.add(r);const o=new Ft(Wi,Xi,e,t);o.layers=this.layers,this.add(o);const a=new Ft(Wi,Xi,e,t);a.layers=this.layers,this.add(a);const c=new Ft(Wi,Xi,e,t);c.layers=this.layers,this.add(c);const l=new Ft(Wi,Xi,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,r,o,a,c]=t;for(const l of t)this.remove(l);if(e===Qn)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Xr)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,c,l,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const v=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,r),e.setRenderTarget(n,1,s),e.render(t,o),e.setRenderTarget(n,2,s),e.render(t,a),e.setRenderTarget(n,3,s),e.render(t,c),e.setRenderTarget(n,4,s),e.render(t,l),n.texture.generateMipmaps=v,e.setRenderTarget(n,5,s),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class Wu extends yt{constructor(e=[],t=os,n,s,r,o,a,c,l,u){super(e,t,n,s,r,o,a,c,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tf extends Rt{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new Wu(s),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new gs(5,5,5),r=new Et({name:"CubemapFromEquirect",uniforms:hs(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ot,blending:St});r.uniforms.tEquirect.value=t;const o=new zt(s,r),a=t.minFilter;return t.minFilter===Kn&&(t.minFilter=Pt),new ef(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,s);e.setRenderTarget(r)}}class Ci extends xt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const nf={type:"move"};class wo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ci,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ci,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ci,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let s=null,r=null,o=null;const a=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){o=!0;for(const v of e.hand.values()){const m=t.getJointPose(v,n),p=this._getHandJoint(l,v);m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=m.radius),p.visible=m!==null}const u=l.joints["index-finger-tip"],h=l.joints["thumb-tip"],d=u.position.distanceTo(h.position),f=.02,g=.005;l.inputState.pinching&&d>f+g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=f-g&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(nf)))}return a!==null&&(a.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Ci;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Fa extends xt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new In,this.environmentIntensity=1,this.environmentRotation=new In,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class sf{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ua,this.updateRanges=[],this.version=0,this.uuid=yn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,r=this.stride;s1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||hf.getNormalMatrix(e),s=this.coplanarPoint(Ro).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const xi=new Pn,df=new Ae(.5,.5),yr=new U;class ac{constructor(e=new ci,t=new ci,n=new ci,s=new ci,r=new ci,o=new ci){this.planes=[e,t,n,s,r,o]}set(e,t,n,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Qn){const n=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],c=s[3],l=s[4],u=s[5],h=s[6],d=s[7],f=s[8],g=s[9],v=s[10],m=s[11],p=s[12],x=s[13],_=s[14],A=s[15];if(n[0].setComponents(c-r,d-l,m-f,A-p).normalize(),n[1].setComponents(c+r,d+l,m+f,A+p).normalize(),n[2].setComponents(c+o,d+u,m+g,A+x).normalize(),n[3].setComponents(c-o,d-u,m-g,A-x).normalize(),n[4].setComponents(c-a,d-h,m-v,A-_).normalize(),t===Qn)n[5].setComponents(c+a,d+h,m+v,A+_).normalize();else if(t===Xr)n[5].setComponents(a,h,v,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),xi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),xi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(xi)}intersectsSprite(e){xi.center.set(0,0,0);const t=df.distanceTo(e.center);return xi.radius=.7071067811865476+t,xi.applyMatrix4(e.matrixWorld),this.intersectsSphere(xi)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)0?e.max.x:e.min.x,yr.y=s.normal.y>0?e.max.y:e.min.y,yr.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(yr)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Yu extends rn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Be(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Yr=new U,qr=new U,ul=new Fe,Cs=new Qs,Mr=new Pn,Do=new U,hl=new U;class cc extends xt{constructor(e=new Jt,t=new Yu){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let s=1,r=t.count;s0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rn)return;Do.applyMatrix4(i.matrixWorld);const l=e.ray.origin.distanceTo(Do);if(!(le.far))return{distance:l,point:hl.clone().applyMatrix4(i.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:i}}const dl=new U,fl=new U;class ff extends cc{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let s=0,r=t.count;s0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class lc extends yt{constructor(e,t,n=hi,s,r,o,a=Tt,c=Tt,l,u=Vs,h=1){if(u!==Vs&&u!==ls)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:h};super(d,s,r,o,a,c,u,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new tc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class uc extends Jt{constructor(e=1,t=1,n=1,s=32,r=1,o=!1,a=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:s,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:c};const l=this;s=Math.floor(s),r=Math.floor(r);const u=[],h=[],d=[],f=[];let g=0;const v=[],m=n/2;let p=0;x(),o===!1&&(e>0&&_(!0),t>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new qt(h,3)),this.setAttribute("normal",new qt(d,3)),this.setAttribute("uv",new qt(f,2));function x(){const A=new U,b=new U;let w=0;const C=(t-e)/n;for(let P=0;P<=r;P++){const S=[],y=P/r,I=y*(t-e)+e;for(let k=0;k<=s;k++){const R=k/s,F=R*c+a,O=Math.sin(F),B=Math.cos(F);b.x=I*O,b.y=-y*n+m,b.z=I*B,h.push(b.x,b.y,b.z),A.set(O,C,B).normalize(),d.push(A.x,A.y,A.z),f.push(R,1-y),S.push(g++)}v.push(S)}for(let P=0;P0||S!==0)&&(u.push(y,I,R),w+=3),(t>0||S!==r-1)&&(u.push(I,k,R),w+=3)}l.addGroup(p,w,0),p+=w}function _(A){const b=g,w=new Ae,C=new U;let P=0;const S=A===!0?e:t,y=A===!0?1:-1;for(let k=1;k<=s;k++)h.push(0,m*y,0),d.push(0,y,0),f.push(.5,.5),g++;const I=g;for(let k=0;k<=s;k++){const F=k/s*c+a,O=Math.cos(F),B=Math.sin(F);C.x=S*B,C.y=m*y,C.z=S*O,h.push(C.x,C.y,C.z),d.push(0,y,0),w.x=O*.5+.5,w.y=B*.5*y+.5,f.push(w.x,w.y),g++}for(let k=0;k0)&&f.push(_,A,w),(p!==n-1||c0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class gf extends rn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$a,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class vf extends rn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=on,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class xf extends rn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function wr(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function Af(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function _f(i){function e(s,r){return i[s]-i[r]}const t=i.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function gl(i,e,t){const n=i.length,s=new i.constructor(n);for(let r=0,o=0;o!==n;++r){const a=t[r]*e;for(let c=0;c!==e;++c)s[o++]=i[a+c]}return s}function Ku(i,e,t,n){let s=1,r=i[0];for(;r!==void 0&&r[n]===void 0;)r=i[s++];if(r===void 0)return;let o=r[n];if(o!==void 0)if(Array.isArray(o))do o=r[n],o!==void 0&&(e.push(r.time),t.push(...o)),r=i[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[n],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=i[s++];while(r!==void 0);else do o=r[n],o!==void 0&&(e.push(r.time),t.push(o)),r=i[s++];while(r!==void 0)}class js{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,s=t[n],r=t[n-1];n:{e:{let o;t:{i:if(!(e=r)){const a=t[1];e=r)break e}o=n,n=0;break t}break n}for(;n>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=n.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const c=n[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(s!==void 0&&Af(s))for(let a=0,c=s.length;a!==c;++a){const l=s[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===so,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*n,c=o*n,l=0;l!==n;++l)t[c+l]=t[a+l];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Sn.prototype.ValueTypeName="";Sn.prototype.TimeBufferType=Float32Array;Sn.prototype.ValueBufferType=Float32Array;Sn.prototype.DefaultInterpolation=Xs;class vs extends Sn{constructor(e,t,n){super(e,t,n)}}vs.prototype.ValueTypeName="bool";vs.prototype.ValueBufferType=Array;vs.prototype.DefaultInterpolation=Ws;vs.prototype.InterpolantFactoryMethodLinear=void 0;vs.prototype.InterpolantFactoryMethodSmooth=void 0;class Qu extends Sn{constructor(e,t,n,s){super(e,t,n,s)}}Qu.prototype.ValueTypeName="color";class ds extends Sn{constructor(e,t,n,s){super(e,t,n,s)}}ds.prototype.ValueTypeName="number";class Sf extends js{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(n-t)/(s-t);let l=e*a;for(let u=l+a;l!==u;l+=4)di.slerpFlat(r,0,o,l-a,o,l,c);return r}}class fs extends Sn{constructor(e,t,n,s){super(e,t,n,s)}InterpolantFactoryMethodLinear(e){return new Sf(this.times,this.values,this.getValueSize(),e)}}fs.prototype.ValueTypeName="quaternion";fs.prototype.InterpolantFactoryMethodSmooth=void 0;class xs extends Sn{constructor(e,t,n){super(e,t,n)}}xs.prototype.ValueTypeName="string";xs.prototype.ValueBufferType=Array;xs.prototype.DefaultInterpolation=Ws;xs.prototype.InterpolantFactoryMethodLinear=void 0;xs.prototype.InterpolantFactoryMethodSmooth=void 0;class ps extends Sn{constructor(e,t,n,s){super(e,t,n,s)}}ps.prototype.ValueTypeName="vector";class Tf{constructor(e="",t=-1,n=[],s=td){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=yn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,s=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(bf(n[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=n.length;r!==o;++r)t.push(Sn.toJSON(n[r]));return s}static CreateFromMorphTargetSequence(e,t,n,s){const r=t.length,o=[];for(let a=0;a1){const h=u[1];let d=s[h];d||(s[h]=d=[]),d.push(l)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,n));return o}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(h,d,f,g,v){if(f.length!==0){const m=[],p=[];Ku(f,m,p,g),m.length!==0&&v.push(new h(d,m,p))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const l=e.hierarchy||[];for(let h=0;h{t&&t(r),this.manager.itemEnd(e)},0),r;if(Hn[e]!==void 0){Hn[e].push({onLoad:t,onProgress:n,onError:s});return}Hn[e]=[],Hn[e].push({onLoad:t,onProgress:n,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const u=Hn[e],h=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=d?parseInt(d):0,g=f!==0;let v=0;const m=new ReadableStream({start(p){x();function x(){h.read().then(({done:_,value:A})=>{if(_)p.close();else{v+=A.byteLength;const b=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:f});for(let w=0,C=u.length;w{p.error(_)})}}});return new Response(m)}else throw new Rf(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(c){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return l.json();default:if(a==="")return l.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return l.arrayBuffer().then(g=>f.decode(g))}}}).then(l=>{jn.add(`file:${e}`,l);const u=Hn[e];delete Hn[e];for(let h=0,d=u.length;h{const u=Hn[e];if(u===void 0)throw this.manager.itemError(e),l;delete Hn[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}const qi=new WeakMap;class Df extends As{constructor(e){super(e)}load(e,t,n,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=jn.get(`image:${e}`);if(o!==void 0){if(o.complete===!0)r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0);else{let h=qi.get(o);h===void 0&&(h=[],qi.set(o,h)),h.push({onLoad:t,onError:s})}return o}const a=Ys("img");function c(){u(),t&&t(this);const h=qi.get(this)||[];for(let d=0;d"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=jn.get(`image-bitmap:${e}`);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(l=>{if(Lo.has(o)===!0)s&&s(Lo.get(o)),r.manager.itemError(e),r.manager.itemEnd(e);else return t&&t(l),r.manager.itemEnd(e),l});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const c=fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){return jn.add(`image-bitmap:${e}`,l),t&&t(l),r.manager.itemEnd(e),l}).catch(function(l){s&&s(l),Lo.set(c,l),jn.remove(`image-bitmap:${e}`),r.manager.itemError(e),r.manager.itemEnd(e)});jn.add(`image-bitmap:${e}`,c),r.manager.itemStart(e)}}class Of extends Ft{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const pc="\\[\\]\\.:\\/",zf=new RegExp("["+pc+"]","g"),mc="[^"+pc+"]",Hf="[^"+pc.replace("\\.","")+"]",kf=/((?:WC+[\/:])*)/.source.replace("WC",mc),Gf=/(WCOD+)?/.source.replace("WCOD",Hf),Vf=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",mc),Wf=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",mc),Xf=new RegExp("^"+kf+Gf+Vf+Wf+"$"),Yf=["material","materials","bones","map"];class qf{constructor(e,t,n){const s=n||ot.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=n.length;s!==r;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class ot{constructor(e,t,n){this.path=t,this.parsedPath=n||ot.parseTrackName(t),this.node=ot.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new ot.Composite(e,t,n):new ot(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(zf,"")}static parseTrackName(e){const t=Xf.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=n.nodeName.substring(s+1);Yf.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(r){for(let o=0;of.start-g.start);let d=0;for(let f=1;f 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,fp=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,pp=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,mp=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,gp=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,vp=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,xp=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Ap=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,_p=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,yp=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Mp=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Ep=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Sp=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Tp=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,wp=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,bp="gl_FragColor = linearToOutputTexel( gl_FragColor );",Cp=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,Rp=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Dp=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Ip=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Pp=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Lp=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Bp=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Np=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Up=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,Fp=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Op=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,zp=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,Hp=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,kp=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Gp=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,Vp=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,Wp=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Xp=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Yp=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,qp=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Kp=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,Qp=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,jp=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,Zp=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,Jp=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,$p=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,em=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,tm=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,nm=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,im=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,sm=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,rm=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,om=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,am=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,cm=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,lm=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,um=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,hm=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,dm=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,fm=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,pm=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,mm=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,gm=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,vm=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,xm=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Am=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,_m=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,ym=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Mm=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,Em=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Sm=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Tm=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,wm=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,bm=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Cm=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Rm=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Dm=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Im=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Pm=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,Lm=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Bm=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,Nm=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Um=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,Fm=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,Om=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,zm=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,Hm=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,km=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Gm=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,Vm=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,Wm=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,Xm=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,Ym=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,qm=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,Km=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,Qm=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const jm=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,Zm=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,Jm=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,$m=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,eg=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,tg=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,ng=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,ig=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,sg=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,rg=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,og=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,ag=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,cg=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,lg=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,ug=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,hg=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,dg=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,fg=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,pg=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,mg=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,gg=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,vg=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,xg=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Ag=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,_g=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,yg=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,Mg=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Eg=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Sg=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Tg=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,wg=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,bg=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,Cg=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Rg=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Ge={alphahash_fragment:Zf,alphahash_pars_fragment:Jf,alphamap_fragment:$f,alphamap_pars_fragment:ep,alphatest_fragment:tp,alphatest_pars_fragment:np,aomap_fragment:ip,aomap_pars_fragment:sp,batching_pars_vertex:rp,batching_vertex:op,begin_vertex:ap,beginnormal_vertex:cp,bsdfs:lp,iridescence_fragment:up,bumpmap_pars_fragment:hp,clipping_planes_fragment:dp,clipping_planes_pars_fragment:fp,clipping_planes_pars_vertex:pp,clipping_planes_vertex:mp,color_fragment:gp,color_pars_fragment:vp,color_pars_vertex:xp,color_vertex:Ap,common:_p,cube_uv_reflection_fragment:yp,defaultnormal_vertex:Mp,displacementmap_pars_vertex:Ep,displacementmap_vertex:Sp,emissivemap_fragment:Tp,emissivemap_pars_fragment:wp,colorspace_fragment:bp,colorspace_pars_fragment:Cp,envmap_fragment:Rp,envmap_common_pars_fragment:Dp,envmap_pars_fragment:Ip,envmap_pars_vertex:Pp,envmap_physical_pars_fragment:Vp,envmap_vertex:Lp,fog_vertex:Bp,fog_pars_vertex:Np,fog_fragment:Up,fog_pars_fragment:Fp,gradientmap_pars_fragment:Op,lightmap_pars_fragment:zp,lights_lambert_fragment:Hp,lights_lambert_pars_fragment:kp,lights_pars_begin:Gp,lights_toon_fragment:Wp,lights_toon_pars_fragment:Xp,lights_phong_fragment:Yp,lights_phong_pars_fragment:qp,lights_physical_fragment:Kp,lights_physical_pars_fragment:Qp,lights_fragment_begin:jp,lights_fragment_maps:Zp,lights_fragment_end:Jp,logdepthbuf_fragment:$p,logdepthbuf_pars_fragment:em,logdepthbuf_pars_vertex:tm,logdepthbuf_vertex:nm,map_fragment:im,map_pars_fragment:sm,map_particle_fragment:rm,map_particle_pars_fragment:om,metalnessmap_fragment:am,metalnessmap_pars_fragment:cm,morphinstance_vertex:lm,morphcolor_vertex:um,morphnormal_vertex:hm,morphtarget_pars_vertex:dm,morphtarget_vertex:fm,normal_fragment_begin:pm,normal_fragment_maps:mm,normal_pars_fragment:gm,normal_pars_vertex:vm,normal_vertex:xm,normalmap_pars_fragment:Am,clearcoat_normal_fragment_begin:_m,clearcoat_normal_fragment_maps:ym,clearcoat_pars_fragment:Mm,iridescence_pars_fragment:Em,opaque_fragment:Sm,packing:Tm,premultiplied_alpha_fragment:wm,project_vertex:bm,dithering_fragment:Cm,dithering_pars_fragment:Rm,roughnessmap_fragment:Dm,roughnessmap_pars_fragment:Im,shadowmap_pars_fragment:Pm,shadowmap_pars_vertex:Lm,shadowmap_vertex:Bm,shadowmask_pars_fragment:Nm,skinbase_vertex:Um,skinning_pars_vertex:Fm,skinning_vertex:Om,skinnormal_vertex:zm,specularmap_fragment:Hm,specularmap_pars_fragment:km,tonemapping_fragment:Gm,tonemapping_pars_fragment:Vm,transmission_fragment:Wm,transmission_pars_fragment:Xm,uv_pars_fragment:Ym,uv_pars_vertex:qm,uv_vertex:Km,worldpos_vertex:Qm,background_vert:jm,background_frag:Zm,backgroundCube_vert:Jm,backgroundCube_frag:$m,cube_vert:eg,cube_frag:tg,depth_vert:ng,depth_frag:ig,distanceRGBA_vert:sg,distanceRGBA_frag:rg,equirect_vert:og,equirect_frag:ag,linedashed_vert:cg,linedashed_frag:lg,meshbasic_vert:ug,meshbasic_frag:hg,meshlambert_vert:dg,meshlambert_frag:fg,meshmatcap_vert:pg,meshmatcap_frag:mg,meshnormal_vert:gg,meshnormal_frag:vg,meshphong_vert:xg,meshphong_frag:Ag,meshphysical_vert:_g,meshphysical_frag:yg,meshtoon_vert:Mg,meshtoon_frag:Eg,points_vert:Sg,points_frag:Tg,shadow_vert:wg,shadow_frag:bg,sprite_vert:Cg,sprite_frag:Rg},ce={common:{diffuse:{value:new Be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new He},alphaMap:{value:null},alphaMapTransform:{value:new He},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new He}},envmap:{envMap:{value:null},envMapRotation:{value:new He},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new He}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new He}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new He},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new He},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new He},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new He}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new He}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new He}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Be(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new He},alphaTest:{value:0},uvTransform:{value:new He}},sprite:{diffuse:{value:new Be(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new He},alphaMap:{value:null},alphaMapTransform:{value:new He},alphaTest:{value:0}}},Cn={basic:{uniforms:Yt([ce.common,ce.specularmap,ce.envmap,ce.aomap,ce.lightmap,ce.fog]),vertexShader:Ge.meshbasic_vert,fragmentShader:Ge.meshbasic_frag},lambert:{uniforms:Yt([ce.common,ce.specularmap,ce.envmap,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.fog,ce.lights,{emissive:{value:new Be(0)}}]),vertexShader:Ge.meshlambert_vert,fragmentShader:Ge.meshlambert_frag},phong:{uniforms:Yt([ce.common,ce.specularmap,ce.envmap,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.fog,ce.lights,{emissive:{value:new Be(0)},specular:{value:new Be(1118481)},shininess:{value:30}}]),vertexShader:Ge.meshphong_vert,fragmentShader:Ge.meshphong_frag},standard:{uniforms:Yt([ce.common,ce.envmap,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.roughnessmap,ce.metalnessmap,ce.fog,ce.lights,{emissive:{value:new Be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ge.meshphysical_vert,fragmentShader:Ge.meshphysical_frag},toon:{uniforms:Yt([ce.common,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.gradientmap,ce.fog,ce.lights,{emissive:{value:new Be(0)}}]),vertexShader:Ge.meshtoon_vert,fragmentShader:Ge.meshtoon_frag},matcap:{uniforms:Yt([ce.common,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.fog,{matcap:{value:null}}]),vertexShader:Ge.meshmatcap_vert,fragmentShader:Ge.meshmatcap_frag},points:{uniforms:Yt([ce.points,ce.fog]),vertexShader:Ge.points_vert,fragmentShader:Ge.points_frag},dashed:{uniforms:Yt([ce.common,ce.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ge.linedashed_vert,fragmentShader:Ge.linedashed_frag},depth:{uniforms:Yt([ce.common,ce.displacementmap]),vertexShader:Ge.depth_vert,fragmentShader:Ge.depth_frag},normal:{uniforms:Yt([ce.common,ce.bumpmap,ce.normalmap,ce.displacementmap,{opacity:{value:1}}]),vertexShader:Ge.meshnormal_vert,fragmentShader:Ge.meshnormal_frag},sprite:{uniforms:Yt([ce.sprite,ce.fog]),vertexShader:Ge.sprite_vert,fragmentShader:Ge.sprite_frag},background:{uniforms:{uvTransform:{value:new He},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ge.background_vert,fragmentShader:Ge.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new He}},vertexShader:Ge.backgroundCube_vert,fragmentShader:Ge.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ge.cube_vert,fragmentShader:Ge.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ge.equirect_vert,fragmentShader:Ge.equirect_frag},distanceRGBA:{uniforms:Yt([ce.common,ce.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ge.distanceRGBA_vert,fragmentShader:Ge.distanceRGBA_frag},shadow:{uniforms:Yt([ce.lights,ce.fog,{color:{value:new Be(0)},opacity:{value:1}}]),vertexShader:Ge.shadow_vert,fragmentShader:Ge.shadow_frag}};Cn.physical={uniforms:Yt([Cn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new He},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new He},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new He},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new He},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new He},sheen:{value:0},sheenColor:{value:new Be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new He},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new He},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new He},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new He},attenuationDistance:{value:0},attenuationColor:{value:new Be(0)},specularColor:{value:new Be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new He},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new He},anisotropyVector:{value:new Ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new He}}]),vertexShader:Ge.meshphysical_vert,fragmentShader:Ge.meshphysical_frag};const br={r:0,b:0,g:0},Ai=new In,Dg=new Fe;function Ig(i,e,t,n,s,r,o){const a=new Be(0);let c=r===!0?0:1,l,u,h=null,d=0,f=null;function g(_){let A=_.isScene===!0?_.background:null;return A&&A.isTexture&&(A=(_.backgroundBlurriness>0?t:e).get(A)),A}function v(_){let A=!1;const b=g(_);b===null?p(a,c):b&&b.isColor&&(p(b,1),A=!0);const w=i.xr.getEnvironmentBlendMode();w==="additive"?n.buffers.color.setClear(0,0,0,1,o):w==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(i.autoClear||A)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(_,A){const b=g(A);b&&(b.isCubeTexture||b.mapping===Qr)?(u===void 0&&(u=new zt(new gs(1,1,1),new Et({name:"BackgroundCubeMaterial",uniforms:hs(Cn.backgroundCube.uniforms),vertexShader:Cn.backgroundCube.vertexShader,fragmentShader:Cn.backgroundCube.fragmentShader,side:Ot,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(w,C,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Ai.copy(A.backgroundRotation),Ai.x*=-1,Ai.y*=-1,Ai.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Ai.y*=-1,Ai.z*=-1),u.material.uniforms.envMap.value=b,u.material.uniforms.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Dg.makeRotationFromEuler(Ai)),u.material.toneMapped=Qe.getTransfer(b.colorSpace)!==ct,(h!==b||d!==b.version||f!==i.toneMapping)&&(u.material.needsUpdate=!0,h=b,d=b.version,f=i.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null)):b&&b.isTexture&&(l===void 0&&(l=new zt(new jr(2,2),new Et({name:"BackgroundMaterial",uniforms:hs(Cn.background.uniforms),vertexShader:Cn.background.vertexShader,fragmentShader:Cn.background.fragmentShader,side:Dn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=b,l.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,l.material.toneMapped=Qe.getTransfer(b.colorSpace)!==ct,b.matrixAutoUpdate===!0&&b.updateMatrix(),l.material.uniforms.uvTransform.value.copy(b.matrix),(h!==b||d!==b.version||f!==i.toneMapping)&&(l.material.needsUpdate=!0,h=b,d=b.version,f=i.toneMapping),l.layers.enableAll(),_.unshift(l,l.geometry,l.material,0,0,null))}function p(_,A){_.getRGB(br,Vu(i)),n.buffers.color.setClear(br.r,br.g,br.b,A,o)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return a},setClearColor:function(_,A=1){a.set(_),c=A,p(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(_){c=_,p(a,c)},render:v,addToRenderList:m,dispose:x}}function Pg(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=d(null);let r=s,o=!1;function a(y,I,k,R,F){let O=!1;const B=h(R,k,I);r!==B&&(r=B,l(r.object)),O=f(y,R,k,F),O&&g(y,R,k,F),F!==null&&e.update(F,i.ELEMENT_ARRAY_BUFFER),(O||o)&&(o=!1,A(y,I,k,R),F!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(F).buffer))}function c(){return i.createVertexArray()}function l(y){return i.bindVertexArray(y)}function u(y){return i.deleteVertexArray(y)}function h(y,I,k){const R=k.wireframe===!0;let F=n[y.id];F===void 0&&(F={},n[y.id]=F);let O=F[I.id];O===void 0&&(O={},F[I.id]=O);let B=O[R];return B===void 0&&(B=d(c()),O[R]=B),B}function d(y){const I=[],k=[],R=[];for(let F=0;F=0){const oe=F[G];let fe=O[G];if(fe===void 0&&(G==="instanceMatrix"&&y.instanceMatrix&&(fe=y.instanceMatrix),G==="instanceColor"&&y.instanceColor&&(fe=y.instanceColor)),oe===void 0||oe.attribute!==fe||fe&&oe.data!==fe.data)return!0;B++}return r.attributesNum!==B||r.index!==R}function g(y,I,k,R){const F={},O=I.attributes;let B=0;const q=k.getAttributes();for(const G in q)if(q[G].location>=0){let oe=O[G];oe===void 0&&(G==="instanceMatrix"&&y.instanceMatrix&&(oe=y.instanceMatrix),G==="instanceColor"&&y.instanceColor&&(oe=y.instanceColor));const fe={};fe.attribute=oe,oe&&oe.data&&(fe.data=oe.data),F[G]=fe,B++}r.attributes=F,r.attributesNum=B,r.index=R}function v(){const y=r.newAttributes;for(let I=0,k=y.length;I=0){let Z=F[q];if(Z===void 0&&(q==="instanceMatrix"&&y.instanceMatrix&&(Z=y.instanceMatrix),q==="instanceColor"&&y.instanceColor&&(Z=y.instanceColor)),Z!==void 0){const oe=Z.normalized,fe=Z.itemSize,ie=e.get(Z);if(ie===void 0)continue;const Ke=ie.buffer,K=ie.type,se=ie.bytesPerElement,Me=K===i.INT||K===i.UNSIGNED_INT||Z.gpuType===Ya;if(Z.isInterleavedBufferAttribute){const ue=Z.data,be=ue.stride,et=Z.offset;if(ue.isInstancedInterleavedBuffer){for(let Le=0;Le0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=t.precision!==void 0?t.precision:"highp";const u=c(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const h=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),p=i.getParameter(i.MAX_VERTEX_ATTRIBS),x=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),_=i.getParameter(i.MAX_VARYING_VECTORS),A=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),b=g>0,w=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:a,precision:l,logarithmicDepthBuffer:h,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:x,maxVaryings:_,maxFragmentUniforms:A,vertexTextures:b,maxSamples:w}}function Ng(i){const e=this;let t=null,n=0,s=!1,r=!1;const o=new ci,a=new He,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const f=h.length!==0||d||n!==0||s;return s=d,n=h.length,f},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,d){t=u(h,d,0)},this.setState=function(h,d,f){const g=h.clippingPlanes,v=h.clipIntersection,m=h.clipShadows,p=i.get(h);if(!s||g===null||g.length===0||r&&!m)r?u(null):l();else{const x=r?0:n,_=x*4;let A=p.clippingState||null;c.value=A,A=u(g,d,_,f);for(let b=0;b!==_;++b)A[b]=t[b];p.clippingState=A,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=x}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,g){const v=h!==null?h.length:0;let m=null;if(v!==0){if(m=c.value,g!==!0||m===null){const p=f+v*4,x=d.matrixWorldInverse;a.getNormalMatrix(x),(m===null||m.length0){const l=new tf(c.height);return l.fromEquirectangularTexture(i,o),e.set(o,l),o.addEventListener("dispose",s),t(l.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const Zi=4,El=[.125,.215,.35,.446,.526,.582],Ti=20,Bo=new fc,Sl=new Be;let No=null,Uo=0,Fo=0,Oo=!1;const Ei=(1+Math.sqrt(5))/2,Ki=1/Ei,Tl=[new U(-Ei,Ki,0),new U(Ei,Ki,0),new U(-Ki,0,Ei),new U(Ki,0,Ei),new U(0,Ei,-Ki),new U(0,Ei,Ki),new U(-1,1,-1),new U(1,1,-1),new U(-1,1,1),new U(1,1,1)],Fg=new U;class wl{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,s=100,r={}){const{size:o=256,position:a=Fg}=r;No=this._renderer.getRenderTarget(),Uo=this._renderer.getActiveCubeFace(),Fo=this._renderer.getActiveMipmapLevel(),Oo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,n,s,c,a),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Rl(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Cl(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?A:0,A,A),h.setRenderTarget(s),m&&h.render(v,c),h.render(e,c)}v.geometry.dispose(),v.material.dispose(),h.toneMapping=f,h.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===os||e.mapping===as;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Rl()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Cl());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new zt(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const c=this._cubeSize;Cr(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(o,Bo)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rTi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ti}`);const p=[];let x=0;for(let C=0;C_-Zi?s-_+Zi:0),w=4*(this._cubeSize-A);Cr(t,b,w,3*A,2*A),c.setRenderTarget(t),c.render(h,Bo)}}function Og(i){const e=[],t=[],n=[];let s=i;const r=i-Zi+1+El.length;for(let o=0;oi-Zi?c=El[o-i+Zi-1]:o===0&&(c=0),n.push(c);const l=1/(a-2),u=-l,h=1+l,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,g=6,v=3,m=2,p=1,x=new Float32Array(v*g*f),_=new Float32Array(m*g*f),A=new Float32Array(p*g*f);for(let w=0;w2?0:-1,S=[C,P,0,C+2/3,P,0,C+2/3,P+1,0,C,P,0,C+2/3,P+1,0,C,P+1,0];x.set(S,v*g*w),_.set(d,m*g*w);const y=[w,w,w,w,w,w];A.set(y,p*g*w)}const b=new Jt;b.setAttribute("position",new Lt(x,v)),b.setAttribute("uv",new Lt(_,m)),b.setAttribute("faceIndex",new Lt(A,p)),e.push(b),s>Zi&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function bl(i,e,t){const n=new Rt(i,e,t);return n.texture.mapping=Qr,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Cr(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function zg(i,e,t){const n=new Float32Array(Ti),s=new U(0,1,0);return new Et({name:"SphericalGaussianBlur",defines:{n:Ti,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:gc(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:St,depthTest:!1,depthWrite:!1})}function Cl(){return new Et({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:gc(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:St,depthTest:!1,depthWrite:!1})}function Rl(){return new Et({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:gc(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:St,depthTest:!1,depthWrite:!1})}function gc(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function Hg(i){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){const c=a.mapping,l=c===aa||c===ca,u=c===os||c===as;if(l||u){let h=e.get(a);const d=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new wl(i)),h=l?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const f=a.image;return l&&f&&f.height>0||u&&f&&s(f)?(t===null&&(t=new wl(i)),h=l?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",r),h.texture):null}}}return a}function s(a){let c=0;const l=6;for(let u=0;ue.maxTextureSize&&(w=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const C=new Float32Array(b*w*4*h),P=new zu(C,b,w,h);P.type=dn,P.needsUpdate=!0;const S=A*4;for(let I=0;I0)return i;const s=e*t;let r=Il[s];if(r===void 0&&(r=new Float32Array(s),Il[s]=r),e!==0){n.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(r,a)}return r}function Bt(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t":" "} ${a}: ${t[o]}`)}return n.join(` +`)}const Ol=new He;function Hv(i){Qe._getMatrix(Ol,Qe.workingColorSpace,i);const e=`mat3( ${Ol.elements.map(t=>t.toFixed(4))} )`;switch(Qe.getTransfer(i)){case Wr:return[e,"LinearTransferOETF"];case ct:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function zl(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),s=i.getShaderInfoLog(e).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` + +`+s+` + +`+zv(i.getShaderSource(e),o)}else return s}function kv(i,e){const t=Hv(e);return[`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function Gv(i,e){let t;switch(e){case Kh:t="Linear";break;case Qh:t="Reinhard";break;case jh:t="Cineon";break;case bu:t="ACESFilmic";break;case Jh:t="AgX";break;case $h:t="Neutral";break;case Zh:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Rr=new U;function Vv(){Qe.getLuminanceCoefficients(Rr);const i=Rr.x.toFixed(4),e=Rr.y.toFixed(4),t=Rr.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function Wv(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Os).join(` +`)}function Xv(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` +`)}function Yv(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Ga(i){return i.replace(qv,Qv)}const Kv=new Map;function Qv(i,e){let t=Ge[e];if(t===void 0){const n=Kv.get(e);if(n!==void 0)t=Ge[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Ga(t)}const jv=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Gl(i){return i.replace(jv,Zv)}function Zv(i,e,t,n){let s="";for(let r=parseInt(e);r0&&(m+=` +`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Os).join(` +`),p.length>0&&(p+=` +`)):(m=[Vl(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Os).join(` +`),p=[Vl(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ui?"#define TONE_MAPPING":"",t.toneMapping!==ui?Ge.tonemapping_pars_fragment:"",t.toneMapping!==ui?Gv("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Ge.colorspace_pars_fragment,kv("linearToOutputTexel",t.outputColorSpace),Vv(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Os).join(` +`)),o=Ga(o),o=Hl(o,t),o=kl(o,t),a=Ga(a),a=Hl(a,t),a=kl(a,t),o=Gl(o),a=Gl(a),t.isRawShaderMaterial!==!0&&(x=`#version 300 es +`,m=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+m,p=["#define varying in",t.glslVersion===Fc?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Fc?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+p);const _=x+m+o,A=x+p+a,b=Fl(s,s.VERTEX_SHADER,_),w=Fl(s,s.FRAGMENT_SHADER,A);s.attachShader(v,b),s.attachShader(v,w),t.index0AttributeName!==void 0?s.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(v,0,"position"),s.linkProgram(v);function C(I){if(i.debug.checkShaderErrors){const k=s.getProgramInfoLog(v).trim(),R=s.getShaderInfoLog(b).trim(),F=s.getShaderInfoLog(w).trim();let O=!0,B=!0;if(s.getProgramParameter(v,s.LINK_STATUS)===!1)if(O=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,v,b,w);else{const q=zl(s,b,"vertex"),G=zl(s,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(v,s.VALIDATE_STATUS)+` + +Material Name: `+I.name+` +Material Type: `+I.type+` + +Program Info Log: `+k+` +`+q+` +`+G)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(R===""||F==="")&&(B=!1);B&&(I.diagnostics={runnable:O,programLog:k,vertexShader:{log:R,prefix:m},fragmentShader:{log:F,prefix:p}})}s.deleteShader(b),s.deleteShader(w),P=new Gr(s,v),S=Yv(s,v)}let P;this.getUniforms=function(){return P===void 0&&C(this),P};let S;this.getAttributes=function(){return S===void 0&&C(this),S};let y=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=s.getProgramParameter(v,Fv)),y},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Ov++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=b,this.fragmentShader=w,this}let sx=0;class rx{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new ox(e),t.set(e,n)),n}}class ox{constructor(e){this.id=sx++,this.code=e,this.usedTimes=0}}function ax(i,e,t,n,s,r,o){const a=new nc,c=new rx,l=new Set,u=[],h=s.logarithmicDepthBuffer,d=s.vertexTextures;let f=s.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(S){return l.add(S),S===0?"uv":`uv${S}`}function m(S,y,I,k,R){const F=k.fog,O=R.geometry,B=S.isMeshStandardMaterial?k.environment:null,q=(S.isMeshStandardMaterial?t:e).get(S.envMap||B),G=q&&q.mapping===Qr?q.image.height:null,Z=g[S.type];S.precision!==null&&(f=s.getMaxPrecision(S.precision),f!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",f,"instead."));const oe=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,fe=oe!==void 0?oe.length:0;let ie=0;O.morphAttributes.position!==void 0&&(ie=1),O.morphAttributes.normal!==void 0&&(ie=2),O.morphAttributes.color!==void 0&&(ie=3);let Ke,K,se,Me;if(Z){const st=Cn[Z];Ke=st.vertexShader,K=st.fragmentShader}else Ke=S.vertexShader,K=S.fragmentShader,c.update(S),se=c.getVertexShaderID(S),Me=c.getFragmentShaderID(S);const ue=i.getRenderTarget(),be=i.state.buffers.depth.getReversed(),et=R.isInstancedMesh===!0,Le=R.isBatchedMesh===!0,mt=!!S.map,gt=!!S.matcap,tt=!!q,L=!!S.aoMap,Vt=!!S.lightMap,nt=!!S.bumpMap,ut=!!S.normalMap,Se=!!S.displacementMap,Ze=!!S.emissiveMap,Re=!!S.metalnessMap,ke=!!S.roughnessMap,Dt=S.anisotropy>0,D=S.clearcoat>0,M=S.dispersion>0,V=S.iridescence>0,Q=S.sheen>0,J=S.transmission>0,Y=Dt&&!!S.anisotropyMap,Te=D&&!!S.clearcoatMap,le=D&&!!S.clearcoatNormalMap,Ee=D&&!!S.clearcoatRoughnessMap,we=V&&!!S.iridescenceMap,$=V&&!!S.iridescenceThicknessMap,me=Q&&!!S.sheenColorMap,Pe=Q&&!!S.sheenRoughnessMap,Ie=!!S.specularMap,ae=!!S.specularColorMap,Oe=!!S.specularIntensityMap,N=J&&!!S.transmissionMap,he=J&&!!S.thicknessMap,ee=!!S.gradientMap,xe=!!S.alphaMap,te=S.alphaTest>0,j=!!S.alphaHash,_e=!!S.extensions;let ze=ui;S.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(ze=i.toneMapping);const ht={shaderID:Z,shaderType:S.type,shaderName:S.name,vertexShader:Ke,fragmentShader:K,defines:S.defines,customVertexShaderID:se,customFragmentShaderID:Me,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:f,batching:Le,batchingColor:Le&&R._colorsTexture!==null,instancing:et,instancingColor:et&&R.instanceColor!==null,instancingMorph:et&&R.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:ue===null?i.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Ht,alphaToCoverage:!!S.alphaToCoverage,map:mt,matcap:gt,envMap:tt,envMapMode:tt&&q.mapping,envMapCubeUVHeight:G,aoMap:L,lightMap:Vt,bumpMap:nt,normalMap:ut,displacementMap:d&&Se,emissiveMap:Ze,normalMapObjectSpace:ut&&S.normalMapType===sd,normalMapTangentSpace:ut&&S.normalMapType===$a,metalnessMap:Re,roughnessMap:ke,anisotropy:Dt,anisotropyMap:Y,clearcoat:D,clearcoatMap:Te,clearcoatNormalMap:le,clearcoatRoughnessMap:Ee,dispersion:M,iridescence:V,iridescenceMap:we,iridescenceThicknessMap:$,sheen:Q,sheenColorMap:me,sheenRoughnessMap:Pe,specularMap:Ie,specularColorMap:ae,specularIntensityMap:Oe,transmission:J,transmissionMap:N,thicknessMap:he,gradientMap:ee,opaque:S.transparent===!1&&S.blending===es&&S.alphaToCoverage===!1,alphaMap:xe,alphaTest:te,alphaHash:j,combine:S.combine,mapUv:mt&&v(S.map.channel),aoMapUv:L&&v(S.aoMap.channel),lightMapUv:Vt&&v(S.lightMap.channel),bumpMapUv:nt&&v(S.bumpMap.channel),normalMapUv:ut&&v(S.normalMap.channel),displacementMapUv:Se&&v(S.displacementMap.channel),emissiveMapUv:Ze&&v(S.emissiveMap.channel),metalnessMapUv:Re&&v(S.metalnessMap.channel),roughnessMapUv:ke&&v(S.roughnessMap.channel),anisotropyMapUv:Y&&v(S.anisotropyMap.channel),clearcoatMapUv:Te&&v(S.clearcoatMap.channel),clearcoatNormalMapUv:le&&v(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&v(S.clearcoatRoughnessMap.channel),iridescenceMapUv:we&&v(S.iridescenceMap.channel),iridescenceThicknessMapUv:$&&v(S.iridescenceThicknessMap.channel),sheenColorMapUv:me&&v(S.sheenColorMap.channel),sheenRoughnessMapUv:Pe&&v(S.sheenRoughnessMap.channel),specularMapUv:Ie&&v(S.specularMap.channel),specularColorMapUv:ae&&v(S.specularColorMap.channel),specularIntensityMapUv:Oe&&v(S.specularIntensityMap.channel),transmissionMapUv:N&&v(S.transmissionMap.channel),thicknessMapUv:he&&v(S.thicknessMap.channel),alphaMapUv:xe&&v(S.alphaMap.channel),vertexTangents:!!O.attributes.tangent&&(ut||Dt),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,pointsUvs:R.isPoints===!0&&!!O.attributes.uv&&(mt||xe),fog:!!F,useFog:S.fog===!0,fogExp2:!!F&&F.isFogExp2,flatShading:S.flatShading===!0&&S.wireframe===!1,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:h,reverseDepthBuffer:be,skinning:R.isSkinnedMesh===!0,morphTargets:O.morphAttributes.position!==void 0,morphNormals:O.morphAttributes.normal!==void 0,morphColors:O.morphAttributes.color!==void 0,morphTargetsCount:fe,morphTextureStride:ie,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:i.shadowMap.enabled&&I.length>0,shadowMapType:i.shadowMap.type,toneMapping:ze,decodeVideoTexture:mt&&S.map.isVideoTexture===!0&&Qe.getTransfer(S.map.colorSpace)===ct,decodeVideoTextureEmissive:Ze&&S.emissiveMap.isVideoTexture===!0&&Qe.getTransfer(S.emissiveMap.colorSpace)===ct,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===jt,flipSided:S.side===Ot,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:_e&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(_e&&S.extensions.multiDraw===!0||Le)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return ht.vertexUv1s=l.has(1),ht.vertexUv2s=l.has(2),ht.vertexUv3s=l.has(3),l.clear(),ht}function p(S){const y=[];if(S.shaderID?y.push(S.shaderID):(y.push(S.customVertexShaderID),y.push(S.customFragmentShaderID)),S.defines!==void 0)for(const I in S.defines)y.push(I),y.push(S.defines[I]);return S.isRawShaderMaterial===!1&&(x(y,S),_(y,S),y.push(i.outputColorSpace)),y.push(S.customProgramCacheKey),y.join()}function x(S,y){S.push(y.precision),S.push(y.outputColorSpace),S.push(y.envMapMode),S.push(y.envMapCubeUVHeight),S.push(y.mapUv),S.push(y.alphaMapUv),S.push(y.lightMapUv),S.push(y.aoMapUv),S.push(y.bumpMapUv),S.push(y.normalMapUv),S.push(y.displacementMapUv),S.push(y.emissiveMapUv),S.push(y.metalnessMapUv),S.push(y.roughnessMapUv),S.push(y.anisotropyMapUv),S.push(y.clearcoatMapUv),S.push(y.clearcoatNormalMapUv),S.push(y.clearcoatRoughnessMapUv),S.push(y.iridescenceMapUv),S.push(y.iridescenceThicknessMapUv),S.push(y.sheenColorMapUv),S.push(y.sheenRoughnessMapUv),S.push(y.specularMapUv),S.push(y.specularColorMapUv),S.push(y.specularIntensityMapUv),S.push(y.transmissionMapUv),S.push(y.thicknessMapUv),S.push(y.combine),S.push(y.fogExp2),S.push(y.sizeAttenuation),S.push(y.morphTargetsCount),S.push(y.morphAttributeCount),S.push(y.numDirLights),S.push(y.numPointLights),S.push(y.numSpotLights),S.push(y.numSpotLightMaps),S.push(y.numHemiLights),S.push(y.numRectAreaLights),S.push(y.numDirLightShadows),S.push(y.numPointLightShadows),S.push(y.numSpotLightShadows),S.push(y.numSpotLightShadowsWithMaps),S.push(y.numLightProbes),S.push(y.shadowMapType),S.push(y.toneMapping),S.push(y.numClippingPlanes),S.push(y.numClipIntersection),S.push(y.depthPacking)}function _(S,y){a.disableAll(),y.supportsVertexTextures&&a.enable(0),y.instancing&&a.enable(1),y.instancingColor&&a.enable(2),y.instancingMorph&&a.enable(3),y.matcap&&a.enable(4),y.envMap&&a.enable(5),y.normalMapObjectSpace&&a.enable(6),y.normalMapTangentSpace&&a.enable(7),y.clearcoat&&a.enable(8),y.iridescence&&a.enable(9),y.alphaTest&&a.enable(10),y.vertexColors&&a.enable(11),y.vertexAlphas&&a.enable(12),y.vertexUv1s&&a.enable(13),y.vertexUv2s&&a.enable(14),y.vertexUv3s&&a.enable(15),y.vertexTangents&&a.enable(16),y.anisotropy&&a.enable(17),y.alphaHash&&a.enable(18),y.batching&&a.enable(19),y.dispersion&&a.enable(20),y.batchingColor&&a.enable(21),y.gradientMap&&a.enable(22),S.push(a.mask),a.disableAll(),y.fog&&a.enable(0),y.useFog&&a.enable(1),y.flatShading&&a.enable(2),y.logarithmicDepthBuffer&&a.enable(3),y.reverseDepthBuffer&&a.enable(4),y.skinning&&a.enable(5),y.morphTargets&&a.enable(6),y.morphNormals&&a.enable(7),y.morphColors&&a.enable(8),y.premultipliedAlpha&&a.enable(9),y.shadowMapEnabled&&a.enable(10),y.doubleSided&&a.enable(11),y.flipSided&&a.enable(12),y.useDepthPacking&&a.enable(13),y.dithering&&a.enable(14),y.transmission&&a.enable(15),y.sheen&&a.enable(16),y.opaque&&a.enable(17),y.pointsUvs&&a.enable(18),y.decodeVideoTexture&&a.enable(19),y.decodeVideoTextureEmissive&&a.enable(20),y.alphaToCoverage&&a.enable(21),S.push(a.mask)}function A(S){const y=g[S.type];let I;if(y){const k=Cn[y];I=Zd.clone(k.uniforms)}else I=S.uniforms;return I}function b(S,y){let I;for(let k=0,R=u.length;k0?n.push(p):f.transparent===!0?s.push(p):t.push(p)}function c(h,d,f,g,v,m){const p=o(h,d,f,g,v,m);f.transmission>0?n.unshift(p):f.transparent===!0?s.unshift(p):t.unshift(p)}function l(h,d){t.length>1&&t.sort(h||lx),n.length>1&&n.sort(d||Wl),s.length>1&&s.sort(d||Wl)}function u(){for(let h=e,d=i.length;h=r.length?(o=new Xl,r.push(o)):o=r[s],o}function t(){i=new WeakMap}return{get:e,dispose:t}}function hx(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new U,color:new Be};break;case"SpotLight":t={position:new U,direction:new U,color:new Be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new U,color:new Be,distance:0,decay:0};break;case"HemisphereLight":t={direction:new U,skyColor:new Be,groundColor:new Be};break;case"RectAreaLight":t={color:new Be,position:new U,halfWidth:new U,halfHeight:new U};break}return i[e.id]=t,t}}}function dx(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let fx=0;function px(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function mx(i){const e=new hx,t=dx(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new U);const s=new U,r=new Fe,o=new Fe;function a(l){let u=0,h=0,d=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let f=0,g=0,v=0,m=0,p=0,x=0,_=0,A=0,b=0,w=0,C=0;l.sort(px);for(let S=0,y=l.length;S0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=ce.LTC_FLOAT_1,n.rectAreaLTC2=ce.LTC_FLOAT_2):(n.rectAreaLTC1=ce.LTC_HALF_1,n.rectAreaLTC2=ce.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=h,n.ambient[2]=d;const P=n.hash;(P.directionalLength!==f||P.pointLength!==g||P.spotLength!==v||P.rectAreaLength!==m||P.hemiLength!==p||P.numDirectionalShadows!==x||P.numPointShadows!==_||P.numSpotShadows!==A||P.numSpotMaps!==b||P.numLightProbes!==C)&&(n.directional.length=f,n.spot.length=v,n.rectArea.length=m,n.point.length=g,n.hemi.length=p,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=_,n.pointShadowMap.length=_,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=_,n.spotLightMatrix.length=A+b-w,n.spotLightMap.length=b,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=C,P.directionalLength=f,P.pointLength=g,P.spotLength=v,P.rectAreaLength=m,P.hemiLength=p,P.numDirectionalShadows=x,P.numPointShadows=_,P.numSpotShadows=A,P.numSpotMaps=b,P.numLightProbes=C,n.version=fx++)}function c(l,u){let h=0,d=0,f=0,g=0,v=0;const m=u.matrixWorldInverse;for(let p=0,x=l.length;p=o.length?(a=new Yl(i),o.push(a)):a=o[r],a}function n(){e=new WeakMap}return{get:t,dispose:n}}const vx=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,xx=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Ax(i,e,t){let n=new ac;const s=new Ae,r=new Ae,o=new je,a=new vf({depthPacking:id}),c=new xf,l={},u=t.maxTextureSize,h={[Dn]:Ot,[Ot]:Dn,[jt]:jt},d=new Et({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:vx,fragmentShader:xx}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const g=new Jt;g.setAttribute("position",new Lt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new zt(g,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Su;let p=this.type;this.render=function(w,C,P){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||w.length===0)return;const S=i.getRenderTarget(),y=i.getActiveCubeFace(),I=i.getActiveMipmapLevel(),k=i.state;k.setBlending(St),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);const R=p!==Xn&&this.type===Xn,F=p===Xn&&this.type!==Xn;for(let O=0,B=w.length;Ou||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/Z.x),s.x=r.x*Z.x,G.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/Z.y),s.y=r.y*Z.y,G.mapSize.y=r.y)),G.map===null||R===!0||F===!0){const fe=this.type!==Xn?{minFilter:Tt,magFilter:Tt}:{};G.map!==null&&G.map.dispose(),G.map=new Rt(s.x,s.y,fe),G.map.texture.name=q.name+".shadowMap",G.camera.updateProjectionMatrix()}i.setRenderTarget(G.map),i.clear();const oe=G.getViewportCount();for(let fe=0;fe0||C.map&&C.alphaTest>0||C.alphaToCoverage===!0){const k=y.uuid,R=C.uuid;let F=l[k];F===void 0&&(F={},l[k]=F);let O=F[R];O===void 0&&(O=y.clone(),F[R]=O,C.addEventListener("dispose",b)),y=O}if(y.visible=C.visible,y.wireframe=C.wireframe,S===Xn?y.side=C.shadowSide!==null?C.shadowSide:C.side:y.side=C.shadowSide!==null?C.shadowSide:h[C.side],y.alphaMap=C.alphaMap,y.alphaTest=C.alphaToCoverage===!0?.5:C.alphaTest,y.map=C.map,y.clipShadows=C.clipShadows,y.clippingPlanes=C.clippingPlanes,y.clipIntersection=C.clipIntersection,y.displacementMap=C.displacementMap,y.displacementScale=C.displacementScale,y.displacementBias=C.displacementBias,y.wireframeLinewidth=C.wireframeLinewidth,y.linewidth=C.linewidth,P.isPointLight===!0&&y.isMeshDistanceMaterial===!0){const k=i.properties.get(y);k.light=P}return y}function A(w,C,P,S,y){if(w.visible===!1)return;if(w.layers.test(C.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&y===Xn)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,w.matrixWorld);const R=e.update(w),F=w.material;if(Array.isArray(F)){const O=R.groups;for(let B=0,q=O.length;B=1):G.indexOf("OpenGL ES")!==-1&&(q=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),B=q>=2);let Z=null,oe={};const fe=i.getParameter(i.SCISSOR_BOX),ie=i.getParameter(i.VIEWPORT),Ke=new je().fromArray(fe),K=new je().fromArray(ie);function se(N,he,ee,xe){const te=new Uint8Array(4),j=i.createTexture();i.bindTexture(N,j),i.texParameteri(N,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(N,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let _e=0;_e"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Ae,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(D,M){return f?new OffscreenCanvas(D,M):Ys("canvas")}function v(D,M,V){let Q=1;const J=Dt(D);if((J.width>V||J.height>V)&&(Q=V/Math.max(J.width,J.height)),Q<1)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap||typeof VideoFrame<"u"&&D instanceof VideoFrame){const Y=Math.floor(Q*J.width),Te=Math.floor(Q*J.height);h===void 0&&(h=g(Y,Te));const le=M?g(Y,Te):h;return le.width=Y,le.height=Te,le.getContext("2d").drawImage(D,0,0,Y,Te),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+Y+"x"+Te+")."),le}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),D;return D}function m(D){return D.generateMipmaps}function p(D){i.generateMipmap(D)}function x(D){return D.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:D.isWebGL3DRenderTarget?i.TEXTURE_3D:D.isWebGLArrayRenderTarget||D.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function _(D,M,V,Q,J=!1){if(D!==null){if(i[D]!==void 0)return i[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let Y=M;if(M===i.RED&&(V===i.FLOAT&&(Y=i.R32F),V===i.HALF_FLOAT&&(Y=i.R16F),V===i.UNSIGNED_BYTE&&(Y=i.R8)),M===i.RED_INTEGER&&(V===i.UNSIGNED_BYTE&&(Y=i.R8UI),V===i.UNSIGNED_SHORT&&(Y=i.R16UI),V===i.UNSIGNED_INT&&(Y=i.R32UI),V===i.BYTE&&(Y=i.R8I),V===i.SHORT&&(Y=i.R16I),V===i.INT&&(Y=i.R32I)),M===i.RG&&(V===i.FLOAT&&(Y=i.RG32F),V===i.HALF_FLOAT&&(Y=i.RG16F),V===i.UNSIGNED_BYTE&&(Y=i.RG8)),M===i.RG_INTEGER&&(V===i.UNSIGNED_BYTE&&(Y=i.RG8UI),V===i.UNSIGNED_SHORT&&(Y=i.RG16UI),V===i.UNSIGNED_INT&&(Y=i.RG32UI),V===i.BYTE&&(Y=i.RG8I),V===i.SHORT&&(Y=i.RG16I),V===i.INT&&(Y=i.RG32I)),M===i.RGB_INTEGER&&(V===i.UNSIGNED_BYTE&&(Y=i.RGB8UI),V===i.UNSIGNED_SHORT&&(Y=i.RGB16UI),V===i.UNSIGNED_INT&&(Y=i.RGB32UI),V===i.BYTE&&(Y=i.RGB8I),V===i.SHORT&&(Y=i.RGB16I),V===i.INT&&(Y=i.RGB32I)),M===i.RGBA_INTEGER&&(V===i.UNSIGNED_BYTE&&(Y=i.RGBA8UI),V===i.UNSIGNED_SHORT&&(Y=i.RGBA16UI),V===i.UNSIGNED_INT&&(Y=i.RGBA32UI),V===i.BYTE&&(Y=i.RGBA8I),V===i.SHORT&&(Y=i.RGBA16I),V===i.INT&&(Y=i.RGBA32I)),M===i.RGB&&V===i.UNSIGNED_INT_5_9_9_9_REV&&(Y=i.RGB9_E5),M===i.RGBA){const Te=J?Wr:Qe.getTransfer(Q);V===i.FLOAT&&(Y=i.RGBA32F),V===i.HALF_FLOAT&&(Y=i.RGBA16F),V===i.UNSIGNED_BYTE&&(Y=Te===ct?i.SRGB8_ALPHA8:i.RGBA8),V===i.UNSIGNED_SHORT_4_4_4_4&&(Y=i.RGBA4),V===i.UNSIGNED_SHORT_5_5_5_1&&(Y=i.RGB5_A1)}return(Y===i.R16F||Y===i.R32F||Y===i.RG16F||Y===i.RG32F||Y===i.RGBA16F||Y===i.RGBA32F)&&e.get("EXT_color_buffer_float"),Y}function A(D,M){let V;return D?M===null||M===hi||M===cs?V=i.DEPTH24_STENCIL8:M===dn?V=i.DEPTH32F_STENCIL8:M===Gs&&(V=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):M===null||M===hi||M===cs?V=i.DEPTH_COMPONENT24:M===dn?V=i.DEPTH_COMPONENT32F:M===Gs&&(V=i.DEPTH_COMPONENT16),V}function b(D,M){return m(D)===!0||D.isFramebufferTexture&&D.minFilter!==Tt&&D.minFilter!==Pt?Math.log2(Math.max(M.width,M.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?M.mipmaps.length:1}function w(D){const M=D.target;M.removeEventListener("dispose",w),P(M),M.isVideoTexture&&u.delete(M)}function C(D){const M=D.target;M.removeEventListener("dispose",C),y(M)}function P(D){const M=n.get(D);if(M.__webglInit===void 0)return;const V=D.source,Q=d.get(V);if(Q){const J=Q[M.__cacheKey];J.usedTimes--,J.usedTimes===0&&S(D),Object.keys(Q).length===0&&d.delete(V)}n.remove(D)}function S(D){const M=n.get(D);i.deleteTexture(M.__webglTexture);const V=D.source,Q=d.get(V);delete Q[M.__cacheKey],o.memory.textures--}function y(D){const M=n.get(D);if(D.depthTexture&&(D.depthTexture.dispose(),n.remove(D.depthTexture)),D.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++){if(Array.isArray(M.__webglFramebuffer[Q]))for(let J=0;J=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+s.maxTextures),I+=1,D}function F(D){const M=[];return M.push(D.wrapS),M.push(D.wrapT),M.push(D.wrapR||0),M.push(D.magFilter),M.push(D.minFilter),M.push(D.anisotropy),M.push(D.internalFormat),M.push(D.format),M.push(D.type),M.push(D.generateMipmaps),M.push(D.premultiplyAlpha),M.push(D.flipY),M.push(D.unpackAlignment),M.push(D.colorSpace),M.join()}function O(D,M){const V=n.get(D);if(D.isVideoTexture&&Re(D),D.isRenderTargetTexture===!1&&D.version>0&&V.__version!==D.version){const Q=D.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Me(V,D,M);return}}t.bindTexture(i.TEXTURE_2D,V.__webglTexture,i.TEXTURE0+M)}function B(D,M){const V=n.get(D);if(D.version>0&&V.__version!==D.version){Me(V,D,M);return}t.bindTexture(i.TEXTURE_2D_ARRAY,V.__webglTexture,i.TEXTURE0+M)}function q(D,M){const V=n.get(D);if(D.version>0&&V.__version!==D.version){Me(V,D,M);return}t.bindTexture(i.TEXTURE_3D,V.__webglTexture,i.TEXTURE0+M)}function G(D,M){const V=n.get(D);if(D.version>0&&V.__version!==D.version){ue(V,D,M);return}t.bindTexture(i.TEXTURE_CUBE_MAP,V.__webglTexture,i.TEXTURE0+M)}const Z={[Ii]:i.REPEAT,[li]:i.CLAMP_TO_EDGE,[Vr]:i.MIRRORED_REPEAT},oe={[Tt]:i.NEAREST,[Ru]:i.NEAREST_MIPMAP_NEAREST,[Us]:i.NEAREST_MIPMAP_LINEAR,[Pt]:i.LINEAR,[Ur]:i.LINEAR_MIPMAP_NEAREST,[Kn]:i.LINEAR_MIPMAP_LINEAR},fe={[rd]:i.NEVER,[hd]:i.ALWAYS,[od]:i.LESS,[Fu]:i.LEQUAL,[ad]:i.EQUAL,[ud]:i.GEQUAL,[cd]:i.GREATER,[ld]:i.NOTEQUAL};function ie(D,M){if(M.type===dn&&e.has("OES_texture_float_linear")===!1&&(M.magFilter===Pt||M.magFilter===Ur||M.magFilter===Us||M.magFilter===Kn||M.minFilter===Pt||M.minFilter===Ur||M.minFilter===Us||M.minFilter===Kn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(D,i.TEXTURE_WRAP_S,Z[M.wrapS]),i.texParameteri(D,i.TEXTURE_WRAP_T,Z[M.wrapT]),(D===i.TEXTURE_3D||D===i.TEXTURE_2D_ARRAY)&&i.texParameteri(D,i.TEXTURE_WRAP_R,Z[M.wrapR]),i.texParameteri(D,i.TEXTURE_MAG_FILTER,oe[M.magFilter]),i.texParameteri(D,i.TEXTURE_MIN_FILTER,oe[M.minFilter]),M.compareFunction&&(i.texParameteri(D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(D,i.TEXTURE_COMPARE_FUNC,fe[M.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(M.magFilter===Tt||M.minFilter!==Us&&M.minFilter!==Kn||M.type===dn&&e.has("OES_texture_float_linear")===!1)return;if(M.anisotropy>1||n.get(M).__currentAnisotropy){const V=e.get("EXT_texture_filter_anisotropic");i.texParameterf(D,V.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,s.getMaxAnisotropy())),n.get(M).__currentAnisotropy=M.anisotropy}}}function Ke(D,M){let V=!1;D.__webglInit===void 0&&(D.__webglInit=!0,M.addEventListener("dispose",w));const Q=M.source;let J=d.get(Q);J===void 0&&(J={},d.set(Q,J));const Y=F(M);if(Y!==D.__cacheKey){J[Y]===void 0&&(J[Y]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,V=!0),J[Y].usedTimes++;const Te=J[D.__cacheKey];Te!==void 0&&(J[D.__cacheKey].usedTimes--,Te.usedTimes===0&&S(M)),D.__cacheKey=Y,D.__webglTexture=J[Y].texture}return V}function K(D,M,V){return Math.floor(Math.floor(D/V)/M)}function se(D,M,V,Q){const Y=D.updateRanges;if(Y.length===0)t.texSubImage2D(i.TEXTURE_2D,0,0,0,M.width,M.height,V,Q,M.data);else{Y.sort(($,me)=>$.start-me.start);let Te=0;for(let $=1;$0){N&&he&&t.texStorage2D(i.TEXTURE_2D,xe,Ie,Oe[0].width,Oe[0].height);for(let te=0,j=Oe.length;te0){const _e=Ml(ae.width,ae.height,M.format,M.type);for(const ze of M.layerUpdates){const ht=ae.data.subarray(ze*_e/ae.data.BYTES_PER_ELEMENT,(ze+1)*_e/ae.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,te,0,0,ze,ae.width,ae.height,1,me,ht)}M.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,te,0,0,0,ae.width,ae.height,$.depth,me,ae.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,te,Ie,ae.width,ae.height,$.depth,0,ae.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else N?ee&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,te,0,0,0,ae.width,ae.height,$.depth,me,Pe,ae.data):t.texImage3D(i.TEXTURE_2D_ARRAY,te,Ie,ae.width,ae.height,$.depth,0,me,Pe,ae.data)}else{N&&he&&t.texStorage2D(i.TEXTURE_2D,xe,Ie,Oe[0].width,Oe[0].height);for(let te=0,j=Oe.length;te0){const te=Ml($.width,$.height,M.format,M.type);for(const j of M.layerUpdates){const _e=$.data.subarray(j*te/$.data.BYTES_PER_ELEMENT,(j+1)*te/$.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,j,$.width,$.height,1,me,Pe,_e)}M.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,$.width,$.height,$.depth,me,Pe,$.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Ie,$.width,$.height,$.depth,0,me,Pe,$.data);else if(M.isData3DTexture)N?(he&&t.texStorage3D(i.TEXTURE_3D,xe,Ie,$.width,$.height,$.depth),ee&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,$.width,$.height,$.depth,me,Pe,$.data)):t.texImage3D(i.TEXTURE_3D,0,Ie,$.width,$.height,$.depth,0,me,Pe,$.data);else if(M.isFramebufferTexture){if(he)if(N)t.texStorage2D(i.TEXTURE_2D,xe,Ie,$.width,$.height);else{let te=$.width,j=$.height;for(let _e=0;_e>=1,j>>=1}}else if(Oe.length>0){if(N&&he){const te=Dt(Oe[0]);t.texStorage2D(i.TEXTURE_2D,xe,Ie,te.width,te.height)}for(let te=0,j=Oe.length;te0&&xe++;const j=Dt(me[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,xe,Oe,j.width,j.height)}for(let j=0;j<6;j++)if($){N?ee&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,0,0,me[j].width,me[j].height,Ie,ae,me[j].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,Oe,me[j].width,me[j].height,0,Ie,ae,me[j].data);for(let _e=0;_e>Y),Pe=Math.max(1,M.height>>Y);J===i.TEXTURE_3D||J===i.TEXTURE_2D_ARRAY?t.texImage3D(J,Y,Ee,me,Pe,M.depth,0,Te,le,null):t.texImage2D(J,Y,Ee,me,Pe,0,Te,le,null)}t.bindFramebuffer(i.FRAMEBUFFER,D),Ze(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Q,J,$.__webglTexture,0,Se(M)):(J===i.TEXTURE_2D||J>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&J<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Q,J,$.__webglTexture,Y),t.bindFramebuffer(i.FRAMEBUFFER,null)}function et(D,M,V){if(i.bindRenderbuffer(i.RENDERBUFFER,D),M.depthBuffer){const Q=M.depthTexture,J=Q&&Q.isDepthTexture?Q.type:null,Y=A(M.stencilBuffer,J),Te=M.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,le=Se(M);Ze(M)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,le,Y,M.width,M.height):V?i.renderbufferStorageMultisample(i.RENDERBUFFER,le,Y,M.width,M.height):i.renderbufferStorage(i.RENDERBUFFER,Y,M.width,M.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Te,i.RENDERBUFFER,D)}else{const Q=M.textures;for(let J=0;J{delete M.__boundDepthTexture,delete M.__depthDisposeCallback,Q.removeEventListener("dispose",J)};Q.addEventListener("dispose",J),M.__depthDisposeCallback=J}M.__boundDepthTexture=Q}if(D.depthTexture&&!M.__autoAllocateDepthBuffer){if(V)throw new Error("target.depthTexture not supported in Cube render targets");const Q=D.texture.mipmaps;Q&&Q.length>0?Le(M.__webglFramebuffer[0],D):Le(M.__webglFramebuffer,D)}else if(V){M.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)if(t.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer[Q]),M.__webglDepthbuffer[Q]===void 0)M.__webglDepthbuffer[Q]=i.createRenderbuffer(),et(M.__webglDepthbuffer[Q],D,!1);else{const J=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Y=M.__webglDepthbuffer[Q];i.bindRenderbuffer(i.RENDERBUFFER,Y),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,Y)}}else{const Q=D.texture.mipmaps;if(Q&&Q.length>0?t.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer),M.__webglDepthbuffer===void 0)M.__webglDepthbuffer=i.createRenderbuffer(),et(M.__webglDepthbuffer,D,!1);else{const J=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Y=M.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,Y),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,Y)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function gt(D,M,V){const Q=n.get(D);M!==void 0&&be(Q.__webglFramebuffer,D,D.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),V!==void 0&&mt(D)}function tt(D){const M=D.texture,V=n.get(D),Q=n.get(M);D.addEventListener("dispose",C);const J=D.textures,Y=D.isWebGLCubeRenderTarget===!0,Te=J.length>1;if(Te||(Q.__webglTexture===void 0&&(Q.__webglTexture=i.createTexture()),Q.__version=M.version,o.memory.textures++),Y){V.__webglFramebuffer=[];for(let le=0;le<6;le++)if(M.mipmaps&&M.mipmaps.length>0){V.__webglFramebuffer[le]=[];for(let Ee=0;Ee0){V.__webglFramebuffer=[];for(let le=0;le0&&Ze(D)===!1){V.__webglMultisampledFramebuffer=i.createFramebuffer(),V.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,V.__webglMultisampledFramebuffer);for(let le=0;le0)for(let Ee=0;Ee0)for(let Ee=0;Ee0){if(Ze(D)===!1){const M=D.textures,V=D.width,Q=D.height;let J=i.COLOR_BUFFER_BIT;const Y=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Te=n.get(D),le=M.length>1;if(le)for(let we=0;we0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Te.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Te.__webglFramebuffer);for(let we=0;we0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function Re(D){const M=o.render.frame;u.get(D)!==M&&(u.set(D,M),D.update())}function ke(D,M){const V=D.colorSpace,Q=D.format,J=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||V!==Ht&&V!==Rn&&(Qe.getTransfer(V)===ct?(Q!==Zt||J!==Mt)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",V)),M}function Dt(D){return typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement?(l.width=D.naturalWidth||D.width,l.height=D.naturalHeight||D.height):typeof VideoFrame<"u"&&D instanceof VideoFrame?(l.width=D.displayWidth,l.height=D.displayHeight):(l.width=D.width,l.height=D.height),l}this.allocateTextureUnit=R,this.resetTextureUnits=k,this.setTexture2D=O,this.setTexture2DArray=B,this.setTexture3D=q,this.setTextureCube=G,this.rebindTextures=gt,this.setupRenderTarget=tt,this.updateRenderTargetMipmap=L,this.updateMultisampleRenderTarget=ut,this.setupDepthRenderbuffer=mt,this.setupFrameBufferTexture=be,this.useMultisampledRTT=Ze}function Ex(i,e){function t(n,s=Rn){let r;const o=Qe.getTransfer(s);if(n===Mt)return i.UNSIGNED_BYTE;if(n===qa)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Ka)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Pu)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===Du)return i.BYTE;if(n===Iu)return i.SHORT;if(n===Gs)return i.UNSIGNED_SHORT;if(n===Ya)return i.INT;if(n===hi)return i.UNSIGNED_INT;if(n===dn)return i.FLOAT;if(n===qs)return i.HALF_FLOAT;if(n===Lu)return i.ALPHA;if(n===Bu)return i.RGB;if(n===Zt)return i.RGBA;if(n===Vs)return i.DEPTH_COMPONENT;if(n===ls)return i.DEPTH_STENCIL;if(n===Ks)return i.RED;if(n===Qa)return i.RED_INTEGER;if(n===ja)return i.RG;if(n===Za)return i.RG_INTEGER;if(n===Ja)return i.RGBA_INTEGER;if(n===Fr||n===Or||n===zr||n===Hr)if(o===ct)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Fr)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Or)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===zr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Hr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Fr)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Or)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===zr)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Hr)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===la||n===ua||n===ha||n===da)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===la)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===ua)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ha)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===da)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===fa||n===pa||n===ma)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===fa||n===pa)return o===ct?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===ma)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ga||n===va||n===xa||n===Aa||n===_a||n===ya||n===Ma||n===Ea||n===Sa||n===Ta||n===wa||n===ba||n===Ca||n===Ra)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===ga)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===va)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===xa)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Aa)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===_a)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ya)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ma)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ea)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Sa)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ta)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===wa)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ba)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Ca)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ra)return o===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===kr||n===Da||n===Ia)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===kr)return o===ct?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Da)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Ia)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Nu||n===Pa||n===La||n===Ba)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===kr)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Pa)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===La)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Ba)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===cs?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const Sx=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Tx=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class wx{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const s=new yt,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Et({vertexShader:Sx,fragmentShader:Tx,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new zt(new jr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class bx extends Jn{constructor(e,t){super();const n=this;let s=null,r=1,o=null,a="local-floor",c=1,l=null,u=null,h=null,d=null,f=null,g=null;const v=new wx,m=t.getContextAttributes();let p=null,x=null;const _=[],A=[],b=new Ae;let w=null;const C=new Ft;C.viewport=new je;const P=new Ft;P.viewport=new je;const S=[C,P],y=new Of;let I=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let se=_[K];return se===void 0&&(se=new wo,_[K]=se),se.getTargetRaySpace()},this.getControllerGrip=function(K){let se=_[K];return se===void 0&&(se=new wo,_[K]=se),se.getGripSpace()},this.getHand=function(K){let se=_[K];return se===void 0&&(se=new wo,_[K]=se),se.getHandSpace()};function R(K){const se=A.indexOf(K.inputSource);if(se===-1)return;const Me=_[se];Me!==void 0&&(Me.update(K.inputSource,K.frame,l||o),Me.dispatchEvent({type:K.type,data:K.inputSource}))}function F(){s.removeEventListener("select",R),s.removeEventListener("selectstart",R),s.removeEventListener("selectend",R),s.removeEventListener("squeeze",R),s.removeEventListener("squeezestart",R),s.removeEventListener("squeezeend",R),s.removeEventListener("end",F),s.removeEventListener("inputsourceschange",O);for(let K=0;K<_.length;K++){const se=A[K];se!==null&&(A[K]=null,_[K].disconnect(se))}I=null,k=null,v.reset(),e.setRenderTarget(p),f=null,d=null,h=null,s=null,x=null,Ke.stop(),n.isPresenting=!1,e.setPixelRatio(w),e.setSize(b.width,b.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){r=K,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){a=K,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(K){l=K},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return h},this.getFrame=function(){return g},this.getSession=function(){return s},this.setSession=async function(K){if(s=K,s!==null){if(p=e.getRenderTarget(),s.addEventListener("select",R),s.addEventListener("selectstart",R),s.addEventListener("selectend",R),s.addEventListener("squeeze",R),s.addEventListener("squeezestart",R),s.addEventListener("squeezeend",R),s.addEventListener("end",F),s.addEventListener("inputsourceschange",O),m.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(b),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Me=null,ue=null,be=null;m.depth&&(be=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Me=m.stencil?ls:Vs,ue=m.stencil?cs:hi);const et={colorFormat:t.RGBA8,depthFormat:be,scaleFactor:r};h=new XRWebGLBinding(s,t),d=h.createProjectionLayer(et),s.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),x=new Rt(d.textureWidth,d.textureHeight,{format:Zt,type:Mt,depthTexture:new lc(d.textureWidth,d.textureHeight,ue,void 0,void 0,void 0,void 0,void 0,void 0,Me),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const Me={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(s,t,Me),s.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),x=new Rt(f.framebufferWidth,f.framebufferHeight,{format:Zt,type:Mt,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(c),l=null,o=await s.requestReferenceSpace(a),Ke.setContext(s),Ke.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return v.getDepthTexture()};function O(K){for(let se=0;se=0&&(A[ue]=null,_[ue].disconnect(Me))}for(let se=0;se=A.length){A.push(Me),ue=et;break}else if(A[et]===null){A[et]=Me,ue=et;break}if(ue===-1)break}const be=_[ue];be&&be.connect(Me)}}const B=new U,q=new U;function G(K,se,Me){B.setFromMatrixPosition(se.matrixWorld),q.setFromMatrixPosition(Me.matrixWorld);const ue=B.distanceTo(q),be=se.projectionMatrix.elements,et=Me.projectionMatrix.elements,Le=be[14]/(be[10]-1),mt=be[14]/(be[10]+1),gt=(be[9]+1)/be[5],tt=(be[9]-1)/be[5],L=(be[8]-1)/be[0],Vt=(et[8]+1)/et[0],nt=Le*L,ut=Le*Vt,Se=ue/(-L+Vt),Ze=Se*-L;if(se.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Ze),K.translateZ(Se),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert(),be[10]===-1)K.projectionMatrix.copy(se.projectionMatrix),K.projectionMatrixInverse.copy(se.projectionMatrixInverse);else{const Re=Le+Se,ke=mt+Se,Dt=nt-Ze,D=ut+(ue-Ze),M=gt*mt/ke*Re,V=tt*mt/ke*Re;K.projectionMatrix.makePerspective(Dt,D,M,V,Re,ke),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}}function Z(K,se){se===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(se.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(s===null)return;let se=K.near,Me=K.far;v.texture!==null&&(v.depthNear>0&&(se=v.depthNear),v.depthFar>0&&(Me=v.depthFar)),y.near=P.near=C.near=se,y.far=P.far=C.far=Me,(I!==y.near||k!==y.far)&&(s.updateRenderState({depthNear:y.near,depthFar:y.far}),I=y.near,k=y.far),C.layers.mask=K.layers.mask|2,P.layers.mask=K.layers.mask|4,y.layers.mask=C.layers.mask|P.layers.mask;const ue=K.parent,be=y.cameras;Z(y,ue);for(let et=0;et0&&(m.alphaTest.value=p.alphaTest);const x=e.get(p),_=x.envMap,A=x.envMapRotation;_&&(m.envMap.value=_,_i.copy(A),_i.x*=-1,_i.y*=-1,_i.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(_i.y*=-1,_i.z*=-1),m.envMapRotation.value.setFromMatrix4(Cx.makeRotationFromEuler(_i)),m.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function c(m,p,x,_){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*x,m.scale.value=_*.5,p.map&&(m.map.value=p.map,t(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function l(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function u(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function h(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function d(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function f(m,p,x){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Ot&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=x.texture,m.transmissionSamplerSize.value.set(x.width,x.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function v(m,p){const x=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(x.matrixWorld),m.nearDistance.value=x.shadow.camera.near,m.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function Dx(i,e,t,n){let s={},r={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(x,_){const A=_.program;n.uniformBlockBinding(x,A)}function l(x,_){let A=s[x.id];A===void 0&&(g(x),A=u(x),s[x.id]=A,x.addEventListener("dispose",m));const b=_.program;n.updateUBOMapping(x,b);const w=e.render.frame;r[x.id]!==w&&(d(x),r[x.id]=w)}function u(x){const _=h();x.__bindingPointIndex=_;const A=i.createBuffer(),b=x.__size,w=x.usage;return i.bindBuffer(i.UNIFORM_BUFFER,A),i.bufferData(i.UNIFORM_BUFFER,b,w),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,_,A),A}function h(){for(let x=0;x0&&(A+=b-w),x.__size=A,x.__cache={},this}function v(x){const _={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(_.boundary=4,_.storage=4):x.isVector2?(_.boundary=8,_.storage=8):x.isVector3||x.isColor?(_.boundary=16,_.storage=12):x.isVector4?(_.boundary=16,_.storage=16):x.isMatrix3?(_.boundary=48,_.storage=48):x.isMatrix4?(_.boundary=64,_.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),_}function m(x){const _=x.target;_.removeEventListener("dispose",m);const A=o.indexOf(_.__bindingPointIndex);o.splice(A,1),i.deleteBuffer(s[_.id]),delete s[_.id],delete r[_.id]}function p(){for(const x in s)i.deleteBuffer(s[x]);o=[],s={},r={}}return{bind:c,update:l,dispose:p}}class Ix{constructor(e={}){const{canvas:t=Rd(),context:n=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;const g=new Uint32Array(4),v=new Int32Array(4);let m=null,p=null;const x=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ui,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const A=this;let b=!1;this._outputColorSpace=Ve;let w=0,C=0,P=null,S=-1,y=null;const I=new je,k=new je;let R=null;const F=new Be(0);let O=0,B=t.width,q=t.height,G=1,Z=null,oe=null;const fe=new je(0,0,B,q),ie=new je(0,0,B,q);let Ke=!1;const K=new ac;let se=!1,Me=!1;const ue=new Fe,be=new Fe,et=new U,Le=new je,mt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let gt=!1;function tt(){return P===null?G:1}let L=n;function Vt(T,z){return t.getContext(T,z)}try{const T={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ms}`),t.addEventListener("webglcontextlost",xe,!1),t.addEventListener("webglcontextrestored",te,!1),t.addEventListener("webglcontextcreationerror",j,!1),L===null){const z="webgl2";if(L=Vt(z,T),L===null)throw Vt(z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(T){throw console.error("THREE.WebGLRenderer: "+T.message),T}let nt,ut,Se,Ze,Re,ke,Dt,D,M,V,Q,J,Y,Te,le,Ee,we,$,me,Pe,Ie,ae,Oe,N;function he(){nt=new kg(L),nt.init(),ae=new Ex(L,nt),ut=new Bg(L,nt,e,ae),Se=new yx(L,nt),ut.reverseDepthBuffer&&d&&Se.buffers.depth.setReversed(!0),Ze=new Wg(L),Re=new cx,ke=new Mx(L,nt,Se,Re,ut,ae,Ze),Dt=new Ug(A),D=new Hg(A),M=new jf(L),Oe=new Pg(L,M),V=new Gg(L,M,Ze,Oe),Q=new Yg(L,V,M,Ze),me=new Xg(L,ut,ke),Ee=new Ng(Re),J=new ax(A,Dt,D,nt,ut,Oe,Ee),Y=new Rx(A,Re),Te=new ux,le=new gx(nt),$=new Ig(A,Dt,D,Se,Q,f,c),we=new Ax(A,Q,ut),N=new Dx(L,Ze,ut,Se),Pe=new Lg(L,nt,Ze),Ie=new Vg(L,nt,Ze),Ze.programs=J.programs,A.capabilities=ut,A.extensions=nt,A.properties=Re,A.renderLists=Te,A.shadowMap=we,A.state=Se,A.info=Ze}he();const ee=new bx(A,L);this.xr=ee,this.getContext=function(){return L},this.getContextAttributes=function(){return L.getContextAttributes()},this.forceContextLoss=function(){const T=nt.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){const T=nt.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return G},this.setPixelRatio=function(T){T!==void 0&&(G=T,this.setSize(B,q,!1))},this.getSize=function(T){return T.set(B,q)},this.setSize=function(T,z,W=!0){if(ee.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=T,q=z,t.width=Math.floor(T*G),t.height=Math.floor(z*G),W===!0&&(t.style.width=T+"px",t.style.height=z+"px"),this.setViewport(0,0,T,z)},this.getDrawingBufferSize=function(T){return T.set(B*G,q*G).floor()},this.setDrawingBufferSize=function(T,z,W){B=T,q=z,G=W,t.width=Math.floor(T*W),t.height=Math.floor(z*W),this.setViewport(0,0,T,z)},this.getCurrentViewport=function(T){return T.copy(I)},this.getViewport=function(T){return T.copy(fe)},this.setViewport=function(T,z,W,X){T.isVector4?fe.set(T.x,T.y,T.z,T.w):fe.set(T,z,W,X),Se.viewport(I.copy(fe).multiplyScalar(G).round())},this.getScissor=function(T){return T.copy(ie)},this.setScissor=function(T,z,W,X){T.isVector4?ie.set(T.x,T.y,T.z,T.w):ie.set(T,z,W,X),Se.scissor(k.copy(ie).multiplyScalar(G).round())},this.getScissorTest=function(){return Ke},this.setScissorTest=function(T){Se.setScissorTest(Ke=T)},this.setOpaqueSort=function(T){Z=T},this.setTransparentSort=function(T){oe=T},this.getClearColor=function(T){return T.copy($.getClearColor())},this.setClearColor=function(){$.setClearColor(...arguments)},this.getClearAlpha=function(){return $.getClearAlpha()},this.setClearAlpha=function(){$.setClearAlpha(...arguments)},this.clear=function(T=!0,z=!0,W=!0){let X=0;if(T){let H=!1;if(P!==null){const ne=P.texture.format;H=ne===Ja||ne===Za||ne===Qa}if(H){const ne=P.texture.type,de=ne===Mt||ne===hi||ne===Gs||ne===cs||ne===qa||ne===Ka,ye=$.getClearColor(),ge=$.getClearAlpha(),Ne=ye.r,Ue=ye.g,Ce=ye.b;de?(g[0]=Ne,g[1]=Ue,g[2]=Ce,g[3]=ge,L.clearBufferuiv(L.COLOR,0,g)):(v[0]=Ne,v[1]=Ue,v[2]=Ce,v[3]=ge,L.clearBufferiv(L.COLOR,0,v))}else X|=L.COLOR_BUFFER_BIT}z&&(X|=L.DEPTH_BUFFER_BIT),W&&(X|=L.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),L.clear(X)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",xe,!1),t.removeEventListener("webglcontextrestored",te,!1),t.removeEventListener("webglcontextcreationerror",j,!1),$.dispose(),Te.dispose(),le.dispose(),Re.dispose(),Dt.dispose(),D.dispose(),Q.dispose(),Oe.dispose(),N.dispose(),J.dispose(),ee.dispose(),ee.removeEventListener("sessionstart",yc),ee.removeEventListener("sessionend",Mc),fi.stop()};function xe(T){T.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function te(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const T=Ze.autoReset,z=we.enabled,W=we.autoUpdate,X=we.needsUpdate,H=we.type;he(),Ze.autoReset=T,we.enabled=z,we.autoUpdate=W,we.needsUpdate=X,we.type=H}function j(T){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",T.statusMessage)}function _e(T){const z=T.target;z.removeEventListener("dispose",_e),ze(z)}function ze(T){ht(T),Re.remove(T)}function ht(T){const z=Re.get(T).programs;z!==void 0&&(z.forEach(function(W){J.releaseProgram(W)}),T.isShaderMaterial&&J.releaseShaderCache(T))}this.renderBufferDirect=function(T,z,W,X,H,ne){z===null&&(z=mt);const de=H.isMesh&&H.matrixWorld.determinant()<0,ye=_h(T,z,W,X,H);Se.setMaterial(X,de);let ge=W.index,Ne=1;if(X.wireframe===!0){if(ge=V.getWireframeAttribute(W),ge===void 0)return;Ne=2}const Ue=W.drawRange,Ce=W.attributes.position;let qe=Ue.start*Ne,at=(Ue.start+Ue.count)*Ne;ne!==null&&(qe=Math.max(qe,ne.start*Ne),at=Math.min(at,(ne.start+ne.count)*Ne)),ge!==null?(qe=Math.max(qe,0),at=Math.min(at,ge.count)):Ce!=null&&(qe=Math.max(qe,0),at=Math.min(at,Ce.count));const At=at-qe;if(At<0||At===1/0)return;Oe.setup(H,X,ye,W,ge);let dt,lt=Pe;if(ge!==null&&(dt=M.get(ge),lt=Ie,lt.setIndex(dt)),H.isMesh)X.wireframe===!0?(Se.setLineWidth(X.wireframeLinewidth*tt()),lt.setMode(L.LINES)):lt.setMode(L.TRIANGLES);else if(H.isLine){let De=X.linewidth;De===void 0&&(De=1),Se.setLineWidth(De*tt()),H.isLineSegments?lt.setMode(L.LINES):H.isLineLoop?lt.setMode(L.LINE_LOOP):lt.setMode(L.LINE_STRIP)}else H.isPoints?lt.setMode(L.POINTS):H.isSprite&<.setMode(L.TRIANGLES);if(H.isBatchedMesh)if(H._multiDrawInstances!==null)ts("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),lt.renderMultiDrawInstances(H._multiDrawStarts,H._multiDrawCounts,H._multiDrawCount,H._multiDrawInstances);else if(nt.get("WEBGL_multi_draw"))lt.renderMultiDraw(H._multiDrawStarts,H._multiDrawCounts,H._multiDrawCount);else{const De=H._multiDrawStarts,vt=H._multiDrawCounts,Je=H._multiDrawCount,en=ge?M.get(ge).bytesPerElement:1,Pi=Re.get(X).currentProgram.getUniforms();for(let tn=0;tn{function ne(){if(X.forEach(function(de){Re.get(de).currentProgram.isReady()&&X.delete(de)}),X.size===0){H(T);return}setTimeout(ne,10)}nt.get("KHR_parallel_shader_compile")!==null?ne():setTimeout(ne,10)})};let fn=null;function Bn(T){fn&&fn(T)}function yc(){fi.stop()}function Mc(){fi.start()}const fi=new Ju;fi.setAnimationLoop(Bn),typeof self<"u"&&fi.setContext(self),this.setAnimationLoop=function(T){fn=T,ee.setAnimationLoop(T),T===null?fi.stop():fi.start()},ee.addEventListener("sessionstart",yc),ee.addEventListener("sessionend",Mc),this.render=function(T,z){if(z!==void 0&&z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;if(T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),ee.enabled===!0&&ee.isPresenting===!0&&(ee.cameraAutoUpdate===!0&&ee.updateCamera(z),z=ee.getCamera()),T.isScene===!0&&T.onBeforeRender(A,T,z,P),p=le.get(T,_.length),p.init(z),_.push(p),be.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),K.setFromProjectionMatrix(be),Me=this.localClippingEnabled,se=Ee.init(this.clippingPlanes,Me),m=Te.get(T,x.length),m.init(),x.push(m),ee.enabled===!0&&ee.isPresenting===!0){const ne=A.xr.getDepthSensingMesh();ne!==null&&no(ne,z,-1/0,A.sortObjects)}no(T,z,0,A.sortObjects),m.finish(),A.sortObjects===!0&&m.sort(Z,oe),gt=ee.enabled===!1||ee.isPresenting===!1||ee.hasDepthSensing()===!1,gt&&$.addToRenderList(m,T),this.info.render.frame++,se===!0&&Ee.beginShadows();const W=p.state.shadowsArray;we.render(W,T,z),se===!0&&Ee.endShadows(),this.info.autoReset===!0&&this.info.reset();const X=m.opaque,H=m.transmissive;if(p.setupLights(),z.isArrayCamera){const ne=z.cameras;if(H.length>0)for(let de=0,ye=ne.length;de0&&Sc(X,H,T,z),gt&&$.render(T),Ec(m,T,z);P!==null&&C===0&&(ke.updateMultisampleRenderTarget(P),ke.updateRenderTargetMipmap(P)),T.isScene===!0&&T.onAfterRender(A,T,z),Oe.resetDefaultState(),S=-1,y=null,_.pop(),_.length>0?(p=_[_.length-1],se===!0&&Ee.setGlobalState(A.clippingPlanes,p.state.camera)):p=null,x.pop(),x.length>0?m=x[x.length-1]:m=null};function no(T,z,W,X){if(T.visible===!1)return;if(T.layers.test(z.layers)){if(T.isGroup)W=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(z);else if(T.isLight)p.pushLight(T),T.castShadow&&p.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||K.intersectsSprite(T)){X&&Le.setFromMatrixPosition(T.matrixWorld).applyMatrix4(be);const de=Q.update(T),ye=T.material;ye.visible&&m.push(T,de,ye,W,Le.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||K.intersectsObject(T))){const de=Q.update(T),ye=T.material;if(X&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),Le.copy(T.boundingSphere.center)):(de.boundingSphere===null&&de.computeBoundingSphere(),Le.copy(de.boundingSphere.center)),Le.applyMatrix4(T.matrixWorld).applyMatrix4(be)),Array.isArray(ye)){const ge=de.groups;for(let Ne=0,Ue=ge.length;Ne0&&tr(H,z,W),ne.length>0&&tr(ne,z,W),de.length>0&&tr(de,z,W),Se.buffers.depth.setTest(!0),Se.buffers.depth.setMask(!0),Se.buffers.color.setMask(!0),Se.setPolygonOffset(!1)}function Sc(T,z,W,X){if((W.isScene===!0?W.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[X.id]===void 0&&(p.state.transmissionRenderTarget[X.id]=new Rt(1,1,{generateMipmaps:!0,type:nt.has("EXT_color_buffer_half_float")||nt.has("EXT_color_buffer_float")?qs:Mt,minFilter:Kn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Qe.workingColorSpace}));const ne=p.state.transmissionRenderTarget[X.id],de=X.viewport||I;ne.setSize(de.z*A.transmissionResolutionScale,de.w*A.transmissionResolutionScale);const ye=A.getRenderTarget(),ge=A.getActiveCubeFace(),Ne=A.getActiveMipmapLevel();A.setRenderTarget(ne),A.getClearColor(F),O=A.getClearAlpha(),O<1&&A.setClearColor(16777215,.5),A.clear(),gt&&$.render(W);const Ue=A.toneMapping;A.toneMapping=ui;const Ce=X.viewport;if(X.viewport!==void 0&&(X.viewport=void 0),p.setupLightsView(X),se===!0&&Ee.setGlobalState(A.clippingPlanes,X),tr(T,W,X),ke.updateMultisampleRenderTarget(ne),ke.updateRenderTargetMipmap(ne),nt.has("WEBGL_multisampled_render_to_texture")===!1){let qe=!1;for(let at=0,At=z.length;at0),Ce=!!W.morphAttributes.position,qe=!!W.morphAttributes.normal,at=!!W.morphAttributes.color;let At=ui;X.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(At=A.toneMapping);const dt=W.morphAttributes.position||W.morphAttributes.normal||W.morphAttributes.color,lt=dt!==void 0?dt.length:0,De=Re.get(X),vt=p.state.lights;if(se===!0&&(Me===!0||T!==y)){const Wt=T===y&&X.id===S;Ee.setState(X,T,Wt)}let Je=!1;X.version===De.__version?(De.needsLights&&De.lightsStateVersion!==vt.state.version||De.outputColorSpace!==ye||H.isBatchedMesh&&De.batching===!1||!H.isBatchedMesh&&De.batching===!0||H.isBatchedMesh&&De.batchingColor===!0&&H.colorTexture===null||H.isBatchedMesh&&De.batchingColor===!1&&H.colorTexture!==null||H.isInstancedMesh&&De.instancing===!1||!H.isInstancedMesh&&De.instancing===!0||H.isSkinnedMesh&&De.skinning===!1||!H.isSkinnedMesh&&De.skinning===!0||H.isInstancedMesh&&De.instancingColor===!0&&H.instanceColor===null||H.isInstancedMesh&&De.instancingColor===!1&&H.instanceColor!==null||H.isInstancedMesh&&De.instancingMorph===!0&&H.morphTexture===null||H.isInstancedMesh&&De.instancingMorph===!1&&H.morphTexture!==null||De.envMap!==ge||X.fog===!0&&De.fog!==ne||De.numClippingPlanes!==void 0&&(De.numClippingPlanes!==Ee.numPlanes||De.numIntersection!==Ee.numIntersection)||De.vertexAlphas!==Ne||De.vertexTangents!==Ue||De.morphTargets!==Ce||De.morphNormals!==qe||De.morphColors!==at||De.toneMapping!==At||De.morphTargetsCount!==lt)&&(Je=!0):(Je=!0,De.__version=X.version);let en=De.currentProgram;Je===!0&&(en=nr(X,z,H));let Pi=!1,tn=!1,ys=!1;const pt=en.getUniforms(),cn=De.uniforms;if(Se.useProgram(en.program)&&(Pi=!0,tn=!0,ys=!0),X.id!==S&&(S=X.id,tn=!0),Pi||y!==T){Se.buffers.depth.getReversed()?(ue.copy(T.projectionMatrix),Id(ue),Pd(ue),pt.setValue(L,"projectionMatrix",ue)):pt.setValue(L,"projectionMatrix",T.projectionMatrix),pt.setValue(L,"viewMatrix",T.matrixWorldInverse);const Kt=pt.map.cameraPosition;Kt!==void 0&&Kt.setValue(L,et.setFromMatrixPosition(T.matrixWorld)),ut.logarithmicDepthBuffer&&pt.setValue(L,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(X.isMeshPhongMaterial||X.isMeshToonMaterial||X.isMeshLambertMaterial||X.isMeshBasicMaterial||X.isMeshStandardMaterial||X.isShaderMaterial)&&pt.setValue(L,"isOrthographic",T.isOrthographicCamera===!0),y!==T&&(y=T,tn=!0,ys=!0)}if(H.isSkinnedMesh){pt.setOptional(L,H,"bindMatrix"),pt.setOptional(L,H,"bindMatrixInverse");const Wt=H.skeleton;Wt&&(Wt.boneTexture===null&&Wt.computeBoneTexture(),pt.setValue(L,"boneTexture",Wt.boneTexture,ke))}H.isBatchedMesh&&(pt.setOptional(L,H,"batchingTexture"),pt.setValue(L,"batchingTexture",H._matricesTexture,ke),pt.setOptional(L,H,"batchingIdTexture"),pt.setValue(L,"batchingIdTexture",H._indirectTexture,ke),pt.setOptional(L,H,"batchingColorTexture"),H._colorsTexture!==null&&pt.setValue(L,"batchingColorTexture",H._colorsTexture,ke));const ln=W.morphAttributes;if((ln.position!==void 0||ln.normal!==void 0||ln.color!==void 0)&&me.update(H,W,en),(tn||De.receiveShadow!==H.receiveShadow)&&(De.receiveShadow=H.receiveShadow,pt.setValue(L,"receiveShadow",H.receiveShadow)),X.isMeshGouraudMaterial&&X.envMap!==null&&(cn.envMap.value=ge,cn.flipEnvMap.value=ge.isCubeTexture&&ge.isRenderTargetTexture===!1?-1:1),X.isMeshStandardMaterial&&X.envMap===null&&z.environment!==null&&(cn.envMapIntensity.value=z.environmentIntensity),tn&&(pt.setValue(L,"toneMappingExposure",A.toneMappingExposure),De.needsLights&&yh(cn,ys),ne&&X.fog===!0&&Y.refreshFogUniforms(cn,ne),Y.refreshMaterialUniforms(cn,X,G,q,p.state.transmissionRenderTarget[T.id]),Gr.upload(L,wc(De),cn,ke)),X.isShaderMaterial&&X.uniformsNeedUpdate===!0&&(Gr.upload(L,wc(De),cn,ke),X.uniformsNeedUpdate=!1),X.isSpriteMaterial&&pt.setValue(L,"center",H.center),pt.setValue(L,"modelViewMatrix",H.modelViewMatrix),pt.setValue(L,"normalMatrix",H.normalMatrix),pt.setValue(L,"modelMatrix",H.matrixWorld),X.isShaderMaterial||X.isRawShaderMaterial){const Wt=X.uniformsGroups;for(let Kt=0,io=Wt.length;Kt0&&ke.useMultisampledRTT(T)===!1?H=Re.get(T).__webglMultisampledFramebuffer:Array.isArray(Ue)?H=Ue[W]:H=Ue,I.copy(T.viewport),k.copy(T.scissor),R=T.scissorTest}else I.copy(fe).multiplyScalar(G).floor(),k.copy(ie).multiplyScalar(G).floor(),R=Ke;if(W!==0&&(H=Eh),Se.bindFramebuffer(L.FRAMEBUFFER,H)&&X&&Se.drawBuffers(T,H),Se.viewport(I),Se.scissor(k),Se.setScissorTest(R),ne){const ge=Re.get(T.texture);L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_CUBE_MAP_POSITIVE_X+z,ge.__webglTexture,W)}else if(de){const ge=Re.get(T.texture),Ne=z;L.framebufferTextureLayer(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,ge.__webglTexture,W,Ne)}else if(T!==null&&W!==0){const ge=Re.get(T.texture);L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,ge.__webglTexture,W)}S=-1},this.readRenderTargetPixels=function(T,z,W,X,H,ne,de,ye=0){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Re.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&de!==void 0&&(ge=ge[de]),ge){Se.bindFramebuffer(L.FRAMEBUFFER,ge);try{const Ne=T.textures[ye],Ue=Ne.format,Ce=Ne.type;if(!ut.textureFormatReadable(Ue)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ut.textureTypeReadable(Ce)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=T.width-X&&W>=0&&W<=T.height-H&&(T.textures.length>1&&L.readBuffer(L.COLOR_ATTACHMENT0+ye),L.readPixels(z,W,X,H,ae.convert(Ue),ae.convert(Ce),ne))}finally{const Ne=P!==null?Re.get(P).__webglFramebuffer:null;Se.bindFramebuffer(L.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(T,z,W,X,H,ne,de,ye=0){if(!(T&&T.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ge=Re.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&de!==void 0&&(ge=ge[de]),ge)if(z>=0&&z<=T.width-X&&W>=0&&W<=T.height-H){Se.bindFramebuffer(L.FRAMEBUFFER,ge);const Ne=T.textures[ye],Ue=Ne.format,Ce=Ne.type;if(!ut.textureFormatReadable(Ue))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ut.textureTypeReadable(Ce))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const qe=L.createBuffer();L.bindBuffer(L.PIXEL_PACK_BUFFER,qe),L.bufferData(L.PIXEL_PACK_BUFFER,ne.byteLength,L.STREAM_READ),T.textures.length>1&&L.readBuffer(L.COLOR_ATTACHMENT0+ye),L.readPixels(z,W,X,H,ae.convert(Ue),ae.convert(Ce),0);const at=P!==null?Re.get(P).__webglFramebuffer:null;Se.bindFramebuffer(L.FRAMEBUFFER,at);const At=L.fenceSync(L.SYNC_GPU_COMMANDS_COMPLETE,0);return L.flush(),await Dd(L,At,4),L.bindBuffer(L.PIXEL_PACK_BUFFER,qe),L.getBufferSubData(L.PIXEL_PACK_BUFFER,0,ne),L.deleteBuffer(qe),L.deleteSync(At),ne}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(T,z=null,W=0){const X=Math.pow(2,-W),H=Math.floor(T.image.width*X),ne=Math.floor(T.image.height*X),de=z!==null?z.x:0,ye=z!==null?z.y:0;ke.setTexture2D(T,0),L.copyTexSubImage2D(L.TEXTURE_2D,W,0,0,de,ye,H,ne),Se.unbindTexture()};const Sh=L.createFramebuffer(),Th=L.createFramebuffer();this.copyTextureToTexture=function(T,z,W=null,X=null,H=0,ne=null){ne===null&&(H!==0?(ts("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ne=H,H=0):ne=0);let de,ye,ge,Ne,Ue,Ce,qe,at,At;const dt=T.isCompressedTexture?T.mipmaps[ne]:T.image;if(W!==null)de=W.max.x-W.min.x,ye=W.max.y-W.min.y,ge=W.isBox3?W.max.z-W.min.z:1,Ne=W.min.x,Ue=W.min.y,Ce=W.isBox3?W.min.z:0;else{const ln=Math.pow(2,-H);de=Math.floor(dt.width*ln),ye=Math.floor(dt.height*ln),T.isDataArrayTexture?ge=dt.depth:T.isData3DTexture?ge=Math.floor(dt.depth*ln):ge=1,Ne=0,Ue=0,Ce=0}X!==null?(qe=X.x,at=X.y,At=X.z):(qe=0,at=0,At=0);const lt=ae.convert(z.format),De=ae.convert(z.type);let vt;z.isData3DTexture?(ke.setTexture3D(z,0),vt=L.TEXTURE_3D):z.isDataArrayTexture||z.isCompressedArrayTexture?(ke.setTexture2DArray(z,0),vt=L.TEXTURE_2D_ARRAY):(ke.setTexture2D(z,0),vt=L.TEXTURE_2D),L.pixelStorei(L.UNPACK_FLIP_Y_WEBGL,z.flipY),L.pixelStorei(L.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z.premultiplyAlpha),L.pixelStorei(L.UNPACK_ALIGNMENT,z.unpackAlignment);const Je=L.getParameter(L.UNPACK_ROW_LENGTH),en=L.getParameter(L.UNPACK_IMAGE_HEIGHT),Pi=L.getParameter(L.UNPACK_SKIP_PIXELS),tn=L.getParameter(L.UNPACK_SKIP_ROWS),ys=L.getParameter(L.UNPACK_SKIP_IMAGES);L.pixelStorei(L.UNPACK_ROW_LENGTH,dt.width),L.pixelStorei(L.UNPACK_IMAGE_HEIGHT,dt.height),L.pixelStorei(L.UNPACK_SKIP_PIXELS,Ne),L.pixelStorei(L.UNPACK_SKIP_ROWS,Ue),L.pixelStorei(L.UNPACK_SKIP_IMAGES,Ce);const pt=T.isDataArrayTexture||T.isData3DTexture,cn=z.isDataArrayTexture||z.isData3DTexture;if(T.isDepthTexture){const ln=Re.get(T),Wt=Re.get(z),Kt=Re.get(ln.__renderTarget),io=Re.get(Wt.__renderTarget);Se.bindFramebuffer(L.READ_FRAMEBUFFER,Kt.__webglFramebuffer),Se.bindFramebuffer(L.DRAW_FRAMEBUFFER,io.__webglFramebuffer);for(let pi=0;pi0){const r=1/s;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return s}unit(e){e===void 0&&(e=new E);const t=this.x,n=this.y,s=this.z;let r=Math.sqrt(t*t+n*n+s*s);return r>0?(r=1/r,e.x=t*r,e.y=n*r,e.z=s*r):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,n=this.z;return Math.sqrt(e*e+t*t+n*n)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,n=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-n)*(o-n)+(a-s)*(a-s))}distanceSquared(e){const t=this.x,n=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-n)*(o-n)+(a-s)*(a-s)}scale(e,t){t===void 0&&(t=new E);const n=this.x,s=this.y,r=this.z;return t.x=e*n,t.y=e*s,t.z=e*r,t}vmul(e,t){return t===void 0&&(t=new E),t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,n){return n===void 0&&(n=new E),n.x=this.x+e*t.x,n.y=this.y+e*t.y,n.z=this.z+e*t.z,n}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e){return e===void 0&&(e=new E),e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const n=this.length();if(n>0){const s=Lx,r=1/n;s.set(this.x*r,this.y*r,this.z*r);const o=Bx;Math.abs(s.x)<.9?(o.set(1,0,0),s.cross(o,e)):(o.set(0,1,0),s.cross(o,e)),s.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,n){const s=this.x,r=this.y,o=this.z;n.x=s+(e.x-s)*t,n.y=r+(e.y-r)*t,n.z=o+(e.z-o)*t}almostEquals(e,t){return t===void 0&&(t=1e-6),!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e){return e===void 0&&(e=1e-6),!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(ql),ql.almostEquals(e,t)}clone(){return new E(this.x,this.y,this.z)}}E.ZERO=new E(0,0,0);E.UNIT_X=new E(1,0,0);E.UNIT_Y=new E(0,1,0);E.UNIT_Z=new E(0,0,1);const Lx=new E,Bx=new E,ql=new E;class an{constructor(e){e===void 0&&(e={}),this.lowerBound=new E,this.upperBound=new E,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,n,s){const r=this.lowerBound,o=this.upperBound,a=n;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(let c=1;co.x&&(o.x=l.x),l.xo.y&&(o.y=l.y),l.yo.z&&(o.z=l.z),l.z=r.x&&t.y<=s.y&&n.y>=r.y&&t.z<=s.z&&n.z>=r.z}getCorners(e,t,n,s,r,o,a,c){const l=this.lowerBound,u=this.upperBound;e.copy(l),t.set(u.x,l.y,l.z),n.set(u.x,u.y,l.z),s.set(l.x,u.y,u.z),r.set(u.x,l.y,u.z),o.set(l.x,u.y,l.z),a.set(l.x,l.y,u.z),c.copy(u)}toLocalFrame(e,t){const n=Ql,s=n[0],r=n[1],o=n[2],a=n[3],c=n[4],l=n[5],u=n[6],h=n[7];this.getCorners(s,r,o,a,c,l,u,h);for(let d=0;d!==8;d++){const f=n[d];e.pointToLocal(f,f)}return t.setFromPoints(n)}toWorldFrame(e,t){const n=Ql,s=n[0],r=n[1],o=n[2],a=n[3],c=n[4],l=n[5],u=n[6],h=n[7];this.getCorners(s,r,o,a,c,l,u,h);for(let d=0;d!==8;d++){const f=n[d];e.pointToWorld(f,f)}return t.setFromPoints(n)}overlapsRay(e){const{direction:t,from:n}=e,s=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-n.x)*s,c=(this.upperBound.x-n.x)*s,l=(this.lowerBound.y-n.y)*r,u=(this.upperBound.y-n.y)*r,h=(this.lowerBound.z-n.z)*o,d=(this.upperBound.z-n.z)*o,f=Math.max(Math.max(Math.min(a,c),Math.min(l,u)),Math.min(h,d)),g=Math.min(Math.min(Math.max(a,c),Math.max(l,u)),Math.max(h,d));return!(g<0||f>g)}}const Kl=new E,Ql=[new E,new E,new E,new E,new E,new E,new E,new E];class jl{constructor(){this.matrix=[]}get(e,t){let{index:n}=e,{index:s}=t;if(s>n){const r=s;s=n,n=r}return this.matrix[(n*(n+1)>>1)+s-1]}set(e,t,n){let{index:s}=e,{index:r}=t;if(r>s){const o=r;r=s,s=o}this.matrix[(s*(s+1)>>1)+r-1]=n?1:0}reset(){for(let e=0,t=this.matrix.length;e!==t;e++)this.matrix[e]=0}setNumObjects(e){this.matrix.length=e*(e-1)>>1}}class ih{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;return n[e]===void 0&&(n[e]=[]),n[e].includes(t)||n[e].push(t),this}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return!!(n[e]!==void 0&&n[e].includes(t))}hasAnyEventListener(e){return this._listeners===void 0?!1:this._listeners[e]!==void 0}removeEventListener(e,t){if(this._listeners===void 0)return this;const n=this._listeners;if(n[e]===void 0)return this;const s=n[e].indexOf(t);return s!==-1&&n[e].splice(s,1),this}dispatchEvent(e){if(this._listeners===void 0)return this;const n=this._listeners[e.type];if(n!==void 0){e.target=this;for(let s=0,r=n.length;s.499&&(n=2*Math.atan2(o,l),s=Math.PI/2,r=0),u<-.499&&(n=-2*Math.atan2(o,l),s=-Math.PI/2,r=0),n===void 0){const h=o*o,d=a*a,f=c*c;n=Math.atan2(2*a*l-2*o*c,1-2*d-2*f),s=Math.asin(2*u),r=Math.atan2(2*o*l-2*a*c,1-2*h-2*f)}break;default:throw new Error(`Euler order ${t} not supported yet.`)}e.y=n,e.z=s,e.x=r}setFromEuler(e,t,n,s){s===void 0&&(s="XYZ");const r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(n/2),c=Math.sin(e/2),l=Math.sin(t/2),u=Math.sin(n/2);return s==="XYZ"?(this.x=c*o*a+r*l*u,this.y=r*l*a-c*o*u,this.z=r*o*u+c*l*a,this.w=r*o*a-c*l*u):s==="YXZ"?(this.x=c*o*a+r*l*u,this.y=r*l*a-c*o*u,this.z=r*o*u-c*l*a,this.w=r*o*a+c*l*u):s==="ZXY"?(this.x=c*o*a-r*l*u,this.y=r*l*a+c*o*u,this.z=r*o*u+c*l*a,this.w=r*o*a-c*l*u):s==="ZYX"?(this.x=c*o*a-r*l*u,this.y=r*l*a+c*o*u,this.z=r*o*u-c*l*a,this.w=r*o*a+c*l*u):s==="YZX"?(this.x=c*o*a+r*l*u,this.y=r*l*a+c*o*u,this.z=r*o*u-c*l*a,this.w=r*o*a-c*l*u):s==="XZY"&&(this.x=c*o*a-r*l*u,this.y=r*l*a-c*o*u,this.z=r*o*u+c*l*a,this.w=r*o*a+c*l*u),this}clone(){return new Ct(this.x,this.y,this.z,this.w)}slerp(e,t,n){n===void 0&&(n=new Ct);const s=this.x,r=this.y,o=this.z,a=this.w;let c=e.x,l=e.y,u=e.z,h=e.w,d,f,g,v,m;return f=s*c+r*l+o*u+a*h,f<0&&(f=-f,c=-c,l=-l,u=-u,h=-h),1-f>1e-6?(d=Math.acos(f),g=Math.sin(d),v=Math.sin((1-t)*d)/g,m=Math.sin(t*d)/g):(v=1-t,m=t),n.x=v*s+m*c,n.y=v*r+m*l,n.z=v*o+m*u,n.w=v*a+m*h,n}integrate(e,t,n,s){s===void 0&&(s=new Ct);const r=e.x*n.x,o=e.y*n.y,a=e.z*n.z,c=this.x,l=this.y,u=this.z,h=this.w,d=t*.5;return s.x+=d*(r*h+o*u-a*l),s.y+=d*(o*h+a*c-r*u),s.z+=d*(a*h+r*l-o*c),s.w+=d*(-r*c-o*l-a*u),s}}const Nx=new E,Ux=new E,Fx={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class ve{constructor(e){e===void 0&&(e={}),this.id=ve.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(e,t){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(e,t,n,s){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}ve.idCounter=0;ve.types=Fx;class it{constructor(e){e===void 0&&(e={}),this.position=new E,this.quaternion=new Ct,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return it.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return it.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t){return t===void 0&&(t=new E),this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,n,s){return s===void 0&&(s=new E),n.vsub(e,s),t.conjugate(Zl),Zl.vmult(s,s),s}static pointToWorldFrame(e,t,n,s){return s===void 0&&(s=new E),t.vmult(n,s),s.vadd(e,s),s}static vectorToWorldFrame(e,t,n){return n===void 0&&(n=new E),e.vmult(t,n),n}static vectorToLocalFrame(e,t,n,s){return s===void 0&&(s=new E),t.w*=-1,t.vmult(n,s),t.w*=-1,s}}const Zl=new Ct;class is extends ve{constructor(e){e===void 0&&(e={});const{vertices:t=[],faces:n=[],normals:s=[],axes:r,boundingSphereRadius:o}=e;super({type:ve.types.CONVEXPOLYHEDRON}),this.vertices=t,this.faces=n,this.faceNormals=s,this.faceNormals.length===0&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,n=this.uniqueEdges;n.length=0;const s=new E;for(let r=0;r!==e.length;r++){const o=e[r],a=o.length;for(let c=0;c!==a;c++){const l=(c+1)%a;t[o[c]].vsub(t[o[l]],s),s.normalize();let u=!1;for(let h=0;h!==n.length;h++)if(n[h].almostEquals(s)||n[h].almostEquals(s)){u=!0;break}u||n.push(s.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ed&&(d=v,h=g)}const f=[];for(let g=0;g=0&&this.clipFaceAgainstHull(o,e,t,f,a,c,l)}findSeparatingAxis(e,t,n,s,r,o,a,c){const l=new E,u=new E,h=new E,d=new E,f=new E,g=new E;let v=Number.MAX_VALUE;const m=this;if(m.uniqueAxes)for(let p=0;p!==m.uniqueAxes.length;p++){n.vmult(m.uniqueAxes[p],l);const x=m.testSepAxis(l,e,t,n,s,r);if(x===!1)return!1;x0&&o.negate(o),!0}testSepAxis(e,t,n,s,r,o){const a=this;is.project(a,e,n,s,Ho),is.project(t,e,r,o,ko);const c=Ho[0],l=Ho[1],u=ko[0],h=ko[1];if(ct.x&&(t.x=r.x),r.yt.y&&(t.y=r.y),r.zt.z&&(t.z=r.z)}}computeWorldFaceNormals(e){const t=this.faceNormals.length;for(;this.worldFaceNormals.lengthe&&(e=s)}this.boundingSphereRadius=Math.sqrt(e)}calculateWorldAABB(e,t,n,s){const r=this.vertices;let o,a,c,l,u,h,d=new E;for(let f=0;fl)&&(l=g.x),(a===void 0||g.yu)&&(u=g.y),(c===void 0||g.zh)&&(h=g.z)}n.set(o,a,c),s.set(l,u,h)}volume(){return 4*Math.PI*this.boundingSphereRadius/3}getAveragePointLocal(e){e===void 0&&(e=new E);const t=this.vertices;for(let n=0;n0||u>0&&d<0)return!1}return-1}static project(e,t,n,s,r){const o=e.vertices.length,a=Ox;let c=0,l=0;const u=zx,h=e.vertices;u.setZero(),it.vectorToLocalFrame(n,s,t,a),it.pointToLocalFrame(n,s,u,u);const d=u.dot(a);l=c=h[0].dot(a);for(let f=1;fc&&(c=g),gc){const f=l;l=c,c=f}r[0]=c,r[1]=l}}const Ho=[],ko=[];new E;const Ox=new E,zx=new E;class $r extends ve{constructor(e){super({type:ve.types.BOX}),this.halfExtents=e,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}updateConvexPolyhedronRepresentation(){const e=this.halfExtents.x,t=this.halfExtents.y,n=this.halfExtents.z,s=E,r=[new s(-e,-t,-n),new s(e,-t,-n),new s(e,t,-n),new s(-e,t,-n),new s(-e,-t,n),new s(e,-t,n),new s(e,t,n),new s(-e,t,n)],o=[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],a=[new s(0,0,1),new s(0,1,0),new s(1,0,0)],c=new is({vertices:r,faces:o,axes:a});this.convexPolyhedronRepresentation=c,c.material=this.material}calculateLocalInertia(e,t){return t===void 0&&(t=new E),$r.calculateInertia(this.halfExtents,e,t),t}static calculateInertia(e,t,n){const s=e;n.x=1/12*t*(2*s.y*2*s.y+2*s.z*2*s.z),n.y=1/12*t*(2*s.x*2*s.x+2*s.z*2*s.z),n.z=1/12*t*(2*s.y*2*s.y+2*s.x*2*s.x)}getSideNormals(e,t){const n=e,s=this.halfExtents;if(n[0].set(s.x,0,0),n[1].set(0,s.y,0),n[2].set(0,0,s.z),n[3].set(-s.x,0,0),n[4].set(0,-s.y,0),n[5].set(0,0,-s.z),t!==void 0)for(let r=0;r!==n.length;r++)t.vmult(n[r],n[r]);return n}volume(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z}updateBoundingSphereRadius(){this.boundingSphereRadius=this.halfExtents.length()}forEachWorldCorner(e,t,n){const s=this.halfExtents,r=[[s.x,s.y,s.z],[-s.x,s.y,s.z],[-s.x,-s.y,s.z],[-s.x,-s.y,-s.z],[s.x,-s.y,-s.z],[s.x,s.y,-s.z],[-s.x,s.y,-s.z],[s.x,-s.y,s.z]];for(let o=0;os.x&&(s.x=l),u>s.y&&(s.y=u),h>s.z&&(s.z=h),l0?1/t:0,this.material=e.material||null,this.linearDamping=typeof e.linearDamping=="number"?e.linearDamping:.01,this.type=t<=0?pe.STATIC:pe.DYNAMIC,typeof e.type==typeof pe.STATIC&&(this.type=e.type),this.allowSleep=typeof e.allowSleep<"u"?e.allowSleep:!0,this.sleepState=pe.AWAKE,this.sleepSpeedLimit=typeof e.sleepSpeedLimit<"u"?e.sleepSpeedLimit:.1,this.sleepTimeLimit=typeof e.sleepTimeLimit<"u"?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new E,this.quaternion=new Ct,this.initQuaternion=new Ct,this.previousQuaternion=new Ct,this.interpolatedQuaternion=new Ct,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new E,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new E,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new E,this.invInertia=new E,this.invInertiaWorld=new _n,this.invMassSolve=0,this.invInertiaSolve=new E,this.invInertiaWorldSolve=new _n,this.fixedRotation=typeof e.fixedRotation<"u"?e.fixedRotation:!1,this.angularDamping=typeof e.angularDamping<"u"?e.angularDamping:.01,this.linearFactor=new E(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new E(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new an,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new E,this.isTrigger=!!e.isTrigger,e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=pe.AWAKE,this.wakeUpAfterNarrowphase=!1,e===pe.SLEEPING&&this.dispatchEvent(pe.wakeupEvent)}sleep(){this.sleepState=pe.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),s=this.sleepSpeedLimit**2;t===pe.AWAKE&&ns?this.wakeUp():t===pe.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(pe.sleepEvent))}}updateSolveMassProperties(){this.sleepState===pe.SLEEPING||this.type===pe.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t){return t===void 0&&(t=new E),e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t){return t===void 0&&(t=new E),this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t){return t===void 0&&(t=new E),this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t){return t===void 0&&(t=new E),this.quaternion.vmult(e,t),t}addShape(e,t,n){const s=new E,r=new Ct;return t&&s.copy(t),n&&r.copy(n),this.shapes.push(e),this.shapeOffsets.push(s),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return t===-1?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,n=e.length;let s=0;for(let r=0;r!==n;r++){const o=e[r];o.updateBoundingSphereRadius();const a=t[r].length(),c=o.boundingSphereRadius;a+c>s&&(s=a+c)}this.boundingRadius=s}updateAABB(){const e=this.shapes,t=this.shapeOffsets,n=this.shapeOrientations,s=e.length,r=Hx,o=kx,a=this.quaternion,c=this.aabb,l=Gx;for(let u=0;u!==s;u++){const h=e[u];a.vmult(t[u],r),r.vadd(this.position,r),a.mult(n[u],o),h.calculateWorldAABB(r,o,l.lowerBound,l.upperBound),u===0?c.copy(l):c.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(!(t.x===t.y&&t.y===t.z&&!e)){const n=Vx,s=Wx;n.setRotationFromQuaternion(this.quaternion),n.transpose(s),n.scale(t,n),n.mmult(s,this.invInertiaWorld)}}applyForce(e,t){if(t===void 0&&(t=new E),this.type!==pe.DYNAMIC)return;this.sleepState===pe.SLEEPING&&this.wakeUp();const n=Xx;t.cross(e,n),this.force.vadd(e,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(e,t){if(t===void 0&&(t=new E),this.type!==pe.DYNAMIC)return;const n=Yx,s=qx;this.vectorToWorldFrame(e,n),this.vectorToWorldFrame(t,s),this.applyForce(n,s)}applyTorque(e){this.type===pe.DYNAMIC&&(this.sleepState===pe.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t){if(t===void 0&&(t=new E),this.type!==pe.DYNAMIC)return;this.sleepState===pe.SLEEPING&&this.wakeUp();const n=t,s=Kx;s.copy(e),s.scale(this.invMass,s),this.velocity.vadd(s,this.velocity);const r=Qx;n.cross(e,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(e,t){if(t===void 0&&(t=new E),this.type!==pe.DYNAMIC)return;const n=jx,s=Zx;this.vectorToWorldFrame(e,n),this.vectorToWorldFrame(t,s),this.applyImpulse(n,s)}updateMassProperties(){const e=Jx;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,n=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),$r.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!n?1/t.x:0,t.y>0&&!n?1/t.y:0,t.z>0&&!n?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const n=new E;return e.vsub(this.position,n),this.angularVelocity.cross(n,t),this.velocity.vadd(t,t),t}integrate(e,t,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),!(this.type===pe.DYNAMIC||this.type===pe.KINEMATIC)||this.sleepState===pe.SLEEPING)return;const s=this.velocity,r=this.angularVelocity,o=this.position,a=this.force,c=this.torque,l=this.quaternion,u=this.invMass,h=this.invInertiaWorld,d=this.linearFactor,f=u*e;s.x+=a.x*f*d.x,s.y+=a.y*f*d.y,s.z+=a.z*f*d.z;const g=h.elements,v=this.angularFactor,m=c.x*v.x,p=c.y*v.y,x=c.z*v.z;r.x+=e*(g[0]*m+g[1]*p+g[2]*x),r.y+=e*(g[3]*m+g[4]*p+g[5]*x),r.z+=e*(g[6]*m+g[7]*p+g[8]*x),o.x+=s.x*e,o.y+=s.y*e,o.z+=s.z*e,l.integrate(this.angularVelocity,e,this.angularFactor,l),t&&(n?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}pe.idCounter=0;pe.COLLIDE_EVENT_NAME="collide";pe.DYNAMIC=vc.DYNAMIC;pe.STATIC=vc.STATIC;pe.KINEMATIC=vc.KINEMATIC;pe.AWAKE=xc.AWAKE;pe.SLEEPY=xc.SLEEPY;pe.SLEEPING=xc.SLEEPING;pe.wakeupEvent={type:"wakeup"};pe.sleepyEvent={type:"sleepy"};pe.sleepEvent={type:"sleep"};const Hx=new E,kx=new Ct,Gx=new an,Vx=new _n,Wx=new _n;new _n;const Xx=new E,Yx=new E,qx=new E,Kx=new E,Qx=new E,jx=new E,Zx=new E,Jx=new E;class sh{constructor(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(e,t,n){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(e,t){return!((e.collisionFilterGroup&t.collisionFilterMask)===0||(t.collisionFilterGroup&e.collisionFilterMask)===0||((e.type&pe.STATIC)!==0||e.sleepState===pe.SLEEPING)&&((t.type&pe.STATIC)!==0||t.sleepState===pe.SLEEPING))}intersectionTest(e,t,n,s){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,t,n,s):this.doBoundingSphereBroadphase(e,t,n,s)}doBoundingSphereBroadphase(e,t,n,s){const r=$x;t.position.vsub(e.position,r);const o=(e.boundingRadius+t.boundingRadius)**2;r.lengthSquared()n.lengthSquared()}aabbQuery(e,t,n){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}}const $x=new E;new E;new Ct;new E;const e0={keys:[]},t0=[],n0=[];new E;new E;new E;class i0 extends sh{constructor(){super()}collisionPairs(e,t,n){const s=e.bodies,r=s.length;let o,a;for(let c=0;c!==r;c++)for(let l=0;l!==c;l++)o=s[c],a=s[l],this.needBroadphaseCollision(o,a)&&this.intersectionTest(o,a,t,n)}aabbQuery(e,t,n){n===void 0&&(n=[]);for(let s=0;s{}}intersectWorld(e,t){return this.mode=t.mode||bt.ANY,this.result=t.result||new Kr,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Jl),Go.length=0,e.broadphase.aabbQuery(e,Jl,Go),this.intersectBodies(Go),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!e.collisionResponse||(this.collisionFilterGroup&e.collisionFilterMask)===0||(e.collisionFilterGroup&this.collisionFilterMask)===0)return;const s=s0,r=r0;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,n,s,e)}_intersectBox(e,t,n,s,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,n,s,r)}_intersectPlane(e,t,n,s,r){const o=this.from,a=this.to,c=this.direction,l=new E(0,0,1);t.vmult(l,l);const u=new E;o.vsub(n,u);const h=u.dot(l);a.vsub(n,u);const d=u.dot(l);if(h*d>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,f),f.vsub(n,g),g.normalize(),this.reportIntersection(g,f,r,s,-1)),this.result.shouldStop)return;m>=0&&m<=1&&(o.lerp(a,m,f),f.vsub(n,g),g.normalize(),this.reportIntersection(g,f,r,s,-1))}}_intersectConvex(e,t,n,s,r,o){const a=u0,c=eu,l=o&&o.faceList||null,u=e.faces,h=e.vertices,d=e.faceNormals,f=this.direction,g=this.from,v=this.to,m=g.distanceTo(v),p=l?l.length:u.length,x=this.result;for(let _=0;!x.shouldStop&&_m||this.reportIntersection(a,Qt,r,s,A)}}}}_intersectTrimesh(e,t,n,s,r,o){const a=h0,c=v0,l=x0,u=eu,h=d0,d=f0,f=p0,g=g0,v=m0,m=e.indices;e.vertices;const p=this.from,x=this.to,_=this.direction;l.position.copy(n),l.quaternion.copy(t),it.vectorToLocalFrame(n,t,_,h),it.pointToLocalFrame(n,t,p,d),it.pointToLocalFrame(n,t,x,f),f.x*=e.scale.x,f.y*=e.scale.y,f.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,f.vsub(d,h),h.normalize();const A=d.distanceSquared(f);e.tree.rayQuery(this,l,c);for(let b=0,w=c.length;!this.result.shouldStop&&b!==w;b++){const C=c[b];e.getNormal(C,a),e.getVertex(m[C*3],vn),vn.vsub(d,u);const P=h.dot(a),S=a.dot(u)/P;if(S<0)continue;h.scale(S,Qt),Qt.vadd(d,Qt),e.getVertex(m[C*3+1],wn),e.getVertex(m[C*3+2],bn);const y=Qt.distanceSquared(d);!(bt.pointInTriangle(Qt,wn,vn,bn)||bt.pointInTriangle(Qt,vn,wn,bn))||y>A||(it.vectorToWorldFrame(t,a,v),it.pointToWorldFrame(n,t,Qt,g),this.reportIntersection(v,g,r,s,C))}c.length=0}reportIntersection(e,t,n,s,r){const o=this.from,a=this.to,c=o.distanceTo(t),l=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(l.hitFaceIndex=typeof r<"u"?r:-1,this.mode){case bt.ALL:this.hasHit=!0,l.set(o,a,e,t,n,s,c),l.hasHit=!0,this.callback(l);break;case bt.CLOSEST:(c=0&&(h=r*l-o*a)>=0&&u+h=0&&!(e[r].aabb.lowerBound.x<=s.aabb.lowerBound.x);r--)e[r+1]=e[r];e[r+1]=s}return e}static insertionSortY(e){for(let t=1,n=e.length;t=0&&!(e[r].aabb.lowerBound.y<=s.aabb.lowerBound.y);r--)e[r+1]=e[r];e[r+1]=s}return e}static insertionSortZ(e){for(let t=1,n=e.length;t=0&&!(e[r].aabb.lowerBound.z<=s.aabb.lowerBound.z);r--)e[r+1]=e[r];e[r+1]=s}return e}constructor(e){super(),this.axisList=[],this.world=null,this.axisIndex=0;const t=this.axisList;this._addBodyHandler=n=>{t.push(n.body)},this._removeBodyHandler=n=>{const s=t.indexOf(n.body);s!==-1&&t.splice(s,1)},e&&this.setWorld(e)}setWorld(e){this.axisList.length=0;for(let t=0;th?u>d?this.axisIndex=0:this.axisIndex=2:h>d?this.axisIndex=1:this.axisIndex=2}aabbQuery(e,t,n){n===void 0&&(n=[]),this.dirty&&(this.sortList(),this.dirty=!1);const s=this.axisIndex;let r="x";s===1&&(r="y"),s===2&&(r="z");const o=this.axisList;t.lowerBound[r],t.upperBound[r];for(let a=0;aC.maxForce&&(f=C.maxForce-m),_[w]+=f,g+=f>0?f:-f,C.addToWlambda(f)}if(g*ge;)t.pop();for(;t.length=0&&u.restitution>=0&&(a.restitution=l.restitution*u.restitution),a.si=r||n,a.sj=o||s,a}createFrictionEquationsFromContact(e,t){const n=e.bi,s=e.bj,r=e.si,o=e.sj,a=this.world,c=this.currentContactMaterial;let l=c.friction;const u=r.material||n.material,h=o.material||s.material;if(u&&h&&u.friction>=0&&h.friction>=0&&(l=u.friction*h.friction),l>0){const d=l*(a.frictionGravity||a.gravity).length();let f=n.invMass+s.invMass;f>0&&(f=1/f);const g=this.frictionEquationPool,v=g.length?g.pop():new ou(n,s,d*f),m=g.length?g.pop():new ou(n,s,d*f);return v.bi=m.bi=n,v.bj=m.bj=s,v.minForce=m.minForce=-d*f,v.maxForce=m.maxForce=d*f,v.ri.copy(e.ri),v.rj.copy(e.rj),m.ri.copy(e.ri),m.rj.copy(e.rj),e.ni.tangents(v.t,m.t),v.setSpookParams(c.frictionEquationStiffness,c.frictionEquationRelaxation,a.dt),m.setSpookParams(c.frictionEquationStiffness,c.frictionEquationRelaxation,a.dt),v.enabled=m.enabled=e.enabled,t.push(v,m),!0}return!1}createFrictionFromAverage(e){let t=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(t,this.frictionResult)||e===1)return;const n=this.frictionResult[this.frictionResult.length-2],s=this.frictionResult[this.frictionResult.length-1];yi.setZero(),Qi.setZero(),ji.setZero();const r=t.bi;t.bj;for(let a=0;a!==e;a++)t=this.result[this.result.length-1-a],t.bi!==r?(yi.vadd(t.ni,yi),Qi.vadd(t.ri,Qi),ji.vadd(t.rj,ji)):(yi.vsub(t.ni,yi),Qi.vadd(t.rj,Qi),ji.vadd(t.ri,ji));const o=1/e;Qi.scale(o,n.ri),ji.scale(o,n.rj),s.ri.copy(n.ri),s.rj.copy(n.rj),yi.normalize(),yi.tangents(n.t,s.t)}getContacts(e,t,n,s,r,o,a){this.contactPointPool=r,this.frictionEquationPool=a,this.result=s,this.frictionResult=o;const c=V0,l=W0,u=k0,h=G0;for(let d=0,f=e.length;d!==f;d++){const g=e[d],v=t[d];let m=null;g.material&&v.material&&(m=n.getContactMaterial(g.material,v.material)||null);const p=g.type&pe.KINEMATIC&&v.type&pe.STATIC||g.type&pe.STATIC&&v.type&pe.KINEMATIC||g.type&pe.KINEMATIC&&v.type&pe.KINEMATIC;for(let x=0;x_.boundingSphereRadius+b.boundingSphereRadius)continue;let w=null;_.material&&b.material&&(w=n.getContactMaterial(_.material,b.material)||null),this.currentContactMaterial=w||m||n.defaultContactMaterial;const C=_.type|b.type,P=this[C];if(P){let S=!1;_.type0){const fe=pA,ie=mA;fe.copy(f[(B+1)%3]),ie.copy(f[(B+2)%3]);const Ke=fe.length(),K=ie.length();fe.normalize(),ie.normalize();const se=Br.dot(fe),Me=Br.dot(ie);if(se-Ke&&Me-K){const ue=Math.abs(oe-Z-g);if((C===null||uee.boundingSphereRadius+t.boundingSphereRadius)&&e.findSeparatingAxis(t,n,r,s,o,g,d,f)){const v=[],m=UA;e.clipAgainstHull(n,r,t,s,o,g,-100,100,v);let p=0;for(let x=0;x!==v.length;x++){if(h)return!0;const _=this.createContactEquation(a,c,e,t,l,u),A=_.ri,b=_.rj;g.negate(_.ni),v[x].normal.negate(m),m.scale(v[x].depth,m),v[x].point.vadd(m,A),b.copy(v[x].point),A.vsub(n,A),b.vsub(s,b),A.vadd(n,A),A.vsub(a.position,A),b.vadd(s,b),b.vsub(c.position,b),this.result.push(_),p++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(_,this.frictionResult)}this.enableFrictionReduction&&p&&this.createFrictionFromAverage(p)}}sphereConvex(e,t,n,s,r,o,a,c,l,u,h){const d=this.v3pool;n.vsub(s,yA);const f=t.faceNormals,g=t.faces,v=t.vertices,m=e.radius;let p=!1;for(let x=0;x!==v.length;x++){const _=v[x],A=TA;o.vmult(_,A),s.vadd(A,A);const b=SA;if(A.vsub(n,b),b.lengthSquared()0){const k=[];for(let R=0,F=b.length;R!==F;R++){const O=d.get();o.vmult(v[b[R]],O),s.vadd(O,O),k.push(O)}if(dA(k,w,n)){if(h)return!0;p=!0;const R=this.createContactEquation(a,c,e,t,l,u);w.scale(-m,R.ri),w.negate(R.ni);const F=d.get();w.scale(-y,F);const O=d.get();w.scale(-m,O),n.vsub(s,R.rj),R.rj.vadd(O,R.rj),R.rj.vadd(F,R.rj),R.rj.vadd(s,R.rj),R.rj.vsub(c.position,R.rj),R.ri.vadd(n,R.ri),R.ri.vsub(a.position,R.ri),d.release(F),d.release(O),this.result.push(R),this.createFrictionEquationsFromContact(R,this.frictionResult);for(let B=0,q=k.length;B!==q;B++)d.release(k[B]);return}else for(let R=0;R!==b.length;R++){const F=d.get(),O=d.get();o.vmult(v[b[(R+1)%b.length]],F),o.vmult(v[b[(R+2)%b.length]],O),s.vadd(F,F),s.vadd(O,O);const B=MA;O.vsub(F,B);const q=EA;B.unit(q);const G=d.get(),Z=d.get();n.vsub(F,Z);const oe=Z.dot(q);q.scale(oe,G),G.vadd(F,G);const fe=d.get();if(G.vsub(n,fe),oe>0&&oe*oed.length||_>d[0].length)return;p<0&&(p=0),x<0&&(x=0),_<0&&(_=0),A<0&&(A=0),p>=d.length&&(p=d.length-1),x>=d.length&&(x=d.length-1),A>=d[0].length&&(A=d[0].length-1),_>=d[0].length&&(_=d[0].length-1);const b=[];t.getRectMinMax(p,_,x,A,b);const w=b[0],C=b[1];if(m.z-f>C||m.z+f2)return}}boxHeightfield(e,t,n,s,r,o,a,c,l,u,h){return e.convexPolyhedronRepresentation.material=e.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,this.convexHeightfield(e.convexPolyhedronRepresentation,t,n,s,r,o,a,c,e,t,h)}convexHeightfield(e,t,n,s,r,o,a,c,l,u,h){const d=t.data,f=t.elementSize,g=e.boundingSphereRadius,v=XA,m=YA,p=WA;it.pointToLocalFrame(s,o,n,p);let x=Math.floor((p.x-g)/f)-1,_=Math.ceil((p.x+g)/f)+1,A=Math.floor((p.y-g)/f)-1,b=Math.ceil((p.y+g)/f)+1;if(_<0||b<0||x>d.length||A>d[0].length)return;x<0&&(x=0),_<0&&(_=0),A<0&&(A=0),b<0&&(b=0),x>=d.length&&(x=d.length-1),_>=d.length&&(_=d.length-1),b>=d[0].length&&(b=d[0].length-1),A>=d[0].length&&(A=d[0].length-1);const w=[];t.getRectMinMax(x,A,_,b,w);const C=w[0],P=w[1];if(!(p.z-g>P||p.z+g0&&O<0&&(m.vsub(d,p),v.copy(g),v.normalize(),B=p.dot(v),v.scale(B,p),p.vadd(d,p),p.distanceTo(m)0&&n===!0||u<=0&&n===!1){n===null&&(n=u>0);continue}else return!1}return!0}const Br=new E,fA=new E,pA=new E,mA=new E,gA=[new E,new E,new E,new E,new E,new E],vA=new E,xA=new E,AA=new E,_A=new E,yA=new E,MA=new E,EA=new E,SA=new E,TA=new E,wA=new E,bA=new E,CA=new E,RA=new E,DA=new E;new E;new E;const IA=new E,PA=new E,LA=new E,BA=new E,NA=new E,UA=new E,FA=new E,OA=new E,zA=new E,HA=new E,cu=new Ct,kA=new E;new E;const GA=new E,lu=new E,VA=new E,WA=new E,XA=new E,YA=[0],qA=new E,KA=new E;class uu{constructor(){this.current=[],this.previous=[]}getKey(e,t){if(ts[r];)r++;if(n!==s[r]){for(let o=s.length-1;o>=r;o--)s[o+1]=s[o];s[r]=n}}tick(){const e=this.current;this.current=this.previous,this.previous=e,this.current.length=0}getDiff(e,t){const n=this.current,s=this.previous,r=n.length,o=s.length;let a=0;for(let c=0;cs[a];)a++;l=u===s[a],l||hu(e,u)}a=0;for(let c=0;cn[a];)a++;l=n[a]===u,l||hu(t,u)}}}function hu(i,e){i.push((e&4294901760)>>16,e&65535)}const Xo=(i,e)=>i0;){const n=t.pop();delete e[n]}}}class jA extends ih{constructor(e){e===void 0&&(e={}),super(),this.dt=-1,this.allowSleep=!!e.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=e.quatNormalizeSkip!==void 0?e.quatNormalizeSkip:0,this.quatNormalizeFast=e.quatNormalizeFast!==void 0?e.quatNormalizeFast:!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new E,e.gravity&&this.gravity.copy(e.gravity),e.frictionGravity&&(this.frictionGravity=new E,this.frictionGravity.copy(e.frictionGravity)),this.broadphase=e.broadphase!==void 0?e.broadphase:new i0,this.bodies=[],this.hasActiveBodies=!1,this.solver=e.solver!==void 0?e.solver:new B0,this.constraints=[],this.narrowphase=new H0(this),this.collisionMatrix=new jl,this.collisionMatrixPrevious=new jl,this.bodyOverlapKeeper=new uu,this.shapeOverlapKeeper=new uu,this.contactmaterials=[],this.contactMaterialTable=new QA,this.defaultMaterial=new $s("default"),this.defaultContactMaterial=new Js(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(e,t){return this.contactMaterialTable.get(e.id,t.id)}collisionMatrixTick(){const e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(e){this.constraints.push(e)}removeConstraint(e){const t=this.constraints.indexOf(e);t!==-1&&this.constraints.splice(t,1)}rayTest(e,t,n){n instanceof Kr?this.raycastClosest(e,t,{skipBackfaces:!0},n):this.raycastAll(e,t,{skipBackfaces:!0},n)}raycastAll(e,t,n,s){return n===void 0&&(n={}),n.mode=bt.ALL,n.from=e,n.to=t,n.callback=s,Yo.intersectWorld(this,n)}raycastAny(e,t,n,s){return n===void 0&&(n={}),n.mode=bt.ANY,n.from=e,n.to=t,n.result=s,Yo.intersectWorld(this,n)}raycastClosest(e,t,n,s){return n===void 0&&(n={}),n.mode=bt.CLOSEST,n.from=e,n.to=t,n.result=s,Yo.intersectWorld(this,n)}addBody(e){this.bodies.includes(e)||(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof pe&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.idToBodyMap[e.id]=e,this.dispatchEvent(this.addBodyEvent))}removeBody(e){e.world=null;const t=this.bodies.length-1,n=this.bodies,s=n.indexOf(e);if(s!==-1){n.splice(s,1);for(let r=0;r!==n.length;r++)n[r].index=r;this.collisionMatrix.setNumObjects(t),this.removeBodyEvent.body=e,delete this.idToBodyMap[e.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(e){return this.idToBodyMap[e]}getShapeById(e){const t=this.bodies;for(let n=0;n=e&&re*1e3)););this.accumulator=this.accumulator%e;const o=this.accumulator/e;for(let a=0;a!==this.bodies.length;a++){const c=this.bodies[a];c.previousPosition.lerp(c.position,o,c.interpolatedPosition),c.previousQuaternion.slerp(c.quaternion,o,c.interpolatedQuaternion),c.previousQuaternion.normalize()}this.time+=t}}internalStep(e){this.dt=e;const t=this.contacts,n=t_,s=n_,r=this.bodies.length,o=this.bodies,a=this.solver,c=this.gravity,l=this.doProfiling,u=this.profile,h=pe.DYNAMIC;let d=-1/0;const f=this.constraints,g=e_;c.length();const v=c.x,m=c.y,p=c.z;let x=0;for(l&&(d=It.now()),x=0;x!==r;x++){const R=o[x];if(R.type===h){const F=R.force,O=R.mass;F.x+=O*v,F.y+=O*m,F.z+=O*p}}for(let R=0,F=this.subsystems.length;R!==F;R++)this.subsystems[R].update();l&&(d=It.now()),n.length=0,s.length=0,this.broadphase.collisionPairs(this,n,s),l&&(u.broadphase=It.now()-d);let _=f.length;for(x=0;x!==_;x++){const R=f[x];if(!R.collideConnected)for(let F=n.length-1;F>=0;F-=1)(R.bodyA===n[F]&&R.bodyB===s[F]||R.bodyB===n[F]&&R.bodyA===s[F])&&(n.splice(F,1),s.splice(F,1))}this.collisionMatrixTick(),l&&(d=It.now());const A=$A,b=t.length;for(x=0;x!==b;x++)A.push(t[x]);t.length=0;const w=this.frictionEquations.length;for(x=0;x!==w;x++)g.push(this.frictionEquations[x]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(n,s,this,t,A,this.frictionEquations,g),l&&(u.narrowphase=It.now()-d),l&&(d=It.now()),x=0;x=0&&B.material.friction>=0&&O.material.friction*B.material.friction,O.material.restitution>=0&&B.material.restitution>=0&&(F.restitution=O.material.restitution*B.material.restitution)),a.addEquation(F),O.allowSleep&&O.type===pe.DYNAMIC&&O.sleepState===pe.SLEEPING&&B.sleepState===pe.AWAKE&&B.type!==pe.STATIC){const oe=B.velocity.lengthSquared()+B.angularVelocity.lengthSquared(),fe=B.sleepSpeedLimit**2;oe>=fe*2&&(O.wakeUpAfterNarrowphase=!0)}if(B.allowSleep&&B.type===pe.DYNAMIC&&B.sleepState===pe.SLEEPING&&O.sleepState===pe.AWAKE&&O.type!==pe.STATIC){const oe=O.velocity.lengthSquared()+O.angularVelocity.lengthSquared(),fe=O.sleepSpeedLimit**2;oe>=fe*2&&(B.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(O,B,!0),this.collisionMatrixPrevious.get(O,B)||(Is.body=B,Is.contact=F,O.dispatchEvent(Is),Is.body=O,B.dispatchEvent(Is)),this.bodyOverlapKeeper.set(O.id,B.id),this.shapeOverlapKeeper.set(q.id,G.id)}for(this.emitContactEvents(),l&&(u.makeContactConstraints=It.now()-d,d=It.now()),x=0;x!==r;x++){const R=o[x];R.wakeUpAfterNarrowphase&&(R.wakeUp(),R.wakeUpAfterNarrowphase=!1)}for(_=f.length,x=0;x!==_;x++){const R=f[x];R.update();for(let F=0,O=R.equations.length;F!==O;F++){const B=R.equations[F];a.addEquation(B)}}a.solve(e,this),l&&(u.solve=It.now()-d),a.removeAllEquations();const P=Math.pow;for(x=0;x!==r;x++){const R=o[x];if(R.type&h){const F=P(1-R.linearDamping,e),O=R.velocity;O.scale(F,O);const B=R.angularVelocity;if(B){const q=P(1-R.angularDamping,e);B.scale(q,B)}}}this.dispatchEvent(JA),l&&(d=It.now());const y=this.stepnumber%(this.quatNormalizeSkip+1)===0,I=this.quatNormalizeFast;for(x=0;x!==r;x++)o[x].integrate(e,y,I);this.clearForces(),this.broadphase.dirty=!0,l&&(u.integrate=It.now()-d),this.stepnumber+=1,this.dispatchEvent(ZA);let k=!0;if(this.allowSleep)for(k=!1,x=0;x!==r;x++){const R=o[x];R.sleepTick(this.time),R.sleepState!==pe.SLEEPING&&(k=!0)}this.hasActiveBodies=k}emitContactEvents(){const e=this.hasAnyEventListener("beginContact"),t=this.hasAnyEventListener("endContact");if((e||t)&&this.bodyOverlapKeeper.getDiff(kn,Gn),e){for(let r=0,o=kn.length;rDate.now()-i}new E;const ZA={type:"postStep"},JA={type:"preStep"},Is={type:pe.COLLIDE_EVENT_NAME,body:null,contact:null},$A=[],e_=[],t_=[],n_=[],kn=[],Gn=[],Ps={type:"beginContact",bodyA:null,bodyB:null},Ls={type:"endContact",bodyA:null,bodyB:null},Vn={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Wn={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null};class i_{static setupLighting(e){const t=new Uf(4210752,.3);e.add(t);const n=new Fs(16777215,1.2);n.position.set(10,10,5),n.castShadow=!0,n.shadow.mapSize.width=2048,n.shadow.mapSize.height=2048,n.shadow.camera.near=.1,n.shadow.camera.far=50,n.shadow.camera.left=-10,n.shadow.camera.right=10,n.shadow.camera.top=10,n.shadow.camera.bottom=-10,e.add(n);const s=new Fs(8947967,.4);s.position.set(-8,5,3),e.add(s);const r=new Fs(16755336,.6);r.position.set(0,-10,-5),e.add(r);const o=new Ha(4474111,.5,30);o.position.set(-5,5,10),e.add(o);const a=new Ha(16729156,.3,25);a.position.set(5,-5,-8),e.add(a);const c=new Fs(8930559,.8);c.position.set(0,0,-15),c.target.position.set(0,0,0),e.add(c),e.add(c.target)}}function du(i,e){if(e===nd)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===Na||e===Uu){let t=i.getIndex();if(t===null){const o=[],a=i.getAttribute("position");if(a!==void 0){for(let c=0;c=2.0 are supported."));return}const l=new F_(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,r){n.parse(e,t,s,r)})}}function r_(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Ye={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class o_{constructor(e){this.parser=e,this.name=Ye.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class __{constructor(e){this.parser=e,this.name=Ye.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let c=n.textureLoader;if(a.uri){const l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return n.loadTextureImage(e,o.source,c)}}class y_{constructor(e){this.parser=e,this.name=Ye.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let c=n.textureLoader;if(a.uri){const l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return n.loadTextureImage(e,o.source,c)}}class M_{constructor(e){this.name=Ye.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const c=s.byteOffset||0,l=s.byteLength||0,u=s.count,h=s.byteStride,d=new Uint8Array(a,c,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,h,d,s.mode,s.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(u*h);return o.decodeGltfBuffer(new Uint8Array(f),u,h,d,s.mode,s.filter),f})})}else return null}}class E_{constructor(e){this.name=Ye.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=t.meshes[n.mesh];for(const l of s.primitives)if(l.mode!==hn.TRIANGLES&&l.mode!==hn.TRIANGLE_STRIP&&l.mode!==hn.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=n.extensions[this.name].attributes,a=[],c={};for(const l in o)a.push(this.parser.getDependency("accessor",o[l]).then(u=>(c[l]=u,c[l])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(l=>{const u=l.pop(),h=u.isGroup?u.children:[u],d=l[0].count,f=[];for(const g of h){const v=new Fe,m=new U,p=new di,x=new U(1,1,1),_=new lf(g.geometry,g.material,d);for(let A=0;A0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const U_=new Fe;class F_{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new r_,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,s=-1,r=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;const c=a.match(/Version\/(\d+)/);s=n&&c?parseInt(c[1],10):-1,r=a.indexOf("Firefox")>-1,o=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||r&&o<98?this.textureLoader=new If(this.options.manager):this.textureLoader=new Ff(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Zu(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:n,userData:{}};return Mi(r,a,s),Yn(a,s),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){for(const c of a.scenes)c.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=t.length;s{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[l,u]of o.children.entries())r(u,a.children[l])};return r(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&m.setY(S,w[C*c+1]),c>=3&&m.setZ(S,w[C*c+2]),c>=4&&m.setW(S,w[C*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=g}return m})}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const c=n.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){const s=this,r=this.json,o=r.textures[e],a=r.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,n).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const d=(r.samplers||{})[o.sampler]||{};return u.magFilter=pu[d.magFilter]||Pt,u.minFilter=pu[d.minFilter]||Kn,u.wrapS=mu[d.wrapS]||Ii,u.wrapT=mu[d.wrapT]||Ii,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Tt&&u.minFilter!==Pt,s.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const n=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=s.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",l=!1;if(o.bufferView!==void 0)c=n.getDependency("bufferView",o.bufferView).then(function(h){l=!0;const d=new Blob([h],{type:o.mimeType});return c=a.createObjectURL(d),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then(function(h){return new Promise(function(d,f){let g=d;t.isImageBitmapLoader===!0&&(g=function(v){const m=new yt(v);m.needsUpdate=!0,d(m)}),t.load(ks.resolveURL(h,r.path),g,void 0,f)})}).then(function(h){return l===!0&&a.revokeObjectURL(c),Yn(h,o),h.userData.mimeType=o.mimeType||N_(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),h});return this.sourceCache[e]=u,u}assignTexture(e,t,n,s){const r=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),r.extensions[Ye.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[Ye.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=r.associations.get(o);o=r.extensions[Ye.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,c)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+n.uuid;let c=this.cache.get(a);c||(c=new qu,rn.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(a,c)),n=c}else if(e.isLine){const a="LineBasicMaterial:"+n.uuid;let c=this.cache.get(a);c||(c=new Yu,rn.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(a,c)),n=c}if(s||r||o){let a="ClonedMaterial:"+n.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=n.clone(),r&&(c.vertexColors=!0),o&&(c.flatShading=!0),s&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return Ri}loadMaterial(e){const t=this,n=this.json,s=this.extensions,r=n.materials[e];let o;const a={},c=r.extensions||{},l=[];if(c[Ye.KHR_MATERIALS_UNLIT]){const h=s[Ye.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),l.push(h.extendParams(a,r,t))}else{const h=r.pbrMetallicRoughness||{};if(a.color=new Be(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;a.color.setRGB(d[0],d[1],d[2],Ht),a.opacity=d[3]}h.baseColorTexture!==void 0&&l.push(t.assignTexture(a,"map",h.baseColorTexture,Ve)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=jt);const u=r.alphaMode||Ko.OPAQUE;if(u===Ko.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===Ko.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==bi&&(l.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Ae(1,1),r.normalTexture.scale!==void 0)){const h=r.normalTexture.scale;a.normalScale.set(h,h)}if(r.occlusionTexture!==void 0&&o!==bi&&(l.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==bi){const h=r.emissiveFactor;a.emissive=new Be().setRGB(h[0],h[1],h[2],Ht)}return r.emissiveTexture!==void 0&&o!==bi&&l.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,Ve)),Promise.all(l).then(function(){const h=new o(a);return r.name&&(h.name=r.name),Yn(h,r),t.associations.set(h,{materials:e}),r.extensions&&Mi(s,h,r),h})}createUniqueName(e){const t=ot.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function r(a){return n[Ye.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return gu(c,a,t)})}const o=[];for(let a=0,c=e.length;a0&&L_(p,r),p.name=t.createUniqueName(r.name||"mesh_"+e),Yn(p,r),m.extensions&&Mi(s,p,m),t.assignFinalMaterial(p),h.push(p)}for(let f=0,g=h.length;f1?u=new Ci:l.length===1?u=l[0]:u=new xt,u!==l[0])for(let h=0,d=l.length;h1){const h=s.associations.get(u);s.associations.set(u,{...h})}return s.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,r=new Ci;n.name&&(r.name=s.createUniqueName(n.name)),Yn(r,n),n.extensions&&Mi(t,r,n);const o=n.nodes||[],a=[];for(let c=0,l=o.length;c{const h=new Map;for(const[d,f]of s.associations)(d instanceof rn||d instanceof yt)&&h.set(d,f);return u.traverse(d=>{const f=s.associations.get(d);f!=null&&h.set(d,f)}),h};return s.associations=l(r),r})}_createAnimationTracks(e,t,n,s,r){const o=[],a=e.name?e.name:e.uuid,c=[];oi[r.path]===oi.weights?e.traverse(function(d){d.morphTargetInfluences&&c.push(d.name?d.name:d.uuid)}):c.push(a);let l;switch(oi[r.path]){case oi.weights:l=ds;break;case oi.rotation:l=fs;break;case oi.translation:case oi.scale:l=ps;break;default:switch(n.itemSize){case 1:l=ds;break;case 2:case 3:default:l=ps;break}break}const u=s.interpolation!==void 0?D_[s.interpolation]:Xs,h=this._getArrayFromAccessor(n);for(let d=0,f=c.length;d{if(c instanceof zt&&c.geometry){const l=c.geometry.clone();c.matrixWorld.equals(new Fe)||l.applyMatrix4(c.matrixWorld),t.push(l);const u=l.getAttribute("position");if(u){const h=new En().setFromBufferAttribute(u);n.union(h)}}}),t.length===0)return console.warn("No geometries found in model"),null;console.log(`Found ${t.length} geometries to merge`);const s=this.mergeBufferGeometries(t),r=s.getAttribute("position");if(!r)return console.error("No position attribute found in combined geometry"),null;const o=Array.from(r.array);let a=[];if(s.index)a=Array.from(s.index.array);else for(let c=0;c{Object.keys(o.attributes).forEach(c=>{n[c]||(n[c]=[]);const l=o.attributes[c];l instanceof Lt&&n[c].push(l)}),o.index&&(Array.from(o.index.array).forEach(l=>r.push(l+s)),s+=o.attributes.position.count)}),Object.keys(n).forEach(o=>{const a=n[o],c=a[0].itemSize,l=a[0].normalized;let u=0;a.forEach(f=>u+=f.count);const h=new Float32Array(u*c);let d=0;a.forEach(f=>{h.set(f.array,d),d+=f.array.length}),t.setAttribute(o,new Lt(h,c,l))}),r.length>0&&t.setIndex(r),t}downsampleGeometry(e,t=.3){const n=Math.max(1,Math.floor(1/t)),s=[],r=[],o=new Map;for(let a=0;a100){const l=e.boundingBox.getSize(new U).multiplyScalar(t);return new $r(new E(l.x*.5,l.y*.5,l.z*.5))}const s=e.vertices.map(c=>c*t),r=[];for(let c=0;c0)return new is({vertices:r,faces:o});throw new Error("No valid faces")}catch(n){console.warn("Failed to create complex collision shape, falling back to sphere:",n);const s=e.boundingBox.getSize(new U),r=Math.max(s.x,s.y,s.z)*.5*t;return new Wo(Math.max(.3,r))}}async loadAndCreateObjects(e,t,n){try{const s=await this.loader.loadAsync("/models/main_model.glb"),r=this.extractModelGeometry(s);r?this.modelGeometry=this.downsampleGeometry(r,.3):this.modelGeometry=null;const o=30,a=new Ri({color:2899536,metalness:.9,roughness:.3,envMapIntensity:1.5});s.scene.traverse(c=>{c instanceof zt&&(c.castShadow=!0,c.receiveShadow=!0,c.material=a)});for(let c=0;c{m instanceof zt&&(m.material=a.clone(),m.castShadow=!0,m.receiveShadow=!0)});const u=(Math.random()-.5)*6,h=(Math.random()-.5)*6,d=(Math.random()-.5)*6;l.position.set(u,h,d);const f=.5+Math.random()*.5;l.scale.setScalar(f);let g;if(this.modelGeometry)g=this.createCollisionShape(this.modelGeometry,f);else{const m=Math.max(.3,.8*f);g=new Wo(m)}const v=new pe({mass:1,material:t.defaultMaterial,type:pe.DYNAMIC});v.addShape(g),v.position.set(u,h,d),v.angularDamping=.1,v.linearDamping=.05,v.sleepSpeedLimit=.1,v.sleepTimeLimit=1,v.addEventListener("collide",m=>{const p=m.contact?.getImpactVelocityAlongNormal()||1,x=Math.min(p*.5,2);v.angularVelocity.set(v.angularVelocity.x+(Math.random()-.5)*x,v.angularVelocity.y+(Math.random()-.5)*x,v.angularVelocity.z+(Math.random()-.5)*x)}),v.velocity.set((Math.random()-.5)*1,(Math.random()-.5)*1,(Math.random()-.5)*1),v.angularVelocity.set((Math.random()-.5)*2,(Math.random()-.5)*2,(Math.random()-.5)*2),e.add(l),t.addBody(v),n.push({mesh:l,body:v})}console.log("Created",o,"instances of main_model with custom collision shapes"),console.log("Total physics objects:",n.length)}catch(s){console.error("Failed to load main_model.glb:",s),console.log("Falling back to placeholder objects..."),this.createFallbackObjects(e,t,n)}}createFallbackObjects(e,t,n){const s=[new gs(.5,.5,.5),new hc(.3,16,16),new uc(.2,.2,.6,12)],r=[new Ri({color:4890367,metalness:.7,roughness:.3}),new Ri({color:16739146,metalness:.5,roughness:.4}),new Ri({color:4915051,metalness:.8,roughness:.2})];for(let o=0;o<15;o++){const a=s[o%s.length],c=r[o%r.length],l=new zt(a,c);l.castShadow=!0,l.receiveShadow=!0;const u=(Math.random()-.5)*6,h=(Math.random()-.5)*6,d=(Math.random()-.5)*6;l.position.set(u,h,d);const f=new Wo(.3),g=new pe({mass:1,material:t.defaultMaterial,type:pe.DYNAMIC});g.addShape(f),g.position.set(u,h,d),g.angularDamping=.1,g.linearDamping=.05,g.velocity.set((Math.random()-.5)*1,(Math.random()-.5)*1,(Math.random()-.5)*1),g.angularVelocity.set((Math.random()-.5)*2,(Math.random()-.5)*2,(Math.random()-.5)*2),e.add(l),t.addBody(g),n.push({mesh:l,body:g})}}}class vu{static setupPhysicsWorld(){const e=new jA;e.gravity.set(0,0,0),e.broadphase=new Ji(e),e.allowSleep=!1;const t=new $s("default"),n=new Js(t,t,{friction:.4,restitution:.3,contactEquationStiffness:1e8,contactEquationRelaxation:3,frictionEquationStiffness:1e8,frictionEquationRelaxation:3});return e.addContactMaterial(n),e.defaultMaterial=t,e}static updatePhysics(e,t,n,s,r){e.step(.016666666666666666,r,5),t.forEach(c=>{const l=new E;l.x=n.x-c.body.position.x,l.y=n.y-c.body.position.y,l.z=n.z-c.body.position.z;const u=Math.sqrt(l.x*l.x+l.y*l.y+l.z*l.z);if(u>0){const f=16/(u*u+1);l.scale(f,l),c.body.force.set(c.body.force.x+l.x,c.body.force.y+l.y,c.body.force.z+l.z)}const h=new E;h.x=c.body.position.x-s.x,h.y=c.body.position.y-s.y,h.z=c.body.position.z-s.z;const d=Math.sqrt(h.x*h.x+h.y*h.y+h.z*h.z);if(d<2.5&&d>0){const f=25/(d*d+.1);h.scale(f,h),c.body.force.set(c.body.force.x+h.x,c.body.force.y+h.y,c.body.force.z+h.z);const g=new E((Math.random()-.5)*f*.1,(Math.random()-.5)*f*.1,(Math.random()-.5)*f*.1);c.body.torque.set(c.body.torque.x+g.x,c.body.torque.y+g.y,c.body.torque.z+g.z)}c.body.velocity.scale(.99,c.body.velocity),c.mesh.position.copy(c.body.position),c.mesh.quaternion.copy(c.body.quaternion)})}}class H_{mouse;raycaster;mouseWorldPosition;camera;renderer;constructor(e,t,n,s,r){this.mouse=e,this.raycaster=t,this.mouseWorldPosition=n,this.camera=s,this.renderer=r}setupEventListeners(){const e=this.renderer.domElement,t=n=>{const s=e.getBoundingClientRect();this.mouse.x=(n.clientX-s.left)/s.width*2-1,this.mouse.y=-((n.clientY-s.top)/s.height)*2+1,this.raycaster.setFromCamera(this.mouse,this.camera);const r=new ci(new U(0,0,1),0),o=new U;if(this.raycaster.ray.intersectPlane(r,o),o)this.mouseWorldPosition.copy(o);else{const a=Math.abs(this.camera.position.z),c=this.raycaster.ray.direction.clone();c.multiplyScalar(a),this.mouseWorldPosition.copy(this.camera.position).add(c)}};window.addEventListener("mousemove",t),e.addEventListener("mousemove",t),window.addEventListener("resize",()=>{this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight)})}}/** + * postprocessing v6.37.6 build Fri Jul 04 2025 + * https://github.com/pmndrs/postprocessing + * Copyright 2015-2025 Raoul van Rüschen + * @license Zlib + */var jo=1/1e3,k_=1e3,G_=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(i){typeof document<"u"&&document.hidden!==void 0&&(i?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=i)}get delta(){return this._delta*jo}get fixedDelta(){return this._fixedDelta*jo}set fixedDelta(i){this._fixedDelta=i*k_}get elapsed(){return this._elapsed*jo}update(i){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(i!==void 0?i:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(i){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},V_=(()=>{const i=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new Jt;return t.setAttribute("position",new Lt(i,3)),t.setAttribute("uv",new Lt(e,2)),t})(),$t=class Xa{static get fullscreenGeometry(){return V_}constructor(e="Pass",t=new Fa,n=new ic){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new zt(Xa.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new Fa),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=on){}render(e,t,n,s,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,n){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Rt||t instanceof rn||t instanceof yt||t instanceof Xa)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},W_=class extends $t{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(i,e,t,n,s){const r=i.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},X_=`#include +#include +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; +#include +#include +}`,er="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",ph=class extends Et{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new re(null),opacity:new re(1)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:X_,vertexShader:er})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}getOpacity(i){return this.uniforms.opacity.value}setOpacity(i){this.uniforms.opacity.value=i}},Y_=class extends $t{constructor(i,e=!0){super("CopyPass"),this.fullscreenMaterial=new ph,this.needsSwap=!1,this.renderTarget=i,i===void 0&&(this.renderTarget=new Rt(1,1,{minFilter:Pt,magFilter:Pt,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(i){this.autoResize=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(i){this.autoResize=i}render(i,e,t,n,s){this.fullscreenMaterial.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){this.autoResize&&this.renderTarget.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==Mt?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":i!==null&&i.outputColorSpace===Ve&&(this.renderTarget.texture.colorSpace=Ve))}},xu=new Be,_c=class extends $t{constructor(i=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=i,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(i,e,t){this.color=i,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(i){this.overrideClearColor=i}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(i){this.overrideClearAlpha=i}render(i,e,t,n,s){const r=this.overrideClearColor,o=this.overrideClearAlpha,a=i.getClearAlpha(),c=r!==null,l=o>=0;c?(i.getClearColor(xu),i.setClearColor(r,l?o:a)):l&&i.setClearAlpha(o),i.setRenderTarget(this.renderToScreen?null:e),i.clear(this.color,this.depth,this.stencil),c?i.setClearColor(xu,a):l&&i.setClearAlpha(a)}},q_=class extends $t{constructor(i,e){super("MaskPass",i,e),this.needsSwap=!1,this.clearPass=new _c(!1,!1,!0),this.inverse=!1}set mainScene(i){this.scene=i}set mainCamera(i){this.camera=i}get inverted(){return this.inverse}set inverted(i){this.inverse=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(i){this.inverted=i}render(i,e,t,n,s){const r=i.getContext(),o=i.state.buffers,a=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.stencil.setFunc(r.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(i,null):(l.render(i,e),l.render(i,t))),this.renderToScreen?(i.setRenderTarget(null),i.render(a,c)):(i.setRenderTarget(e),i.render(a,c),i.setRenderTarget(t),i.render(a,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(r.EQUAL,1,4294967295),o.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.stencil.setLocked(!0)}},K_=class{constructor(i=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:n=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,s,n),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Y_,this.depthTexture=null,this.passes=[],this.timer=new G_,this.autoRenderToScreen=!0,this.setRenderer(i)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(i){const e=this.inputBuffer,t=this.multisampling;t>0&&i>0?(this.inputBuffer.samples=i,this.outputBuffer.samples=i,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==i&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,i),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(i){if(this.renderer=i,i!==null){const e=i.getSize(new Ae),t=i.getContext().getContextAttributes().alpha,n=this.inputBuffer.texture.type;n===Mt&&i.outputColorSpace===Ve&&(this.inputBuffer.texture.colorSpace=Ve,this.outputBuffer.texture.colorSpace=Ve,this.inputBuffer.dispose(),this.outputBuffer.dispose()),i.autoClear=!1,this.setSize(e.width,e.height);for(const s of this.passes)s.initialize(i,t,n)}}replaceRenderer(i,e=!0){const t=this.renderer,n=t.domElement.parentNode;return this.setRenderer(i),e&&n!==null&&(n.removeChild(t.domElement),n.appendChild(i.domElement)),t}createDepthTexture(){const i=this.depthTexture=new lc;return this.inputBuffer.depthTexture=i,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(i.format=ls,i.type=cs):i.type=hi,i}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const i of this.passes)i.setDepthTexture(null)}}createBuffer(i,e,t,n){const s=this.renderer,r=s===null?new Ae:s.getDrawingBufferSize(new Ae),o={minFilter:Pt,magFilter:Pt,stencilBuffer:e,depthBuffer:i,type:t},a=new Rt(r.width,r.height,o);return n>0&&(a.ignoreDepthForMultisampleCopy=!1,a.samples=n),t===Mt&&s!==null&&s.outputColorSpace===Ve&&(a.texture.colorSpace=Ve),a.texture.name="EffectComposer.Buffer",a.texture.generateMipmaps=!1,a}setMainScene(i){for(const e of this.passes)e.mainScene=i}setMainCamera(i){for(const e of this.passes)e.mainCamera=i}addPass(i,e){const t=this.passes,n=this.renderer,s=n.getDrawingBufferSize(new Ae),r=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(i.setRenderer(n),i.setSize(s.width,s.height),i.initialize(n,r,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),i.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,i):t.push(i),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),i.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const a=this.createDepthTexture();for(i of t)i.setDepthTexture(a)}else i.setDepthTexture(this.depthTexture)}removePass(i){const e=this.passes,t=e.indexOf(i);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const r=(a,c)=>a||c.needsDepthTexture;e.reduce(r,!1)||(i.getDepthTexture()===this.depthTexture&&i.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(i.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const i=this.passes;this.deleteDepthTexture(),i.length>0&&(this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!1),this.passes=[])}render(i){const e=this.renderer,t=this.copyPass;let n=this.inputBuffer,s=this.outputBuffer,r=!1,o,a,c;i===void 0&&(this.timer.update(),i=this.timer.getDelta());for(const l of this.passes)l.enabled&&(l.render(e,n,s,i,r),l.needsSwap&&(r&&(t.renderToScreen=l.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,s,i,r),a.setFunc(o.EQUAL,1,4294967295)),c=n,n=s,s=c),l instanceof q_?r=!0:l instanceof W_&&(r=!1))}setSize(i,e,t){const n=this.renderer,s=n.getSize(new Ae);(i===void 0||e===void 0)&&(i=s.width,e=s.height),(s.width!==i||s.height!==e)&&n.setSize(i,e,t);const r=n.getDrawingBufferSize(new Ae);this.inputBuffer.setSize(r.width,r.height),this.outputBuffer.setSize(r.width,r.height);for(const o of this.passes)o.setSize(r.width,r.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const i of this.passes)i.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),$t.fullscreenGeometry.dispose()}},Mn={NONE:0,DEPTH:1,CONVOLUTION:2},$e={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Q_=class{constructor(){this.shaderParts=new Map([[$e.FRAGMENT_HEAD,null],[$e.FRAGMENT_MAIN_UV,null],[$e.FRAGMENT_MAIN_IMAGE,null],[$e.VERTEX_HEAD,null],[$e.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Mn.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Ht}},Zo=!1,Au=class{constructor(i=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(i),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case jt:t=this.materialsFlatShadedDoubleSide;break;case Ot:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case jt:t=this.materialsDoubleSide;break;case Ot:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(i){if(!(i instanceof Et))return i.clone();const e=i.uniforms,t=new Map;for(const s in e){const r=e[s].value;r.isRenderTargetTexture&&(e[s].value=null,t.set(s,r))}const n=i.clone();for(const s of t)e[s[0]].value=s[1],n.uniforms[s[0]].value=s[1];return n}setMaterial(i){if(this.disposeMaterials(),this.material=i,i!==null){const e=this.materials=[this.cloneMaterial(i),this.cloneMaterial(i),this.cloneMaterial(i)];for(const t of e)t.uniforms=Object.assign({},i.uniforms),t.side=Dn;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.side=Ot,n}),this.materialsDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.side=jt,n}),this.materialsFlatShaded=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n.side=Ot,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n.side=jt,n})}}render(i,e,t){const n=i.shadowMap.enabled;if(i.shadowMap.enabled=!1,Zo){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),i.render(e,t);for(const r of s)r[0].material=r[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,i.render(e,t),e.overrideMaterial=s}i.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){const i=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of i)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Zo}static set workaroundEnabled(i){Zo=i}},ai=-1,_t=class extends Jn{constructor(i,e=ai,t=ai,n=1){super(),this.resizable=i,this.baseSize=new Ae(1,1),this.preferredSize=new Ae(e,t),this.target=this.preferredSize,this.s=n,this.effectiveSize=new Ae,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const i=this.baseSize,e=this.preferredSize,t=this.effectiveSize,n=this.scale;e.width!==ai?t.width=e.width:e.height!==ai?t.width=Math.round(e.height*(i.width/Math.max(i.height,1))):t.width=Math.round(i.width*n),e.height!==ai?t.height=e.height:e.width!==ai?t.height=Math.round(e.width/Math.max(i.width/Math.max(i.height,1),1)):t.height=Math.round(i.height*n)}get width(){return this.effectiveSize.width}set width(i){this.preferredWidth=i}get height(){return this.effectiveSize.height}set height(i){this.preferredHeight=i}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(i){this.s!==i&&(this.s=i,this.preferredSize.setScalar(ai),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(i){this.scale=i}get baseWidth(){return this.baseSize.width}set baseWidth(i){this.baseSize.width!==i&&(this.baseSize.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(i){this.baseWidth=i}get baseHeight(){return this.baseSize.height}set baseHeight(i){this.baseSize.height!==i&&(this.baseSize.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(i){this.baseHeight=i}setBaseSize(i,e){(this.baseSize.width!==i||this.baseSize.height!==e)&&(this.baseSize.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(i){this.preferredSize.width!==i&&(this.preferredSize.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(i){this.preferredWidth=i}get preferredHeight(){return this.preferredSize.height}set preferredHeight(i){this.preferredSize.height!==i&&(this.preferredSize.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(i){this.preferredHeight=i}setPreferredSize(i,e){(this.preferredSize.width!==i||this.preferredSize.height!==e)&&(this.preferredSize.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(i){this.s=i.scale,this.baseSize.set(i.baseWidth,i.baseHeight),this.preferredSize.set(i.preferredWidth,i.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return ai}},We={ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},j_="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),opacity);}",Z_="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}",J_="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),opacity);}",$_="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),opacity);}",ey="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),opacity);}",ty="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),opacity);}",ny="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),opacity);}",iy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),opacity);}",sy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),opacity);}",ry="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),opacity);}",oy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),opacity);}",ay="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),opacity);}",cy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),opacity);}",ly="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),opacity);}",uy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),opacity);}",hy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),opacity);}",dy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),opacity);}",fy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),opacity);}",py="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),opacity);}",my="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),opacity);}",gy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),opacity);}",vy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),opacity);}",xy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",Ay="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),opacity);}",_y="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),opacity);}",yy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),opacity);}",My="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),opacity);}",Ey="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),opacity);}",Sy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),opacity);}",Ty="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",wy="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),opacity);}",by="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),opacity);}",Cy=new Map([[We.ADD,j_],[We.ALPHA,Z_],[We.AVERAGE,J_],[We.COLOR,$_],[We.COLOR_BURN,ey],[We.COLOR_DODGE,ty],[We.DARKEN,ny],[We.DIFFERENCE,iy],[We.DIVIDE,sy],[We.DST,null],[We.EXCLUSION,ry],[We.HARD_LIGHT,oy],[We.HARD_MIX,ay],[We.HUE,cy],[We.INVERT,ly],[We.INVERT_RGB,uy],[We.LIGHTEN,hy],[We.LINEAR_BURN,dy],[We.LINEAR_DODGE,fy],[We.LINEAR_LIGHT,py],[We.LUMINOSITY,my],[We.MULTIPLY,gy],[We.NEGATION,vy],[We.NORMAL,xy],[We.OVERLAY,Ay],[We.PIN_LIGHT,_y],[We.REFLECT,yy],[We.SATURATION,My],[We.SCREEN,Ey],[We.SOFT_LIGHT,Sy],[We.SRC,Ty],[We.SUBTRACT,wy],[We.VIVID_LIGHT,by]]),Ry=class extends Jn{constructor(i,e=1){super(),this._blendFunction=i,this.opacity=new re(e)}getOpacity(){return this.opacity.value}setOpacity(i){this.opacity.value=i}get blendFunction(){return this._blendFunction}set blendFunction(i){this._blendFunction=i,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(i){this.blendFunction=i}getShaderCode(){return Cy.get(this.blendFunction)}},eo=class extends Jn{constructor(i,e,{attributes:t=Mn.NONE,blendFunction:n=We.NORMAL,defines:s=new Map,uniforms:r=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=i,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=s,this.uniforms=r,this.extensions=o,this.blendMode=new Ry(n),this.blendMode.addEventListener("change",c=>this.setChanged()),this._inputColorSpace=Ht,this._outputColorSpace=Rn}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(i){this._inputColorSpace=i,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(i){this._outputColorSpace=i,this.setChanged()}set mainScene(i){}set mainCamera(i){}getName(){return this.name}setRenderer(i){this.renderer=i}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(i){this.attributes=i,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(i){this.fragmentShader=i,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(i){this.vertexShader=i,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(i,e=on){}update(i,e,t){}setSize(i,e){}initialize(i,e,t){}dispose(){for(const i of Object.keys(this)){const e=this[i];(e instanceof Rt||e instanceof rn||e instanceof yt||e instanceof $t)&&this[i].dispose()}}},to={MEDIUM:2,LARGE:3},Dy=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; +#include +}`,Iy="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",Py=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],Ly=class extends Et{constructor(i=new je){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new re(null),texelSize:new re(new je),scale:new re(1),kernel:new re(0)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Dy,vertexShader:Iy}),this.setTexelSize(i.x,i.y),this.kernelSize=to.MEDIUM}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.inputBuffer=i}get kernelSequence(){return Py[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(i){this.uniforms.scale.value=i}getScale(){return this.uniforms.scale.value}setScale(i){this.uniforms.scale.value=i}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(i){this.uniforms.kernel.value=i}setKernel(i){this.kernel=i}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e,i*.5,e*.5)}setSize(i,e){const t=1/i,n=1/e;this.uniforms.texelSize.value.set(t,n,t*.5,n*.5)}},mh=class extends $t{constructor({kernelSize:i=to.MEDIUM,resolutionScale:e=.5,width:t=_t.AUTO_SIZE,height:n=_t.AUTO_SIZE,resolutionX:s=t,resolutionY:r=n}={}){super("KawaseBlurPass"),this.renderTargetA=new Rt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new _t(this,s,r,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new Ly,this._blurMaterial.kernelSize=i,this.copyMaterial=new ph}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(i){this._blurMaterial=i}get dithering(){return this.copyMaterial.dithering}set dithering(i){this.copyMaterial.dithering=i}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(i){this.blurMaterial.kernelSize=i}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get scale(){return this.blurMaterial.scale}set scale(i){this.blurMaterial.scale=i}getScale(){return this.blurMaterial.scale}setScale(i){this.blurMaterial.scale=i}getKernelSize(){return this.kernelSize}setKernelSize(i){this.kernelSize=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,n,s){const r=this.scene,o=this.camera,a=this.renderTargetA,c=this.renderTargetB,l=this.blurMaterial,u=l.kernelSequence;let h=e;this.fullscreenMaterial=l;for(let d=0,f=u.length;d +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef RANGE +uniform vec2 range; +#elif defined(THRESHOLD) +uniform float threshold;uniform float smoothing; +#endif +varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb); +#ifdef RANGE +float low=step(range.x,l);float high=step(l,range.y);l*=low*high; +#elif defined(THRESHOLD) +l=smoothstep(threshold,threshold+smoothing,l)*l; +#endif +#ifdef COLOR +gl_FragColor=vec4(texel.rgb*clamp(l,0.0,1.0),l); +#else +gl_FragColor=vec4(l); +#endif +}`,Ny=class extends Et{constructor(i=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:ms.replace(/\D+/g,"")},uniforms:{inputBuffer:new re(null),threshold:new re(0),smoothing:new re(1),range:new re(null)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:By,vertexShader:er}),this.colorOutput=i,this.luminanceRange=e}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get threshold(){return this.uniforms.threshold.value}set threshold(i){this.smoothing>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=i}getThreshold(){return this.threshold}setThreshold(i){this.threshold=i}get smoothing(){return this.uniforms.smoothing.value}set smoothing(i){this.threshold>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=i}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(i){this.smoothing=i}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(i){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(i){i?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(i){return this.colorOutput}setColorOutputEnabled(i){this.colorOutput=i}get useRange(){return this.luminanceRange!==null}set useRange(i){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(i){i!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=i,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(i){this.luminanceRange=i}},Uy=class extends $t{constructor({renderTarget:i,luminanceRange:e,colorOutput:t,resolutionScale:n=1,width:s=_t.AUTO_SIZE,height:r=_t.AUTO_SIZE,resolutionX:o=s,resolutionY:a=r}={}){super("LuminancePass"),this.fullscreenMaterial=new Ny(t,e),this.needsSwap=!1,this.renderTarget=i,this.renderTarget===void 0&&(this.renderTarget=new Rt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const c=this.resolution=new _t(this,o,a,n);c.addEventListener("change",l=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(i,e,t,n,s){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}initialize(i,e,t){t!==void 0&&t!==Mt&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Fy=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#define WEIGHT_INNER 0.125 +#define WEIGHT_OUTER 0.0555555 +varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; +#include +}`,Oy="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",zy=class extends Et{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new re(null),texelSize:new re(new Ae)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Fy,vertexShader:Oy})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},Hy=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; +#else +uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; +#endif +uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); +#include +}`,ky="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",Gy=class extends Et{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new re(null),supportBuffer:new re(null),texelSize:new re(new Ae),radius:new re(.85)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Hy,vertexShader:ky})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}set supportBuffer(i){this.uniforms.supportBuffer.value=i}get radius(){return this.uniforms.radius.value}set radius(i){this.uniforms.radius.value=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},Vy=class extends $t{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Rt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new zy,this.upsamplingMaterial=new Gy,this.resolution=new Ae}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(i){if(this.levels!==i){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const f=u[d];c.setSize(h.width,h.height),c.inputBuffer=h.texture,c.supportBuffer=l[d].texture,i.setRenderTarget(f),i.render(r,o),h=f}}setSize(i,e){const t=this.resolution;t.set(i,e);let n=t.width,s=t.height;for(let r=0,o=this.downsamplingMipmaps.length;rthis.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get dithering(){return this.blurPass.dithering}set dithering(i){this.blurPass.dithering=i}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(i){this.blurPass.kernelSize=i}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(i){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(i){this.uniforms.get("intensity").value=i}getIntensity(){return this.intensity}setIntensity(i){this.intensity=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}update(i,e,t){const n=this.renderTarget,s=this.luminancePass;s.enabled?(s.render(i,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(i,s.renderTarget):this.blurPass.render(i,s.renderTarget,n)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(i,e):this.blurPass.render(i,e,n)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(i,e),this.mipmapBlurPass.setSize(i,e)}initialize(i,e,t){this.blurPass.initialize(i,e,t),this.luminancePass.initialize(i,e,t),this.mipmapBlurPass.initialize(i,e,t),t!==void 0&&(this.renderTarget.texture.type=t,i!==null&&i.outputColorSpace===Ve&&(this.renderTarget.texture.colorSpace=Ve))}},gh={RED:0,GREEN:1},vh={DISCARD:0,MULTIPLY_RGB:3},Yy=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#if PASS == 1 +uniform vec4 kernel64[32]; +#else +uniform vec4 kernel16[8]; +#endif +uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;varying vec2 vUv;void main(){ +#ifdef FOREGROUND +vec2 cocNearFar=texture2D(cocBuffer,vUv).rg*scale;float coc=cocNearFar.x; +#else +float coc=texture2D(cocBuffer,vUv).g*scale; +#endif +if(coc==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ +#ifdef FOREGROUND +vec2 step=texelSize*max(cocNearFar.x,cocNearFar.y); +#else +vec2 step=texelSize*coc; +#endif +#if PASS == 1 +vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; +#else +vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; +#endif +}}`,Nr=class extends Et{constructor(i=!1,e=!1){super({name:"BokehMaterial",defines:{PASS:i?"2":"1"},uniforms:{inputBuffer:new re(null),cocBuffer:new re(null),texelSize:new re(new Ae),kernel64:new re(null),kernel16:new re(null),scale:new re(1)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Yy,vertexShader:er}),e&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}set cocBuffer(i){this.uniforms.cocBuffer.value=i}setCoCBuffer(i){this.uniforms.cocBuffer.value=i}get scale(){return this.uniforms.scale.value}set scale(i){this.uniforms.scale.value=i}getScale(i){return this.scale}setScale(i){this.scale=i}generateKernel(){const i=2.39996323,e=new Float64Array(128),t=new Float64Array(32);let n=0,s=0;for(let r=0,o=Math.sqrt(80);r<80;++r){const a=r*i,c=Math.sqrt(r)/o,l=c*Math.cos(a),u=c*Math.sin(a);r%5===0?(t[s++]=l,t[s++]=u):(e[n++]=l,e[n++]=u)}this.uniforms.kernel64.value=e,this.uniforms.kernel16.value=t}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e)}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}};function $i(i,e,t){return i*(e-t)-e}function Di(i,e,t){return Math.min(Math.max((i+e)/(e-t),0),1)}var qy=`#include +#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +float depth=texture2D(depthBuffer,uv).r; +#endif +#ifdef LOG_DEPTH +float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d; +#endif +return depth;}void main(){float depth=readDepth(vUv); +#ifdef PERSPECTIVE_CAMERA +float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); +#else +float linearDepth=depth; +#endif +float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,Ky=class extends Et{constructor(i){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new re(null),focusDistance:new re(0),focusRange:new re(0),cameraNear:new re(.3),cameraFar:new re(1e3)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:qy,vertexShader:er}),this.uniforms.focalLength=this.uniforms.focusRange,this.copyCameraSettings(i)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(i){this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=on){this.depthBuffer=i,this.depthPacking=e}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(i){this.uniforms.focusDistance.value=i}get worldFocusDistance(){return-$i(this.focusDistance,this.near,this.far)}set worldFocusDistance(i){this.focusDistance=Di(-i,this.near,this.far)}getFocusDistance(i){this.uniforms.focusDistance.value=i}setFocusDistance(i){this.uniforms.focusDistance.value=i}get focalLength(){return this.focusRange}set focalLength(i){this.focusRange=i}get focusRange(){return this.uniforms.focusRange.value}set focusRange(i){this.uniforms.focusRange.value=i}get worldFocusRange(){return-$i(this.focusRange,this.near,this.far)}set worldFocusRange(i){this.focusRange=Di(-i,this.near,this.far)}getFocalLength(i){return this.focusRange}setFocalLength(i){this.focusRange=i}adoptCameraSettings(i){this.copyCameraSettings(i)}copyCameraSettings(i){i&&(this.uniforms.cameraNear.value=i.near,this.uniforms.cameraFar.value=i.far,i instanceof Ft?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},Qy=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef MASK_PRECISION_HIGH +uniform mediump sampler2D maskTexture; +#else +uniform lowp sampler2D maskTexture; +#endif +#if MASK_FUNCTION != 0 +uniform float strength; +#endif +varying vec2 vUv;void main(){ +#if COLOR_CHANNEL == 0 +float mask=texture2D(maskTexture,vUv).r; +#elif COLOR_CHANNEL == 1 +float mask=texture2D(maskTexture,vUv).g; +#elif COLOR_CHANNEL == 2 +float mask=texture2D(maskTexture,vUv).b; +#else +float mask=texture2D(maskTexture,vUv).a; +#endif +#if MASK_FUNCTION == 0 +#ifdef INVERTED +mask=step(mask,0.0); +#else +mask=1.0-step(mask,0.0); +#endif +#else +mask=clamp(mask*strength,0.0,1.0); +#ifdef INVERTED +mask=1.0-mask; +#endif +#endif +#if MASK_FUNCTION == 3 +vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=vec4(mask*texel.rgb,texel.a); +#elif MASK_FUNCTION == 2 +gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); +#else +gl_FragColor=mask*texture2D(inputBuffer,vUv); +#endif +}`,jy=class extends Et{constructor(i=null){super({name:"MaskMaterial",uniforms:{maskTexture:new re(i),inputBuffer:new re(null),strength:new re(1)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Qy,vertexShader:er}),this.colorChannel=gh.RED,this.maskFunction=vh.DISCARD}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}set maskTexture(i){this.uniforms.maskTexture.value=i,delete this.defines.MASK_PRECISION_HIGH,i.type!==Mt&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(i){this.maskTexture=i}set colorChannel(i){this.defines.COLOR_CHANNEL=i.toFixed(0),this.needsUpdate=!0}setColorChannel(i){this.colorChannel=i}set maskFunction(i){this.defines.MASK_FUNCTION=i.toFixed(0),this.needsUpdate=!0}setMaskFunction(i){this.maskFunction=i}get inverted(){return this.defines.INVERTED!==void 0}set inverted(i){this.inverted&&!i?delete this.defines.INVERTED:i&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(i){this.inverted=i}get strength(){return this.uniforms.strength.value}set strength(i){this.uniforms.strength.value=i}getStrength(){return this.strength}setStrength(i){this.strength=i}},qn=class extends $t{constructor(i,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=i,this.input=e}setInput(i){this.input=i}render(i,e,t,n,s){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}initialize(i,e,t){t!==void 0&&t!==Mt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Zy=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; +#else +uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; +#endif +uniform lowp sampler2D nearCoCBuffer;uniform lowp sampler2D farCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv); +#if MASK_FUNCTION == 1 +vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,colorFar.a);cocNearFar.x=min(cocNearFar.x*scale,1.0); +#else +vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,texture2D(farCoCBuffer,uv).g);cocNearFar=min(cocNearFar*scale,1.0); +#endif +vec4 result=inputColor*(1.0-cocNearFar.y)+colorFar;result=mix(result,colorNear,cocNearFar.x);outputColor=result;}`,Jy=class extends eo{constructor(i,{blendFunction:e,worldFocusDistance:t,worldFocusRange:n,focusDistance:s=0,focalLength:r=.1,focusRange:o=r,bokehScale:a=1,resolutionScale:c=1,width:l=_t.AUTO_SIZE,height:u=_t.AUTO_SIZE,resolutionX:h=l,resolutionY:d=u}={}){super("DepthOfFieldEffect",Zy,{blendFunction:e,attributes:Mn.DEPTH,uniforms:new Map([["nearColorBuffer",new re(null)],["farColorBuffer",new re(null)],["nearCoCBuffer",new re(null)],["farCoCBuffer",new re(null)],["scale",new re(1)]])}),this.camera=i,this.renderTarget=new Rt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.uniforms.get("farCoCBuffer").value=this.renderTargetCoC.texture,this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new qn(new Ky(i));const f=this.cocMaterial;f.focusDistance=s,f.focusRange=o,t!==void 0&&(f.worldFocusDistance=t),n!==void 0&&(f.worldFocusRange=n),this.blurPass=new mh({resolutionScale:c,resolutionX:h,resolutionY:d,kernelSize:to.MEDIUM}),this.maskPass=new qn(new jy(this.renderTargetCoC.texture));const g=this.maskPass.fullscreenMaterial;g.colorChannel=gh.GREEN,this.maskFunction=vh.MULTIPLY_RGB,this.bokehNearBasePass=new qn(new Nr(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new qn(new Nr(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new qn(new Nr(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new qn(new Nr(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null;const v=this.resolution=new _t(this,h,d,c);v.addEventListener("change",m=>this.setSize(v.baseWidth,v.baseHeight)),this.bokehScale=a}set mainCamera(i){this.camera=i,this.cocMaterial.copyCameraSettings(i)}get cocTexture(){return this.renderTargetCoC.texture}get maskFunction(){return this.maskPass.fullscreenMaterial.maskFunction}set maskFunction(i){this.maskFunction!==i&&(this.defines.set("MASK_FUNCTION",i.toFixed(0)),this.maskPass.fullscreenMaterial.maskFunction=i,this.setChanged())}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.cocMaterial}getBlurPass(){return this.blurPass}getResolution(){return this.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(i){this.bokehNearBasePass.fullscreenMaterial.scale=i,this.bokehNearFillPass.fullscreenMaterial.scale=i,this.bokehFarBasePass.fullscreenMaterial.scale=i,this.bokehFarFillPass.fullscreenMaterial.scale=i,this.maskPass.fullscreenMaterial.strength=i,this.uniforms.get("scale").value=i}getBokehScale(){return this.bokehScale}setBokehScale(i){this.bokehScale=i}getTarget(){return this.target}setTarget(i){this.target=i}calculateFocusDistance(i){const e=this.camera,t=e.position.distanceTo(i);return Di(-t,e.near,e.far)}setDepthTexture(i,e=on){this.cocMaterial.depthBuffer=i,this.cocMaterial.depthPacking=e}update(i,e,t){const n=this.renderTarget,s=this.renderTargetCoC,r=this.renderTargetCoCBlurred,o=this.renderTargetMasked;if(this.target!==null){const a=this.calculateFocusDistance(this.target);this.cocMaterial.focusDistance=a}this.cocPass.render(i,null,s),this.blurPass.render(i,s,r),this.maskPass.render(i,e,o),this.bokehFarBasePass.render(i,o,n),this.bokehFarFillPass.render(i,n,this.renderTargetFar),this.bokehNearBasePass.render(i,e,n),this.bokehNearFillPass.render(i,n,this.renderTargetNear)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e);const n=t.width,s=t.height;this.cocPass.setSize(i,e),this.blurPass.setSize(i,e),this.maskPass.setSize(i,e),this.renderTargetFar.setSize(i,e),this.renderTargetCoC.setSize(i,e),this.renderTargetMasked.setSize(i,e),this.renderTarget.setSize(n,s),this.renderTargetNear.setSize(n,s),this.renderTargetCoCBlurred.setSize(n,s),this.bokehNearBasePass.fullscreenMaterial.setSize(i,e),this.bokehNearFillPass.fullscreenMaterial.setSize(i,e),this.bokehFarBasePass.fullscreenMaterial.setSize(i,e),this.bokehFarFillPass.fullscreenMaterial.setSize(i,e)}initialize(i,e,t){this.cocPass.initialize(i,e,t),this.maskPass.initialize(i,e,t),this.bokehNearBasePass.initialize(i,e,t),this.bokehNearFillPass.initialize(i,e,t),this.bokehFarBasePass.initialize(i,e,t),this.bokehFarFillPass.initialize(i,e,t),this.blurPass.initialize(i,e,Mt),i.capabilities.logarithmicDepthBuffer&&(this.cocPass.fullscreenMaterial.defines.LOG_DEPTH="1"),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t,i!==null&&i.outputColorSpace===Ve&&(this.renderTarget.texture.colorSpace=Ve,this.renderTargetNear.texture.colorSpace=Ve,this.renderTargetFar.texture.colorSpace=Ve,this.renderTargetMasked.texture.colorSpace=Ve))}};function $y(i,e,t){const n=new Map([[Ks,1],[ja,2],[Zt,4]]);let s;if(n.has(e)||console.error("Invalid noise texture format"),t===Mt){s=new Uint8Array(i*n.get(e));for(let r=0,o=s.length;r +#endif +#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} +#elif PREDICATION_MODE == 2 +uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} +#endif +#if PREDICATION_MODE != 0 +vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} +#endif +#if EDGE_DETECTION_MODE != 0 +uniform sampler2D inputBuffer; +#endif +void main(){ +#if EDGE_DETECTION_MODE == 0 +const vec2 threshold=vec2(DEPTH_THRESHOLD); +#elif PREDICATION_MODE != 0 +vec2 threshold=calculatePredicatedThreshold(); +#else +const vec2 threshold=vec2(EDGE_THRESHOLD); +#endif +#if EDGE_DETECTION_MODE == 0 +vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); +#elif EDGE_DETECTION_MODE == 1 +float l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); +#elif EDGE_DETECTION_MODE == 2 +vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); +#endif +}`,iM=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; +#if EDGE_DETECTION_MODE != 0 +varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; +#endif +void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); +#if EDGE_DETECTION_MODE != 0 +vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); +#endif +gl_Position=vec4(position.xy,1.0,1.0);}`,sM=class extends Et{constructor(i=new Ae,e=Ah.COLOR){super({name:"EdgeDetectionMaterial",defines:{THREE_REVISION:ms.replace(/\D+/g,""),LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new re(null),depthBuffer:new re(null),predicationBuffer:new re(null),texelSize:new re(i)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:nM,vertexShader:iM}),this.edgeDetectionMode=e}set depthBuffer(i){this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=on){this.depthBuffer=i,this.depthPacking=e}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(i){this.defines.EDGE_DETECTION_MODE=i.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(i){this.edgeDetectionMode=i}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(i){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=i.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(i){this.localContrastAdaptationFactor=i}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(i){this.defines.EDGE_THRESHOLD=i.toFixed("6"),this.defines.DEPTH_THRESHOLD=(i*.1).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(i){this.edgeDetectionThreshold=i}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(i){this.defines.PREDICATION_MODE=i.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(i){this.predicationMode=i}set predicationBuffer(i){this.uniforms.predicationBuffer.value=i}setPredicationBuffer(i){this.uniforms.predicationBuffer.value=i}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(i){this.defines.PREDICATION_THRESHOLD=i.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(i){this.predicationThreshold=i}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(i){this.defines.PREDICATION_SCALE=i.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(i){this.predicationScale=i}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(i){this.defines.PREDICATION_STRENGTH=i.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(i){this.predicationStrength=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},rM=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) +#if __VERSION__ < 300 +#define round(v) floor(v + 0.5) +#endif +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ +#if !defined(DISABLE_CORNER_DETECTION) +vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); +#endif +}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ +#if !defined(DISABLE_CORNER_DETECTION) +vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); +#endif +}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ +#if !defined(DISABLE_DIAG_DETECTION) +weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ +#endif +vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); +#if !defined(DISABLE_DIAG_DETECTION) +}else{e.r=0.0;} +#endif +}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,oM="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",aM=class extends Et{constructor(i=new Ae,e=new Ae){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new re(null),searchTexture:new re(null),areaTexture:new re(null),resolution:new re(e),texelSize:new re(i)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:rM,vertexShader:oM})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(i){this.uniforms.searchTexture.value=i}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(i){this.uniforms.areaTexture.value=i}setLookupTextures(i,e){this.searchTexture=i,this.areaTexture=e}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(i){const e=Math.min(Math.max(i,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(i){this.orthogonalSearchSteps=i}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(i){const e=Math.min(Math.max(i,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(i){this.diagonalSearchSteps=i}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(i){i?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(i){this.diagonalDetection=i}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(i){const e=Math.min(Math.max(i,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(i){this.cornerRounding=i}get cornerDetection(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerDetection(i){i?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(i){this.cornerDetection=i}setSize(i,e){const t=this.uniforms;t.texelSize.value.set(1/i,1/e),t.resolution.value.set(i,e)}},_u="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",yu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17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r9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",cM="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",lM="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",uM=class extends eo{constructor({blendFunction:i=We.SRC,preset:e=Ns.MEDIUM,edgeDetectionMode:t=Ah.COLOR,predicationMode:n=tM.DISABLED}={}){super("SMAAEffect",cM,{vertexShader:lM,blendFunction:i,attributes:Mn.CONVOLUTION|Mn.DEPTH,uniforms:new Map([["weightMap",new re(null)]])});let s,r;arguments.length>1&&(s=arguments[0],r=arguments[1],arguments.length>2&&(e=arguments[2]),arguments.length>3&&(t=arguments[3])),this.renderTargetEdges=new Rt(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new _c(!0,!1,!1),this.clearPass.overrideClearColor=new Be(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new qn(new sM),this.edgeDetectionMaterial.edgeDetectionMode=t,this.edgeDetectionMaterial.predicationMode=n,this.weightsPass=new qn(new aM);const o=new ju;o.onLoad=()=>{const a=new yt(s);a.name="SMAA.Search",a.magFilter=Tt,a.minFilter=Tt,a.generateMipmaps=!1,a.needsUpdate=!0,a.flipY=!0,this.weightsMaterial.searchTexture=a;const c=new yt(r);c.name="SMAA.Area",c.magFilter=Pt,c.minFilter=Pt,c.generateMipmaps=!1,c.needsUpdate=!0,c.flipY=!1,this.weightsMaterial.areaTexture=c,this.dispatchEvent({type:"load"})},o.itemStart("search"),o.itemStart("area"),s!==void 0&&r!==void 0?(o.itemEnd("search"),o.itemEnd("area")):typeof Image<"u"&&(s=new Image,r=new Image,s.addEventListener("load",()=>o.itemEnd("search")),r.addEventListener("load",()=>o.itemEnd("area")),s.src=_u,r.src=yu),this.applyPreset(e)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(i){this.edgeDetectionMaterial.edgeDetectionThreshold=i}setOrthogonalSearchSteps(i){this.weightsMaterial.orthogonalSearchSteps=i}applyPreset(i){const e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(i){case Ns.LOW:e.edgeDetectionThreshold=.15,t.orthogonalSearchSteps=4,t.diagonalDetection=!1,t.cornerDetection=!1;break;case Ns.MEDIUM:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=8,t.diagonalDetection=!1,t.cornerDetection=!1;break;case Ns.HIGH:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=16,t.diagonalSearchSteps=8,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break;case Ns.ULTRA:e.edgeDetectionThreshold=.05,t.orthogonalSearchSteps=32,t.diagonalSearchSteps=16,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break}}setDepthTexture(i,e=on){this.edgeDetectionMaterial.depthBuffer=i,this.edgeDetectionMaterial.depthPacking=e}update(i,e,t){this.clearPass.render(i,this.renderTargetEdges),this.edgeDetectionPass.render(i,e,this.renderTargetEdges),this.weightsPass.render(i,this.renderTargetEdges,this.renderTargetWeights)}setSize(i,e){this.edgeDetectionMaterial.setSize(i,e),this.weightsMaterial.setSize(i,e),this.renderTargetEdges.setSize(i,e),this.renderTargetWeights.setSize(i,e)}dispose(){const{searchTexture:i,areaTexture:e}=this.weightsMaterial;i!==null&&e!==null&&(i.dispose(),e.dispose()),super.dispose()}static get searchImageDataURL(){return _u}static get areaImageDataURL(){return yu}},hM=`#include +#include +#ifdef NORMAL_DEPTH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D normalDepthBuffer; +#else +uniform mediump sampler2D normalDepthBuffer; +#endif +float readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;} +#else +uniform lowp sampler2D normalBuffer; +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +} +#endif +uniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform vec2 cameraNearFar;uniform float intensity;uniform float minRadiusScale;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#else +return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#endif +}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){float radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;float noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i1.0||coords.t<0.0||coords.t>1.0){continue;}float sampleDepth=readDepth(coords);float viewZ=getViewZ(sampleDepth); +#ifdef PERSPECTIVE_CAMERA +float linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y); +#else +float linearSampleDepth=sampleDepth; +#endif +float proximity=abs(depth-linearSampleDepth);if(proximity +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +#ifdef DOWNSAMPLE_NORMALS +uniform lowp sampler2D normalBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(i,e=on){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e}render(i,e,t,n,s){i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(i,e)}initialize(i,e,t){const n=i.getContext();if(!(n.getExtension("EXT_color_buffer_float")||n.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},xM=`uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity; +#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D normalDepthBuffer; +#else +uniform mediump sampler2D normalDepthBuffer; +#endif +#endif +#ifdef COLORIZE +uniform vec3 color; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r; +#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300 +vec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distancethis.setSize(I.baseWidth,I.baseHeight)),this.camera=i,this.depthDownsamplingPass=new vM({normalBuffer:e,resolutionScale:w}),this.depthDownsamplingPass.enabled=r===null,this.ssaoPass=new qn(new fM(i));const k=new eM(Mu,Mu,Zt);k.wrapS=k.wrapT=Ii;const R=this.ssaoMaterial;R.normalBuffer=e,R.noiseTexture=k,R.minRadiusScale=v,R.samples=n,R.radius=p,R.rings=s,R.fade=A,R.bias=_,R.distanceThreshold=h,R.distanceFalloff=d,R.proximityThreshold=f,R.proximityFalloff=g,a!==void 0&&(R.worldDistanceThreshold=a),c!==void 0&&(R.worldDistanceFalloff=c),l!==void 0&&(R.worldProximityThreshold=l),u!==void 0&&(R.worldProximityFalloff=u),r!==null&&(this.ssaoMaterial.normalDepthBuffer=r,this.defines.set("NORMAL_DEPTH","1")),this.depthAwareUpsampling=o,this.color=b}set mainCamera(i){this.camera=i,this.ssaoMaterial.copyCameraSettings(i)}get normalBuffer(){return this.ssaoMaterial.normalBuffer}set normalBuffer(i){this.ssaoMaterial.normalBuffer=i,this.depthDownsamplingPass.fullscreenMaterial.normalBuffer=i}getResolution(){return this.resolution}get ssaoMaterial(){return this.ssaoPass.fullscreenMaterial}getSSAOMaterial(){return this.ssaoMaterial}get samples(){return this.ssaoMaterial.samples}set samples(i){this.ssaoMaterial.samples=i}get rings(){return this.ssaoMaterial.rings}set rings(i){this.ssaoMaterial.rings=i}get radius(){return this.ssaoMaterial.radius}set radius(i){this.ssaoMaterial.radius=i}get depthAwareUpsampling(){return this.defines.has("DEPTH_AWARE_UPSAMPLING")}set depthAwareUpsampling(i){this.depthAwareUpsampling!==i&&(i?this.defines.set("DEPTH_AWARE_UPSAMPLING","1"):this.defines.delete("DEPTH_AWARE_UPSAMPLING"),this.setChanged())}isDepthAwareUpsamplingEnabled(){return this.depthAwareUpsampling}setDepthAwareUpsamplingEnabled(i){this.depthAwareUpsampling=i}get distanceScaling(){return!0}set distanceScaling(i){}get color(){return this.uniforms.get("color").value}set color(i){const e=this.uniforms,t=this.defines;i!==null?t.has("COLORIZE")?e.get("color").value.set(i):(t.set("COLORIZE","1"),e.get("color").value=new Be(i),this.setChanged()):t.has("COLORIZE")&&(t.delete("COLORIZE"),e.get("color").value=null,this.setChanged())}get luminanceInfluence(){return this.uniforms.get("luminanceInfluence").value}set luminanceInfluence(i){this.uniforms.get("luminanceInfluence").value=i}get intensity(){return this.uniforms.get("intensity").value}set intensity(i){this.uniforms.get("intensity").value=i}getColor(){return this.color}setColor(i){this.color=i}setDistanceCutoff(i,e){this.ssaoMaterial.distanceThreshold=i,this.ssaoMaterial.distanceFalloff=e}setProximityCutoff(i,e){this.ssaoMaterial.proximityThreshold=i,this.ssaoMaterial.proximityFalloff=e}setDepthTexture(i,e=on){this.depthDownsamplingPass.setDepthTexture(i,e),this.ssaoMaterial.depthBuffer=i,this.ssaoMaterial.depthPacking=e}update(i,e,t){const n=this.renderTarget;this.depthDownsamplingPass.enabled&&this.depthDownsamplingPass.render(i),this.ssaoPass.render(i,null,n)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e);const n=t.width,s=t.height;this.ssaoMaterial.copyCameraSettings(this.camera),this.ssaoMaterial.setSize(n,s),this.renderTarget.setSize(n,s),this.depthDownsamplingPass.resolution.scale=t.scale,this.depthDownsamplingPass.setSize(i,e)}initialize(i,e,t){try{let n=this.uniforms.get("normalDepthBuffer").value;n===null&&(this.depthDownsamplingPass.initialize(i,e,t),n=this.depthDownsamplingPass.texture,this.uniforms.get("normalDepthBuffer").value=n,this.ssaoMaterial.normalDepthBuffer=n,this.defines.set("NORMAL_DEPTH","1"))}catch{this.depthDownsamplingPass.enabled=!1}}},_M=`#include +#include +#include +#define packFloatToRGBA(v) packDepthToRGBA(v) +#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); +#else +return orthographicDepthToViewZ(depth,cameraNear,cameraFar); +#endif +}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; +#ifdef ENCODE_OUTPUT +#include +#endif +#include +}`,yM="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",MM=class extends Et{constructor(i,e,t,n,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:ms.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new re(null),depthBuffer:new re(null),resolution:new re(new Ae),texelSize:new re(new Ae),cameraNear:new re(.3),cameraFar:new re(1e3),aspect:new re(1),time:new re(0)},blending:St,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:s}),i&&this.setShaderParts(i),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(n)}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(i){this.uniforms.depthBuffer.value=i}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=on){this.depthBuffer=i,this.depthPacking=e}setShaderData(i){this.setShaderParts(i.shaderParts),this.setDefines(i.defines),this.setUniforms(i.uniforms),this.setExtensions(i.extensions)}setShaderParts(i){return this.fragmentShader=_M.replace($e.FRAGMENT_HEAD,i.get($e.FRAGMENT_HEAD)||"").replace($e.FRAGMENT_MAIN_UV,i.get($e.FRAGMENT_MAIN_UV)||"").replace($e.FRAGMENT_MAIN_IMAGE,i.get($e.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=yM.replace($e.VERTEX_HEAD,i.get($e.VERTEX_HEAD)||"").replace($e.VERTEX_MAIN_SUPPORT,i.get($e.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(i){for(const e of i.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(i){for(const e of i.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(i){this.extensions={};for(const e of i)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(i){this.encodeOutput!==i&&(i?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(i){return this.encodeOutput}setOutputEncodingEnabled(i){this.encodeOutput=i}get time(){return this.uniforms.time.value}set time(i){this.uniforms.time.value=i}setDeltaTime(i){this.uniforms.time.value+=i}adoptCameraSettings(i){this.copyCameraSettings(i)}copyCameraSettings(i){i&&(this.uniforms.cameraNear.value=i.near,this.uniforms.cameraFar.value=i.far,i instanceof Ft?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(i,e){const t=this.uniforms;t.resolution.value.set(i,e),t.texelSize.value.set(1/i,1/e),t.aspect.value=i/e}static get Section(){return $e}};function Eu(i,e,t){for(const n of e){const s="$1"+i+n.charAt(0).toUpperCase()+n.slice(1),r=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(r,s))}}function EM(i,e,t){let n=e.getFragmentShader(),s=e.getVertexShader();const r=n!==void 0&&/mainImage/.test(n),o=n!==void 0&&/mainUv/.test(n);if(t.attributes|=e.getAttributes(),n===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&(t.attributes&Mn.CONVOLUTION)!==0)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=t.shaderParts;let l=c.get($e.FRAGMENT_HEAD)||"",u=c.get($e.FRAGMENT_MAIN_UV)||"",h=c.get($e.FRAGMENT_MAIN_IMAGE)||"",d=c.get($e.VERTEX_HEAD)||"",f=c.get($e.VERTEX_MAIN_SUPPORT)||"";const g=new Set,v=new Set;if(o&&(u+=` ${i}MainUv(UV); +`,t.uvTransformation=!0),s!==null&&/mainSupport/.test(s)){const x=/mainSupport *\([\w\s]*?uv\s*?\)/.test(s);f+=` ${i}MainSupport(`,f+=x?`vUv); +`:`); +`;for(const _ of s.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const A of _[1].split(/\s*,\s*/))t.varyings.add(A),g.add(A),v.add(A);for(const _ of s.matchAll(a))v.add(_[1])}for(const x of n.matchAll(a))v.add(x[1]);for(const x of e.defines.keys())v.add(x.replace(/\([\w\s,]*\)/g,""));for(const x of e.uniforms.keys())v.add(x);v.delete("while"),v.delete("for"),v.delete("if"),e.uniforms.forEach((x,_)=>t.uniforms.set(i+_.charAt(0).toUpperCase()+_.slice(1),x)),e.defines.forEach((x,_)=>t.defines.set(i+_.charAt(0).toUpperCase()+_.slice(1),x));const m=new Map([["fragment",n],["vertex",s]]);Eu(i,v,t.defines),Eu(i,v,m),n=m.get("fragment"),s=m.get("vertex");const p=e.blendMode;if(t.blendModes.set(p.blendFunction,p),r){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(h+=e.inputColorSpace===Ve?`color0 = sRGBTransferOETF(color0); + `:`color0 = sRGBToLinear(color0); + `),e.outputColorSpace!==Rn?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const x=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;h+=`${i}MainImage(color0, UV, `,(t.attributes&Mn.DEPTH)!==0&&x.test(n)&&(h+="depth, ",t.readDepth=!0),h+=`color1); + `;const _=i+"BlendOpacity";t.uniforms.set(_,p.opacity),h+=`color0 = blend${p.blendFunction}(color0, color1, ${_}); + + `,l+=`uniform float ${_}; + +`}if(l+=n+` +`,s!==null&&(d+=s+` +`),c.set($e.FRAGMENT_HEAD,l),c.set($e.FRAGMENT_MAIN_UV,u),c.set($e.FRAGMENT_MAIN_IMAGE,h),c.set($e.VERTEX_HEAD,d),c.set($e.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const x of e.extensions)t.extensions.add(x)}}var SM=class extends $t{constructor(i,...e){super("EffectPass"),this.fullscreenMaterial=new MM(null,null,null,i),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(i){for(const e of this.effects)e.mainScene=i}set mainCamera(i){this.fullscreenMaterial.copyCameraSettings(i);for(const e of this.effects)e.mainCamera=i}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(i){this.fullscreenMaterial.encodeOutput=i}get dithering(){return this.fullscreenMaterial.dithering}set dithering(i){const e=this.fullscreenMaterial;e.dithering=i,e.needsUpdate=!0}setEffects(i){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=i.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const i=new Q_;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===We.DST)i.attributes|=o.getAttributes()&Mn.DEPTH;else{if((i.attributes&o.getAttributes()&Mn.CONVOLUTION)!==0)throw new Error(`Convolution effects cannot be merged (${o.name})`);EM("e"+e++,o,i)}let t=i.shaderParts.get($e.FRAGMENT_HEAD),n=i.shaderParts.get($e.FRAGMENT_MAIN_IMAGE),s=i.shaderParts.get($e.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const o of i.blendModes.values())t+=o.getShaderCode().replace(r,`blend${o.blendFunction}`)+` +`;(i.attributes&Mn.DEPTH)!==0?(i.readDepth&&(n=`float depth = readDepth(UV); + + `+n),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,i.colorSpace===Ve&&(n+=`color0 = sRGBToLinear(color0); + `),i.uvTransformation?(s=`vec2 transformedUv = vUv; +`+s,i.defines.set("UV","transformedUv")):i.defines.set("UV","vUv"),i.shaderParts.set($e.FRAGMENT_HEAD,t),i.shaderParts.set($e.FRAGMENT_MAIN_IMAGE,n),i.shaderParts.set($e.FRAGMENT_MAIN_UV,s);for(const[o,a]of i.shaderParts)a!==null&&i.shaderParts.set(o,a.trim().replace(/^#/,` +#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(i)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(i,e=on){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(i,e)}render(i,e,t,n,s){for(const r of this.effects)r.update(i,e,n);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=n*this.timeScale,i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}}setSize(i,e){this.fullscreenMaterial.setSize(i,e);for(const t of this.effects)t.setSize(i,e)}initialize(i,e,t){this.renderer=i;for(const n of this.effects)n.initialize(i,e,t);this.updateMaterial(),t!==void 0&&t!==Mt&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const i of this.effects)i.removeEventListener("change",this.listener),i.dispose()}handleEvent(i){switch(i.type){case"change":this.recompile();break}}},TM=class extends $t{constructor(i,e,{renderTarget:t,resolutionScale:n=1,width:s=_t.AUTO_SIZE,height:r=_t.AUTO_SIZE,resolutionX:o=s,resolutionY:a=r}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new xh(i,e,new gf);const c=this.renderPass;c.ignoreBackground=!0,c.skipShadowMapUpdate=!0;const l=c.getClearPass();l.overrideClearColor=new Be(7829503),l.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Rt(1,1,{minFilter:Tt,magFilter:Tt}),this.renderTarget.texture.name="NormalPass.Target");const u=this.resolution=new _t(this,o,a,n);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(i){this.renderPass.mainScene=i}set mainCamera(i){this.renderPass.mainCamera=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,n,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(i,r,r)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}};class wM{composer;bloomEffect;ssaoEffect;depthOfFieldEffect;normalPass;constructor(e,t,n){this.composer=new K_(e);const s=new xh(t,n);this.composer.addPass(s),this.normalPass=new TM(t,n),this.composer.addPass(this.normalPass),this.bloomEffect=new Xy({intensity:1.2,luminanceThreshold:.1,luminanceSmoothing:.15,radius:.9,mipmapBlur:!0}),this.ssaoEffect=new AM(n,this.normalPass.texture,{intensity:.8,fade:.01,radius:.15,samples:32,rings:4,worldDistanceThreshold:20,worldDistanceFalloff:5,worldProximityThreshold:5e-4,worldProximityFalloff:.001,luminanceInfluence:.7,bias:.02}),this.depthOfFieldEffect=new Jy(n,{focusDistance:.015,focalLength:.12,bokehScale:4,height:480});const r=new uM,o=new SM(n,this.bloomEffect,this.ssaoEffect,this.depthOfFieldEffect,r);this.composer.addPass(o)}render(e){this.composer.render(e)}resize(e,t){this.composer.setSize(e,t)}setBloomIntensity(e){this.bloomEffect.intensity=e}setSSAOIntensity(e){this.ssaoEffect.intensity=e}setDepthOfFieldFocus(e){this.depthOfFieldEffect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}getComposer(){return this.composer}update(e){}dispose(){this.composer.dispose(),this.bloomEffect.dispose(),this.ssaoEffect.dispose(),this.depthOfFieldEffect.dispose(),this.normalPass.dispose()}}class bM{scene;camera;renderer;world;physicsObjects=[];mouse;raycaster;attractionPoint;mouseWorldPosition;lastTime=0;modelLoader;eventManager;postProcessing;usePostProcessing=!0;constructor(){this.scene=new Fa,this.camera=new Ft(45,window.innerWidth/window.innerHeight,.1,1e3);const e=document.getElementById("three-canvas");if(!e)throw new Error("Canvas element not found");this.renderer=new Ix({canvas:e,antialias:!0,alpha:!0}),this.world=vu.setupPhysicsWorld(),this.mouse=new Ae,this.raycaster=new Kf,this.attractionPoint=new U(0,0,0),this.mouseWorldPosition=new U,this.modelLoader=new z_,this.eventManager=new H_(this.mouse,this.raycaster,this.mouseWorldPosition,this.camera,this.renderer),this.setupHomeButton(),this.init()}setupHomeButton(){const e=document.getElementById("home-button");e&&e.addEventListener("click",()=>{window.location.href="https://home.aaf.systems/"})}init(){this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=Tu,this.renderer.outputColorSpace=Ve,this.renderer.toneMapping=bu,this.renderer.toneMappingExposure=1,this.camera.position.set(0,0,6),this.camera.lookAt(this.attractionPoint),i_.setupLighting(this.scene),this.postProcessing=new wM(this.renderer,this.scene,this.camera),window.addEventListener("resize",()=>{const e=window.innerWidth,t=window.innerHeight;this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.postProcessing.resize(e,t)}),this.loadAndCreateObjects(),this.eventManager.setupEventListeners(),this.animate()}async loadAndCreateObjects(){await this.modelLoader.loadAndCreateObjects(this.scene,this.world,this.physicsObjects)}animate(e=0){requestAnimationFrame(s=>this.animate(s));const t=this.lastTime>0?(e-this.lastTime)/1e3:1/60;this.lastTime=e;const n=Math.min(t,1/30);vu.updatePhysics(this.world,this.physicsObjects,this.attractionPoint,this.mouseWorldPosition,n),this.usePostProcessing?(this.postProcessing.update(n),this.postProcessing.render(n)):this.renderer.render(this.scene,this.camera)}}new bM; diff --git a/app/dist/index.html b/app/dist/index.html index 5d2d8bb..91a9faa 100644 --- a/app/dist/index.html +++ b/app/dist/index.html @@ -8,11 +8,15 @@ - + +
+
diff --git a/app/dist/models/main_model.glb b/app/dist/models/main_model.glb new file mode 100644 index 0000000..abd526f Binary files /dev/null and b/app/dist/models/main_model.glb differ diff --git a/app/node_modules/.vite/deps/_metadata.json b/app/node_modules/.vite/deps/_metadata.json index 996e418..818ae7e 100644 --- a/app/node_modules/.vite/deps/_metadata.json +++ b/app/node_modules/.vite/deps/_metadata.json @@ -1,25 +1,31 @@ { - "hash": "d7c7cf78", + "hash": "a88ce823", "configHash": "3b37792f", - "lockfileHash": "2e740449", - "browserHash": "77a23b30", + "lockfileHash": "5c312a08", + "browserHash": "152c0a59", "optimized": { "cannon-es": { "src": "../../cannon-es/dist/cannon-es.js", "file": "cannon-es.js", - "fileHash": "67229923", + "fileHash": "8ff8e437", "needsInterop": false }, "three": { "src": "../../three/build/three.module.js", "file": "three.js", - "fileHash": "9d8610fe", + "fileHash": "cb2e35a2", "needsInterop": false }, "three/examples/jsm/loaders/GLTFLoader.js": { "src": "../../three/examples/jsm/loaders/GLTFLoader.js", "file": "three_examples_jsm_loaders_GLTFLoader__js.js", - "fileHash": "54e38767", + "fileHash": "c927b765", + "needsInterop": false + }, + "postprocessing": { + "src": "../../postprocessing/build/index.js", + "file": "postprocessing.js", + "fileHash": "f93b9e9a", "needsInterop": false } }, diff --git a/app/node_modules/.vite/deps/postprocessing.js b/app/node_modules/.vite/deps/postprocessing.js new file mode 100644 index 0000000..8dfaa66 --- /dev/null +++ b/app/node_modules/.vite/deps/postprocessing.js @@ -0,0 +1,16007 @@ +import { + AlwaysDepth, + BackSide, + BasicDepthPacking, + BufferAttribute, + BufferGeometry, + Camera, + CanvasTexture, + ClampToEdgeWrapping, + Color, + Data3DTexture, + DataTexture, + DepthStencilFormat, + DepthTexture, + DoubleSide, + EqualDepth, + EventDispatcher, + FileLoader, + FloatType, + FrontSide, + GreaterDepth, + GreaterEqualDepth, + HalfFloatType, + LessDepth, + LessEqualDepth, + LinearFilter, + LinearMipmapLinearFilter, + LinearSRGBColorSpace, + Loader, + LoadingManager, + Material, + Matrix4, + Mesh, + MeshDepthMaterial, + MeshNormalMaterial, + NearestFilter, + NeverDepth, + NoBlending, + NoColorSpace, + NotEqualDepth, + PerspectiveCamera, + REVISION, + RGBADepthPacking, + RGBAFormat, + RGFormat, + RedFormat, + RepeatWrapping, + SRGBColorSpace, + Scene, + ShaderMaterial, + Texture, + Uniform, + UnsignedByteType, + UnsignedInt248Type, + UnsignedIntType, + Vector2, + Vector3, + Vector4, + WebGLRenderTarget +} from "./chunk-5MKLNLKQ.js"; + +// node_modules/postprocessing/build/index.js +var version = "6.37.6"; +var Disposable = class { + /** + * Frees internal resources. + */ + dispose() { + } +}; +var MILLISECONDS_TO_SECONDS = 1 / 1e3; +var SECONDS_TO_MILLISECONDS = 1e3; +var Timer = class { + /** + * Constructs a new timer. + */ + constructor() { + this.startTime = performance.now(); + this.previousTime = 0; + this.currentTime = 0; + this._delta = 0; + this._elapsed = 0; + this._fixedDelta = 1e3 / 60; + this.timescale = 1; + this.useFixedDelta = false; + this._autoReset = false; + } + /** + * Enables or disables auto reset based on page visibility. + * + * If enabled, the timer will be reset when the page becomes visible. This effectively pauses the timer when the page + * is hidden. Has no effect if the API is not supported. + * + * @type {Boolean} + * @see https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API + */ + get autoReset() { + return this._autoReset; + } + set autoReset(value) { + if (typeof document !== "undefined" && document.hidden !== void 0) { + if (value) { + document.addEventListener("visibilitychange", this); + } else { + document.removeEventListener("visibilitychange", this); + } + this._autoReset = value; + } + } + get delta() { + return this._delta * MILLISECONDS_TO_SECONDS; + } + get fixedDelta() { + return this._fixedDelta * MILLISECONDS_TO_SECONDS; + } + set fixedDelta(value) { + this._fixedDelta = value * SECONDS_TO_MILLISECONDS; + } + get elapsed() { + return this._elapsed * MILLISECONDS_TO_SECONDS; + } + /** + * Updates this timer. + * + * @param {Boolean} [timestamp] - The current time in milliseconds. + */ + update(timestamp) { + if (this.useFixedDelta) { + this._delta = this.fixedDelta; + } else { + this.previousTime = this.currentTime; + this.currentTime = (timestamp !== void 0 ? timestamp : performance.now()) - this.startTime; + this._delta = this.currentTime - this.previousTime; + } + this._delta *= this.timescale; + this._elapsed += this._delta; + } + /** + * Resets this timer. + */ + reset() { + this._delta = 0; + this._elapsed = 0; + this.currentTime = performance.now() - this.startTime; + } + getDelta() { + return this.delta; + } + getElapsed() { + return this.elapsed; + } + handleEvent(e) { + if (!document.hidden) { + this.currentTime = performance.now() - this.startTime; + } + } + dispose() { + this.autoReset = false; + } +}; +var fullscreenGeometry = (() => { + const vertices = new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]); + const uvs = new Float32Array([0, 0, 2, 0, 0, 2]); + const geometry = new BufferGeometry(); + geometry.setAttribute("position", new BufferAttribute(vertices, 3)); + geometry.setAttribute("uv", new BufferAttribute(uvs, 2)); + return geometry; +})(); +var Pass = class _Pass { + /** + * A shared fullscreen triangle. + * + * The screen size is 2x2 units (NDC). A triangle needs to be 4x4 units to fill the screen. + * @see https://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/ + * @type {BufferGeometry} + * @internal + */ + static get fullscreenGeometry() { + return fullscreenGeometry; + } + /** + * Constructs a new pass. + * + * @param {String} [name] - The name of this pass. Does not have to be unique. + * @param {Scene} [scene] - The scene to render. The default scene contains a single mesh that fills the screen. + * @param {Camera} [camera] - A camera. Fullscreen effect passes don't require a camera. + */ + constructor(name = "Pass", scene = new Scene(), camera = new Camera()) { + this.name = name; + this.renderer = null; + this.scene = scene; + this.camera = camera; + this.screen = null; + this.rtt = true; + this.needsSwap = true; + this.needsDepthTexture = false; + this.enabled = true; + } + /** + * Sets the render to screen flag. + * + * If this flag is changed, the fullscreen material will be updated as well. + * + * @type {Boolean} + */ + get renderToScreen() { + return !this.rtt; + } + set renderToScreen(value) { + if (this.rtt === value) { + const material = this.fullscreenMaterial; + if (material !== null) { + material.needsUpdate = true; + } + this.rtt = !value; + } + } + /** + * Sets the main scene. + * + * @type {Scene} + */ + set mainScene(value) { + } + /** + * Sets the main camera. + * + * @type {Camera} + */ + set mainCamera(value) { + } + /** + * Sets the renderer + * + * @deprecated + * @param {WebGLRenderer} renderer - The renderer. + */ + setRenderer(renderer) { + this.renderer = renderer; + } + /** + * Indicates whether this pass is enabled. + * + * @deprecated Use enabled instead. + * @return {Boolean} Whether this pass is enabled. + */ + isEnabled() { + return this.enabled; + } + /** + * Enables or disables this pass. + * + * @deprecated Use enabled instead. + * @param {Boolean} value - Whether the pass should be enabled. + */ + setEnabled(value) { + this.enabled = value; + } + /** + * The fullscreen material. + * + * @type {Material} + */ + get fullscreenMaterial() { + return this.screen !== null ? this.screen.material : null; + } + set fullscreenMaterial(value) { + let screen = this.screen; + if (screen !== null) { + screen.material = value; + } else { + screen = new Mesh(_Pass.fullscreenGeometry, value); + screen.frustumCulled = false; + if (this.scene === null) { + this.scene = new Scene(); + } + this.scene.add(screen); + this.screen = screen; + } + } + /** + * Returns the current fullscreen material. + * + * @deprecated Use fullscreenMaterial instead. + * @return {Material} The current fullscreen material, or null if there is none. + */ + getFullscreenMaterial() { + return this.fullscreenMaterial; + } + /** + * Sets the fullscreen material. + * + * @deprecated Use fullscreenMaterial instead. + * @protected + * @param {Material} value - A fullscreen material. + */ + setFullscreenMaterial(value) { + this.fullscreenMaterial = value; + } + /** + * Returns the current depth texture. + * + * @return {Texture} The current depth texture, or null if there is none. + */ + getDepthTexture() { + return null; + } + /** + * Sets the depth texture. + * + * This method will be called automatically by the {@link EffectComposer}. + * You may override this method if your pass relies on the depth information of a preceding {@link RenderPass}. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategy} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + } + /** + * Renders this pass. + * + * This is an abstract method that must be overridden. + * + * @abstract + * @throws {Error} An error is thrown if the method is not overridden. + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + throw new Error("Render method not implemented!"); + } + /** + * Sets the size. + * + * You may override this method if you want to be informed about the size of the backbuffer/canvas. + * This method is called before {@link initialize} and every time the size of the {@link EffectComposer} changes. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + } + /** + * Performs initialization tasks. + * + * This method is called when this pass is added to an {@link EffectComposer}. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + } + /** + * Performs a shallow search for disposable properties and deletes them. + * + * The {@link EffectComposer} calls this method when it is being destroyed. You can use it independently to free + * memory when you're certain that you don't need this pass anymore. + */ + dispose() { + for (const key of Object.keys(this)) { + const property = this[key]; + const isDisposable = property instanceof WebGLRenderTarget || property instanceof Material || property instanceof Texture || property instanceof _Pass; + if (isDisposable) { + this[key].dispose(); + } + } + if (this.fullscreenMaterial !== null) { + this.fullscreenMaterial.dispose(); + } + } +}; +var ClearMaskPass = class extends Pass { + /** + * Constructs a new clear mask pass. + */ + constructor() { + super("ClearMaskPass", null, null); + this.needsSwap = false; + } + /** + * Disables the global stencil test. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const stencil = renderer.state.buffers.stencil; + stencil.setLocked(false); + stencil.setTest(false); + } +}; +var copy_default = `#include +#include +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; +#include +#include +}`; +var common_default = `varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`; +var CopyMaterial = class extends ShaderMaterial { + /** + * Constructs a new copy material. + */ + constructor() { + super({ + name: "CopyMaterial", + uniforms: { + inputBuffer: new Uniform(null), + opacity: new Uniform(1) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: copy_default, + vertexShader: common_default + }); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Number} value - The buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Returns the opacity. + * + * @deprecated Use opacity instead. + * @return {Number} The opacity. + */ + getOpacity(value) { + return this.uniforms.opacity.value; + } + /** + * Sets the opacity. + * + * @deprecated Use opacity instead. + * @param {Number} value - The opacity. + */ + setOpacity(value) { + this.uniforms.opacity.value = value; + } +}; +var CopyPass = class extends Pass { + /** + * Constructs a new save pass. + * + * @param {WebGLRenderTarget} [renderTarget] - A render target. + * @param {Boolean} [autoResize=true] - Whether the render target size should be updated automatically. + */ + constructor(renderTarget, autoResize = true) { + super("CopyPass"); + this.fullscreenMaterial = new CopyMaterial(); + this.needsSwap = false; + this.renderTarget = renderTarget; + if (renderTarget === void 0) { + this.renderTarget = new WebGLRenderTarget(1, 1, { + minFilter: LinearFilter, + magFilter: LinearFilter, + stencilBuffer: false, + depthBuffer: false + }); + this.renderTarget.texture.name = "CopyPass.Target"; + } + this.autoResize = autoResize; + } + /** + * Enables or disables auto resizing of the render target. + * + * @deprecated Use autoResize instead. + * @type {Boolean} + */ + get resize() { + return this.autoResize; + } + set resize(value) { + this.autoResize = value; + } + /** + * The output texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * Returns the output texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTarget.texture; + } + /** + * Enables or disables auto resizing of the render target. + * + * @deprecated Use autoResize instead. + * @param {Boolean} value - Whether the render target size should be updated automatically. + */ + setAutoResizeEnabled(value) { + this.autoResize = value; + } + /** + * Saves the input buffer. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + this.fullscreenMaterial.inputBuffer = inputBuffer.texture; + renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget); + renderer.render(this.scene, this.camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + if (this.autoResize) { + this.renderTarget.setSize(width, height); + } + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - A renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (frameBufferType !== void 0) { + this.renderTarget.texture.type = frameBufferType; + if (frameBufferType !== UnsignedByteType) { + this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTarget.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var color = new Color(); +var ClearPass = class extends Pass { + /** + * Constructs a new clear pass. + * + * @param {Boolean} [color=true] - Determines whether the color buffer should be cleared. + * @param {Boolean} [depth=true] - Determines whether the depth buffer should be cleared. + * @param {Boolean} [stencil=false] - Determines whether the stencil buffer should be cleared. + */ + constructor(color2 = true, depth = true, stencil = false) { + super("ClearPass", null, null); + this.needsSwap = false; + this.color = color2; + this.depth = depth; + this.stencil = stencil; + this.overrideClearColor = null; + this.overrideClearAlpha = -1; + } + /** + * Sets the clear flags. + * + * @param {Boolean} color - Whether the color buffer should be cleared. + * @param {Boolean} depth - Whether the depth buffer should be cleared. + * @param {Boolean} stencil - Whether the stencil buffer should be cleared. + */ + setClearFlags(color2, depth, stencil) { + this.color = color2; + this.depth = depth; + this.stencil = stencil; + } + /** + * Returns the override clear color. Default is null. + * + * @deprecated Use overrideClearColor instead. + * @return {Color} The clear color. + */ + getOverrideClearColor() { + return this.overrideClearColor; + } + /** + * Sets the override clear color. + * + * @deprecated Use overrideClearColor instead. + * @param {Color} value - The clear color. + */ + setOverrideClearColor(value) { + this.overrideClearColor = value; + } + /** + * Returns the override clear alpha. Default is -1. + * + * @deprecated Use overrideClearAlpha instead. + * @return {Number} The clear alpha. + */ + getOverrideClearAlpha() { + return this.overrideClearAlpha; + } + /** + * Sets the override clear alpha. + * + * @deprecated Use overrideClearAlpha instead. + * @param {Number} value - The clear alpha. + */ + setOverrideClearAlpha(value) { + this.overrideClearAlpha = value; + } + /** + * Clears the input buffer or the screen. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const overrideClearColor = this.overrideClearColor; + const overrideClearAlpha = this.overrideClearAlpha; + const clearAlpha = renderer.getClearAlpha(); + const hasOverrideClearColor = overrideClearColor !== null; + const hasOverrideClearAlpha = overrideClearAlpha >= 0; + if (hasOverrideClearColor) { + renderer.getClearColor(color); + renderer.setClearColor(overrideClearColor, hasOverrideClearAlpha ? overrideClearAlpha : clearAlpha); + } else if (hasOverrideClearAlpha) { + renderer.setClearAlpha(overrideClearAlpha); + } + renderer.setRenderTarget(this.renderToScreen ? null : inputBuffer); + renderer.clear(this.color, this.depth, this.stencil); + if (hasOverrideClearColor) { + renderer.setClearColor(color, clearAlpha); + } else if (hasOverrideClearAlpha) { + renderer.setClearAlpha(clearAlpha); + } + } +}; +var MaskPass = class extends Pass { + /** + * Constructs a new mask pass. + * + * @param {Scene} scene - The scene to render. + * @param {Camera} camera - The camera to use. + */ + constructor(scene, camera) { + super("MaskPass", scene, camera); + this.needsSwap = false; + this.clearPass = new ClearPass(false, false, true); + this.inverse = false; + } + set mainScene(value) { + this.scene = value; + } + set mainCamera(value) { + this.camera = value; + } + /** + * Indicates whether the mask should be inverted. + * + * @type {Boolean} + */ + get inverted() { + return this.inverse; + } + set inverted(value) { + this.inverse = value; + } + /** + * Indicates whether this pass should clear the stencil buffer. + * + * @type {Boolean} + * @deprecated Use clearPass.enabled instead. + */ + get clear() { + return this.clearPass.enabled; + } + set clear(value) { + this.clearPass.enabled = value; + } + /** + * Returns the internal clear pass. + * + * @deprecated Use clearPass.enabled instead. + * @return {ClearPass} The clear pass. + */ + getClearPass() { + return this.clearPass; + } + /** + * Indicates whether the mask is inverted. + * + * @deprecated Use inverted instead. + * @return {Boolean} Whether the mask is inverted. + */ + isInverted() { + return this.inverted; + } + /** + * Enables or disable mask inversion. + * + * @deprecated Use inverted instead. + * @param {Boolean} value - Whether the mask should be inverted. + */ + setInverted(value) { + this.inverted = value; + } + /** + * Renders the effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const context = renderer.getContext(); + const buffers = renderer.state.buffers; + const scene = this.scene; + const camera = this.camera; + const clearPass = this.clearPass; + const writeValue = this.inverted ? 0 : 1; + const clearValue = 1 - writeValue; + buffers.color.setMask(false); + buffers.depth.setMask(false); + buffers.color.setLocked(true); + buffers.depth.setLocked(true); + buffers.stencil.setTest(true); + buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE); + buffers.stencil.setFunc(context.ALWAYS, writeValue, 4294967295); + buffers.stencil.setClear(clearValue); + buffers.stencil.setLocked(true); + if (this.clearPass.enabled) { + if (this.renderToScreen) { + clearPass.render(renderer, null); + } else { + clearPass.render(renderer, inputBuffer); + clearPass.render(renderer, outputBuffer); + } + } + if (this.renderToScreen) { + renderer.setRenderTarget(null); + renderer.render(scene, camera); + } else { + renderer.setRenderTarget(inputBuffer); + renderer.render(scene, camera); + renderer.setRenderTarget(outputBuffer); + renderer.render(scene, camera); + } + buffers.color.setLocked(false); + buffers.depth.setLocked(false); + buffers.stencil.setLocked(false); + buffers.stencil.setFunc(context.EQUAL, 1, 4294967295); + buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP); + buffers.stencil.setLocked(true); + } +}; +var EffectComposer = class { + /** + * Constructs a new effect composer. + * + * @param {WebGLRenderer} renderer - The renderer that should be used. + * @param {Object} [options] - The options. + * @param {Boolean} [options.depthBuffer=true] - Whether the main render targets should have a depth buffer. + * @param {Boolean} [options.stencilBuffer=false] - Whether the main render targets should have a stencil buffer. + * @param {Boolean} [options.alpha] - Deprecated. Buffers are always RGBA since three r137. + * @param {Number} [options.multisampling=0] - The number of samples used for multisample antialiasing. Requires WebGL 2. + * @param {Number} [options.frameBufferType] - The type of the internal frame buffers. It's recommended to use HalfFloatType if possible. + */ + constructor(renderer = null, { + depthBuffer = true, + stencilBuffer = false, + multisampling = 0, + frameBufferType + } = {}) { + this.renderer = null; + this.inputBuffer = this.createBuffer(depthBuffer, stencilBuffer, frameBufferType, multisampling); + this.outputBuffer = this.inputBuffer.clone(); + this.copyPass = new CopyPass(); + this.depthTexture = null; + this.passes = []; + this.timer = new Timer(); + this.autoRenderToScreen = true; + this.setRenderer(renderer); + } + /** + * The current amount of samples used for multisample anti-aliasing. + * + * @type {Number} + */ + get multisampling() { + return this.inputBuffer.samples || 0; + } + /** + * Sets the amount of MSAA samples. + * + * Requires WebGL 2. Set to zero to disable multisampling. + * + * @type {Number} + */ + set multisampling(value) { + const buffer = this.inputBuffer; + const multisampling = this.multisampling; + if (multisampling > 0 && value > 0) { + this.inputBuffer.samples = value; + this.outputBuffer.samples = value; + this.inputBuffer.dispose(); + this.outputBuffer.dispose(); + } else if (multisampling !== value) { + this.inputBuffer.dispose(); + this.outputBuffer.dispose(); + this.inputBuffer = this.createBuffer( + buffer.depthBuffer, + buffer.stencilBuffer, + buffer.texture.type, + value + ); + this.inputBuffer.depthTexture = this.depthTexture; + this.outputBuffer = this.inputBuffer.clone(); + } + } + /** + * Returns the internal timer. + * + * @return {Timer} The timer. + */ + getTimer() { + return this.timer; + } + /** + * Returns the renderer. + * + * @return {WebGLRenderer} The renderer. + */ + getRenderer() { + return this.renderer; + } + /** + * Sets the renderer. + * + * @param {WebGLRenderer} renderer - The renderer. + */ + setRenderer(renderer) { + this.renderer = renderer; + if (renderer !== null) { + const size = renderer.getSize(new Vector2()); + const alpha = renderer.getContext().getContextAttributes().alpha; + const frameBufferType = this.inputBuffer.texture.type; + if (frameBufferType === UnsignedByteType && renderer.outputColorSpace === SRGBColorSpace) { + this.inputBuffer.texture.colorSpace = SRGBColorSpace; + this.outputBuffer.texture.colorSpace = SRGBColorSpace; + this.inputBuffer.dispose(); + this.outputBuffer.dispose(); + } + renderer.autoClear = false; + this.setSize(size.width, size.height); + for (const pass of this.passes) { + pass.initialize(renderer, alpha, frameBufferType); + } + } + } + /** + * Replaces the current renderer with the given one. + * + * The auto clear mechanism of the provided renderer will be disabled. If the new render size differs from the + * previous one, all passes will be updated. + * + * By default, the DOM element of the current renderer will automatically be removed from its parent node and the DOM + * element of the new renderer will take its place. + * + * @deprecated Use setRenderer instead. + * @param {WebGLRenderer} renderer - The new renderer. + * @param {Boolean} updateDOM - Indicates whether the old canvas should be replaced by the new one in the DOM. + * @return {WebGLRenderer} The old renderer. + */ + replaceRenderer(renderer, updateDOM = true) { + const oldRenderer = this.renderer; + const parent = oldRenderer.domElement.parentNode; + this.setRenderer(renderer); + if (updateDOM && parent !== null) { + parent.removeChild(oldRenderer.domElement); + parent.appendChild(renderer.domElement); + } + return oldRenderer; + } + /** + * Creates a depth texture attachment that will be provided to all passes. + * + * Note: When a shader reads from a depth texture and writes to a render target that uses the same depth texture + * attachment, the depth information will be lost. This happens even if `depthWrite` is disabled. + * + * @private + * @return {DepthTexture} The depth texture. + */ + createDepthTexture() { + const depthTexture = this.depthTexture = new DepthTexture(); + this.inputBuffer.depthTexture = depthTexture; + this.inputBuffer.dispose(); + if (this.inputBuffer.stencilBuffer) { + depthTexture.format = DepthStencilFormat; + depthTexture.type = UnsignedInt248Type; + } else { + depthTexture.type = UnsignedIntType; + } + return depthTexture; + } + /** + * Deletes the current depth texture. + * + * @private + */ + deleteDepthTexture() { + if (this.depthTexture !== null) { + this.depthTexture.dispose(); + this.depthTexture = null; + this.inputBuffer.depthTexture = null; + this.inputBuffer.dispose(); + for (const pass of this.passes) { + pass.setDepthTexture(null); + } + } + } + /** + * Creates a new render target. + * + * @deprecated Create buffers manually via WebGLRenderTarget instead. + * @param {Boolean} depthBuffer - Whether the render target should have a depth buffer. + * @param {Boolean} stencilBuffer - Whether the render target should have a stencil buffer. + * @param {Number} type - The frame buffer type. + * @param {Number} multisampling - The number of samples to use for antialiasing. + * @return {WebGLRenderTarget} A new render target that equals the renderer's canvas. + */ + createBuffer(depthBuffer, stencilBuffer, type, multisampling) { + const renderer = this.renderer; + const size = renderer === null ? new Vector2() : renderer.getDrawingBufferSize(new Vector2()); + const options = { + minFilter: LinearFilter, + magFilter: LinearFilter, + stencilBuffer, + depthBuffer, + type + }; + const renderTarget = new WebGLRenderTarget(size.width, size.height, options); + if (multisampling > 0) { + renderTarget.ignoreDepthForMultisampleCopy = false; + renderTarget.samples = multisampling; + } + if (type === UnsignedByteType && renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + renderTarget.texture.colorSpace = SRGBColorSpace; + } + renderTarget.texture.name = "EffectComposer.Buffer"; + renderTarget.texture.generateMipmaps = false; + return renderTarget; + } + /** + * Can be used to change the main scene for all registered passes and effects. + * + * @param {Scene} scene - The scene. + */ + setMainScene(scene) { + for (const pass of this.passes) { + pass.mainScene = scene; + } + } + /** + * Can be used to change the main camera for all registered passes and effects. + * + * @param {Camera} camera - The camera. + */ + setMainCamera(camera) { + for (const pass of this.passes) { + pass.mainCamera = camera; + } + } + /** + * Adds a pass, optionally at a specific index. + * + * @param {Pass} pass - A new pass. + * @param {Number} [index] - An index at which the pass should be inserted. + */ + addPass(pass, index) { + const passes = this.passes; + const renderer = this.renderer; + const drawingBufferSize = renderer.getDrawingBufferSize(new Vector2()); + const alpha = renderer.getContext().getContextAttributes().alpha; + const frameBufferType = this.inputBuffer.texture.type; + pass.setRenderer(renderer); + pass.setSize(drawingBufferSize.width, drawingBufferSize.height); + pass.initialize(renderer, alpha, frameBufferType); + if (this.autoRenderToScreen) { + if (passes.length > 0) { + passes[passes.length - 1].renderToScreen = false; + } + if (pass.renderToScreen) { + this.autoRenderToScreen = false; + } + } + if (index !== void 0) { + passes.splice(index, 0, pass); + } else { + passes.push(pass); + } + if (this.autoRenderToScreen) { + passes[passes.length - 1].renderToScreen = true; + } + if (pass.needsDepthTexture || this.depthTexture !== null) { + if (this.depthTexture === null) { + const depthTexture = this.createDepthTexture(); + for (pass of passes) { + pass.setDepthTexture(depthTexture); + } + } else { + pass.setDepthTexture(this.depthTexture); + } + } + } + /** + * Removes a pass. + * + * @param {Pass} pass - The pass. + */ + removePass(pass) { + const passes = this.passes; + const index = passes.indexOf(pass); + const exists = index !== -1; + const removed = exists && passes.splice(index, 1).length > 0; + if (removed) { + if (this.depthTexture !== null) { + const reducer = (a, b) => a || b.needsDepthTexture; + const depthTextureRequired = passes.reduce(reducer, false); + if (!depthTextureRequired) { + if (pass.getDepthTexture() === this.depthTexture) { + pass.setDepthTexture(null); + } + this.deleteDepthTexture(); + } + } + if (this.autoRenderToScreen) { + if (index === passes.length) { + pass.renderToScreen = false; + if (passes.length > 0) { + passes[passes.length - 1].renderToScreen = true; + } + } + } + } + } + /** + * Removes all passes. + */ + removeAllPasses() { + const passes = this.passes; + this.deleteDepthTexture(); + if (passes.length > 0) { + if (this.autoRenderToScreen) { + passes[passes.length - 1].renderToScreen = false; + } + this.passes = []; + } + } + /** + * Renders all enabled passes in the order in which they were added. + * + * @param {Number} [deltaTime] - The time since the last frame in seconds. + */ + render(deltaTime) { + const renderer = this.renderer; + const copyPass = this.copyPass; + let inputBuffer = this.inputBuffer; + let outputBuffer = this.outputBuffer; + let stencilTest = false; + let context, stencil, buffer; + if (deltaTime === void 0) { + this.timer.update(); + deltaTime = this.timer.getDelta(); + } + for (const pass of this.passes) { + if (pass.enabled) { + pass.render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest); + if (pass.needsSwap) { + if (stencilTest) { + copyPass.renderToScreen = pass.renderToScreen; + context = renderer.getContext(); + stencil = renderer.state.buffers.stencil; + stencil.setFunc(context.NOTEQUAL, 1, 4294967295); + copyPass.render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest); + stencil.setFunc(context.EQUAL, 1, 4294967295); + } + buffer = inputBuffer; + inputBuffer = outputBuffer; + outputBuffer = buffer; + } + if (pass instanceof MaskPass) { + stencilTest = true; + } else if (pass instanceof ClearMaskPass) { + stencilTest = false; + } + } + } + } + /** + * Sets the size of the buffers, passes and the renderer. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + * @param {Boolean} [updateStyle] - Determines whether the style of the canvas should be updated. + */ + setSize(width, height, updateStyle) { + const renderer = this.renderer; + const currentSize = renderer.getSize(new Vector2()); + if (width === void 0 || height === void 0) { + width = currentSize.width; + height = currentSize.height; + } + if (currentSize.width !== width || currentSize.height !== height) { + renderer.setSize(width, height, updateStyle); + } + const drawingBufferSize = renderer.getDrawingBufferSize(new Vector2()); + this.inputBuffer.setSize(drawingBufferSize.width, drawingBufferSize.height); + this.outputBuffer.setSize(drawingBufferSize.width, drawingBufferSize.height); + for (const pass of this.passes) { + pass.setSize(drawingBufferSize.width, drawingBufferSize.height); + } + } + /** + * Resets this composer by deleting all passes and creating new buffers. + */ + reset() { + this.dispose(); + this.autoRenderToScreen = true; + } + /** + * Disposes this composer and all passes. + */ + dispose() { + for (const pass of this.passes) { + pass.dispose(); + } + this.passes = []; + if (this.inputBuffer !== null) { + this.inputBuffer.dispose(); + } + if (this.outputBuffer !== null) { + this.outputBuffer.dispose(); + } + this.deleteDepthTexture(); + this.copyPass.dispose(); + this.timer.dispose(); + Pass.fullscreenGeometry.dispose(); + } +}; +var EffectAttribute = { + NONE: 0, + DEPTH: 1, + CONVOLUTION: 2 +}; +var EffectShaderSection = { + FRAGMENT_HEAD: "FRAGMENT_HEAD", + FRAGMENT_MAIN_UV: "FRAGMENT_MAIN_UV", + FRAGMENT_MAIN_IMAGE: "FRAGMENT_MAIN_IMAGE", + VERTEX_HEAD: "VERTEX_HEAD", + VERTEX_MAIN_SUPPORT: "VERTEX_MAIN_SUPPORT" +}; +var EffectShaderData = class { + /** + * Constructs new shader data. + */ + constructor() { + this.shaderParts = /* @__PURE__ */ new Map([ + [EffectShaderSection.FRAGMENT_HEAD, null], + [EffectShaderSection.FRAGMENT_MAIN_UV, null], + [EffectShaderSection.FRAGMENT_MAIN_IMAGE, null], + [EffectShaderSection.VERTEX_HEAD, null], + [EffectShaderSection.VERTEX_MAIN_SUPPORT, null] + ]); + this.defines = /* @__PURE__ */ new Map(); + this.uniforms = /* @__PURE__ */ new Map(); + this.blendModes = /* @__PURE__ */ new Map(); + this.extensions = /* @__PURE__ */ new Set(); + this.attributes = EffectAttribute.NONE; + this.varyings = /* @__PURE__ */ new Set(); + this.uvTransformation = false; + this.readDepth = false; + this.colorSpace = LinearSRGBColorSpace; + } +}; +function getCoefficients(n) { + let result; + if (n === 0) { + result = new Float64Array(0); + } else if (n === 1) { + result = new Float64Array([1]); + } else if (n > 1) { + let row0 = new Float64Array(n); + let row1 = new Float64Array(n); + for (let y = 1; y <= n; ++y) { + for (let x = 0; x < y; ++x) { + row1[x] = x === 0 || x === y - 1 ? 1 : row0[x - 1] + row0[x]; + } + result = row1; + row1 = row0; + row0 = result; + } + } + return result; +} +var GaussKernel = class { + /** + * Constructs a new Gauss kernel. + * + * @param {Number} kernelSize - The kernel size. Should be an odd number in the range [3, 1020]. + * @param {Number} [edgeBias=2] - Determines how many edge coefficients should be cut off for increased accuracy. + */ + constructor(kernelSize, edgeBias = 2) { + this.weights = null; + this.offsets = null; + this.linearWeights = null; + this.linearOffsets = null; + this.generate(kernelSize, edgeBias); + } + /** + * The number of steps for discrete sampling. + * + * @type {Number} + */ + get steps() { + return this.offsets === null ? 0 : this.offsets.length; + } + /** + * The number of steps for linear sampling. + * + * @type {Number} + */ + get linearSteps() { + return this.linearOffsets === null ? 0 : this.linearOffsets.length; + } + /** + * Generates the kernel. + * + * @private + * @param {Number} kernelSize - The kernel size. + * @param {Number} edgeBias - The amount of edge coefficients to ignore. + */ + generate(kernelSize, edgeBias) { + if (kernelSize < 3 || kernelSize > 1020) { + throw new Error("The kernel size must be in the range [3, 1020]"); + } + const n = kernelSize + edgeBias * 2; + const coefficients = edgeBias > 0 ? getCoefficients(n).slice(edgeBias, -edgeBias) : getCoefficients(n); + const mid = Math.floor((coefficients.length - 1) / 2); + const sum = coefficients.reduce((a, b) => a + b, 0); + const weights = coefficients.slice(mid); + const offsets = [...Array(mid + 1).keys()]; + const linearWeights = new Float64Array(Math.floor(offsets.length / 2)); + const linearOffsets = new Float64Array(linearWeights.length); + linearWeights[0] = weights[0] / sum; + for (let i = 1, j = 1, l = offsets.length - 1; i < l; i += 2, ++j) { + const offset0 = offsets[i], offset1 = offsets[i + 1]; + const weight0 = weights[i], weight1 = weights[i + 1]; + const w = weight0 + weight1; + const o = (offset0 * weight0 + offset1 * weight1) / w; + linearWeights[j] = w / sum; + linearOffsets[j] = o; + } + for (let i = 0, l = weights.length, s = 1 / sum; i < l; ++i) { + weights[i] *= s; + } + const linearWeightSum = (linearWeights.reduce((a, b) => a + b, 0) - linearWeights[0] * 0.5) * 2; + if (linearWeightSum !== 0) { + for (let i = 0, l = linearWeights.length, s = 1 / linearWeightSum; i < l; ++i) { + linearWeights[i] *= s; + } + } + this.offsets = offsets; + this.weights = weights; + this.linearOffsets = linearOffsets; + this.linearWeights = linearWeights; + } +}; +var ImmutableTimer = class { + /** + * The current delta time in seconds. + * + * @type {Number} + */ + getDelta() { + return NaN; + } + /** + * The elapsed time in seconds. + * + * @type {Number} + */ + getElapsed() { + return NaN; + } +}; +var Initializable = class { + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - A renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + } +}; +var workaroundEnabled = false; +var OverrideMaterialManager = class { + /** + * Constructs a new override material manager. + * + * @param {Material} [material=null] - An override material. + */ + constructor(material = null) { + this.originalMaterials = /* @__PURE__ */ new Map(); + this.material = null; + this.materials = null; + this.materialsBackSide = null; + this.materialsDoubleSide = null; + this.materialsFlatShaded = null; + this.materialsFlatShadedBackSide = null; + this.materialsFlatShadedDoubleSide = null; + this.setMaterial(material); + this.meshCount = 0; + this.replaceMaterial = (node) => { + if (node.isMesh) { + let materials; + if (node.material.flatShading) { + switch (node.material.side) { + case DoubleSide: + materials = this.materialsFlatShadedDoubleSide; + break; + case BackSide: + materials = this.materialsFlatShadedBackSide; + break; + default: + materials = this.materialsFlatShaded; + break; + } + } else { + switch (node.material.side) { + case DoubleSide: + materials = this.materialsDoubleSide; + break; + case BackSide: + materials = this.materialsBackSide; + break; + default: + materials = this.materials; + break; + } + } + this.originalMaterials.set(node, node.material); + if (node.isSkinnedMesh) { + node.material = materials[2]; + } else if (node.isInstancedMesh) { + node.material = materials[1]; + } else { + node.material = materials[0]; + } + ++this.meshCount; + } + }; + } + /** + * Clones the given material. + * + * @private + * @param {Material} material - The material. + * @return {Material} The cloned material. + */ + cloneMaterial(material) { + if (!(material instanceof ShaderMaterial)) { + return material.clone(); + } + const uniforms = material.uniforms; + const textureUniforms = /* @__PURE__ */ new Map(); + for (const key in uniforms) { + const value = uniforms[key].value; + if (value.isRenderTargetTexture) { + uniforms[key].value = null; + textureUniforms.set(key, value); + } + } + const clone = material.clone(); + for (const entry of textureUniforms) { + uniforms[entry[0]].value = entry[1]; + clone.uniforms[entry[0]].value = entry[1]; + } + return clone; + } + /** + * Sets the override material. + * + * @param {Material} material - The material. + */ + setMaterial(material) { + this.disposeMaterials(); + this.material = material; + if (material !== null) { + const materials = this.materials = [ + this.cloneMaterial(material), + this.cloneMaterial(material), + this.cloneMaterial(material) + ]; + for (const m2 of materials) { + m2.uniforms = Object.assign({}, material.uniforms); + m2.side = FrontSide; + } + materials[2].skinning = true; + this.materialsBackSide = materials.map((m2) => { + const c2 = this.cloneMaterial(m2); + c2.uniforms = Object.assign({}, material.uniforms); + c2.side = BackSide; + return c2; + }); + this.materialsDoubleSide = materials.map((m2) => { + const c2 = this.cloneMaterial(m2); + c2.uniforms = Object.assign({}, material.uniforms); + c2.side = DoubleSide; + return c2; + }); + this.materialsFlatShaded = materials.map((m2) => { + const c2 = this.cloneMaterial(m2); + c2.uniforms = Object.assign({}, material.uniforms); + c2.flatShading = true; + return c2; + }); + this.materialsFlatShadedBackSide = materials.map((m2) => { + const c2 = this.cloneMaterial(m2); + c2.uniforms = Object.assign({}, material.uniforms); + c2.flatShading = true; + c2.side = BackSide; + return c2; + }); + this.materialsFlatShadedDoubleSide = materials.map((m2) => { + const c2 = this.cloneMaterial(m2); + c2.uniforms = Object.assign({}, material.uniforms); + c2.flatShading = true; + c2.side = DoubleSide; + return c2; + }); + } + } + /** + * Renders the scene with the override material. + * + * @private + * @param {WebGLRenderer} renderer - The renderer. + * @param {Scene} scene - A scene. + * @param {Camera} camera - A camera. + */ + render(renderer, scene, camera) { + const shadowMapEnabled = renderer.shadowMap.enabled; + renderer.shadowMap.enabled = false; + if (workaroundEnabled) { + const originalMaterials = this.originalMaterials; + this.meshCount = 0; + scene.traverse(this.replaceMaterial); + renderer.render(scene, camera); + for (const entry of originalMaterials) { + entry[0].material = entry[1]; + } + if (this.meshCount !== originalMaterials.size) { + originalMaterials.clear(); + } + } else { + const overrideMaterial = scene.overrideMaterial; + scene.overrideMaterial = this.material; + renderer.render(scene, camera); + scene.overrideMaterial = overrideMaterial; + } + renderer.shadowMap.enabled = shadowMapEnabled; + } + /** + * Deletes cloned override materials. + * + * @private + */ + disposeMaterials() { + if (this.material !== null) { + const materials = this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide); + for (const m2 of materials) { + m2.dispose(); + } + } + } + /** + * Performs cleanup tasks. + */ + dispose() { + this.originalMaterials.clear(); + this.disposeMaterials(); + } + /** + * Indicates whether the override material workaround is enabled. + * + * @type {Boolean} + */ + static get workaroundEnabled() { + return workaroundEnabled; + } + /** + * Enables or disables the override material workaround globally. + * + * This only affects post processing passes and effects. + * + * @type {Boolean} + */ + static set workaroundEnabled(value) { + workaroundEnabled = value; + } +}; +var Resizable = class { + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + } +}; +var AUTO_SIZE = -1; +var Resolution = class extends EventDispatcher { + /** + * Constructs a new resolution. + * + * TODO Remove resizable param. + * @param {Resizable} resizable - A resizable object. + * @param {Number} [width=Resolution.AUTO_SIZE] - The preferred width. + * @param {Number} [height=Resolution.AUTO_SIZE] - The preferred height. + * @param {Number} [scale=1.0] - A resolution scale. + */ + constructor(resizable, width = AUTO_SIZE, height = AUTO_SIZE, scale = 1) { + super(); + this.resizable = resizable; + this.baseSize = new Vector2(1, 1); + this.preferredSize = new Vector2(width, height); + this.target = this.preferredSize; + this.s = scale; + this.effectiveSize = new Vector2(); + this.addEventListener("change", () => this.updateEffectiveSize()); + this.updateEffectiveSize(); + } + /** + * Calculates the effective size. + * + * @private + */ + updateEffectiveSize() { + const base = this.baseSize; + const preferred = this.preferredSize; + const effective = this.effectiveSize; + const scale = this.scale; + if (preferred.width !== AUTO_SIZE) { + effective.width = preferred.width; + } else if (preferred.height !== AUTO_SIZE) { + effective.width = Math.round(preferred.height * (base.width / Math.max(base.height, 1))); + } else { + effective.width = Math.round(base.width * scale); + } + if (preferred.height !== AUTO_SIZE) { + effective.height = preferred.height; + } else if (preferred.width !== AUTO_SIZE) { + effective.height = Math.round(preferred.width / Math.max(base.width / Math.max(base.height, 1), 1)); + } else { + effective.height = Math.round(base.height * scale); + } + } + /** + * The effective width. + * + * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base width will be returned. + * + * @type {Number} + */ + get width() { + return this.effectiveSize.width; + } + set width(value) { + this.preferredWidth = value; + } + /** + * The effective height. + * + * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base height will be returned. + * + * @type {Number} + */ + get height() { + return this.effectiveSize.height; + } + set height(value) { + this.preferredHeight = value; + } + /** + * Returns the effective width. + * + * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base width will be returned. + * + * @deprecated Use width instead. + * @return {Number} The effective width. + */ + getWidth() { + return this.width; + } + /** + * Returns the effective height. + * + * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base height will be returned. + * + * @deprecated Use height instead. + * @return {Number} The effective height. + */ + getHeight() { + return this.height; + } + /** + * The resolution scale. + * + * @type {Number} + */ + get scale() { + return this.s; + } + set scale(value) { + if (this.s !== value) { + this.s = value; + this.preferredSize.setScalar(AUTO_SIZE); + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * Returns the current resolution scale. + * + * @deprecated Use scale instead. + * @return {Number} The scale. + */ + getScale() { + return this.scale; + } + /** + * Sets the resolution scale. + * + * Also sets the preferred resolution to {@link Resizer.AUTO_SIZE}. + * + * @deprecated Use scale instead. + * @param {Number} value - The scale. + */ + setScale(value) { + this.scale = value; + } + /** + * The base width. + * + * @type {Number} + */ + get baseWidth() { + return this.baseSize.width; + } + set baseWidth(value) { + if (this.baseSize.width !== value) { + this.baseSize.width = value; + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * Returns the base width. + * + * @deprecated Use baseWidth instead. + * @return {Number} The base width. + */ + getBaseWidth() { + return this.baseWidth; + } + /** + * Sets the base width. + * + * @deprecated Use baseWidth instead. + * @param {Number} value - The width. + */ + setBaseWidth(value) { + this.baseWidth = value; + } + /** + * The base height. + * + * @type {Number} + */ + get baseHeight() { + return this.baseSize.height; + } + set baseHeight(value) { + if (this.baseSize.height !== value) { + this.baseSize.height = value; + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * Returns the base height. + * + * @deprecated Use baseHeight instead. + * @return {Number} The base height. + */ + getBaseHeight() { + return this.baseHeight; + } + /** + * Sets the base height. + * + * @deprecated Use baseHeight instead. + * @param {Number} value - The height. + */ + setBaseHeight(value) { + this.baseHeight = value; + } + /** + * Sets the base size. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setBaseSize(width, height) { + if (this.baseSize.width !== width || this.baseSize.height !== height) { + this.baseSize.set(width, height); + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * The preferred width. + * + * @type {Number} + */ + get preferredWidth() { + return this.preferredSize.width; + } + set preferredWidth(value) { + if (this.preferredSize.width !== value) { + this.preferredSize.width = value; + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * Returns the preferred width. + * + * @deprecated Use preferredWidth instead. + * @return {Number} The preferred width. + */ + getPreferredWidth() { + return this.preferredWidth; + } + /** + * Sets the preferred width. + * + * Use {@link Resizer.AUTO_SIZE} to automatically calculate the width based on the height and aspect ratio. + * + * @deprecated Use preferredWidth instead. + * @param {Number} value - The width. + */ + setPreferredWidth(value) { + this.preferredWidth = value; + } + /** + * The preferred height. + * + * @type {Number} + */ + get preferredHeight() { + return this.preferredSize.height; + } + set preferredHeight(value) { + if (this.preferredSize.height !== value) { + this.preferredSize.height = value; + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * Returns the preferred height. + * + * @deprecated Use preferredHeight instead. + * @return {Number} The preferred height. + */ + getPreferredHeight() { + return this.preferredHeight; + } + /** + * Sets the preferred height. + * + * Use {@link Resizer.AUTO_SIZE} to automatically calculate the height based on the width and aspect ratio. + * + * @deprecated Use preferredHeight instead. + * @param {Number} value - The height. + */ + setPreferredHeight(value) { + this.preferredHeight = value; + } + /** + * Sets the preferred size. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setPreferredSize(width, height) { + if (this.preferredSize.width !== width || this.preferredSize.height !== height) { + this.preferredSize.set(width, height); + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + } + /** + * Copies the given resolution. + * + * @param {Resolution} resolution - The resolution. + */ + copy(resolution) { + this.s = resolution.scale; + this.baseSize.set(resolution.baseWidth, resolution.baseHeight); + this.preferredSize.set(resolution.preferredWidth, resolution.preferredHeight); + this.dispatchEvent({ type: "change" }); + this.resizable.setSize(this.baseSize.width, this.baseSize.height); + } + /** + * An auto sizing constant. + * + * Can be used to automatically calculate the width or height based on the original aspect ratio. + * + * @type {Number} + */ + static get AUTO_SIZE() { + return AUTO_SIZE; + } +}; +var IdManager = class { + /** + * Constructs a new ID manager. + * + * @param initialId - The first ID. + */ + constructor(initialId = 0) { + this.nextId = initialId; + } + /** + * Returns the next unique ID. + * + * @return The ID. + */ + getNextId() { + return this.nextId++; + } + /** + * Resets the ID counter. + * + * @param initialId - The first ID. + * @return This manager. + */ + reset(initialId = 0) { + this.nextId = initialId; + return this; + } +}; +var idManager = new IdManager(2); +var Selection = class extends Set { + /** + * Constructs a new selection. + * + * @param {Iterable} [iterable] - A collection of objects that should be added to this selection. + * @param {Number} [layer] - A dedicated render layer for selected objects. Range is `[2, 31]`. Starts at 2 if omitted. + */ + constructor(iterable, layer = idManager.getNextId()) { + super(); + this.exclusive = false; + this._layer = layer; + if (this._layer < 1 || this._layer > 31) { + console.warn("Layer out of range, resetting to 2"); + idManager.reset(2); + this._layer = idManager.getNextId(); + } + if (iterable !== void 0) { + this.set(iterable); + } + } + /** + * The render layer for selected objects. + * + * @type {Number} + */ + get layer() { + return this._layer; + } + set layer(value) { + const currentLayer = this._layer; + for (const object of this) { + object.layers.disable(currentLayer); + object.layers.enable(value); + } + this._layer = value; + } + /** + * Returns the current render layer for selected objects. + * + * The default layer is 2. If this collides with your own custom layers, please change it before rendering! + * + * @deprecated Use layer instead. + * @return {Number} The layer. + */ + getLayer() { + return this.layer; + } + /** + * Sets the render layer for selected objects. + * + * The current selection will be updated accordingly. + * + * @deprecated Use layer instead. + * @param {Number} value - The layer. Range is [0, 31]. + */ + setLayer(value) { + this.layer = value; + } + /** + * Indicates whether objects that are added to this selection will be removed from all other layers. + * + * @deprecated Use exclusive instead. + * @return {Number} Whether this selection is exclusive. Default is false. + */ + isExclusive() { + return this.exclusive; + } + /** + * Controls whether objects that are added to this selection should be removed from all other layers. + * + * @deprecated Use exclusive instead. + * @param {Number} value - Whether this selection should be exclusive. + */ + setExclusive(value) { + this.exclusive = value; + } + /** + * Clears this selection. + * + * @return {Selection} This selection. + */ + clear() { + const layer = this.layer; + for (const object of this) { + object.layers.disable(layer); + } + return super.clear(); + } + /** + * Clears this selection and adds the given objects. + * + * @param {Iterable} objects - The objects that should be selected. + * @return {Selection} This selection. + */ + set(objects) { + this.clear(); + for (const object of objects) { + this.add(object); + } + return this; + } + /** + * An alias for {@link has}. + * + * @param {Object3D} object - An object. + * @return {Number} Returns 0 if the given object is currently selected, or -1 otherwise. + * @deprecated Added for backward-compatibility. + */ + indexOf(object) { + return this.has(object) ? 0 : -1; + } + /** + * Adds an object to this selection. + * + * If {@link exclusive} is set to `true`, the object will also be removed from all other layers. + * + * @param {Object3D} object - The object that should be selected. + * @return {Selection} This selection. + */ + add(object) { + if (this.exclusive) { + object.layers.set(this.layer); + } else { + object.layers.enable(this.layer); + } + return super.add(object); + } + /** + * Removes an object from this selection. + * + * @param {Object3D} object - The object that should be deselected. + * @return {Boolean} Returns true if an object has successfully been removed from this selection; otherwise false. + */ + delete(object) { + if (this.has(object)) { + object.layers.disable(this.layer); + } + return super.delete(object); + } + /** + * Removes an existing object from the selection. If the object doesn't exist it's added instead. + * + * @param {Object3D} object - The object. + * @return {Boolean} Returns true if the object is added, false otherwise. + */ + toggle(object) { + let result; + if (this.has(object)) { + this.delete(object); + result = false; + } else { + this.add(object); + result = true; + } + return result; + } + /** + * Sets the visibility of all selected objects. + * + * This method enables or disables render layer 0 of all selected objects. + * + * @param {Boolean} visible - Whether the selected objects should be visible. + * @return {Selection} This selection. + */ + setVisible(visible) { + for (const object of this) { + if (visible) { + object.layers.enable(0); + } else { + object.layers.disable(0); + } + } + return this; + } +}; +var BlendFunction = { + SKIP: 9, + SET: 30, + ADD: 0, + ALPHA: 1, + AVERAGE: 2, + COLOR: 3, + COLOR_BURN: 4, + COLOR_DODGE: 5, + DARKEN: 6, + DIFFERENCE: 7, + DIVIDE: 8, + DST: 9, + EXCLUSION: 10, + HARD_LIGHT: 11, + HARD_MIX: 12, + HUE: 13, + INVERT: 14, + INVERT_RGB: 15, + LIGHTEN: 16, + LINEAR_BURN: 17, + LINEAR_DODGE: 18, + LINEAR_LIGHT: 19, + LUMINOSITY: 20, + MULTIPLY: 21, + NEGATION: 22, + NORMAL: 23, + OVERLAY: 24, + PIN_LIGHT: 25, + REFLECT: 26, + SATURATION: 27, + SCREEN: 28, + SOFT_LIGHT: 29, + SRC: 30, + SUBTRACT: 31, + VIVID_LIGHT: 32 +}; +var add_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),opacity);}`; +var alpha_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}`; +var average_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),opacity);}`; +var color_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),opacity);}`; +var color_burn_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),opacity);}`; +var color_dodge_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),opacity);}`; +var darken_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),opacity);}`; +var difference_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),opacity);}`; +var divide_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),opacity);}`; +var exclusion_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),opacity);}`; +var hard_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),opacity);}`; +var hard_mix_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),opacity);}`; +var hue_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),opacity);}`; +var invert_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),opacity);}`; +var invert_rgb_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),opacity);}`; +var lighten_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),opacity);}`; +var linear_burn_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),opacity);}`; +var linear_dodge_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),opacity);}`; +var linear_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),opacity);}`; +var luminosity_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),opacity);}`; +var multiply_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),opacity);}`; +var negation_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),opacity);}`; +var normal_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}`; +var overlay_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),opacity);}`; +var pin_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),opacity);}`; +var reflect_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),opacity);}`; +var saturation_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),opacity);}`; +var screen_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),opacity);}`; +var soft_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),opacity);}`; +var src_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}`; +var subtract_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),opacity);}`; +var vivid_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),opacity);}`; +var blendFunctions = /* @__PURE__ */ new Map([ + [BlendFunction.ADD, add_default], + [BlendFunction.ALPHA, alpha_default], + [BlendFunction.AVERAGE, average_default], + [BlendFunction.COLOR, color_default], + [BlendFunction.COLOR_BURN, color_burn_default], + [BlendFunction.COLOR_DODGE, color_dodge_default], + [BlendFunction.DARKEN, darken_default], + [BlendFunction.DIFFERENCE, difference_default], + [BlendFunction.DIVIDE, divide_default], + [BlendFunction.DST, null], + [BlendFunction.EXCLUSION, exclusion_default], + [BlendFunction.HARD_LIGHT, hard_light_default], + [BlendFunction.HARD_MIX, hard_mix_default], + [BlendFunction.HUE, hue_default], + [BlendFunction.INVERT, invert_default], + [BlendFunction.INVERT_RGB, invert_rgb_default], + [BlendFunction.LIGHTEN, lighten_default], + [BlendFunction.LINEAR_BURN, linear_burn_default], + [BlendFunction.LINEAR_DODGE, linear_dodge_default], + [BlendFunction.LINEAR_LIGHT, linear_light_default], + [BlendFunction.LUMINOSITY, luminosity_default], + [BlendFunction.MULTIPLY, multiply_default], + [BlendFunction.NEGATION, negation_default], + [BlendFunction.NORMAL, normal_default], + [BlendFunction.OVERLAY, overlay_default], + [BlendFunction.PIN_LIGHT, pin_light_default], + [BlendFunction.REFLECT, reflect_default], + [BlendFunction.SATURATION, saturation_default], + [BlendFunction.SCREEN, screen_default], + [BlendFunction.SOFT_LIGHT, soft_light_default], + [BlendFunction.SRC, src_default], + [BlendFunction.SUBTRACT, subtract_default], + [BlendFunction.VIVID_LIGHT, vivid_light_default] +]); +var BlendMode = class extends EventDispatcher { + /** + * Constructs a new blend mode. + * + * @param {BlendFunction} blendFunction - The blend function. + * @param {Number} opacity - The opacity of the color that will be blended with the base color. + */ + constructor(blendFunction, opacity = 1) { + super(); + this._blendFunction = blendFunction; + this.opacity = new Uniform(opacity); + } + /** + * Returns the opacity. + * + * @return {Number} The opacity. + */ + getOpacity() { + return this.opacity.value; + } + /** + * Sets the opacity. + * + * @param {Number} value - The opacity. + */ + setOpacity(value) { + this.opacity.value = value; + } + /** + * The blend function. + * + * @type {BlendFunction} + */ + get blendFunction() { + return this._blendFunction; + } + set blendFunction(value) { + this._blendFunction = value; + this.dispatchEvent({ type: "change" }); + } + /** + * Returns the blend function. + * + * @deprecated Use blendFunction instead. + * @return {BlendFunction} The blend function. + */ + getBlendFunction() { + return this.blendFunction; + } + /** + * Sets the blend function. + * + * @deprecated Use blendFunction instead. + * @param {BlendFunction} value - The blend function. + */ + setBlendFunction(value) { + this.blendFunction = value; + } + /** + * Returns the blend function shader code. + * + * @return {String} The blend function shader code. + */ + getShaderCode() { + return blendFunctions.get(this.blendFunction); + } +}; +var ASCIITexture = class extends CanvasTexture { + /** + * Constructs a new ASCII texture. + * + * @param {Object} [options] - The options. + * @param {String} [options.characters] - The character set to render. Defaults to a common ASCII art charset. + * @param {String} [options.font="Arial"] - The font. + * @param {Number} [options.fontSize=54] - The font size in pixels. + * @param {Number} [options.size=1024] - The texture size. + * @param {Number} [options.cellCount=16] - The cell count along each side of the texture. + */ + constructor({ + characters = " .:,'-^=*+?!|0#X%WM@", + font = "Arial", + fontSize = 54, + size = 1024, + cellCount = 16 + } = {}) { + super( + document.createElement("canvas"), + void 0, + RepeatWrapping, + RepeatWrapping + ); + const canvas = this.image; + canvas.width = canvas.height = size; + const context = canvas.getContext("2d"); + const cellSize = size / cellCount; + context.font = `${fontSize}px ${font}`; + context.textAlign = "center"; + context.textBaseline = "middle"; + context.fillStyle = "#ffffff"; + for (let i = 0, l = characters.length; i < l; ++i) { + const char = characters[i]; + const x = i % cellCount; + const y = Math.floor(i / cellCount); + context.fillText(char, x * cellSize + cellSize / 2, y * cellSize + cellSize / 2); + } + this.characterCount = characters.length; + this.cellCount = cellCount; + } +}; +var Effect = class extends EventDispatcher { + /** + * Constructs a new effect. + * + * @param {String} name - The name of this effect. Doesn't have to be unique. + * @param {String} fragmentShader - The fragment shader. This shader is required. + * @param {Object} [options] - Additional options. + * @param {EffectAttribute} [options.attributes=EffectAttribute.NONE] - The effect attributes that determine the execution priority and resource requirements. + * @param {BlendFunction} [options.blendFunction=BlendFunction.NORMAL] - The blend function of this effect. + * @param {Map} [options.defines] - Custom preprocessor macro definitions. Keys are names and values are code. + * @param {Map} [options.uniforms] - Custom shader uniforms. Keys are names and values are uniforms. + * @param {Set} [options.extensions] - WebGL extensions. + * @param {String} [options.vertexShader=null] - The vertex shader. Most effects don't need one. + */ + constructor(name, fragmentShader, { + attributes = EffectAttribute.NONE, + blendFunction = BlendFunction.NORMAL, + defines = /* @__PURE__ */ new Map(), + uniforms = /* @__PURE__ */ new Map(), + extensions = null, + vertexShader = null + } = {}) { + super(); + this.name = name; + this.renderer = null; + this.attributes = attributes; + this.fragmentShader = fragmentShader; + this.vertexShader = vertexShader; + this.defines = defines; + this.uniforms = uniforms; + this.extensions = extensions; + this.blendMode = new BlendMode(blendFunction); + this.blendMode.addEventListener("change", (event) => this.setChanged()); + this._inputColorSpace = LinearSRGBColorSpace; + this._outputColorSpace = NoColorSpace; + } + /** + * The input color space. + * + * @type {ColorSpace} + * @experimental + */ + get inputColorSpace() { + return this._inputColorSpace; + } + /** + * @type {ColorSpace} + * @protected + * @experimental + */ + set inputColorSpace(value) { + this._inputColorSpace = value; + this.setChanged(); + } + /** + * The output color space. + * + * Should only be changed if this effect converts the input colors to a different color space. + * + * @type {ColorSpace} + * @experimental + */ + get outputColorSpace() { + return this._outputColorSpace; + } + /** + * @type {ColorSpace} + * @protected + * @experimental + */ + set outputColorSpace(value) { + this._outputColorSpace = value; + this.setChanged(); + } + /** + * Sets the main scene. + * + * @type {Scene} + */ + set mainScene(value) { + } + /** + * Sets the main camera. + * + * @type {Camera} + */ + set mainCamera(value) { + } + /** + * Returns the name of this effect. + * + * @deprecated Use name instead. + * @return {String} The name. + */ + getName() { + return this.name; + } + /** + * Sets the renderer. + * + * @deprecated + * @param {WebGLRenderer} renderer - The renderer. + */ + setRenderer(renderer) { + this.renderer = renderer; + } + /** + * Returns the preprocessor macro definitions. + * + * @deprecated Use defines instead. + * @return {Map} The extensions. + */ + getDefines() { + return this.defines; + } + /** + * Returns the uniforms of this effect. + * + * @deprecated Use uniforms instead. + * @return {Map} The extensions. + */ + getUniforms() { + return this.uniforms; + } + /** + * Returns the WebGL extensions that are required by this effect. + * + * @deprecated Use extensions instead. + * @return {Set} The extensions. + */ + getExtensions() { + return this.extensions; + } + /** + * Returns the blend mode. + * + * The result of this effect will be blended with the result of the previous effect using this blend mode. + * + * @deprecated Use blendMode instead. + * @return {BlendMode} The blend mode. + */ + getBlendMode() { + return this.blendMode; + } + /** + * Returns the effect attributes. + * + * @return {EffectAttribute} The attributes. + */ + getAttributes() { + return this.attributes; + } + /** + * Sets the effect attributes. + * + * Effects that have the same attributes will be executed in the order in which they were registered. Some attributes + * imply a higher priority. + * + * @protected + * @param {EffectAttribute} attributes - The attributes. + */ + setAttributes(attributes) { + this.attributes = attributes; + this.setChanged(); + } + /** + * Returns the fragment shader. + * + * @return {String} The fragment shader. + */ + getFragmentShader() { + return this.fragmentShader; + } + /** + * Sets the fragment shader. + * + * @protected + * @param {String} fragmentShader - The fragment shader. + */ + setFragmentShader(fragmentShader) { + this.fragmentShader = fragmentShader; + this.setChanged(); + } + /** + * Returns the vertex shader. + * + * @return {String} The vertex shader. + */ + getVertexShader() { + return this.vertexShader; + } + /** + * Sets the vertex shader. + * + * @protected + * @param {String} vertexShader - The vertex shader. + */ + setVertexShader(vertexShader) { + this.vertexShader = vertexShader; + this.setChanged(); + } + /** + * Informs the associated {@link EffectPass} that this effect requires a shader recompilation. + * + * Should be called after changing macros or extensions and after adding/removing uniforms. + * + * @protected + */ + setChanged() { + this.dispatchEvent({ type: "change" }); + } + /** + * Sets the depth texture. + * + * You may override this method if your effect requires direct access to the depth texture that is bound to the + * associated {@link EffectPass}. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + } + /** + * Updates this effect by performing supporting operations. + * + * This method is called by the {@link EffectPass} right before the main fullscreen render operation, even if the + * blend function is set to `SKIP`. + * + * You may override this method if you need to update custom uniforms or render additional off-screen textures. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + } + /** + * Updates the size of this effect. + * + * You may override this method if you want to be informed about the size of the backbuffer/canvas. + * This method is called before {@link initialize} and every time the size of the {@link EffectComposer} changes. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + } + /** + * Performs initialization tasks. + * + * This method is called when the associated {@link EffectPass} is added to an {@link EffectComposer}. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + * @example if(!alpha && frameBufferType === UnsignedByteType) { this.myRenderTarget.texture.format = RGBFormat; } + */ + initialize(renderer, alpha, frameBufferType) { + } + /** + * Performs a shallow search for properties that define a dispose method and deletes them. + * + * The {@link EffectComposer} calls this method when it is being destroyed. + */ + dispose() { + for (const key of Object.keys(this)) { + const property = this[key]; + const isDisposable = property instanceof WebGLRenderTarget || property instanceof Material || property instanceof Texture || property instanceof Pass; + if (isDisposable) { + this[key].dispose(); + } + } + } +}; +var ascii_default = `uniform sampler2D asciiTexture;uniform vec4 cellCount; +#ifdef USE_COLOR +uniform vec3 color; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 pixelizedUv=cellCount.zw*(0.5+floor(uv*cellCount.xy));vec4 texel=texture(inputBuffer,pixelizedUv);float lum=min(luminance(texel.rgb),1.0); +#ifdef INVERTED +lum=1.0-lum; +#endif +float characterIndex=floor(CHAR_COUNT_MINUS_ONE*lum);vec2 characterPosition=vec2(mod(characterIndex,TEX_CELL_COUNT),floor(characterIndex*INV_TEX_CELL_COUNT));vec2 offset=vec2(characterPosition.x,-characterPosition.y)*INV_TEX_CELL_COUNT;vec2 characterUv=mod(uv*(cellCount.xy*INV_TEX_CELL_COUNT),INV_TEX_CELL_COUNT);characterUv=characterUv-vec2(0.0,INV_TEX_CELL_COUNT)+offset;float asciiCharacter=texture(asciiTexture,characterUv).r; +#ifdef USE_COLOR +outputColor=vec4(color*asciiCharacter,inputColor.a); +#else +outputColor=vec4(texel.rgb*asciiCharacter,inputColor.a); +#endif +}`; +var ASCIIEffect = class extends Effect { + /** + * Constructs a new ASCII effect. + * + * @param {Object} [options] - The options. + * @param {ASCIITexture} [options.asciiTexture] - An ASCII character lookup texture. + * @param {Number} [options.cellSize=16] - The cell size. It's recommended to use even numbers. + * @param {Number} [options.color=null] - A color to use instead of the scene colors. + * @param {Boolean} [options.inverted=false] - Inverts the effect. + */ + constructor({ + asciiTexture = new ASCIITexture(), + cellSize = 16, + color: color2 = null, + inverted = false + } = {}) { + super("ASCIIEffect", ascii_default, { + uniforms: /* @__PURE__ */ new Map([ + ["asciiTexture", new Uniform(null)], + ["cellCount", new Uniform(new Vector4())], + ["color", new Uniform(new Color())] + ]) + }); + this._cellSize = -1; + this.resolution = new Vector2(); + this.asciiTexture = asciiTexture; + this.cellSize = cellSize; + this.color = color2; + this.inverted = inverted; + } + /** + * The current ASCII lookup texture. + * + * @type {ASCIITexture} + */ + get asciiTexture() { + return this.uniforms.get("asciiTexture").value; + } + set asciiTexture(value) { + const currentTexture = this.uniforms.get("asciiTexture").value; + this.uniforms.get("asciiTexture").value = value; + if (currentTexture !== null && currentTexture !== value) { + currentTexture.dispose(); + } + if (value !== null) { + const cellCount = value.cellCount; + this.defines.set("CHAR_COUNT_MINUS_ONE", (value.characterCount - 1).toFixed(1)); + this.defines.set("TEX_CELL_COUNT", cellCount.toFixed(1)); + this.defines.set("INV_TEX_CELL_COUNT", (1 / cellCount).toFixed(9)); + this.setChanged(); + } + } + /** + * A color that overrides the scene colors. + * + * @type {Color | String | Number | null} + */ + get color() { + return this.uniforms.get("color").value; + } + set color(value) { + if (value !== null) { + this.uniforms.get("color").value.set(value); + } + if (this.defines.has("USE_COLOR") && value === null) { + this.defines.delete("USE_COLOR"); + this.setChanged(); + } else if (!this.defines.has("USE_COLOR") && value !== null) { + this.defines.set("USE_COLOR", "1"); + this.setChanged(); + } + } + /** + * Controls whether the effect should be inverted. + * + * @type {Boolean} + */ + get inverted() { + return this.defines.has("INVERTED"); + } + set inverted(value) { + if (this.inverted !== value) { + if (value) { + this.defines.set("INVERTED", "1"); + } else { + this.defines.delete("INVERTED"); + } + this.setChanged(); + } + } + /** + * The cell size. + * + * @type {Number} + */ + get cellSize() { + return this._cellSize; + } + set cellSize(value) { + if (this._cellSize !== value) { + this._cellSize = value; + this.updateCellCount(); + } + } + /** + * Updates the cell count uniform. + * + * @private + */ + updateCellCount() { + const cellCount = this.uniforms.get("cellCount").value; + const resolution = this.resolution; + cellCount.x = resolution.width / this.cellSize; + cellCount.y = resolution.height / this.cellSize; + cellCount.z = 1 / cellCount.x; + cellCount.w = 1 / cellCount.y; + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.resolution.set(width, height); + this.updateCellCount(); + } + /** + * Deletes internal render targets and textures. + */ + dispose() { + if (this.asciiTexture !== null) { + this.asciiTexture.dispose(); + } + super.dispose(); + } +}; +var KernelSize = { + VERY_SMALL: 0, + SMALL: 1, + MEDIUM: 2, + LARGE: 3, + VERY_LARGE: 4, + HUGE: 5 +}; +var convolution_kawase_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; +#include +}`; +var convolution_kawase_default2 = `uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}`; +var kernelPresets = [ + new Float32Array([0, 0]), + new Float32Array([0, 1, 1]), + new Float32Array([0, 1, 1, 2]), + new Float32Array([0, 1, 2, 2, 3]), + new Float32Array([0, 1, 2, 3, 4, 4, 5]), + new Float32Array([0, 1, 2, 3, 4, 5, 7, 8, 9, 10]) +]; +var KawaseBlurMaterial = class extends ShaderMaterial { + /** + * Constructs a new convolution material. + * + * TODO Remove texelSize param. + * @param {Vector4} [texelSize] - Deprecated. + */ + constructor(texelSize = new Vector4()) { + super({ + name: "KawaseBlurMaterial", + uniforms: { + inputBuffer: new Uniform(null), + texelSize: new Uniform(new Vector4()), + scale: new Uniform(1), + kernel: new Uniform(0) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_kawase_default, + vertexShader: convolution_kawase_default2 + }); + this.setTexelSize(texelSize.x, texelSize.y); + this.kernelSize = KernelSize.MEDIUM; + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.inputBuffer = value; + } + /** + * The kernel sequence for the current kernel size. + * + * @type {Float32Array} + */ + get kernelSequence() { + return kernelPresets[this.kernelSize]; + } + /** + * The blur scale. + * + * @type {Number} + */ + get scale() { + return this.uniforms.scale.value; + } + set scale(value) { + this.uniforms.scale.value = value; + } + /** + * Returns the blur scale. + * + * @deprecated Use scale instead. + * @return {Number} The scale. + */ + getScale() { + return this.uniforms.scale.value; + } + /** + * Sets the blur scale. + * + * @deprecated Use scale instead. + * @return {Number} value - The scale. + */ + setScale(value) { + this.uniforms.scale.value = value; + } + /** + * Returns the kernel. + * + * @return {Float32Array} The kernel. + * @deprecated Implementation detail, removed with no replacement. + */ + getKernel() { + return null; + } + /** + * The current kernel. + * + * @type {Number} + */ + get kernel() { + return this.uniforms.kernel.value; + } + set kernel(value) { + this.uniforms.kernel.value = value; + } + /** + * Sets the current kernel. + * + * @deprecated Use kernel instead. + * @param {Number} value - The kernel. + */ + setKernel(value) { + this.kernel = value; + } + /** + * Sets the texel size. + * + * @deprecated Use setSize() instead. + * @param {Number} x - The texel width. + * @param {Number} y - The texel height. + */ + setTexelSize(x, y) { + this.uniforms.texelSize.value.set(x, y, x * 0.5, y * 0.5); + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const x = 1 / width, y = 1 / height; + this.uniforms.texelSize.value.set(x, y, x * 0.5, y * 0.5); + } +}; +var KawaseBlurPass = class extends Pass { + /** + * Constructs a new Kawase blur pass. + * + * @param {Object} [options] - The options. + * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size. + * @param {Number} [options.resolutionScale=0.5] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + */ + constructor({ + kernelSize = KernelSize.MEDIUM, + resolutionScale = 0.5, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("KawaseBlurPass"); + this.renderTargetA = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetA.texture.name = "Blur.Target.A"; + this.renderTargetB = this.renderTargetA.clone(); + this.renderTargetB.texture.name = "Blur.Target.B"; + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + this._blurMaterial = new KawaseBlurMaterial(); + this._blurMaterial.kernelSize = kernelSize; + this.copyMaterial = new CopyMaterial(); + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * The blur material. + * + * @type {KawaseBlurMaterial} + */ + get blurMaterial() { + return this._blurMaterial; + } + /** + * The blur material. + * + * @type {KawaseBlurMaterial} + * @protected + */ + set blurMaterial(value) { + this._blurMaterial = value; + } + /** + * Indicates whether dithering is enabled. + * + * @type {Boolean} + * @deprecated Use copyMaterial.dithering instead. + */ + get dithering() { + return this.copyMaterial.dithering; + } + set dithering(value) { + this.copyMaterial.dithering = value; + } + /** + * The kernel size. + * + * @type {KernelSize} + * @deprecated Use blurMaterial.kernelSize instead. + */ + get kernelSize() { + return this.blurMaterial.kernelSize; + } + set kernelSize(value) { + this.blurMaterial.kernelSize = value; + } + /** + * The current width of the internal render targets. + * + * @type {Number} + * @deprecated Use resolution.width instead. + */ + get width() { + return this.resolution.width; + } + /** + * Sets the render width. + * + * @type {Number} + * @deprecated Use resolution.preferredWidth instead. + */ + set width(value) { + this.resolution.preferredWidth = value; + } + /** + * The current height of the internal render targets. + * + * @type {Number} + * @deprecated Use resolution.height instead. + */ + get height() { + return this.resolution.height; + } + /** + * Sets the render height. + * + * @type {Number} + * @deprecated Use resolution.preferredHeight instead. + */ + set height(value) { + this.resolution.preferredHeight = value; + } + /** + * The current blur scale. + * + * @type {Number} + * @deprecated Use blurMaterial.scale instead. + */ + get scale() { + return this.blurMaterial.scale; + } + set scale(value) { + this.blurMaterial.scale = value; + } + /** + * Returns the current blur scale. + * + * @deprecated Use blurMaterial.scale instead. + * @return {Number} The scale. + */ + getScale() { + return this.blurMaterial.scale; + } + /** + * Sets the blur scale. + * + * @deprecated Use blurMaterial.scale instead. + * @param {Number} value - The scale. + */ + setScale(value) { + this.blurMaterial.scale = value; + } + /** + * Returns the kernel size. + * + * @deprecated Use blurMaterial.kernelSize instead. + * @return {KernelSize} The kernel size. + */ + getKernelSize() { + return this.kernelSize; + } + /** + * Sets the kernel size. + * + * Larger kernels require more processing power but scale well with larger render resolutions. + * + * @deprecated Use blurMaterial.kernelSize instead. + * @param {KernelSize} value - The kernel size. + */ + setKernelSize(value) { + this.kernelSize = value; + } + /** + * Returns the current resolution scale. + * + * @return {Number} The resolution scale. + * @deprecated Use resolution instead. + */ + getResolutionScale() { + return this.resolution.scale; + } + /** + * Sets the resolution scale. + * + * @param {Number} scale - The new resolution scale. + * @deprecated Use resolution instead. + */ + setResolutionScale(scale) { + this.resolution.scale = scale; + } + /** + * Renders the blur. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const scene = this.scene; + const camera = this.camera; + const renderTargetA = this.renderTargetA; + const renderTargetB = this.renderTargetB; + const material = this.blurMaterial; + const kernelSequence = material.kernelSequence; + let previousBuffer = inputBuffer; + this.fullscreenMaterial = material; + for (let i = 0, l = kernelSequence.length; i < l; ++i) { + const buffer = (i & 1) === 0 ? renderTargetA : renderTargetB; + material.kernel = kernelSequence[i]; + material.inputBuffer = previousBuffer.texture; + renderer.setRenderTarget(buffer); + renderer.render(scene, camera); + previousBuffer = buffer; + } + this.fullscreenMaterial = this.copyMaterial; + this.copyMaterial.inputBuffer = previousBuffer.texture; + renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer); + renderer.render(scene, camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.renderTargetA.setSize(w, h); + this.renderTargetB.setSize(w, h); + this.blurMaterial.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (frameBufferType !== void 0) { + this.renderTargetA.texture.type = frameBufferType; + this.renderTargetB.texture.type = frameBufferType; + if (frameBufferType !== UnsignedByteType) { + this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTargetA.texture.colorSpace = SRGBColorSpace; + this.renderTargetB.texture.colorSpace = SRGBColorSpace; + } + } + } + /** + * An auto sizing flag. + * + * @type {Number} + * @deprecated Use {@link Resolution.AUTO_SIZE} instead. + */ + static get AUTO_SIZE() { + return Resolution.AUTO_SIZE; + } +}; +var luminance_default = `#include +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef RANGE +uniform vec2 range; +#elif defined(THRESHOLD) +uniform float threshold;uniform float smoothing; +#endif +varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb); +#ifdef RANGE +float low=step(range.x,l);float high=step(l,range.y);l*=low*high; +#elif defined(THRESHOLD) +l=smoothstep(threshold,threshold+smoothing,l)*l; +#endif +#ifdef COLOR +gl_FragColor=vec4(texel.rgb*clamp(l,0.0,1.0),l); +#else +gl_FragColor=vec4(l); +#endif +}`; +var LuminanceMaterial = class extends ShaderMaterial { + /** + * Constructs a new luminance material. + * + * @param {Boolean} [colorOutput=false] - Defines whether the shader should output colors scaled with their luminance value. + * @param {Vector2} [luminanceRange] - If provided, the shader will mask out texels that aren't in the specified luminance range. + */ + constructor(colorOutput = false, luminanceRange = null) { + super({ + name: "LuminanceMaterial", + defines: { + THREE_REVISION: REVISION.replace(/\D+/g, "") + }, + uniforms: { + inputBuffer: new Uniform(null), + threshold: new Uniform(0), + smoothing: new Uniform(1), + range: new Uniform(null) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: luminance_default, + vertexShader: common_default + }); + this.colorOutput = colorOutput; + this.luminanceRange = luminanceRange; + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The luminance threshold. + * + * @type {Number} + */ + get threshold() { + return this.uniforms.threshold.value; + } + set threshold(value) { + if (this.smoothing > 0 || value > 0) { + this.defines.THRESHOLD = "1"; + } else { + delete this.defines.THRESHOLD; + } + this.uniforms.threshold.value = value; + } + /** + * Returns the luminance threshold. + * + * @deprecated Use threshold instead. + * @return {Number} The threshold. + */ + getThreshold() { + return this.threshold; + } + /** + * Sets the luminance threshold. + * + * @deprecated Use threshold instead. + * @param {Number} value - The threshold. + */ + setThreshold(value) { + this.threshold = value; + } + /** + * The luminance threshold smoothing. + * + * @type {Number} + */ + get smoothing() { + return this.uniforms.smoothing.value; + } + set smoothing(value) { + if (this.threshold > 0 || value > 0) { + this.defines.THRESHOLD = "1"; + } else { + delete this.defines.THRESHOLD; + } + this.uniforms.smoothing.value = value; + } + /** + * Returns the luminance threshold smoothing factor. + * + * @deprecated Use smoothing instead. + * @return {Number} The smoothing factor. + */ + getSmoothingFactor() { + return this.smoothing; + } + /** + * Sets the luminance threshold smoothing factor. + * + * @deprecated Use smoothing instead. + * @param {Number} value - The smoothing factor. + */ + setSmoothingFactor(value) { + this.smoothing = value; + } + /** + * Indicates whether the luminance threshold is enabled. + * + * @type {Boolean} + * @deprecated Adjust the threshold or smoothing factor instead. + */ + get useThreshold() { + return this.threshold > 0 || this.smoothing > 0; + } + set useThreshold(value) { + } + /** + * Indicates whether color output is enabled. + * + * @type {Boolean} + */ + get colorOutput() { + return this.defines.COLOR !== void 0; + } + set colorOutput(value) { + if (value) { + this.defines.COLOR = "1"; + } else { + delete this.defines.COLOR; + } + this.needsUpdate = true; + } + /** + * Indicates whether color output is enabled. + * + * @deprecated Use colorOutput instead. + * @return {Boolean} Whether color output is enabled. + */ + isColorOutputEnabled(value) { + return this.colorOutput; + } + /** + * Enables or disables color output. + * + * @deprecated Use colorOutput instead. + * @param {Boolean} value - Whether color output should be enabled. + */ + setColorOutputEnabled(value) { + this.colorOutput = value; + } + /** + * Indicates whether luminance masking is enabled. + * + * @type {Boolean} + * @deprecated + */ + get useRange() { + return this.luminanceRange !== null; + } + set useRange(value) { + this.luminanceRange = null; + } + /** + * The luminance range. Set to null to disable. + * + * @type {Boolean} + */ + get luminanceRange() { + return this.uniforms.range.value; + } + set luminanceRange(value) { + if (value !== null) { + this.defines.RANGE = "1"; + } else { + delete this.defines.RANGE; + } + this.uniforms.range.value = value; + this.needsUpdate = true; + } + /** + * Returns the current luminance range. + * + * @deprecated Use luminanceRange instead. + * @return {Vector2} The luminance range. + */ + getLuminanceRange() { + return this.luminanceRange; + } + /** + * Sets a luminance range. Set to null to disable. + * + * @deprecated Use luminanceRange instead. + * @param {Vector2} value - The luminance range. + */ + setLuminanceRange(value) { + this.luminanceRange = value; + } +}; +var LuminancePass = class extends Pass { + /** + * Constructs a new luminance pass. + * + * @param {Object} [options] - The options. See {@link LuminanceMaterial} for additional options. + * @param {WebGLRenderTarget} [options.renderTarget] - A custom render target. + * @param {Number} [options.resolutionScale=1.0] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + */ + constructor({ + renderTarget, + luminanceRange, + colorOutput, + resolutionScale = 1, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("LuminancePass"); + this.fullscreenMaterial = new LuminanceMaterial(colorOutput, luminanceRange); + this.needsSwap = false; + this.renderTarget = renderTarget; + if (this.renderTarget === void 0) { + this.renderTarget = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTarget.texture.name = "LuminancePass.Target"; + } + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + } + /** + * The luminance texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * Returns the luminance texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTarget.texture; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * Renders the luminance. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const material = this.fullscreenMaterial; + material.inputBuffer = inputBuffer.texture; + renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget); + renderer.render(this.scene, this.camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + this.renderTarget.setSize(resolution.width, resolution.height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - A renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (frameBufferType !== void 0 && frameBufferType !== UnsignedByteType) { + this.renderTarget.texture.type = frameBufferType; + this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } + } +}; +var convolution_downsampling_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#define WEIGHT_INNER 0.125 +#define WEIGHT_OUTER 0.0555555 +varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; +#include +}`; +var convolution_downsampling_default2 = `uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}`; +var DownsamplingMaterial = class extends ShaderMaterial { + /** + * Constructs a new downsampling material. + */ + constructor() { + super({ + name: "DownsamplingMaterial", + uniforms: { + inputBuffer: new Uniform(null), + texelSize: new Uniform(new Vector2()) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_downsampling_default, + vertexShader: convolution_downsampling_default2 + }); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +var convolution_upsampling_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; +#else +uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; +#endif +uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); +#include +}`; +var convolution_upsampling_default2 = `uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}`; +var UpsamplingMaterial = class extends ShaderMaterial { + /** + * Constructs a new upsampling material. + */ + constructor() { + super({ + name: "UpsamplingMaterial", + uniforms: { + inputBuffer: new Uniform(null), + supportBuffer: new Uniform(null), + texelSize: new Uniform(new Vector2()), + radius: new Uniform(0.85) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_upsampling_default, + vertexShader: convolution_upsampling_default2 + }); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * A support buffer. + * + * @type {Texture} + */ + set supportBuffer(value) { + this.uniforms.supportBuffer.value = value; + } + /** + * The blur radius. + * + * @type {Number} + */ + get radius() { + return this.uniforms.radius.value; + } + set radius(value) { + this.uniforms.radius.value = value; + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +var MipmapBlurPass = class extends Pass { + /** + * Constructs a new mipmap blur pass. + * + * @param {Object} [options] - The options. + */ + constructor() { + super("MipmapBlurPass"); + this.needsSwap = false; + this.renderTarget = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTarget.texture.name = "Upsampling.Mipmap0"; + this.downsamplingMipmaps = []; + this.upsamplingMipmaps = []; + this.downsamplingMaterial = new DownsamplingMaterial(); + this.upsamplingMaterial = new UpsamplingMaterial(); + this.resolution = new Vector2(); + } + /** + * A texture that contains the blurred result. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * The MIP levels. Default is 8. + * + * @type {Number} + */ + get levels() { + return this.downsamplingMipmaps.length; + } + set levels(value) { + if (this.levels !== value) { + const renderTarget = this.renderTarget; + this.dispose(); + this.downsamplingMipmaps = []; + this.upsamplingMipmaps = []; + for (let i = 0; i < value; ++i) { + const mipmap = renderTarget.clone(); + mipmap.texture.name = "Downsampling.Mipmap" + i; + this.downsamplingMipmaps.push(mipmap); + } + this.upsamplingMipmaps.push(renderTarget); + for (let i = 1, l = value - 1; i < l; ++i) { + const mipmap = renderTarget.clone(); + mipmap.texture.name = "Upsampling.Mipmap" + i; + this.upsamplingMipmaps.push(mipmap); + } + this.setSize(this.resolution.x, this.resolution.y); + } + } + /** + * The blur radius. + * + * @type {Number} + */ + get radius() { + return this.upsamplingMaterial.radius; + } + set radius(value) { + this.upsamplingMaterial.radius = value; + } + /** + * Renders the blur. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const { scene, camera } = this; + const { downsamplingMaterial, upsamplingMaterial } = this; + const { downsamplingMipmaps, upsamplingMipmaps } = this; + let previousBuffer = inputBuffer; + this.fullscreenMaterial = downsamplingMaterial; + for (let i = 0, l = downsamplingMipmaps.length; i < l; ++i) { + const mipmap = downsamplingMipmaps[i]; + downsamplingMaterial.setSize(previousBuffer.width, previousBuffer.height); + downsamplingMaterial.inputBuffer = previousBuffer.texture; + renderer.setRenderTarget(mipmap); + renderer.render(scene, camera); + previousBuffer = mipmap; + } + this.fullscreenMaterial = upsamplingMaterial; + for (let i = upsamplingMipmaps.length - 1; i >= 0; --i) { + const mipmap = upsamplingMipmaps[i]; + upsamplingMaterial.setSize(previousBuffer.width, previousBuffer.height); + upsamplingMaterial.inputBuffer = previousBuffer.texture; + upsamplingMaterial.supportBuffer = downsamplingMipmaps[i].texture; + renderer.setRenderTarget(mipmap); + renderer.render(scene, camera); + previousBuffer = mipmap; + } + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.set(width, height); + let w = resolution.width, h = resolution.height; + for (let i = 0, l = this.downsamplingMipmaps.length; i < l; ++i) { + w = Math.round(w * 0.5); + h = Math.round(h * 0.5); + this.downsamplingMipmaps[i].setSize(w, h); + if (i < this.upsamplingMipmaps.length) { + this.upsamplingMipmaps[i].setSize(w, h); + } + } + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (frameBufferType !== void 0) { + const mipmaps = this.downsamplingMipmaps.concat(this.upsamplingMipmaps); + for (const mipmap of mipmaps) { + mipmap.texture.type = frameBufferType; + } + if (frameBufferType !== UnsignedByteType) { + this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + for (const mipmap of mipmaps) { + mipmap.texture.colorSpace = SRGBColorSpace; + } + } + } + } + /** + * Deletes internal render targets and textures. + */ + dispose() { + super.dispose(); + for (const mipmap of this.downsamplingMipmaps.concat(this.upsamplingMipmaps)) { + mipmap.dispose(); + } + } +}; +var bloom_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D map; +#else +uniform lowp sampler2D map; +#endif +uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,max(inputColor.a,texel.a));}`; +var BloomEffect = class extends Effect { + /** + * Constructs a new bloom effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function of this effect. + * @param {Number} [options.luminanceThreshold=1.0] - The luminance threshold. Raise this value to mask out darker elements in the scene. + * @param {Number} [options.luminanceSmoothing=0.03] - Controls the smoothness of the luminance threshold. + * @param {Boolean} [options.mipmapBlur=true] - Enables or disables mipmap blur. + * @param {Number} [options.intensity=1.0] - The bloom intensity. + * @param {Number} [options.radius=0.85] - The blur radius. Only applies to mipmap blur. + * @param {Number} [options.levels=8] - The amount of MIP levels. Only applies to mipmap blur. + * @param {KernelSize} [options.kernelSize=KernelSize.LARGE] - Deprecated. Use mipmapBlur instead. + * @param {Number} [options.resolutionScale=0.5] - Deprecated. Use mipmapBlur instead. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead. + */ + constructor({ + blendFunction = BlendFunction.SCREEN, + luminanceThreshold = 1, + luminanceSmoothing = 0.03, + mipmapBlur = true, + intensity = 1, + radius = 0.85, + levels = 8, + kernelSize = KernelSize.LARGE, + resolutionScale = 0.5, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("BloomEffect", bloom_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["map", new Uniform(null)], + ["intensity", new Uniform(intensity)] + ]) + }); + this.renderTarget = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTarget.texture.name = "Bloom.Target"; + this.blurPass = new KawaseBlurPass({ kernelSize }); + this.luminancePass = new LuminancePass({ colorOutput: true }); + this.luminanceMaterial.threshold = luminanceThreshold; + this.luminanceMaterial.smoothing = luminanceSmoothing; + this.mipmapBlurPass = new MipmapBlurPass(); + this.mipmapBlurPass.enabled = mipmapBlur; + this.mipmapBlurPass.radius = radius; + this.mipmapBlurPass.levels = levels; + this.uniforms.get("map").value = mipmapBlur ? this.mipmapBlurPass.texture : this.renderTarget.texture; + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + } + /** + * A texture that contains the intermediate result of this effect. + * + * @type {Texture} + */ + get texture() { + return this.mipmapBlurPass.enabled ? this.mipmapBlurPass.texture : this.renderTarget.texture; + } + /** + * Returns the generated bloom texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.texture; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * Returns the blur pass. + * + * @deprecated + * @return {KawaseBlurPass} The blur pass. + */ + getBlurPass() { + return this.blurPass; + } + /** + * Returns the luminance pass. + * + * @deprecated Use luminancePass instead. + * @return {LuminancePass} The luminance pass. + */ + getLuminancePass() { + return this.luminancePass; + } + /** + * The luminance material. + * + * @type {LuminanceMaterial} + */ + get luminanceMaterial() { + return this.luminancePass.fullscreenMaterial; + } + /** + * Returns the luminance material. + * + * @deprecated Use luminanceMaterial instead. + * @return {LuminanceMaterial} The material. + */ + getLuminanceMaterial() { + return this.luminancePass.fullscreenMaterial; + } + /** + * The current width of the internal render targets. + * + * @type {Number} + * @deprecated + */ + get width() { + return this.resolution.width; + } + set width(value) { + this.resolution.preferredWidth = value; + } + /** + * The current height of the internal render targets. + * + * @type {Number} + * @deprecated + */ + get height() { + return this.resolution.height; + } + set height(value) { + this.resolution.preferredHeight = value; + } + /** + * Indicates whether dithering is enabled. + * + * @type {Boolean} + * @deprecated Use EffectPass.dithering instead. + */ + get dithering() { + return this.blurPass.dithering; + } + set dithering(value) { + this.blurPass.dithering = value; + } + /** + * The blur kernel size. + * + * @type {KernelSize} + * @deprecated + */ + get kernelSize() { + return this.blurPass.kernelSize; + } + set kernelSize(value) { + this.blurPass.kernelSize = value; + } + /** + * @type {Number} + * @deprecated + */ + get distinction() { + console.warn(this.name, "distinction was removed"); + return 1; + } + set distinction(value) { + console.warn(this.name, "distinction was removed"); + } + /** + * The bloom intensity. + * + * @type {Number} + */ + get intensity() { + return this.uniforms.get("intensity").value; + } + set intensity(value) { + this.uniforms.get("intensity").value = value; + } + /** + * The bloom intensity. + * + * @deprecated Use intensity instead. + * @return {Number} The intensity. + */ + getIntensity() { + return this.intensity; + } + /** + * Sets the bloom intensity. + * + * @deprecated Use intensity instead. + * @param {Number} value - The intensity. + */ + setIntensity(value) { + this.intensity = value; + } + /** + * Returns the current resolution scale. + * + * @return {Number} The resolution scale. + * @deprecated + */ + getResolutionScale() { + return this.resolution.scale; + } + /** + * Sets the resolution scale. + * + * @param {Number} scale - The new resolution scale. + * @deprecated + */ + setResolutionScale(scale) { + this.resolution.scale = scale; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const renderTarget = this.renderTarget; + const luminancePass = this.luminancePass; + if (luminancePass.enabled) { + luminancePass.render(renderer, inputBuffer); + if (this.mipmapBlurPass.enabled) { + this.mipmapBlurPass.render(renderer, luminancePass.renderTarget); + } else { + this.blurPass.render(renderer, luminancePass.renderTarget, renderTarget); + } + } else { + if (this.mipmapBlurPass.enabled) { + this.mipmapBlurPass.render(renderer, inputBuffer); + } else { + this.blurPass.render(renderer, inputBuffer, renderTarget); + } + } + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + this.renderTarget.setSize(resolution.width, resolution.height); + this.blurPass.resolution.copy(resolution); + this.luminancePass.setSize(width, height); + this.mipmapBlurPass.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.blurPass.initialize(renderer, alpha, frameBufferType); + this.luminancePass.initialize(renderer, alpha, frameBufferType); + this.mipmapBlurPass.initialize(renderer, alpha, frameBufferType); + if (frameBufferType !== void 0) { + this.renderTarget.texture.type = frameBufferType; + if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTarget.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var bokeh_default = `uniform float focus;uniform float dof;uniform float aperture;uniform float maxBlur;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec2 aspectCorrection=vec2(1.0,aspect); +#ifdef PERSPECTIVE_CAMERA +float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); +#else +float linearDepth=depth; +#endif +float focusNear=clamp(focus-dof,0.0,1.0);float focusFar=clamp(focus+dof,0.0,1.0);float low=step(linearDepth,focusNear);float high=step(focusFar,linearDepth);float factor=(linearDepth-focusNear)*low+(linearDepth-focusFar)*high;vec2 dofBlur=vec2(clamp(factor*aperture,-maxBlur,maxBlur));vec2 dofblur9=dofBlur*0.9;vec2 dofblur7=dofBlur*0.7;vec2 dofblur4=dofBlur*0.4;vec4 color=inputColor;color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.37,0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.40,0.0)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.37,-0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.15,-0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.15,0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.37,0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.37,-0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,-0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.37,0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.37,-0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.15,-0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.15,0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.37,0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.37,-0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.15,-0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.40,0.0)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.4,0.0)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofblur4);outputColor=color/41.0;}`; +var BokehEffect = class extends Effect { + /** + * Constructs a new bokeh effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.focus=0.5] - The focus distance ratio, ranging from 0.0 to 1.0. + * @param {Number} [options.dof=0.02] - Depth of field. An area in front of and behind the focal point that still appears sharp. + * @param {Number} [options.aperture=0.015] - Camera aperture scale. Bigger values for stronger blur and shallower depth of field. + * @param {Number} [options.maxBlur=1.0] - The maximum blur strength. + */ + constructor({ + blendFunction, + focus = 0.5, + dof = 0.02, + aperture = 0.015, + maxBlur = 1 + } = {}) { + super("BokehEffect", bokeh_default, { + blendFunction, + attributes: EffectAttribute.CONVOLUTION | EffectAttribute.DEPTH, + uniforms: /* @__PURE__ */ new Map([ + ["focus", new Uniform(focus)], + ["dof", new Uniform(dof)], + ["aperture", new Uniform(aperture)], + ["maxBlur", new Uniform(maxBlur)] + ]) + }); + } +}; +var brightness_contrast_default = `uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(color+vec3(0.5),inputColor.a);}`; +var BrightnessContrastEffect = class extends Effect { + /** + * Constructs a new brightness/contrast effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + * @param {Number} [options.brightness=0.0] - The brightness factor, ranging from -1 to 1, where 0 means no change. + * @param {Number} [options.contrast=0.0] - The contrast factor, ranging from -1 to 1, where 0 means no change. + */ + constructor({ blendFunction = BlendFunction.SRC, brightness = 0, contrast = 0 } = {}) { + super("BrightnessContrastEffect", brightness_contrast_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["brightness", new Uniform(brightness)], + ["contrast", new Uniform(contrast)] + ]) + }); + this.inputColorSpace = SRGBColorSpace; + } + /** + * The brightness. + * + * @type {Number} + */ + get brightness() { + return this.uniforms.get("brightness").value; + } + set brightness(value) { + this.uniforms.get("brightness").value = value; + } + /** + * Returns the brightness. + * + * @deprecated Use brightness instead. + * @return {Number} The brightness. + */ + getBrightness() { + return this.brightness; + } + /** + * Sets the brightness. + * + * @deprecated Use brightness instead. + * @param {Number} value - The brightness. + */ + setBrightness(value) { + this.brightness = value; + } + /** + * The contrast. + * + * @type {Number} + */ + get contrast() { + return this.uniforms.get("contrast").value; + } + set contrast(value) { + this.uniforms.get("contrast").value = value; + } + /** + * Returns the contrast. + * + * @deprecated Use contrast instead. + * @return {Number} The contrast. + */ + getContrast() { + return this.contrast; + } + /** + * Sets the contrast. + * + * @deprecated Use contrast instead. + * @param {Number} value - The contrast. + */ + setContrast(value) { + this.contrast = value; + } +}; +var color_average_default = `void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}`; +var ColorAverageEffect = class extends Effect { + /** + * Constructs a new color average effect. + * + * @param {BlendFunction} [blendFunction] - The blend function of this effect. + */ + constructor(blendFunction) { + super("ColorAverageEffect", color_average_default, { blendFunction }); + } +}; +var color_depth_default = `uniform float factor;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(floor(inputColor.rgb*factor+0.5)/factor,inputColor.a);}`; +var ColorDepthEffect = class extends Effect { + /** + * Constructs a new color depth effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.bits=16] - The color bit depth. + */ + constructor({ blendFunction, bits = 16 } = {}) { + super("ColorDepthEffect", color_depth_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["factor", new Uniform(1)] + ]) + }); + this.bits = 0; + this.bitDepth = bits; + } + /** + * The virtual amount of color bits. + * + * Each color channel effectively uses a fourth of the total amount of bits. Alpha remains unaffected. + * + * @type {Number} + */ + get bitDepth() { + return this.bits; + } + set bitDepth(value) { + this.bits = value; + this.uniforms.get("factor").value = Math.pow(2, value / 3); + } + /** + * Returns the current color bit depth. + * + * @return {Number} The bit depth. + */ + getBitDepth() { + return this.bitDepth; + } + /** + * Sets the virtual amount of color bits. + * + * @param {Number} value - The bit depth. + */ + setBitDepth(value) { + this.bitDepth = value; + } +}; +var chromatic_aberration_default = `#ifdef RADIAL_MODULATION +uniform float modulationOffset; +#endif +varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=inputColor.ra;vec2 ba=inputColor.ba; +#ifdef RADIAL_MODULATION +const vec2 center=vec2(0.5);float d=distance(uv,center)*2.0;d=max(d-modulationOffset,0.0);if(vActive>0.0&&d>0.0){ra=texture2D(inputBuffer,mix(uv,vUvR,d)).ra;ba=texture2D(inputBuffer,mix(uv,vUvB,d)).ba;} +#else +if(vActive>0.0){ra=texture2D(inputBuffer,vUvR).ra;ba=texture2D(inputBuffer,vUvB).ba;} +#endif +outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}`; +var chromatic_aberration_default2 = `uniform vec2 offset;varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vActive=(shift.x!=0.0||shift.y!=0.0)?1.0:0.0;vUvR=uv+shift;vUvB=uv-shift;}`; +var ChromaticAberrationEffect = class extends Effect { + /** + * Constructs a new chromatic aberration effect. + * + * @param {Object} [options] - The options. + * @param {Vector2} [options.offset] - The color offset. + * @param {Boolean} [options.radialModulation=false] - Whether the effect should be modulated with a radial gradient. + * @param {Number} [options.modulationOffset=0.15] - The modulation offset. Only applies if `radialModulation` is enabled. + */ + constructor({ + offset = new Vector2(1e-3, 5e-4), + radialModulation = false, + modulationOffset = 0.15 + } = {}) { + super("ChromaticAberrationEffect", chromatic_aberration_default, { + vertexShader: chromatic_aberration_default2, + attributes: EffectAttribute.CONVOLUTION, + uniforms: /* @__PURE__ */ new Map([ + ["offset", new Uniform(offset)], + ["modulationOffset", new Uniform(modulationOffset)] + ]) + }); + this.radialModulation = radialModulation; + } + /** + * The color offset. + * + * @type {Vector2} + */ + get offset() { + return this.uniforms.get("offset").value; + } + set offset(value) { + this.uniforms.get("offset").value = value; + } + /** + * Indicates whether radial modulation is enabled. + * + * When enabled, the effect will be weaker in the middle and stronger towards the screen edges. + * + * @type {Boolean} + */ + get radialModulation() { + return this.defines.has("RADIAL_MODULATION"); + } + set radialModulation(value) { + if (value) { + this.defines.set("RADIAL_MODULATION", "1"); + } else { + this.defines.delete("RADIAL_MODULATION"); + } + this.setChanged(); + } + /** + * The modulation offset. + * + * @type {Number} + */ + get modulationOffset() { + return this.uniforms.get("modulationOffset").value; + } + set modulationOffset(value) { + this.uniforms.get("modulationOffset").value = value; + } + /** + * Returns the color offset vector. + * + * @deprecated Use offset instead. + * @return {Vector2} The offset. + */ + getOffset() { + return this.offset; + } + /** + * Sets the color offset vector. + * + * @deprecated Use offset instead. + * @param {Vector2} value - The offset. + */ + setOffset(value) { + this.offset = value; + } +}; +var depth_default = `void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){ +#ifdef INVERTED +vec3 color=vec3(1.0-depth); +#else +vec3 color=vec3(depth); +#endif +outputColor=vec4(color,inputColor.a);}`; +var DepthEffect = class extends Effect { + /** + * Constructs a new depth effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + * @param {Boolean} [options.inverted=false] - Whether the depth should be inverted. + */ + constructor({ blendFunction = BlendFunction.SRC, inverted = false } = {}) { + super("DepthEffect", depth_default, { + blendFunction, + attributes: EffectAttribute.DEPTH + }); + this.inverted = inverted; + } + /** + * Indicates whether depth should be inverted. + * + * @type {Boolean} + */ + get inverted() { + return this.defines.has("INVERTED"); + } + set inverted(value) { + if (this.inverted !== value) { + if (value) { + this.defines.set("INVERTED", "1"); + } else { + this.defines.delete("INVERTED"); + } + this.setChanged(); + } + } + /** + * Indicates whether the rendered depth is inverted. + * + * @deprecated Use inverted instead. + * @return {Boolean} Whether the rendered depth is inverted. + */ + isInverted() { + return this.inverted; + } + /** + * Enables or disables depth inversion. + * + * @deprecated Use inverted instead. + * @param {Boolean} value - Whether depth should be inverted. + */ + setInverted(value) { + this.inverted = value; + } +}; +var ColorChannel = { + RED: 0, + GREEN: 1, + BLUE: 2, + ALPHA: 3 +}; +var MaskFunction = { + DISCARD: 0, + MULTIPLY: 1, + MULTIPLY_RGB_SET_ALPHA: 2, + MULTIPLY_RGB: 3 +}; +var convolution_bokeh_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#if PASS == 1 +uniform vec4 kernel64[32]; +#else +uniform vec4 kernel16[8]; +#endif +uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;varying vec2 vUv;void main(){ +#ifdef FOREGROUND +vec2 cocNearFar=texture2D(cocBuffer,vUv).rg*scale;float coc=cocNearFar.x; +#else +float coc=texture2D(cocBuffer,vUv).g*scale; +#endif +if(coc==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ +#ifdef FOREGROUND +vec2 step=texelSize*max(cocNearFar.x,cocNearFar.y); +#else +vec2 step=texelSize*coc; +#endif +#if PASS == 1 +vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; +#else +vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; +#endif +}}`; +var BokehMaterial = class extends ShaderMaterial { + /** + * Constructs a new bokeh material. + * + * @param {Boolean} [fill=false] - Enables or disables the bokeh highlight fill mode. + * @param {Boolean} [foreground=false] - Determines whether this material will be applied to foreground colors. + */ + constructor(fill = false, foreground = false) { + super({ + name: "BokehMaterial", + defines: { + PASS: fill ? "2" : "1" + }, + uniforms: { + inputBuffer: new Uniform(null), + cocBuffer: new Uniform(null), + texelSize: new Uniform(new Vector2()), + kernel64: new Uniform(null), + kernel16: new Uniform(null), + scale: new Uniform(1) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_bokeh_default, + vertexShader: common_default + }); + if (foreground) { + this.defines.FOREGROUND = "1"; + } + this.generateKernel(); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The circle of confusion buffer. + * + * @type {Texture} + */ + set cocBuffer(value) { + this.uniforms.cocBuffer.value = value; + } + /** + * Sets the circle of confusion buffer. + * + * @deprecated Use cocBuffer instead. + * @param {Texture} value - The buffer. + */ + setCoCBuffer(value) { + this.uniforms.cocBuffer.value = value; + } + /** + * The blur scale. + * + * @type {Number} + */ + get scale() { + return this.uniforms.scale.value; + } + set scale(value) { + this.uniforms.scale.value = value; + } + /** + * Returns the blur scale. + * + * @deprecated Use scale instead. + * @return {Number} The scale. + */ + getScale(value) { + return this.scale; + } + /** + * Sets the blur scale. + * + * @deprecated Use scale instead. + * @param {Number} value - The scale. + */ + setScale(value) { + this.scale = value; + } + /** + * Generates the blur kernel. + * + * @private + */ + generateKernel() { + const GOLDEN_ANGLE = 2.39996323; + const points64 = new Float64Array(128); + const points16 = new Float64Array(32); + let i64 = 0, i16 = 0; + for (let i = 0, sqrt80 = Math.sqrt(80); i < 80; ++i) { + const theta = i * GOLDEN_ANGLE; + const r = Math.sqrt(i) / sqrt80; + const u = r * Math.cos(theta), v3 = r * Math.sin(theta); + if (i % 5 === 0) { + points16[i16++] = u; + points16[i16++] = v3; + } else { + points64[i64++] = u; + points64[i64++] = v3; + } + } + this.uniforms.kernel64.value = points64; + this.uniforms.kernel16.value = points16; + } + /** + * Sets the texel size. + * + * @deprecated Use setSize() instead. + * @param {Number} x - The texel width. + * @param {Number} y - The texel height. + */ + setTexelSize(x, y) { + this.uniforms.texelSize.value.set(x, y); + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +function orthographicDepthToViewZ(depth, near, far) { + return depth * (near - far) - near; +} +function viewZToOrthographicDepth(viewZ, near, far) { + return Math.min(Math.max((viewZ + near) / (near - far), 0), 1); +} +var circle_of_confusion_default = `#include +#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +float depth=texture2D(depthBuffer,uv).r; +#endif +#ifdef LOG_DEPTH +float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d; +#endif +return depth;}void main(){float depth=readDepth(vUv); +#ifdef PERSPECTIVE_CAMERA +float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); +#else +float linearDepth=depth; +#endif +float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`; +var CircleOfConfusionMaterial = class extends ShaderMaterial { + /** + * Constructs a new CoC material. + * + * @param {Camera} camera - A camera. + */ + constructor(camera) { + super({ + name: "CircleOfConfusionMaterial", + defines: { + DEPTH_PACKING: "0" + }, + uniforms: { + depthBuffer: new Uniform(null), + focusDistance: new Uniform(0), + focusRange: new Uniform(0), + cameraNear: new Uniform(0.3), + cameraFar: new Uniform(1e3) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: circle_of_confusion_default, + vertexShader: common_default + }); + this.uniforms.focalLength = this.uniforms.focusRange; + this.copyCameraSettings(camera); + } + /** + * The current near plane setting. + * + * @type {Number} + * @private + */ + get near() { + return this.uniforms.cameraNear.value; + } + /** + * The current far plane setting. + * + * @type {Number} + * @private + */ + get far() { + return this.uniforms.cameraFar.value; + } + /** + * The depth buffer. + * + * @type {Texture} + */ + set depthBuffer(value) { + this.uniforms.depthBuffer.value = value; + } + /** + * The depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set depthPacking(value) { + this.defines.DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the depth buffer. + * + * @deprecated Use depthBuffer and depthPacking instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthBuffer(buffer, depthPacking = BasicDepthPacking) { + this.depthBuffer = buffer; + this.depthPacking = depthPacking; + } + /** + * The focus distance. Range: [0.0, 1.0]. + * + * @type {Number} + */ + get focusDistance() { + return this.uniforms.focusDistance.value; + } + set focusDistance(value) { + this.uniforms.focusDistance.value = value; + } + /** + * The focus distance in world units. + * + * @type {Number} + */ + get worldFocusDistance() { + return -orthographicDepthToViewZ(this.focusDistance, this.near, this.far); + } + set worldFocusDistance(value) { + this.focusDistance = viewZToOrthographicDepth(-value, this.near, this.far); + } + /** + * Returns the focus distance. + * + * @deprecated Use focusDistance instead. + * @return {Number} The focus distance. + */ + getFocusDistance(value) { + this.uniforms.focusDistance.value = value; + } + /** + * Sets the focus distance. + * + * @deprecated Use focusDistance instead. + * @param {Number} value - The focus distance. + */ + setFocusDistance(value) { + this.uniforms.focusDistance.value = value; + } + /** + * The focal length. + * + * @deprecated Renamed to focusRange. + * @type {Number} + */ + get focalLength() { + return this.focusRange; + } + set focalLength(value) { + this.focusRange = value; + } + /** + * The focus range. Range: [0.0, 1.0]. + * + * @type {Number} + */ + get focusRange() { + return this.uniforms.focusRange.value; + } + set focusRange(value) { + this.uniforms.focusRange.value = value; + } + /** + * The focus range in world units. + * + * @type {Number} + */ + get worldFocusRange() { + return -orthographicDepthToViewZ(this.focusRange, this.near, this.far); + } + set worldFocusRange(value) { + this.focusRange = viewZToOrthographicDepth(-value, this.near, this.far); + } + /** + * Returns the focal length. + * + * @deprecated Use focusRange instead. + * @return {Number} The focal length. + */ + getFocalLength(value) { + return this.focusRange; + } + /** + * Sets the focal length. + * + * @deprecated Use focusRange instead. + * @param {Number} value - The focal length. + */ + setFocalLength(value) { + this.focusRange = value; + } + /** + * Copies the settings of the given camera. + * + * @deprecated Use copyCameraSettings instead. + * @param {Camera} camera - A camera. + */ + adoptCameraSettings(camera) { + this.copyCameraSettings(camera); + } + /** + * Copies the settings of the given camera. + * + * @param {Camera} camera - A camera. + */ + copyCameraSettings(camera) { + if (camera) { + this.uniforms.cameraNear.value = camera.near; + this.uniforms.cameraFar.value = camera.far; + if (camera instanceof PerspectiveCamera) { + this.defines.PERSPECTIVE_CAMERA = "1"; + } else { + delete this.defines.PERSPECTIVE_CAMERA; + } + this.needsUpdate = true; + } + } +}; +var mask_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef MASK_PRECISION_HIGH +uniform mediump sampler2D maskTexture; +#else +uniform lowp sampler2D maskTexture; +#endif +#if MASK_FUNCTION != 0 +uniform float strength; +#endif +varying vec2 vUv;void main(){ +#if COLOR_CHANNEL == 0 +float mask=texture2D(maskTexture,vUv).r; +#elif COLOR_CHANNEL == 1 +float mask=texture2D(maskTexture,vUv).g; +#elif COLOR_CHANNEL == 2 +float mask=texture2D(maskTexture,vUv).b; +#else +float mask=texture2D(maskTexture,vUv).a; +#endif +#if MASK_FUNCTION == 0 +#ifdef INVERTED +mask=step(mask,0.0); +#else +mask=1.0-step(mask,0.0); +#endif +#else +mask=clamp(mask*strength,0.0,1.0); +#ifdef INVERTED +mask=1.0-mask; +#endif +#endif +#if MASK_FUNCTION == 3 +vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=vec4(mask*texel.rgb,texel.a); +#elif MASK_FUNCTION == 2 +gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); +#else +gl_FragColor=mask*texture2D(inputBuffer,vUv); +#endif +}`; +var MaskMaterial = class extends ShaderMaterial { + /** + * Constructs a new mask material. + * + * @param {Texture} [maskTexture] - The mask texture. + */ + constructor(maskTexture = null) { + super({ + name: "MaskMaterial", + uniforms: { + maskTexture: new Uniform(maskTexture), + inputBuffer: new Uniform(null), + strength: new Uniform(1) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: mask_default, + vertexShader: common_default + }); + this.colorChannel = ColorChannel.RED; + this.maskFunction = MaskFunction.DISCARD; + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The mask texture. + * + * @type {Texture} + */ + set maskTexture(value) { + this.uniforms.maskTexture.value = value; + delete this.defines.MASK_PRECISION_HIGH; + if (value.type !== UnsignedByteType) { + this.defines.MASK_PRECISION_HIGH = "1"; + } + this.needsUpdate = true; + } + /** + * Sets the mask texture. + * + * @deprecated Use maskTexture instead. + * @param {Texture} value - The texture. + */ + setMaskTexture(value) { + this.maskTexture = value; + } + /** + * Sets the color channel to use for masking. Default is `ColorChannel.RED`. + * + * @type {ColorChannel} + */ + set colorChannel(value) { + this.defines.COLOR_CHANNEL = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the color channel to use for masking. Default is `ColorChannel.RED`. + * + * @deprecated Use colorChannel instead. + * @param {ColorChannel} value - The channel. + */ + setColorChannel(value) { + this.colorChannel = value; + } + /** + * The masking technique. Default is `MaskFunction.DISCARD`. + * + * @type {MaskFunction} + */ + set maskFunction(value) { + this.defines.MASK_FUNCTION = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the masking technique. Default is `MaskFunction.DISCARD`. + * + * @deprecated Use maskFunction instead. + * @param {MaskFunction} value - The function. + */ + setMaskFunction(value) { + this.maskFunction = value; + } + /** + * Indicates whether the masking is inverted. + * + * @type {Boolean} + */ + get inverted() { + return this.defines.INVERTED !== void 0; + } + set inverted(value) { + if (this.inverted && !value) { + delete this.defines.INVERTED; + } else if (value) { + this.defines.INVERTED = "1"; + } + this.needsUpdate = true; + } + /** + * Indicates whether the masking is inverted. + * + * @deprecated Use inverted instead. + * @return {Boolean} Whether the masking is inverted. + */ + isInverted() { + return this.inverted; + } + /** + * Determines whether the masking should be inverted. + * + * @deprecated Use inverted instead. + * @param {Boolean} value - Whether the masking should be inverted. + */ + setInverted(value) { + this.inverted = value; + } + /** + * The current mask strength. + * + * Individual mask values will be clamped to [0.0, 1.0]. Has no effect when the mask function is set to `DISCARD`. + * + * @type {Number} + */ + get strength() { + return this.uniforms.strength.value; + } + set strength(value) { + this.uniforms.strength.value = value; + } + /** + * Returns the current mask strength. + * + * @deprecated Use strength instead. + * @return {Number} The mask strength. + */ + getStrength() { + return this.strength; + } + /** + * Sets the mask strength. + * + * Has no effect when the mask function is set to `DISCARD`. + * + * @deprecated Use strength instead. + * @param {Number} value - The mask strength. + */ + setStrength(value) { + this.strength = value; + } +}; +var ShaderPass = class extends Pass { + /** + * Constructs a new shader pass. + * + * @param {ShaderMaterial} material - A shader material. + * @param {String} [input="inputBuffer"] - The name of the input buffer uniform. + */ + constructor(material, input = "inputBuffer") { + super("ShaderPass"); + this.fullscreenMaterial = material; + this.input = input; + } + /** + * Sets the name of the input buffer uniform. + * + * @param {String} input - The name of the input buffer uniform. + * @deprecated Use input instead. + */ + setInput(input) { + this.input = input; + } + /** + * Renders the effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const uniforms = this.fullscreenMaterial.uniforms; + if (inputBuffer !== null && uniforms !== void 0 && uniforms[this.input] !== void 0) { + uniforms[this.input].value = inputBuffer.texture; + } + renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer); + renderer.render(this.scene, this.camera); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - A renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (frameBufferType !== void 0 && frameBufferType !== UnsignedByteType) { + this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } + } +}; +var depth_of_field_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; +#else +uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; +#endif +uniform lowp sampler2D nearCoCBuffer;uniform lowp sampler2D farCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv); +#if MASK_FUNCTION == 1 +vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,colorFar.a);cocNearFar.x=min(cocNearFar.x*scale,1.0); +#else +vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,texture2D(farCoCBuffer,uv).g);cocNearFar=min(cocNearFar*scale,1.0); +#endif +vec4 result=inputColor*(1.0-cocNearFar.y)+colorFar;result=mix(result,colorNear,cocNearFar.x);outputColor=result;}`; +var DepthOfFieldEffect = class extends Effect { + /** + * Constructs a new depth of field effect. + * + * @param {Camera} camera - The main camera. + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.worldFocusDistance] - The focus distance in world units. + * @param {Number} [options.worldFocusRange] - The focus distance in world units. + * @param {Number} [options.focusDistance=0.0] - The normalized focus distance. Range is [0.0, 1.0]. + * @param {Number} [options.focusRange=0.1] - The focus range. Range is [0.0, 1.0]. + * @param {Number} [options.focalLength=0.1] - Deprecated. + * @param {Number} [options.bokehScale=1.0] - The scale of the bokeh blur. + * @param {Number} [options.resolutionScale=0.5] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + */ + constructor(camera, { + blendFunction, + worldFocusDistance, + worldFocusRange, + focusDistance = 0, + focalLength = 0.1, + focusRange = focalLength, + bokehScale = 1, + resolutionScale = 1, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("DepthOfFieldEffect", depth_of_field_default, { + blendFunction, + attributes: EffectAttribute.DEPTH, + uniforms: /* @__PURE__ */ new Map([ + ["nearColorBuffer", new Uniform(null)], + ["farColorBuffer", new Uniform(null)], + ["nearCoCBuffer", new Uniform(null)], + ["farCoCBuffer", new Uniform(null)], + ["scale", new Uniform(1)] + ]) + }); + this.camera = camera; + this.renderTarget = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTarget.texture.name = "DoF.Intermediate"; + this.renderTargetMasked = this.renderTarget.clone(); + this.renderTargetMasked.texture.name = "DoF.Masked.Far"; + this.renderTargetNear = this.renderTarget.clone(); + this.renderTargetNear.texture.name = "DoF.Bokeh.Near"; + this.uniforms.get("nearColorBuffer").value = this.renderTargetNear.texture; + this.renderTargetFar = this.renderTarget.clone(); + this.renderTargetFar.texture.name = "DoF.Bokeh.Far"; + this.uniforms.get("farColorBuffer").value = this.renderTargetFar.texture; + this.renderTargetCoC = this.renderTarget.clone(); + this.renderTargetCoC.texture.name = "DoF.CoC"; + this.uniforms.get("farCoCBuffer").value = this.renderTargetCoC.texture; + this.renderTargetCoCBlurred = this.renderTargetCoC.clone(); + this.renderTargetCoCBlurred.texture.name = "DoF.CoC.Blurred"; + this.uniforms.get("nearCoCBuffer").value = this.renderTargetCoCBlurred.texture; + this.cocPass = new ShaderPass(new CircleOfConfusionMaterial(camera)); + const cocMaterial = this.cocMaterial; + cocMaterial.focusDistance = focusDistance; + cocMaterial.focusRange = focusRange; + if (worldFocusDistance !== void 0) { + cocMaterial.worldFocusDistance = worldFocusDistance; + } + if (worldFocusRange !== void 0) { + cocMaterial.worldFocusRange = worldFocusRange; + } + this.blurPass = new KawaseBlurPass({ resolutionScale, resolutionX, resolutionY, kernelSize: KernelSize.MEDIUM }); + this.maskPass = new ShaderPass(new MaskMaterial(this.renderTargetCoC.texture)); + const maskMaterial = this.maskPass.fullscreenMaterial; + maskMaterial.colorChannel = ColorChannel.GREEN; + this.maskFunction = MaskFunction.MULTIPLY_RGB; + this.bokehNearBasePass = new ShaderPass(new BokehMaterial(false, true)); + this.bokehNearBasePass.fullscreenMaterial.cocBuffer = this.renderTargetCoCBlurred.texture; + this.bokehNearFillPass = new ShaderPass(new BokehMaterial(true, true)); + this.bokehNearFillPass.fullscreenMaterial.cocBuffer = this.renderTargetCoCBlurred.texture; + this.bokehFarBasePass = new ShaderPass(new BokehMaterial(false, false)); + this.bokehFarBasePass.fullscreenMaterial.cocBuffer = this.renderTargetCoC.texture; + this.bokehFarFillPass = new ShaderPass(new BokehMaterial(true, false)); + this.bokehFarFillPass.fullscreenMaterial.cocBuffer = this.renderTargetCoC.texture; + this.target = null; + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + this.bokehScale = bokehScale; + } + set mainCamera(value) { + this.camera = value; + this.cocMaterial.copyCameraSettings(value); + } + /** + * The circle of confusion texture. + * + * @type {Texture} + */ + get cocTexture() { + return this.renderTargetCoC.texture; + } + /** + * The mask function. Default is `MULTIPLY_RGB`. + * + * @type {MaskFunction} + */ + get maskFunction() { + return this.maskPass.fullscreenMaterial.maskFunction; + } + set maskFunction(value) { + if (this.maskFunction !== value) { + this.defines.set("MASK_FUNCTION", value.toFixed(0)); + this.maskPass.fullscreenMaterial.maskFunction = value; + this.setChanged(); + } + } + /** + * The circle of confusion material. + * + * @type {CircleOfConfusionMaterial} + */ + get cocMaterial() { + return this.cocPass.fullscreenMaterial; + } + /** + * The circle of confusion material. + * + * @deprecated Use cocMaterial instead. + * @type {CircleOfConfusionMaterial} + */ + get circleOfConfusionMaterial() { + return this.cocMaterial; + } + /** + * Returns the circle of confusion material. + * + * @deprecated Use cocMaterial instead. + * @return {CircleOfConfusionMaterial} The material. + */ + getCircleOfConfusionMaterial() { + return this.cocMaterial; + } + /** + * Returns the pass that blurs the foreground CoC buffer to soften edges. + * + * @deprecated Use blurPass instead. + * @return {KawaseBlurPass} The blur pass. + */ + getBlurPass() { + return this.blurPass; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * The current bokeh scale. + * + * @type {Number} + */ + get bokehScale() { + return this.uniforms.get("scale").value; + } + set bokehScale(value) { + this.bokehNearBasePass.fullscreenMaterial.scale = value; + this.bokehNearFillPass.fullscreenMaterial.scale = value; + this.bokehFarBasePass.fullscreenMaterial.scale = value; + this.bokehFarFillPass.fullscreenMaterial.scale = value; + this.maskPass.fullscreenMaterial.strength = value; + this.uniforms.get("scale").value = value; + } + /** + * Returns the current bokeh scale. + * + * @deprecated Use bokehScale instead. + * @return {Number} The scale. + */ + getBokehScale() { + return this.bokehScale; + } + /** + * Sets the bokeh scale. + * + * @deprecated Use bokehScale instead. + * @param {Number} value - The scale. + */ + setBokehScale(value) { + this.bokehScale = value; + } + /** + * Returns the current auto focus target. + * + * @deprecated Use target instead. + * @return {Vector3} The target. + */ + getTarget() { + return this.target; + } + /** + * Sets the auto focus target. + * + * @deprecated Use target instead. + * @param {Vector3} value - The target. + */ + setTarget(value) { + this.target = value; + } + /** + * Calculates the focus distance from the camera to the given position. + * + * @param {Vector3} target - The target. + * @return {Number} The normalized focus distance. + */ + calculateFocusDistance(target) { + const camera = this.camera; + const distance = camera.position.distanceTo(target); + return viewZToOrthographicDepth(-distance, camera.near, camera.far); + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.cocMaterial.depthBuffer = depthTexture; + this.cocMaterial.depthPacking = depthPacking; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const renderTarget = this.renderTarget; + const renderTargetCoC = this.renderTargetCoC; + const renderTargetCoCBlurred = this.renderTargetCoCBlurred; + const renderTargetMasked = this.renderTargetMasked; + if (this.target !== null) { + const distance = this.calculateFocusDistance(this.target); + this.cocMaterial.focusDistance = distance; + } + this.cocPass.render(renderer, null, renderTargetCoC); + this.blurPass.render(renderer, renderTargetCoC, renderTargetCoCBlurred); + this.maskPass.render(renderer, inputBuffer, renderTargetMasked); + this.bokehFarBasePass.render(renderer, renderTargetMasked, renderTarget); + this.bokehFarFillPass.render(renderer, renderTarget, this.renderTargetFar); + this.bokehNearBasePass.render(renderer, inputBuffer, renderTarget); + this.bokehNearFillPass.render(renderer, renderTarget, this.renderTargetNear); + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.cocPass.setSize(width, height); + this.blurPass.setSize(width, height); + this.maskPass.setSize(width, height); + this.renderTargetFar.setSize(width, height); + this.renderTargetCoC.setSize(width, height); + this.renderTargetMasked.setSize(width, height); + this.renderTarget.setSize(w, h); + this.renderTargetNear.setSize(w, h); + this.renderTargetCoCBlurred.setSize(w, h); + this.bokehNearBasePass.fullscreenMaterial.setSize(width, height); + this.bokehNearFillPass.fullscreenMaterial.setSize(width, height); + this.bokehFarBasePass.fullscreenMaterial.setSize(width, height); + this.bokehFarFillPass.fullscreenMaterial.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.cocPass.initialize(renderer, alpha, frameBufferType); + this.maskPass.initialize(renderer, alpha, frameBufferType); + this.bokehNearBasePass.initialize(renderer, alpha, frameBufferType); + this.bokehNearFillPass.initialize(renderer, alpha, frameBufferType); + this.bokehFarBasePass.initialize(renderer, alpha, frameBufferType); + this.bokehFarFillPass.initialize(renderer, alpha, frameBufferType); + this.blurPass.initialize(renderer, alpha, UnsignedByteType); + if (renderer.capabilities.logarithmicDepthBuffer) { + this.cocPass.fullscreenMaterial.defines.LOG_DEPTH = "1"; + } + if (frameBufferType !== void 0) { + this.renderTarget.texture.type = frameBufferType; + this.renderTargetNear.texture.type = frameBufferType; + this.renderTargetFar.texture.type = frameBufferType; + this.renderTargetMasked.texture.type = frameBufferType; + if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTarget.texture.colorSpace = SRGBColorSpace; + this.renderTargetNear.texture.colorSpace = SRGBColorSpace; + this.renderTargetFar.texture.colorSpace = SRGBColorSpace; + this.renderTargetMasked.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var dot_screen_default = `uniform vec2 angle;uniform float scale;float pattern(const in vec2 uv){vec2 point=scale*vec2(dot(angle.yx,vec2(uv.x,-uv.y)),dot(angle,uv));return(sin(point.x)*sin(point.y))*4.0;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(inputColor.rgb*10.0-5.0+pattern(uv*resolution));outputColor=vec4(color,inputColor.a);}`; +var DotScreenEffect = class extends Effect { + /** + * Constructs a new dot screen effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.angle=1.57] - The angle of the dot pattern. + * @param {Number} [options.scale=1.0] - The scale of the dot pattern. + */ + constructor({ blendFunction, angle = Math.PI * 0.5, scale = 1 } = {}) { + super("DotScreenEffect", dot_screen_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["angle", new Uniform(new Vector2())], + ["scale", new Uniform(scale)] + ]) + }); + this.angle = angle; + } + /** + * The angle. + * + * @type {Number} + */ + get angle() { + return Math.acos(this.uniforms.get("angle").value.y); + } + set angle(value) { + this.uniforms.get("angle").value.set(Math.sin(value), Math.cos(value)); + } + /** + * Returns the pattern angle. + * + * @deprecated Use angle instead. + * @return {Number} The angle in radians. + */ + getAngle() { + return this.angle; + } + /** + * Sets the pattern angle. + * + * @deprecated Use angle instead. + * @param {Number} value - The angle in radians. + */ + setAngle(value) { + this.angle = value; + } + /** + * The scale. + * + * @type {Number} + */ + get scale() { + return this.uniforms.get("scale").value; + } + set scale(value) { + this.uniforms.get("scale").value = value; + } +}; +var fxaa_default = `#define QUALITY(q) ((q) < 5 ? 1.0 : ((q) > 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5)) +#define ONE_OVER_TWELVE 0.08333333333333333 +varying vec2 vUvDown;varying vec2 vUvUp;varying vec2 vUvLeft;varying vec2 vUvRight;varying vec2 vUvDownLeft;varying vec2 vUvUpRight;varying vec2 vUvUpLeft;varying vec2 vUvDownRight;vec4 fxaa(const in vec4 inputColor,const in vec2 uv){float lumaCenter=luminance(inputColor.rgb);float lumaDown=luminance(texture2D(inputBuffer,vUvDown).rgb);float lumaUp=luminance(texture2D(inputBuffer,vUvUp).rgb);float lumaLeft=luminance(texture2D(inputBuffer,vUvLeft).rgb);float lumaRight=luminance(texture2D(inputBuffer,vUvRight).rgb);float lumaMin=min(lumaCenter,min(min(lumaDown,lumaUp),min(lumaLeft,lumaRight)));float lumaMax=max(lumaCenter,max(max(lumaDown,lumaUp),max(lumaLeft,lumaRight)));float lumaRange=lumaMax-lumaMin;if(lumaRange=edgeVertical);float stepLength=isHorizontal?texelSize.y:texelSize.x;float luma1=isHorizontal?lumaDown:lumaLeft;float luma2=isHorizontal?lumaUp:lumaRight;float gradient1=abs(luma1-lumaCenter);float gradient2=abs(luma2-lumaCenter);bool is1Steepest=gradient1>=gradient2;float gradientScaled=0.25*max(gradient1,gradient2);float lumaLocalAverage=0.0;if(is1Steepest){stepLength=-stepLength;lumaLocalAverage=0.5*(luma1+lumaCenter);}else{lumaLocalAverage=0.5*(luma2+lumaCenter);}vec2 currentUv=uv;if(isHorizontal){currentUv.y+=stepLength*0.5;}else{currentUv.x+=stepLength*0.5;}vec2 offset=isHorizontal?vec2(texelSize.x,0.0):vec2(0.0,texelSize.y);vec2 uv1=currentUv-offset*QUALITY(0);vec2 uv2=currentUv+offset*QUALITY(0);float lumaEnd1=luminance(texture2D(inputBuffer,uv1).rgb);float lumaEnd2=luminance(texture2D(inputBuffer,uv2).rgb);lumaEnd1-=lumaLocalAverage;lumaEnd2-=lumaLocalAverage;bool reached1=abs(lumaEnd1)>=gradientScaled;bool reached2=abs(lumaEnd2)>=gradientScaled;bool reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(1);}if(!reached2){uv2+=offset*QUALITY(1);}if(!reachedBoth){for(int i=2;i=gradientScaled;reached2=abs(lumaEnd2)>=gradientScaled;reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(i);}if(!reached2){uv2+=offset*QUALITY(i);}if(reachedBoth){break;}}}float distance1=isHorizontal?(uv.x-uv1.x):(uv.y-uv1.y);float distance2=isHorizontal?(uv2.x-uv.x):(uv2.y-uv.y);bool isDirection1=distance1distortion.x-columns*random){float sx=clamp(ceil(seeds.x),0.0,1.0);uv.y=sx*(1.0-(uv.y+distortion.y))+(1.0-sx)*distortion.y;}if(uv.xdistortion.y-columns*random){float sy=clamp(ceil(seeds.y),0.0,1.0);uv.x=sy*distortion.x+(1.0-sy)*(1.0-(uv.x+distortion.x));}vec2 normal=texture2D(perturbationMap,uv*random*random).rg;uv+=normal*seeds*(random*0.2);}}`; +var textureTag = "Glitch.Generated"; +function randomFloat(low, high) { + return low + Math.random() * (high - low); +} +var GlitchEffect = class extends Effect { + /** + * Constructs a new glitch effect. + * + * TODO Change ratio to 0.15. + * @param {Object} [options] - The options. + * @param {Vector2} [options.chromaticAberrationOffset] - A chromatic aberration offset. If provided, the glitch effect will influence this offset. + * @param {Vector2} [options.delay] - The minimum and maximum delay between glitch activations in seconds. + * @param {Vector2} [options.duration] - The minimum and maximum duration of a glitch in seconds. + * @param {Vector2} [options.strength] - The strength of weak and strong glitches. + * @param {Texture} [options.perturbationMap] - A perturbation map. If none is provided, a noise texture will be created. + * @param {Number} [options.dtSize=64] - The size of the generated noise map. Will be ignored if a perturbation map is provided. + * @param {Number} [options.columns=0.05] - The scale of the blocky glitch columns. + * @param {Number} [options.ratio=0.85] - The threshold for strong glitches. + */ + constructor({ + chromaticAberrationOffset = null, + delay = new Vector2(1.5, 3.5), + duration = new Vector2(0.6, 1), + strength = new Vector2(0.3, 1), + columns = 0.05, + ratio = 0.85, + perturbationMap = null, + dtSize = 64 + } = {}) { + super("GlitchEffect", glitch_default, { + uniforms: /* @__PURE__ */ new Map([ + ["perturbationMap", new Uniform(null)], + ["columns", new Uniform(columns)], + ["active", new Uniform(false)], + ["random", new Uniform(1)], + ["seeds", new Uniform(new Vector2())], + ["distortion", new Uniform(new Vector2())] + ]) + }); + if (perturbationMap === null) { + const map = new NoiseTexture(dtSize, dtSize, RGBAFormat); + map.name = textureTag; + this.perturbationMap = map; + } else { + this.perturbationMap = perturbationMap; + } + this.time = 0; + this.distortion = this.uniforms.get("distortion").value; + this.delay = delay; + this.duration = duration; + this.breakPoint = new Vector2( + randomFloat(this.delay.x, this.delay.y), + randomFloat(this.duration.x, this.duration.y) + ); + this.strength = strength; + this.mode = GlitchMode.SPORADIC; + this.ratio = ratio; + this.chromaticAberrationOffset = chromaticAberrationOffset; + } + /** + * Random number seeds. + * + * @type {Vector2} + * @private + */ + get seeds() { + return this.uniforms.get("seeds").value; + } + /** + * Indicates whether the glitch effect is currently active. + * + * @type {Boolean} + */ + get active() { + return this.uniforms.get("active").value; + } + /** + * Indicates whether the glitch effect is currently active. + * + * @deprecated Use active instead. + * @return {Boolean} Whether the glitch effect is active. + */ + isActive() { + return this.active; + } + /** + * The minimum delay between glitch activations. + * + * @type {Number} + */ + get minDelay() { + return this.delay.x; + } + set minDelay(value) { + this.delay.x = value; + } + /** + * Returns the minimum delay between glitch activations. + * + * @deprecated Use minDelay instead. + * @return {Number} The minimum delay in seconds. + */ + getMinDelay() { + return this.delay.x; + } + /** + * Sets the minimum delay between glitch activations. + * + * @deprecated Use minDelay instead. + * @param {Number} value - The minimum delay in seconds. + */ + setMinDelay(value) { + this.delay.x = value; + } + /** + * The maximum delay between glitch activations. + * + * @type {Number} + */ + get maxDelay() { + return this.delay.y; + } + set maxDelay(value) { + this.delay.y = value; + } + /** + * Returns the maximum delay between glitch activations. + * + * @deprecated Use maxDelay instead. + * @return {Number} The maximum delay in seconds. + */ + getMaxDelay() { + return this.delay.y; + } + /** + * Sets the maximum delay between glitch activations. + * + * @deprecated Use maxDelay instead. + * @param {Number} value - The maximum delay in seconds. + */ + setMaxDelay(value) { + this.delay.y = value; + } + /** + * The minimum duration of sporadic glitches. + * + * @type {Number} + */ + get minDuration() { + return this.duration.x; + } + set minDuration(value) { + this.duration.x = value; + } + /** + * Returns the minimum duration of sporadic glitches. + * + * @deprecated Use minDuration instead. + * @return {Number} The minimum duration in seconds. + */ + getMinDuration() { + return this.duration.x; + } + /** + * Sets the minimum duration of sporadic glitches. + * + * @deprecated Use minDuration instead. + * @param {Number} value - The minimum duration in seconds. + */ + setMinDuration(value) { + this.duration.x = value; + } + /** + * The maximum duration of sporadic glitches. + * + * @type {Number} + */ + get maxDuration() { + return this.duration.y; + } + set maxDuration(value) { + this.duration.y = value; + } + /** + * Returns the maximum duration of sporadic glitches. + * + * @deprecated Use maxDuration instead. + * @return {Number} The maximum duration in seconds. + */ + getMaxDuration() { + return this.duration.y; + } + /** + * Sets the maximum duration of sporadic glitches. + * + * @deprecated Use maxDuration instead. + * @param {Number} value - The maximum duration in seconds. + */ + setMaxDuration(value) { + this.duration.y = value; + } + /** + * The strength of weak glitches. + * + * @type {Number} + */ + get minStrength() { + return this.strength.x; + } + set minStrength(value) { + this.strength.x = value; + } + /** + * Returns the strength of weak glitches. + * + * @deprecated Use minStrength instead. + * @return {Number} The strength. + */ + getMinStrength() { + return this.strength.x; + } + /** + * Sets the strength of weak glitches. + * + * @deprecated Use minStrength instead. + * @param {Number} value - The strength. + */ + setMinStrength(value) { + this.strength.x = value; + } + /** + * The strength of strong glitches. + * + * @type {Number} + */ + get maxStrength() { + return this.strength.y; + } + set maxStrength(value) { + this.strength.y = value; + } + /** + * Returns the strength of strong glitches. + * + * @deprecated Use maxStrength instead. + * @return {Number} The strength. + */ + getMaxStrength() { + return this.strength.y; + } + /** + * Sets the strength of strong glitches. + * + * @deprecated Use maxStrength instead. + * @param {Number} value - The strength. + */ + setMaxStrength(value) { + this.strength.y = value; + } + /** + * Returns the current glitch mode. + * + * @deprecated Use mode instead. + * @return {GlitchMode} The mode. + */ + getMode() { + return this.mode; + } + /** + * Sets the current glitch mode. + * + * @deprecated Use mode instead. + * @param {GlitchMode} value - The mode. + */ + setMode(value) { + this.mode = value; + } + /** + * Returns the glitch ratio. + * + * @deprecated Use ratio instead. + * @return {Number} The ratio. + */ + getGlitchRatio() { + return 1 - this.ratio; + } + /** + * Sets the ratio of weak (0.0) and strong (1.0) glitches. + * + * @deprecated Use ratio instead. + * @param {Number} value - The ratio. Range is [0.0, 1.0]. + */ + setGlitchRatio(value) { + this.ratio = Math.min(Math.max(1 - value, 0), 1); + } + /** + * The glitch column size. + * + * @type {Number} + */ + get columns() { + return this.uniforms.get("columns").value; + } + set columns(value) { + this.uniforms.get("columns").value = value; + } + /** + * Returns the glitch column size. + * + * @deprecated Use columns instead. + * @return {Number} The glitch column size. + */ + getGlitchColumns() { + return this.columns; + } + /** + * Sets the glitch column size. + * + * @deprecated Use columns instead. + * @param {Number} value - The glitch column size. + */ + setGlitchColumns(value) { + this.columns = value; + } + /** + * Returns the chromatic aberration offset. + * + * @deprecated Use chromaticAberrationOffset instead. + * @return {Vector2} The offset. + */ + getChromaticAberrationOffset() { + return this.chromaticAberrationOffset; + } + /** + * Sets the chromatic aberration offset. + * + * @deprecated Use chromaticAberrationOffset instead. + * @param {Vector2} value - The offset. + */ + setChromaticAberrationOffset(value) { + this.chromaticAberrationOffset = value; + } + /** + * The perturbation map. + * + * @type {Texture} + */ + get perturbationMap() { + return this.uniforms.get("perturbationMap").value; + } + set perturbationMap(value) { + const currentMap = this.perturbationMap; + if (currentMap !== null && currentMap.name === textureTag) { + currentMap.dispose(); + } + value.minFilter = value.magFilter = NearestFilter; + value.wrapS = value.wrapT = RepeatWrapping; + value.generateMipmaps = false; + this.uniforms.get("perturbationMap").value = value; + } + /** + * Returns the current perturbation map. + * + * @deprecated Use perturbationMap instead. + * @return {Texture} The current perturbation map. + */ + getPerturbationMap() { + return this.perturbationMap; + } + /** + * Replaces the current perturbation map with the given one. + * + * The current map will be disposed if it was generated by this effect. + * + * @deprecated Use perturbationMap instead. + * @param {Texture} value - The new perturbation map. + */ + setPerturbationMap(value) { + this.perturbationMap = value; + } + /** + * Generates a perturbation map. + * + * @deprecated Use NoiseTexture instead. + * @param {Number} [value=64] - The texture size. + * @return {DataTexture} The perturbation map. + */ + generatePerturbationMap(value = 64) { + const map = new NoiseTexture(value, value, RGBAFormat); + map.name = textureTag; + return map; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const mode = this.mode; + const breakPoint = this.breakPoint; + const offset = this.chromaticAberrationOffset; + const s = this.strength; + let time = this.time; + let active = false; + let r = 0, a = 0; + let trigger; + if (mode !== GlitchMode.DISABLED) { + if (mode === GlitchMode.SPORADIC) { + time += deltaTime; + trigger = time > breakPoint.x; + if (time >= breakPoint.x + breakPoint.y) { + breakPoint.set( + randomFloat(this.delay.x, this.delay.y), + randomFloat(this.duration.x, this.duration.y) + ); + time = 0; + } + } + r = Math.random(); + this.uniforms.get("random").value = r; + if (trigger && r > this.ratio || mode === GlitchMode.CONSTANT_WILD) { + active = true; + r *= s.y * 0.03; + a = randomFloat(-Math.PI, Math.PI); + this.seeds.set(randomFloat(-s.y, s.y), randomFloat(-s.y, s.y)); + this.distortion.set(randomFloat(0, 1), randomFloat(0, 1)); + } else if (trigger || mode === GlitchMode.CONSTANT_MILD) { + active = true; + r *= s.x * 0.03; + a = randomFloat(-Math.PI, Math.PI); + this.seeds.set(randomFloat(-s.x, s.x), randomFloat(-s.x, s.x)); + this.distortion.set(randomFloat(0, 1), randomFloat(0, 1)); + } + this.time = time; + } + if (offset !== null) { + if (active) { + offset.set(Math.cos(a), Math.sin(a)).multiplyScalar(r); + } else { + offset.set(0, 0); + } + } + this.uniforms.get("active").value = active; + } + /** + * Deletes generated resources. + */ + dispose() { + const map = this.perturbationMap; + if (map !== null && map.name === textureTag) { + map.dispose(); + } + } +}; +var DepthTestStrategy = { + DEFAULT: 0, + KEEP_MAX_DEPTH: 1, + DISCARD_MAX_DEPTH: 2 +}; +var depth_mask_default = `#include +#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer0;uniform highp sampler2D depthBuffer1; +#else +uniform mediump sampler2D depthBuffer0;uniform mediump sampler2D depthBuffer1; +#endif +uniform sampler2D inputBuffer;uniform vec2 cameraNearFar;float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#else +return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#endif +}varying vec2 vUv;void main(){vec2 depth; +#if DEPTH_PACKING_0 == 3201 +depth.x=unpackRGBAToDepth(texture2D(depthBuffer0,vUv)); +#else +depth.x=texture2D(depthBuffer0,vUv).r; +#ifdef LOG_DEPTH +float d=pow(2.0,depth.x*log2(cameraNearFar.y+1.0))-1.0;float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);depth.x=a+b/d; +#endif +#endif +#if DEPTH_PACKING_1 == 3201 +depth.y=unpackRGBAToDepth(texture2D(depthBuffer1,vUv)); +#else +depth.y=texture2D(depthBuffer1,vUv).r; +#ifdef LOG_DEPTH +float d=pow(2.0,depth.y*log2(cameraNearFar.y+1.0))-1.0;float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);depth.y=a+b/d; +#endif +#endif +bool isMaxDepth=(depth.x==1.0); +#ifdef PERSPECTIVE_CAMERA +depth.x=viewZToOrthographicDepth(getViewZ(depth.x),cameraNearFar.x,cameraNearFar.y);depth.y=viewZToOrthographicDepth(getViewZ(depth.y),cameraNearFar.x,cameraNearFar.y); +#endif +#if DEPTH_TEST_STRATEGY == 0 +bool keep=depthTest(depth.x,depth.y); +#elif DEPTH_TEST_STRATEGY == 1 +bool keep=isMaxDepth||depthTest(depth.x,depth.y); +#else +bool keep=!isMaxDepth&&depthTest(depth.x,depth.y); +#endif +if(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}`; +var DepthMaskMaterial = class extends ShaderMaterial { + /** + * Constructs a new depth mask material. + */ + constructor() { + super({ + name: "DepthMaskMaterial", + defines: { + DEPTH_EPSILON: "0.0001", + DEPTH_PACKING_0: "0", + DEPTH_PACKING_1: "0", + DEPTH_TEST_STRATEGY: DepthTestStrategy.KEEP_MAX_DEPTH + }, + uniforms: { + inputBuffer: new Uniform(null), + depthBuffer0: new Uniform(null), + depthBuffer1: new Uniform(null), + cameraNearFar: new Uniform(new Vector2(1, 1)) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: depth_mask_default, + vertexShader: common_default + }); + this.depthMode = LessDepth; + } + /** + * The primary depth buffer. + * + * @type {Texture} + */ + set depthBuffer0(value) { + this.uniforms.depthBuffer0.value = value; + } + /** + * The primary depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set depthPacking0(value) { + this.defines.DEPTH_PACKING_0 = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the base depth buffer. + * + * @deprecated Use depthBuffer0 and depthPacking0 instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthBuffer0(buffer, depthPacking = BasicDepthPacking) { + this.depthBuffer0 = buffer; + this.depthPacking0 = depthPacking; + } + /** + * The secondary depth buffer. + * + * @type {Texture} + */ + set depthBuffer1(value) { + this.uniforms.depthBuffer1.value = value; + } + /** + * The secondary depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set depthPacking1(value) { + this.defines.DEPTH_PACKING_1 = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the depth buffer that will be compared with the base depth buffer. + * + * @deprecated Use depthBuffer1 and depthPacking1 instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthBuffer1(buffer, depthPacking = BasicDepthPacking) { + this.depthBuffer1 = buffer; + this.depthPacking1 = depthPacking; + } + /** + * The strategy for handling maximum depth. + * + * @type {DepthTestStrategy} + */ + get maxDepthStrategy() { + return Number(this.defines.DEPTH_TEST_STRATEGY); + } + set maxDepthStrategy(value) { + this.defines.DEPTH_TEST_STRATEGY = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Indicates whether maximum depth values should be preserved. + * + * @type {Boolean} + * @deprecated Use maxDepthStrategy instead. + */ + get keepFar() { + return this.maxDepthStrategy; + } + set keepFar(value) { + this.maxDepthStrategy = value ? DepthTestStrategy.KEEP_MAX_DEPTH : DepthTestStrategy.DISCARD_MAX_DEPTH; + } + /** + * Returns the strategy for dealing with maximum depth values. + * + * @deprecated Use maxDepthStrategy instead. + * @return {DepthTestStrategy} The strategy. + */ + getMaxDepthStrategy() { + return this.maxDepthStrategy; + } + /** + * Sets the strategy for dealing with maximum depth values. + * + * @deprecated Use maxDepthStrategy instead. + * @param {DepthTestStrategy} value - The strategy. + */ + setMaxDepthStrategy(value) { + this.maxDepthStrategy = value; + } + /** + * A small error threshold that is used for `EqualDepth` and `NotEqualDepth` tests. Default is `1e-4`. + * + * @type {Number} + */ + get epsilon() { + return Number(this.defines.DEPTH_EPSILON); + } + set epsilon(value) { + this.defines.DEPTH_EPSILON = value.toFixed(16); + this.needsUpdate = true; + } + /** + * Returns the current error threshold for depth comparisons. + * + * @deprecated Use epsilon instead. + * @return {Number} The error threshold. + */ + getEpsilon() { + return this.epsilon; + } + /** + * Sets the depth comparison error threshold. + * + * @deprecated Use epsilon instead. + * @param {Number} value - The new error threshold. + */ + setEpsilon(value) { + this.epsilon = value; + } + /** + * The depth mode. + * + * @see https://threejs.org/docs/#api/en/constants/Materials + * @type {DepthModes} + */ + get depthMode() { + return Number(this.defines.DEPTH_MODE); + } + set depthMode(value) { + let depthTest; + switch (value) { + case NeverDepth: + depthTest = "false"; + break; + case AlwaysDepth: + depthTest = "true"; + break; + case EqualDepth: + depthTest = "abs(d1 - d0) <= DEPTH_EPSILON"; + break; + case NotEqualDepth: + depthTest = "abs(d1 - d0) > DEPTH_EPSILON"; + break; + case LessDepth: + depthTest = "d0 > d1"; + break; + case LessEqualDepth: + depthTest = "d0 >= d1"; + break; + case GreaterEqualDepth: + depthTest = "d0 <= d1"; + break; + case GreaterDepth: + default: + depthTest = "d0 < d1"; + break; + } + this.defines.DEPTH_MODE = value.toFixed(0); + this.defines["depthTest(d0, d1)"] = depthTest; + this.needsUpdate = true; + } + /** + * Returns the current depth mode. + * + * @deprecated Use depthMode instead. + * @return {DepthModes} The depth mode. Default is `LessDepth`. + */ + getDepthMode() { + return this.depthMode; + } + /** + * Sets the depth mode. + * + * @deprecated Use depthMode instead. + * @param {DepthModes} mode - The depth mode. + */ + setDepthMode(mode) { + this.depthMode = mode; + } + /** + * Copies the settings of the given camera. + * + * @deprecated Use copyCameraSettings instead. + * @param {Camera} camera - A camera. + */ + adoptCameraSettings(camera) { + this.copyCameraSettings(camera); + } + /** + * Copies the settings of the given camera. + * + * @param {Camera} camera - A camera. + */ + copyCameraSettings(camera) { + if (camera) { + this.uniforms.cameraNearFar.value.set(camera.near, camera.far); + if (camera instanceof PerspectiveCamera) { + this.defines.PERSPECTIVE_CAMERA = "1"; + } else { + delete this.defines.PERSPECTIVE_CAMERA; + } + this.needsUpdate = true; + } + } +}; +var convolution_god_rays_default = `#include +#include +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform vec2 lightPosition;uniform float exposure;uniform float decay;uniform float density;uniform float weight;uniform float clampMax;varying vec2 vUv;void main(){vec2 coord=vUv;vec2 delta=lightPosition-coord;delta*=1.0/SAMPLES_FLOAT*density;float illuminationDecay=1.0;vec4 color=vec4(0.0);for(int i=0;i +}`; +var GodRaysMaterial = class extends ShaderMaterial { + /** + * Constructs a new god rays material. + * + * TODO Remove lightPosition param. + * @param {Vector2} lightPosition - Deprecated. + */ + constructor(lightPosition) { + super({ + name: "GodRaysMaterial", + defines: { + SAMPLES_INT: "60", + SAMPLES_FLOAT: "60.0" + }, + uniforms: { + inputBuffer: new Uniform(null), + lightPosition: new Uniform(lightPosition), + density: new Uniform(1), + decay: new Uniform(1), + weight: new Uniform(1), + exposure: new Uniform(1), + clampMax: new Uniform(1) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_god_rays_default, + vertexShader: common_default + }); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The screen space position of the light source. + * + * @type {Vector2} + */ + get lightPosition() { + return this.uniforms.lightPosition.value; + } + /** + * Returns the screen space position of the light source. + * + * @deprecated Use lightPosition instead. + * @return {Vector2} The position. + */ + getLightPosition() { + return this.uniforms.lightPosition.value; + } + /** + * Sets the screen space position of the light source. + * + * @deprecated Use lightPosition instead. + * @param {Vector2} value - The position. + */ + setLightPosition(value) { + this.uniforms.lightPosition.value = value; + } + /** + * The density. + * + * @type {Number} + */ + get density() { + return this.uniforms.density.value; + } + set density(value) { + this.uniforms.density.value = value; + } + /** + * Returns the density. + * + * @deprecated Use density instead. + * @return {Number} The density. + */ + getDensity() { + return this.uniforms.density.value; + } + /** + * Sets the density. + * + * @deprecated Use density instead. + * @param {Number} value - The density. + */ + setDensity(value) { + this.uniforms.density.value = value; + } + /** + * The decay. + * + * @type {Number} + */ + get decay() { + return this.uniforms.decay.value; + } + set decay(value) { + this.uniforms.decay.value = value; + } + /** + * Returns the decay. + * + * @deprecated Use decay instead. + * @return {Number} The decay. + */ + getDecay() { + return this.uniforms.decay.value; + } + /** + * Sets the decay. + * + * @deprecated Use decay instead. + * @param {Number} value - The decay. + */ + setDecay(value) { + this.uniforms.decay.value = value; + } + /** + * The weight. + * + * @type {Number} + */ + get weight() { + return this.uniforms.weight.value; + } + set weight(value) { + this.uniforms.weight.value = value; + } + /** + * Returns the weight. + * + * @deprecated Use weight instead. + * @return {Number} The weight. + */ + getWeight() { + return this.uniforms.weight.value; + } + /** + * Sets the weight. + * + * @deprecated Use weight instead. + * @param {Number} value - The weight. + */ + setWeight(value) { + this.uniforms.weight.value = value; + } + /** + * The exposure. + * + * @type {Number} + */ + get exposure() { + return this.uniforms.exposure.value; + } + set exposure(value) { + this.uniforms.exposure.value = value; + } + /** + * Returns the exposure. + * + * @deprecated Use exposure instead. + * @return {Number} The exposure. + */ + getExposure() { + return this.uniforms.exposure.value; + } + /** + * Sets the exposure. + * + * @deprecated Use exposure instead. + * @param {Number} value - The exposure. + */ + setExposure(value) { + this.uniforms.exposure.value = value; + } + /** + * The maximum light intensity. + * + * @type {Number} + */ + get maxIntensity() { + return this.uniforms.clampMax.value; + } + set maxIntensity(value) { + this.uniforms.clampMax.value = value; + } + /** + * Returns the maximum light intensity. + * + * @deprecated Use maxIntensity instead. + * @return {Number} The maximum light intensity. + */ + getMaxIntensity() { + return this.uniforms.clampMax.value; + } + /** + * Sets the maximum light intensity. + * + * @deprecated Use maxIntensity instead. + * @param {Number} value - The maximum light intensity. + */ + setMaxIntensity(value) { + this.uniforms.clampMax.value = value; + } + /** + * The amount of samples per pixel. + * + * @type {Number} + */ + get samples() { + return Number(this.defines.SAMPLES_INT); + } + set samples(value) { + const s = Math.floor(value); + this.defines.SAMPLES_INT = s.toFixed(0); + this.defines.SAMPLES_FLOAT = s.toFixed(1); + this.needsUpdate = true; + } + /** + * Returns the amount of samples per pixel. + * + * @deprecated Use samples instead. + * @return {Number} The sample count. + */ + getSamples() { + return this.samples; + } + /** + * Sets the amount of samples per pixel. + * + * @deprecated Use samples instead. + * @param {Number} value - The sample count. + */ + setSamples(value) { + this.samples = value; + } +}; +var RenderPass = class extends Pass { + /** + * Constructs a new render pass. + * + * @param {Scene} scene - The scene to render. + * @param {Camera} camera - The camera to use to render the scene. + * @param {Material} [overrideMaterial=null] - An override material. + */ + constructor(scene, camera, overrideMaterial = null) { + super("RenderPass", scene, camera); + this.needsSwap = false; + this.clearPass = new ClearPass(); + this.overrideMaterialManager = overrideMaterial === null ? null : new OverrideMaterialManager(overrideMaterial); + this.ignoreBackground = false; + this.skipShadowMapUpdate = false; + this.selection = null; + } + set mainScene(value) { + this.scene = value; + } + set mainCamera(value) { + this.camera = value; + } + get renderToScreen() { + return super.renderToScreen; + } + set renderToScreen(value) { + super.renderToScreen = value; + this.clearPass.renderToScreen = value; + } + /** + * The current override material. + * + * @type {Material} + */ + get overrideMaterial() { + const manager = this.overrideMaterialManager; + return manager !== null ? manager.material : null; + } + set overrideMaterial(value) { + const manager = this.overrideMaterialManager; + if (value !== null) { + if (manager !== null) { + manager.setMaterial(value); + } else { + this.overrideMaterialManager = new OverrideMaterialManager(value); + } + } else if (manager !== null) { + manager.dispose(); + this.overrideMaterialManager = null; + } + } + /** + * Returns the current override material. + * + * @deprecated Use overrideMaterial instead. + * @return {Material} The material. + */ + getOverrideMaterial() { + return this.overrideMaterial; + } + /** + * Sets the override material. + * + * @deprecated Use overrideMaterial instead. + * @return {Material} value - The material. + */ + setOverrideMaterial(value) { + this.overrideMaterial = value; + } + /** + * Indicates whether the target buffer should be cleared before rendering. + * + * @type {Boolean} + * @deprecated Use clearPass.enabled instead. + */ + get clear() { + return this.clearPass.enabled; + } + set clear(value) { + this.clearPass.enabled = value; + } + /** + * Returns the selection. Default is `null` (no restriction). + * + * @deprecated Use selection instead. + * @return {Selection} The selection. + */ + getSelection() { + return this.selection; + } + /** + * Sets the selection. Set to `null` to disable. + * + * @deprecated Use selection instead. + * @param {Selection} value - The selection. + */ + setSelection(value) { + this.selection = value; + } + /** + * Indicates whether the scene background is disabled. + * + * @deprecated Use ignoreBackground instead. + * @return {Boolean} Whether the scene background is disabled. + */ + isBackgroundDisabled() { + return this.ignoreBackground; + } + /** + * Enables or disables the scene background. + * + * @deprecated Use ignoreBackground instead. + * @param {Boolean} value - Whether the scene background should be disabled. + */ + setBackgroundDisabled(value) { + this.ignoreBackground = value; + } + /** + * Indicates whether the shadow map auto update is disabled. + * + * @deprecated Use skipShadowMapUpdate instead. + * @return {Boolean} Whether the shadow map update is disabled. + */ + isShadowMapDisabled() { + return this.skipShadowMapUpdate; + } + /** + * Enables or disables the shadow map auto update. + * + * @deprecated Use skipShadowMapUpdate instead. + * @param {Boolean} value - Whether the shadow map auto update should be disabled. + */ + setShadowMapDisabled(value) { + this.skipShadowMapUpdate = value; + } + /** + * Returns the clear pass. + * + * @deprecated Use clearPass.enabled instead. + * @return {ClearPass} The clear pass. + */ + getClearPass() { + return this.clearPass; + } + /** + * Renders the scene. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const scene = this.scene; + const camera = this.camera; + const selection = this.selection; + const mask = camera.layers.mask; + const background = scene.background; + const shadowMapAutoUpdate = renderer.shadowMap.autoUpdate; + const renderTarget = this.renderToScreen ? null : inputBuffer; + if (selection !== null) { + camera.layers.set(selection.getLayer()); + } + if (this.skipShadowMapUpdate) { + renderer.shadowMap.autoUpdate = false; + } + if (this.ignoreBackground || this.clearPass.overrideClearColor !== null) { + scene.background = null; + } + if (this.clearPass.enabled) { + this.clearPass.render(renderer, inputBuffer); + } + renderer.setRenderTarget(renderTarget); + if (this.overrideMaterialManager !== null) { + this.overrideMaterialManager.render(renderer, scene, camera); + } else { + renderer.render(scene, camera); + } + camera.layers.mask = mask; + scene.background = background; + renderer.shadowMap.autoUpdate = shadowMapAutoUpdate; + } +}; +var god_rays_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D map; +#else +uniform lowp sampler2D map; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv);}`; +var v = new Vector3(); +var m = new Matrix4(); +var GodRaysEffect = class extends Effect { + /** + * Constructs a new god rays effect. + * + * @param {Camera} [camera] - The main camera. + * @param {Mesh|Points} [lightSource] - The light source. Must not write depth and has to be flagged as transparent. + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function of this effect. + * @param {Number} [options.samples=60.0] - The number of samples per pixel. + * @param {Number} [options.density=0.96] - The density of the light rays. + * @param {Number} [options.decay=0.9] - An illumination decay factor. + * @param {Number} [options.weight=0.4] - A light ray weight factor. + * @param {Number} [options.exposure=0.6] - A constant attenuation coefficient. + * @param {Number} [options.clampMax=1.0] - An upper bound for the saturation of the overall effect. + * @param {Number} [options.resolutionScale=0.5] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + * @param {KernelSize} [options.kernelSize=KernelSize.SMALL] - The blur kernel size. Has no effect if blur is disabled. + * @param {Boolean} [options.blur=true] - Whether the god rays should be blurred to reduce artifacts. + */ + constructor(camera, lightSource, { + blendFunction = BlendFunction.SCREEN, + samples = 60, + density = 0.96, + decay = 0.9, + weight = 0.4, + exposure = 0.6, + clampMax = 1, + blur = true, + kernelSize = KernelSize.SMALL, + resolutionScale = 0.5, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("GodRaysEffect", god_rays_default, { + blendFunction, + attributes: EffectAttribute.DEPTH, + uniforms: /* @__PURE__ */ new Map([ + ["map", new Uniform(null)] + ]) + }); + this.camera = camera; + this._lightSource = lightSource; + this.lightSource = lightSource; + this.lightScene = new Scene(); + this.screenPosition = new Vector2(); + this.renderTargetA = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetA.texture.name = "GodRays.Target.A"; + this.renderTargetB = this.renderTargetA.clone(); + this.renderTargetB.texture.name = "GodRays.Target.B"; + this.uniforms.get("map").value = this.renderTargetB.texture; + this.renderTargetLight = new WebGLRenderTarget(1, 1); + this.renderTargetLight.texture.name = "GodRays.Light"; + this.renderTargetLight.depthTexture = new DepthTexture(); + this.renderPassLight = new RenderPass(this.lightScene, camera); + this.renderPassLight.clearPass.overrideClearColor = new Color(0); + this.clearPass = new ClearPass(true, false, false); + this.clearPass.overrideClearColor = new Color(0); + this.blurPass = new KawaseBlurPass({ kernelSize }); + this.blurPass.enabled = blur; + this.depthMaskPass = new ShaderPass(new DepthMaskMaterial()); + const depthMaskMaterial = this.depthMaskMaterial; + depthMaskMaterial.depthBuffer1 = this.renderTargetLight.depthTexture; + depthMaskMaterial.copyCameraSettings(camera); + this.godRaysPass = new ShaderPass(new GodRaysMaterial(this.screenPosition)); + const godRaysMaterial = this.godRaysMaterial; + godRaysMaterial.density = density; + godRaysMaterial.decay = decay; + godRaysMaterial.weight = weight; + godRaysMaterial.exposure = exposure; + godRaysMaterial.maxIntensity = clampMax; + godRaysMaterial.samples = samples; + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + } + set mainCamera(value) { + this.camera = value; + this.renderPassLight.mainCamera = value; + this.depthMaskMaterial.copyCameraSettings(value); + } + /** + * Sets the light source. + * + * @type {Mesh|Points} + */ + get lightSource() { + return this._lightSource; + } + set lightSource(value) { + this._lightSource = value; + if (value !== null) { + value.material.depthWrite = false; + value.material.transparent = true; + } + } + /** + * Returns the blur pass that reduces aliasing artifacts and makes the light softer. + * + * @deprecated Use blurPass instead. + * @return {KawaseBlurPass} The blur pass. + */ + getBlurPass() { + return this.blurPass; + } + /** + * A texture that contains the intermediate result of this effect. + * + * @type {Texture} + */ + get texture() { + return this.renderTargetB.texture; + } + /** + * Returns the god rays texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.texture; + } + /** + * The depth mask material. + * + * @type {DepthMaskMaterial} + * @private + */ + get depthMaskMaterial() { + return this.depthMaskPass.fullscreenMaterial; + } + /** + * The internal god rays material. + * + * @type {GodRaysMaterial} + */ + get godRaysMaterial() { + return this.godRaysPass.fullscreenMaterial; + } + /** + * Returns the god rays material. + * + * @deprecated Use godRaysMaterial instead. + * @return {GodRaysMaterial} The material. + */ + getGodRaysMaterial() { + return this.godRaysMaterial; + } + /** + * Returns the resolution of this effect. + * + * @deprecated Use resolution instead. + * @return {GodRaysMaterial} The material. + */ + getResolution() { + return this.resolution; + } + /** + * The current width of the internal render targets. + * + * @type {Number} + * @deprecated Use resolution.width instead. + */ + get width() { + return this.resolution.width; + } + set width(value) { + this.resolution.preferredWidth = value; + } + /** + * The current height of the internal render targets. + * + * @type {Number} + * @deprecated Use resolution.height instead. + */ + get height() { + return this.resolution.height; + } + set height(value) { + this.resolution.preferredHeight = value; + } + /** + * Indicates whether dithering is enabled. + * + * @type {Boolean} + * @deprecated + */ + get dithering() { + return this.godRaysMaterial.dithering; + } + set dithering(value) { + const material = this.godRaysMaterial; + material.dithering = value; + material.needsUpdate = true; + } + /** + * Indicates whether the god rays should be blurred to reduce artifacts. + * + * @type {Boolean} + * @deprecated Use blurPass.enabled instead. + */ + get blur() { + return this.blurPass.enabled; + } + set blur(value) { + this.blurPass.enabled = value; + } + /** + * The blur kernel size. + * + * @type {KernelSize} + * @deprecated Use blurPass.kernelSize instead. + */ + get kernelSize() { + return this.blurPass.kernelSize; + } + set kernelSize(value) { + this.blurPass.kernelSize = value; + } + /** + * Returns the current resolution scale. + * + * @return {Number} The resolution scale. + * @deprecated Use resolution instead. + */ + getResolutionScale() { + return this.resolution.scale; + } + /** + * Sets the resolution scale. + * + * @param {Number} scale - The new resolution scale. + * @deprecated Use resolution instead. + */ + setResolutionScale(scale) { + this.resolution.scale = scale; + } + /** + * The number of samples per pixel. + * + * @type {Number} + * @deprecated Use godRaysMaterial.samples instead. + */ + get samples() { + return this.godRaysMaterial.samples; + } + /** + * A higher sample count improves quality at the cost of performance. + * + * @type {Number} + * @deprecated Use godRaysMaterial.samples instead. + */ + set samples(value) { + this.godRaysMaterial.samples = value; + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {Number} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.depthMaskPass.fullscreenMaterial.depthBuffer0 = depthTexture; + this.depthMaskPass.fullscreenMaterial.depthPacking0 = depthPacking; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const lightSource = this.lightSource; + const parent = lightSource.parent; + const matrixAutoUpdate = lightSource.matrixAutoUpdate; + const renderTargetA = this.renderTargetA; + const renderTargetLight = this.renderTargetLight; + lightSource.material.depthWrite = true; + lightSource.matrixAutoUpdate = false; + lightSource.updateWorldMatrix(true, false); + if (parent !== null) { + if (!matrixAutoUpdate) { + m.copy(lightSource.matrix); + } + lightSource.matrix.copy(lightSource.matrixWorld); + } + this.lightScene.add(lightSource); + this.renderPassLight.render(renderer, renderTargetLight); + this.clearPass.render(renderer, renderTargetA); + this.depthMaskPass.render(renderer, renderTargetLight, renderTargetA); + lightSource.material.depthWrite = false; + lightSource.matrixAutoUpdate = matrixAutoUpdate; + if (parent !== null) { + if (!matrixAutoUpdate) { + lightSource.matrix.copy(m); + } + parent.add(lightSource); + } + v.setFromMatrixPosition(lightSource.matrixWorld).project(this.camera); + this.screenPosition.set( + Math.min(Math.max((v.x + 1) * 0.5, -1), 2), + Math.min(Math.max((v.y + 1) * 0.5, -1), 2) + ); + if (this.blurPass.enabled) { + this.blurPass.render(renderer, renderTargetA, renderTargetA); + } + this.godRaysPass.render(renderer, renderTargetA, this.renderTargetB); + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.renderTargetA.setSize(w, h); + this.renderTargetB.setSize(w, h); + this.renderTargetLight.setSize(w, h); + this.blurPass.resolution.copy(resolution); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.blurPass.initialize(renderer, alpha, frameBufferType); + this.renderPassLight.initialize(renderer, alpha, frameBufferType); + this.depthMaskPass.initialize(renderer, alpha, frameBufferType); + this.godRaysPass.initialize(renderer, alpha, frameBufferType); + if (frameBufferType !== void 0) { + this.renderTargetA.texture.type = frameBufferType; + this.renderTargetB.texture.type = frameBufferType; + this.renderTargetLight.texture.type = frameBufferType; + if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTargetA.texture.colorSpace = SRGBColorSpace; + this.renderTargetB.texture.colorSpace = SRGBColorSpace; + this.renderTargetLight.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var grid_default = `uniform vec2 scale;uniform float lineWidth;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float grid=0.5-max(abs(mod(uv.x*scale.x,1.0)-0.5),abs(mod(uv.y*scale.y,1.0)-0.5));outputColor=vec4(vec3(smoothstep(0.0,lineWidth,grid)),inputColor.a);}`; +var GridEffect = class extends Effect { + /** + * Constructs a new grid effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.OVERLAY] - The blend function of this effect. + * @param {Number} [options.scale=1.0] - The scale of the grid pattern. + * @param {Number} [options.lineWidth=0.0] - The line width of the grid pattern. + */ + constructor({ blendFunction = BlendFunction.OVERLAY, scale = 1, lineWidth = 0 } = {}) { + super("GridEffect", grid_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["scale", new Uniform(new Vector2())], + ["lineWidth", new Uniform(lineWidth)] + ]) + }); + this.resolution = new Vector2(); + this.s = 0; + this.scale = scale; + this.l = 0; + this.lineWidth = lineWidth; + } + /** + * The scale. + * + * @type {Number} + */ + get scale() { + return this.s; + } + set scale(value) { + this.s = Math.max(value, 1e-6); + this.setSize(this.resolution.width, this.resolution.height); + } + /** + * Returns the current grid scale. + * + * @deprecated Use scale instead. + * @return {Number} The grid scale. + */ + getScale() { + return this.scale; + } + /** + * Sets the grid scale. + * + * @deprecated Use scale instead. + * @param {Number} value - The new grid scale. + */ + setScale(value) { + this.scale = value; + } + /** + * The line width. + * + * @type {Number} + */ + get lineWidth() { + return this.l; + } + set lineWidth(value) { + this.l = value; + this.setSize(this.resolution.width, this.resolution.height); + } + /** + * Returns the current grid line width. + * + * @deprecated Use lineWidth instead. + * @return {Number} The grid line width. + */ + getLineWidth() { + return this.lineWidth; + } + /** + * Sets the grid line width. + * + * @deprecated Use lineWidth instead. + * @param {Number} value - The new grid line width. + */ + setLineWidth(value) { + this.lineWidth = value; + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.resolution.set(width, height); + const aspect = width / height; + const scale = this.scale * (height * 0.125); + this.uniforms.get("scale").value.set(aspect * scale, scale); + this.uniforms.get("lineWidth").value = scale / height + this.lineWidth; + } +}; +var hue_saturation_default = `uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}`; +var HueSaturationEffect = class extends Effect { + /** + * Constructs a new hue/saturation effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + * @param {Number} [options.hue=0.0] - The hue in radians. + * @param {Number} [options.saturation=0.0] - The saturation factor, ranging from -1 to 1, where 0 means no change. + */ + constructor({ blendFunction = BlendFunction.SRC, hue = 0, saturation = 0 } = {}) { + super("HueSaturationEffect", hue_saturation_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["hue", new Uniform(new Vector3())], + ["saturation", new Uniform(saturation)] + ]) + }); + this.hue = hue; + } + /** + * The saturation. + * + * @type {Number} + */ + get saturation() { + return this.uniforms.get("saturation").value; + } + set saturation(value) { + this.uniforms.get("saturation").value = value; + } + /** + * Returns the saturation. + * + * @deprecated Use saturation instead. + * @return {Number} The saturation. + */ + getSaturation() { + return this.saturation; + } + /** + * Sets the saturation. + * + * @deprecated Use saturation instead. + * @param {Number} value - The saturation. + */ + setSaturation(value) { + this.saturation = value; + } + /** + * The hue. + * + * @type {Number} + */ + get hue() { + const hue = this.uniforms.get("hue").value; + return Math.acos((hue.x * 3 - 1) / 2); + } + set hue(value) { + const s = Math.sin(value), c2 = Math.cos(value); + this.uniforms.get("hue").value.set( + (2 * c2 + 1) / 3, + (-Math.sqrt(3) * s - c2 + 1) / 3, + (Math.sqrt(3) * s - c2 + 1) / 3 + ); + } + /** + * Returns the hue. + * + * @deprecated Use hue instead. + * @return {Number} The hue in radians. + */ + getHue() { + return this.hue; + } + /** + * Sets the hue. + * + * @deprecated Use hue instead. + * @param {Number} value - The hue in radians. + */ + setHue(value) { + this.hue = value; + } +}; +var lens_distortion_default = `uniform vec2 distortion;uniform vec2 principalPoint;uniform vec2 focalLength;uniform float skew;float mask(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void mainUv(inout vec2 uv){vec2 xn=2.0*(uv.st-0.5);vec3 xDistorted=vec3((1.0+distortion*dot(xn,xn))*xn,1.0);mat3 kk=mat3(vec3(focalLength.x,0.0,0.0),vec3(skew*focalLength.x,focalLength.y,0.0),vec3(principalPoint.x,principalPoint.y,1.0));uv=(kk*xDistorted).xy*0.5+0.5;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=mask(uv)*inputColor;}`; +var LensDistortionEffect = class extends Effect { + /** + * Constructs a new lens distortion effect. + * + * @param {Object} [options] - The options. + * @param {Vector2} [options.distortion] - The distortion value. + * @param {Vector2} [options.principalPoint] - The center point. + * @param {Vector2} [options.focalLength] - The focal length. + * @param {Number} [options.skew=0] - The skew value. + */ + constructor({ + distortion = new Vector2(0, 0), + principalPoint = new Vector2(0, 0), + focalLength = new Vector2(1, 1), + skew = 0 + } = {}) { + super("LensDistortionEffect", lens_distortion_default, { + uniforms: /* @__PURE__ */ new Map([ + ["distortion", new Uniform(distortion)], + ["principalPoint", new Uniform(principalPoint)], + ["focalLength", new Uniform(focalLength)], + ["skew", new Uniform(skew)] + ]) + }); + } + /** + * The radial distortion coefficients. Default is (0, 0). + * + * @type {Vector2} + */ + get distortion() { + return this.uniforms.get("distortion").value; + } + set distortion(value) { + this.uniforms.get("distortion").value = value; + } + /** + * The principal point. Default is (0, 0). + * + * @type {Vector2} + */ + get principalPoint() { + return this.uniforms.get("principalPoint").value; + } + set principalPoint(value) { + this.uniforms.get("principalPoint").value = value; + } + /** + * The focal length. Default is (1, 1). + * + * @type {Vector2} + */ + get focalLength() { + return this.uniforms.get("focalLength").value; + } + set focalLength(value) { + this.uniforms.get("focalLength").value = value; + } + /** + * The skew factor in radians. + * + * @type {Number} + */ + get skew() { + return this.uniforms.get("skew").value; + } + set skew(value) { + this.uniforms.get("skew").value = value; + } +}; +var lut_1d_default = `#ifdef LUT_PRECISION_HIGH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D lut; +#else +uniform mediump sampler2D lut; +#endif +#else +uniform lowp sampler2D lut; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(texture2D(lut,vec2(inputColor.r,0.5)).r,texture2D(lut,vec2(inputColor.g,0.5)).r,texture2D(lut,vec2(inputColor.b,0.5)).r,inputColor.a);}`; +var LUT1DEffect = class extends Effect { + /** + * Constructs a new color grading effect. + * + * @param {Texture} lut - The lookup texture. + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + */ + constructor(lut, { blendFunction = BlendFunction.SRC } = {}) { + super("LUT1DEffect", lut_1d_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([["lut", new Uniform(null)]]) + }); + this.lut = lut; + } + /** + * The LUT. + * + * @type {Texture} + */ + get lut() { + return this.uniforms.get("lut").value; + } + set lut(value) { + this.uniforms.get("lut").value = value; + if (value !== null && (value.type === FloatType || value.type === HalfFloatType)) { + this.defines.set("LUT_PRECISION_HIGH", "1"); + } + } +}; +var LUTOperation = { + SCALE_UP: "lut.scaleup" +}; +function createCanvas(width, height, data) { + const canvas = document.createElement("canvas"); + const context = canvas.getContext("2d"); + canvas.width = width; + canvas.height = height; + if (data instanceof Image) { + context.drawImage(data, 0, 0); + } else { + const imageData = context.createImageData(width, height); + imageData.data.set(data); + context.putImageData(imageData, 0, 0); + } + return canvas; +} +var RawImageData = class _RawImageData { + /** + * Constructs a new image data container. + * + * @param {Number} [width=0] - The width of the image. + * @param {Number} [height=0] - The height of the image. + * @param {Uint8ClampedArray} [data=null] - The image data. + */ + constructor(width = 0, height = 0, data = null) { + this.width = width; + this.height = height; + this.data = data; + } + /** + * Creates a canvas from this image data. + * + * @return {Canvas} The canvas, or null if it couldn't be created. + */ + toCanvas() { + return typeof document === "undefined" ? null : createCanvas(this.width, this.height, this.data); + } + /** + * Creates a new image data container. + * + * @param {ImageData|Image} image - An image or plain image data. + * @return {RawImageData} The image data. + */ + static from(image) { + const { width, height } = image; + let data; + if (image instanceof Image) { + const canvas = createCanvas(width, height, image); + if (canvas !== null) { + const context = canvas.getContext("2d"); + data = context.getImageData(0, 0, width, height).data; + } + } else { + data = image.data; + } + return new _RawImageData(width, height, data); + } +}; +var worker_default = '"use strict";(()=>{var O={SCALE_UP:"lut.scaleup"};var _=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function d(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function V(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function k(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)V(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=_[0];P[0]=s,P[1]=F,P[2]=f;let o=_[1],L=x-w,S=u-c,U=b-l;o[0]=L*M[0]+w,o[1]=S*M[1]+c,o[2]=U*M[2]+l,V(a,t,o[0],o[1],o[2],n[0]),o[0]=L*g[0]+w,o[1]=S*g[1]+c,o[2]=U*g[2]+l,V(a,t,o[0],o[1],o[2],n[1]),o[0]=L*X[0]+w,o[1]=S*X[1]+c,o[2]=U*X[2]+l,V(a,t,o[0],o[1],o[2],n[2]),o[0]=L*Y[0]+w,o[1]=S*Y[1]+c,o[2]=U*Y[2]+l,V(a,t,o[0],o[1],o[2],n[3]);let T=d(g,X,Y,P)*6,q=d(M,X,Y,P)*6,C=d(M,g,Y,P)*6,E=d(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=q,n[1][1]*=q,n[1][2]*=q,n[2][0]*=C,n[2][1]*=C,n[2][2]*=C,n[3][0]*=E,n[3][1]*=E,n[3][2]*=E,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var v=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(r**3*4),y=t instanceof Uint8Array?255:1,h=r**2,A=1/(r-1);for(let w=0;w{let t=a.data,r=t.data;switch(t.operation){case O.SCALE_UP:r=v.expand(r,t.size);break}postMessage(r,[r.buffer]),close()});})();\n'; +var c = new Color(); +var LookupTexture = class _LookupTexture extends Data3DTexture { + /** + * Constructs a cubic 3D lookup texture. + * + * @param {TypedArray} data - The pixel data. The default format is RGBA. + * @param {Number} size - The sidelength. + */ + constructor(data, size) { + super(data, size, size, size); + this.type = FloatType; + this.format = RGBAFormat; + this.minFilter = LinearFilter; + this.magFilter = LinearFilter; + this.wrapS = ClampToEdgeWrapping; + this.wrapT = ClampToEdgeWrapping; + this.wrapR = ClampToEdgeWrapping; + this.unpackAlignment = 1; + this.needsUpdate = true; + this.colorSpace = LinearSRGBColorSpace; + this.domainMin = new Vector3(0, 0, 0); + this.domainMax = new Vector3(1, 1, 1); + } + /** + * Indicates that this is an instance of LookupTexture3D. + * + * @type {Boolean} + * @deprecated + */ + get isLookupTexture3D() { + return true; + } + /** + * Scales this LUT up to a given target size using tetrahedral interpolation. + * + * @param {Number} size - The target sidelength. + * @param {Boolean} [transferData=true] - Extra fast mode. Set to false to keep the original data intact. + * @return {Promise} A promise that resolves with a new LUT upon completion. + */ + scaleUp(size, transferData = true) { + const image = this.image; + let promise; + if (size <= image.width) { + promise = Promise.reject(new Error("The target size must be greater than the current size")); + } else { + promise = new Promise((resolve, reject) => { + const workerURL = URL.createObjectURL(new Blob([worker_default], { + type: "text/javascript" + })); + const worker = new Worker(workerURL); + worker.addEventListener("error", (event) => reject(event.error)); + worker.addEventListener("message", (event) => { + const lut = new _LookupTexture(event.data, size); + this.colorSpace = lut.colorSpace; + lut.type = this.type; + lut.name = this.name; + URL.revokeObjectURL(workerURL); + resolve(lut); + }); + const transferList = transferData ? [image.data.buffer] : []; + worker.postMessage({ + operation: LUTOperation.SCALE_UP, + data: image.data, + size + }, transferList); + }); + } + return promise; + } + /** + * Applies the given LUT to this one. + * + * @param {LookupTexture} lut - A LUT. Must have the same dimensions, type and format as this LUT. + * @return {LookupTexture} This texture. + */ + applyLUT(lut) { + const img0 = this.image; + const img1 = lut.image; + const size0 = Math.min(img0.width, img0.height, img0.depth); + const size1 = Math.min(img1.width, img1.height, img1.depth); + if (size0 !== size1) { + console.error("Size mismatch"); + } else if (lut.type !== FloatType || this.type !== FloatType) { + console.error("Both LUTs must be FloatType textures"); + } else if (lut.format !== RGBAFormat || this.format !== RGBAFormat) { + console.error("Both LUTs must be RGBA textures"); + } else { + const data0 = img0.data; + const data1 = img1.data; + const size = size0; + const sizeSq = size ** 2; + const s = size - 1; + for (let i = 0, l = size ** 3; i < l; ++i) { + const i4 = i * 4; + const r = data0[i4 + 0] * s; + const g = data0[i4 + 1] * s; + const b = data0[i4 + 2] * s; + const iRGB = Math.round(r + g * size + b * sizeSq) * 4; + data0[i4 + 0] = data1[iRGB + 0]; + data0[i4 + 1] = data1[iRGB + 1]; + data0[i4 + 2] = data1[iRGB + 2]; + } + this.needsUpdate = true; + } + return this; + } + /** + * Converts the LUT data into unsigned byte data. + * + * This is a lossy operation which should only be performed after all other transformations have been applied. + * + * @return {LookupTexture} This texture. + */ + convertToUint8() { + if (this.type === FloatType) { + const floatData = this.image.data; + const uint8Data = new Uint8Array(floatData.length); + for (let i = 0, l = floatData.length; i < l; ++i) { + uint8Data[i] = floatData[i] * 255 + 0.5; + } + this.image.data = uint8Data; + this.type = UnsignedByteType; + this.needsUpdate = true; + } + return this; + } + /** + * Converts the LUT data into float data. + * + * @return {LookupTexture} This texture. + */ + convertToFloat() { + if (this.type === UnsignedByteType) { + const uint8Data = this.image.data; + const floatData = new Float32Array(uint8Data.length); + for (let i = 0, l = uint8Data.length; i < l; ++i) { + floatData[i] = uint8Data[i] / 255; + } + this.image.data = floatData; + this.type = FloatType; + this.needsUpdate = true; + } + return this; + } + /** + * Converts this LUT into RGBA data. + * + * @deprecated LUTs are RGBA by default since three r137. + * @return {LookupTexture} This texture. + */ + convertToRGBA() { + console.warn("LookupTexture", "convertToRGBA() is deprecated, LUTs are now RGBA by default"); + return this; + } + /** + * Converts the output of this LUT into sRGB color space. + * + * @return {LookupTexture} This texture. + */ + convertLinearToSRGB() { + const data = this.image.data; + if (this.type === FloatType) { + for (let i = 0, l = data.length; i < l; i += 4) { + c.fromArray(data, i).convertLinearToSRGB().toArray(data, i); + } + this.colorSpace = SRGBColorSpace; + this.needsUpdate = true; + } else { + console.error("Color space conversion requires FloatType data"); + } + return this; + } + /** + * Converts the output of this LUT into linear color space. + * + * @return {LookupTexture} This texture. + */ + convertSRGBToLinear() { + const data = this.image.data; + if (this.type === FloatType) { + for (let i = 0, l = data.length; i < l; i += 4) { + c.fromArray(data, i).convertSRGBToLinear().toArray(data, i); + } + this.colorSpace = LinearSRGBColorSpace; + this.needsUpdate = true; + } else { + console.error("Color space conversion requires FloatType data"); + } + return this; + } + /** + * Converts this LUT into a 2D data texture. + * + * Please note that custom input domains are not carried over to 2D textures. + * + * @return {DataTexture} The texture. + */ + toDataTexture() { + const width = this.image.width; + const height = this.image.height * this.image.depth; + const texture = new DataTexture(this.image.data, width, height); + texture.name = this.name; + texture.type = this.type; + texture.format = this.format; + texture.minFilter = LinearFilter; + texture.magFilter = LinearFilter; + texture.wrapS = this.wrapS; + texture.wrapT = this.wrapT; + texture.generateMipmaps = false; + texture.needsUpdate = true; + this.colorSpace = texture.colorSpace; + return texture; + } + /** + * Creates a new 3D LUT by copying a given LUT. + * + * Common image-based textures will be converted into 3D data textures. + * + * @param {Texture} texture - The LUT. Assumed to be cubic. + * @return {LookupTexture} A new 3D LUT. + */ + static from(texture) { + const image = texture.image; + const { width, height } = image; + const size = Math.min(width, height); + let data; + if (image instanceof Image) { + const rawImageData = RawImageData.from(image); + const src = rawImageData.data; + if (width > height) { + data = new Uint8Array(src.length); + for (let z = 0; z < size; ++z) { + for (let y = 0; y < size; ++y) { + for (let x = 0; x < size; ++x) { + const i4 = (x + z * size + y * size * size) * 4; + const j4 = (x + y * size + z * size * size) * 4; + data[j4 + 0] = src[i4 + 0]; + data[j4 + 1] = src[i4 + 1]; + data[j4 + 2] = src[i4 + 2]; + data[j4 + 3] = src[i4 + 3]; + } + } + } + } else { + data = new Uint8Array(src.buffer); + } + } else { + data = image.data.slice(); + } + const lut = new _LookupTexture(data, size); + lut.type = texture.type; + lut.name = texture.name; + texture.colorSpace = lut.colorSpace; + return lut; + } + /** + * Creates a neutral 3D LUT. + * + * @param {Number} size - The sidelength. + * @return {LookupTexture} A neutral 3D LUT. + */ + static createNeutral(size) { + const data = new Float32Array(size ** 3 * 4); + const sizeSq = size ** 2; + const s = 1 / (size - 1); + for (let r = 0; r < size; ++r) { + for (let g = 0; g < size; ++g) { + for (let b = 0; b < size; ++b) { + const i4 = (r + g * size + b * sizeSq) * 4; + data[i4 + 0] = r * s; + data[i4 + 1] = g * s; + data[i4 + 2] = b * s; + data[i4 + 3] = 1; + } + } + } + const lut = new _LookupTexture(data, size); + lut.name = "neutral"; + return lut; + } +}; +var lut_3d_default = `uniform vec3 scale;uniform vec3 offset; +#ifdef CUSTOM_INPUT_DOMAIN +uniform vec3 domainMin;uniform vec3 domainMax; +#endif +#ifdef LUT_3D +#ifdef LUT_PRECISION_HIGH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler3D lut; +#else +uniform mediump sampler3D lut; +#endif +#else +uniform lowp sampler3D lut; +#endif +vec4 applyLUT(const in vec3 rgb){ +#ifdef TETRAHEDRAL_INTERPOLATION +vec3 p=floor(rgb);vec3 f=rgb-p;vec3 v1=(p+0.5)*LUT_TEXEL_WIDTH;vec3 v4=(p+1.5)*LUT_TEXEL_WIDTH;vec3 v2,v3;vec3 frac;if(f.r>=f.g){if(f.g>f.b){frac=f.rgb;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else if(f.r>=f.b){frac=f.rbg;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v1.y,v4.z);}else{frac=f.brg;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v4.x,v1.y,v4.z);}}else{if(f.b>f.g){frac=f.bgr;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v1.x,v4.y,v4.z);}else if(f.r>=f.b){frac=f.grb;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else{frac=f.gbr;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v1.x,v4.y,v4.z);}}vec4 n1=texture(lut,v1);vec4 n2=texture(lut,v2);vec4 n3=texture(lut,v3);vec4 n4=texture(lut,v4);vec4 weights=vec4(1.0-frac.x,frac.x-frac.y,frac.y-frac.z,frac.z);vec4 result=weights*mat4(vec4(n1.r,n2.r,n3.r,n4.r),vec4(n1.g,n2.g,n3.g,n4.g),vec4(n1.b,n2.b,n3.b,n4.b),vec4(1.0));return vec4(result.rgb,1.0); +#else +return texture(lut,rgb); +#endif +} +#else +#ifdef LUT_PRECISION_HIGH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D lut; +#else +uniform mediump sampler2D lut; +#endif +#else +uniform lowp sampler2D lut; +#endif +vec4 applyLUT(const in vec3 rgb){float slice=rgb.b*LUT_SIZE;float slice0=floor(slice);float interp=slice-slice0;float centeredInterp=interp-0.5;float slice1=slice0+sign(centeredInterp); +#ifdef LUT_STRIP_HORIZONTAL +float xOffset=clamp(rgb.r*LUT_TEXEL_HEIGHT,LUT_TEXEL_WIDTH*0.5,LUT_TEXEL_HEIGHT-LUT_TEXEL_WIDTH*0.5);vec2 uv0=vec2(slice0*LUT_TEXEL_HEIGHT+xOffset,rgb.g);vec2 uv1=vec2(slice1*LUT_TEXEL_HEIGHT+xOffset,rgb.g); +#else +float yOffset=clamp(rgb.g*LUT_TEXEL_WIDTH,LUT_TEXEL_HEIGHT*0.5,LUT_TEXEL_WIDTH-LUT_TEXEL_HEIGHT*0.5);vec2 uv0=vec2(rgb.r,slice0*LUT_TEXEL_WIDTH+yOffset);vec2 uv1=vec2(rgb.r,slice1*LUT_TEXEL_WIDTH+yOffset); +#endif +vec4 sample0=texture2D(lut,uv0);vec4 sample1=texture2D(lut,uv1);return mix(sample0,sample1,abs(centeredInterp));} +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 c=inputColor.rgb; +#ifdef CUSTOM_INPUT_DOMAIN +if(c.r>=domainMin.r&&c.g>=domainMin.g&&c.b>=domainMin.b&&c.r<=domainMax.r&&c.g<=domainMax.g&&c.b<=domainMax.b){c=applyLUT(scale*c+offset).rgb;}else{c=inputColor.rgb;} +#else +#if !defined(LUT_3D) || defined(TETRAHEDRAL_INTERPOLATION) +c=clamp(c,0.0,1.0); +#endif +c=applyLUT(scale*c+offset).rgb; +#endif +outputColor=vec4(c,inputColor.a);}`; +var LUT3DEffect = class extends Effect { + /** + * Constructs a new color grading effect. + * + * @param {Texture} lut - The lookup texture. + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + * @param {Boolean} [options.tetrahedralInterpolation=false] - Enables or disables tetrahedral interpolation. + * @param {ColorSpace} [options.inputColorSpace=SRGBColorSpace] - The input color space. + */ + constructor(lut, { + blendFunction = BlendFunction.SRC, + tetrahedralInterpolation = false, + inputColorSpace = SRGBColorSpace + } = {}) { + super("LUT3DEffect", lut_3d_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["lut", new Uniform(null)], + ["scale", new Uniform(new Vector3())], + ["offset", new Uniform(new Vector3())], + ["domainMin", new Uniform(null)], + ["domainMax", new Uniform(null)] + ]) + }); + this.tetrahedralInterpolation = tetrahedralInterpolation; + this.inputColorSpace = inputColorSpace; + this.lut = lut; + } + /** + * The LUT. + * + * @type {Texture} + */ + get lut() { + return this.uniforms.get("lut").value; + } + set lut(value) { + const defines = this.defines; + const uniforms = this.uniforms; + if (this.lut !== value) { + uniforms.get("lut").value = value; + if (value !== null) { + const image = value.image; + const tetrahedralInterpolation = this.tetrahedralInterpolation; + defines.clear(); + defines.set("LUT_SIZE", Math.min(image.width, image.height).toFixed(16)); + defines.set("LUT_TEXEL_WIDTH", (1 / image.width).toFixed(16)); + defines.set("LUT_TEXEL_HEIGHT", (1 / image.height).toFixed(16)); + uniforms.get("domainMin").value = null; + uniforms.get("domainMax").value = null; + if (value.type === FloatType || value.type === HalfFloatType) { + defines.set("LUT_PRECISION_HIGH", "1"); + } + if (image.width > image.height) { + defines.set("LUT_STRIP_HORIZONTAL", "1"); + } else if (value instanceof Data3DTexture) { + defines.set("LUT_3D", "1"); + } + if (value instanceof LookupTexture) { + const min = value.domainMin; + const max = value.domainMax; + if (min.x !== 0 || min.y !== 0 || min.z !== 0 || max.x !== 1 || max.y !== 1 || max.z !== 1) { + defines.set("CUSTOM_INPUT_DOMAIN", "1"); + uniforms.get("domainMin").value = min.clone(); + uniforms.get("domainMax").value = max.clone(); + } + } + this.tetrahedralInterpolation = tetrahedralInterpolation; + } + } + } + /** + * Returns the current LUT. + * + * @deprecated Use lut instead. + * @return {Texture} The LUT. + */ + getLUT() { + return this.lut; + } + /** + * Sets the LUT. + * + * @deprecated Use lut instead. + * @param {Texture} value - The LUT. + */ + setLUT(value) { + this.lut = value; + } + /** + * Updates the scale and offset for the LUT sampling coordinates. + * + * @private + */ + updateScaleOffset() { + const lut = this.lut; + if (lut !== null) { + const size = Math.min(lut.image.width, lut.image.height); + const scale = this.uniforms.get("scale").value; + const offset = this.uniforms.get("offset").value; + if (this.tetrahedralInterpolation && lut instanceof Data3DTexture) { + if (this.defines.has("CUSTOM_INPUT_DOMAIN")) { + const domainScale = lut.domainMax.clone().sub(lut.domainMin); + scale.setScalar(size - 1).divide(domainScale); + offset.copy(lut.domainMin).negate().multiply(scale); + } else { + scale.setScalar(size - 1); + offset.setScalar(0); + } + } else { + if (this.defines.has("CUSTOM_INPUT_DOMAIN")) { + const domainScale = lut.domainMax.clone().sub(lut.domainMin).multiplyScalar(size); + scale.setScalar(size - 1).divide(domainScale); + offset.copy(lut.domainMin).negate().multiply(scale).addScalar(1 / (2 * size)); + } else { + scale.setScalar((size - 1) / size); + offset.setScalar(1 / (2 * size)); + } + } + } + } + /** + * Configures parameters for tetrahedral interpolation. + * + * @private + */ + configureTetrahedralInterpolation() { + const lut = this.lut; + if (lut !== null) { + lut.minFilter = LinearFilter; + lut.magFilter = LinearFilter; + if (this.tetrahedralInterpolation) { + if (lut instanceof Data3DTexture) { + lut.minFilter = NearestFilter; + lut.magFilter = NearestFilter; + } else { + console.warn("Tetrahedral interpolation requires a 3D texture"); + } + } + lut.needsUpdate = true; + } + } + /** + * Indicates whether tetrahedral interpolation is enabled. Requires a 3D LUT, disabled by default. + * + * Tetrahedral interpolation produces highly accurate results but is slower than hardware interpolation. + * + * @type {Boolean} + */ + get tetrahedralInterpolation() { + return this.defines.has("TETRAHEDRAL_INTERPOLATION"); + } + set tetrahedralInterpolation(value) { + if (value) { + this.defines.set("TETRAHEDRAL_INTERPOLATION", "1"); + } else { + this.defines.delete("TETRAHEDRAL_INTERPOLATION"); + } + this.configureTetrahedralInterpolation(); + this.updateScaleOffset(); + this.setChanged(); + } + /** + * Enables or disables tetrahedral interpolation. + * + * @deprecated Use tetrahedralInterpolation instead. + * @param {Boolean} value - Whether tetrahedral interpolation should be enabled. + */ + setTetrahedralInterpolationEnabled(value) { + this.tetrahedralInterpolation = value; + } +}; +var DepthCopyMode = { + FULL: 0, + SINGLE: 1 +}; +var EdgeDetectionMode = { + DEPTH: 0, + LUMA: 1, + COLOR: 2 +}; +var PredicationMode = { + DISABLED: 0, + DEPTH: 1, + CUSTOM: 2 +}; +var SMAAPreset = { + LOW: 0, + MEDIUM: 1, + HIGH: 2, + ULTRA: 3 +}; +var ToneMappingMode = { + LINEAR: 0, + REINHARD: 1, + REINHARD2: 2, + REINHARD2_ADAPTIVE: 3, + UNCHARTED2: 4, + OPTIMIZED_CINEON: 5, + CINEON: 5, + ACES_FILMIC: 6, + AGX: 7, + NEUTRAL: 8 +}; +var VignetteTechnique = { + DEFAULT: 0, + ESKIL: 1 +}; +var WebGLExtension = { + DERIVATIVES: "derivatives", + FRAG_DEPTH: "fragDepth", + DRAW_BUFFERS: "drawBuffers", + SHADER_TEXTURE_LOD: "shaderTextureLOD" +}; +var noise_default = `void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*(1.0+time))); +#ifdef PREMULTIPLY +outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); +#else +outputColor=vec4(noise,inputColor.a); +#endif +}`; +var NoiseEffect = class extends Effect { + /** + * Constructs a new noise effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function of this effect. + * @param {Boolean} [options.premultiply=false] - Whether the noise should be multiplied with the input colors prior to blending. + */ + constructor({ blendFunction = BlendFunction.SCREEN, premultiply = false } = {}) { + super("NoiseEffect", noise_default, { blendFunction }); + this.premultiply = premultiply; + } + /** + * Indicates whether noise will be multiplied with the input colors prior to blending. + * + * @type {Boolean} + */ + get premultiply() { + return this.defines.has("PREMULTIPLY"); + } + set premultiply(value) { + if (this.premultiply !== value) { + if (value) { + this.defines.set("PREMULTIPLY", "1"); + } else { + this.defines.delete("PREMULTIPLY"); + } + this.setChanged(); + } + } + /** + * Indicates whether noise will be multiplied with the input colors prior to blending. + * + * @deprecated Use premultiply instead. + * @return {Boolean} Whether noise is premultiplied. + */ + isPremultiplied() { + return this.premultiply; + } + /** + * Controls whether noise should be multiplied with the input colors prior to blending. + * + * @deprecated Use premultiply instead. + * @param {Boolean} value - Whether noise should be premultiplied. + */ + setPremultiplied(value) { + this.premultiply = value; + } +}; +var depth_comparison_default = `#include +#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform float cameraNear;uniform float cameraFar;centroid varying float vViewZ;centroid varying vec4 vProjTexCoord;void main(){ +#include +vec2 projTexCoord=(vProjTexCoord.xy/vProjTexCoord.w)*0.5+0.5;projTexCoord=clamp(projTexCoord,0.002,0.998); +#if DEPTH_PACKING == 3201 +float fragCoordZ=unpackRGBAToDepth(texture2D(depthBuffer,projTexCoord)); +#else +float fragCoordZ=texture2D(depthBuffer,projTexCoord).r; +#endif +#ifdef PERSPECTIVE_CAMERA +float viewZ=perspectiveDepthToViewZ(fragCoordZ,cameraNear,cameraFar); +#else +float viewZ=orthographicDepthToViewZ(fragCoordZ,cameraNear,cameraFar); +#endif +float depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}`; +var depth_comparison_default2 = `#include +#include +#include +#include +varying float vViewZ;varying vec4 vProjTexCoord;void main(){ +#include +#include +#include +#include +#include +vViewZ=mvPosition.z;vProjTexCoord=gl_Position; +#include +}`; +var DepthComparisonMaterial = class extends ShaderMaterial { + /** + * Constructs a new depth comparison material. + * + * @param {Texture} [depthTexture=null] - A depth texture. + * @param {PerspectiveCamera} [camera] - A camera. + */ + constructor(depthTexture = null, camera) { + super({ + name: "DepthComparisonMaterial", + defines: { + DEPTH_PACKING: "0" + }, + uniforms: { + depthBuffer: new Uniform(null), + cameraNear: new Uniform(0.3), + cameraFar: new Uniform(1e3) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: depth_comparison_default, + vertexShader: depth_comparison_default2 + }); + this.depthBuffer = depthTexture; + this.depthPacking = RGBADepthPacking; + this.copyCameraSettings(camera); + } + /** + * The depth buffer. + * + * @type {Texture} + */ + set depthBuffer(value) { + this.uniforms.depthBuffer.value = value; + } + /** + * The depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set depthPacking(value) { + this.defines.DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the depth buffer. + * + * @deprecated Use depthBuffer and depthPacking instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=RGBADepthPacking] - The depth packing strategy. + */ + setDepthBuffer(buffer, depthPacking = RGBADepthPacking) { + this.depthBuffer = buffer; + this.depthPacking = depthPacking; + } + /** + * Copies the settings of the given camera. + * + * @deprecated Use copyCameraSettings instead. + * @param {Camera} camera - A camera. + */ + adoptCameraSettings(camera) { + this.copyCameraSettings(camera); + } + /** + * Copies the settings of the given camera. + * + * @param {Camera} camera - A camera. + */ + copyCameraSettings(camera) { + if (camera) { + this.uniforms.cameraNear.value = camera.near; + this.uniforms.cameraFar.value = camera.far; + if (camera instanceof PerspectiveCamera) { + this.defines.PERSPECTIVE_CAMERA = "1"; + } else { + delete this.defines.PERSPECTIVE_CAMERA; + } + this.needsUpdate = true; + } + } +}; +var outline_default = `uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}`; +var outline_default2 = `uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}`; +var OutlineMaterial = class extends ShaderMaterial { + /** + * Constructs a new outline material. + * + * TODO Remove texelSize param. + * @param {Vector2} [texelSize] - The screen texel size. + */ + constructor(texelSize = new Vector2()) { + super({ + name: "OutlineMaterial", + uniforms: { + inputBuffer: new Uniform(null), + texelSize: new Uniform(new Vector2()) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: outline_default, + vertexShader: outline_default2 + }); + this.uniforms.texelSize.value.set(texelSize.x, texelSize.y); + this.uniforms.maskTexture = this.uniforms.inputBuffer; + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the texel size. + * + * @deprecated Use setSize() instead. + * @param {Number} x - The texel width. + * @param {Number} y - The texel height. + */ + setTexelSize(x, y) { + this.uniforms.texelSize.value.set(x, y); + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +var DepthPass = class extends Pass { + /** + * Constructs a new depth pass. + * + * @param {Scene} scene - The scene to render. + * @param {Camera} camera - The camera to use to render the scene. + * @param {Object} [options] - The options. + * @param {WebGLRenderTarget} [options.renderTarget] - A custom render target. + * @param {Number} [options.resolutionScale=1.0] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + */ + constructor(scene, camera, { + renderTarget, + resolutionScale = 1, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("DepthPass"); + this.needsSwap = false; + this.renderPass = new RenderPass(scene, camera, new MeshDepthMaterial({ + depthPacking: RGBADepthPacking + })); + const renderPass = this.renderPass; + renderPass.skipShadowMapUpdate = true; + renderPass.ignoreBackground = true; + const clearPass = renderPass.clearPass; + clearPass.overrideClearColor = new Color(16777215); + clearPass.overrideClearAlpha = 1; + this.renderTarget = renderTarget; + if (this.renderTarget === void 0) { + this.renderTarget = new WebGLRenderTarget(1, 1, { + minFilter: NearestFilter, + magFilter: NearestFilter + }); + this.renderTarget.texture.name = "DepthPass.Target"; + } + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + } + set mainScene(value) { + this.renderPass.mainScene = value; + } + set mainCamera(value) { + this.renderPass.mainCamera = value; + } + /** + * The depth texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * Returns the depth texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTarget.texture; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * Returns the current resolution scale. + * + * @return {Number} The resolution scale. + * @deprecated Use resolution instead. + */ + getResolutionScale() { + return this.resolution.scale; + } + /** + * Sets the resolution scale. + * + * @param {Number} scale - The new resolution scale. + * @deprecated Use resolution instead. + */ + setResolutionScale(scale) { + this.resolution.scale = scale; + } + /** + * Renders the scene depth. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const renderTarget = this.renderToScreen ? null : this.renderTarget; + this.renderPass.render(renderer, renderTarget); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + this.renderTarget.setSize(resolution.width, resolution.height); + } +}; +var outline_default3 = `uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength; +#ifdef USE_PATTERN +uniform lowp sampler2D patternTexture;varying vec2 vUvPattern; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 edge=texture2D(edgeTexture,uv).rg;vec2 mask=texture2D(maskTexture,uv).rg; +#ifndef X_RAY +edge.y=0.0; +#endif +edge*=(edgeStrength*mask.x*pulse);vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;float visibilityFactor=0.0; +#ifdef USE_PATTERN +vec4 patternColor=texture2D(patternTexture,vUvPattern); +#ifdef X_RAY +float hiddenFactor=0.5; +#else +float hiddenFactor=0.0; +#endif +visibilityFactor=(1.0-mask.y>0.0)?1.0:hiddenFactor;visibilityFactor*=(1.0-mask.x)*patternColor.a;color+=visibilityFactor*patternColor.rgb; +#endif +float alpha=max(max(edge.x,edge.y),visibilityFactor); +#ifdef ALPHA +outputColor=vec4(color,alpha); +#else +outputColor=vec4(color,max(alpha,inputColor.a)); +#endif +}`; +var outline_default4 = `uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}`; +var OutlineEffect = class extends Effect { + /** + * Constructs a new outline effect. + * + * @param {Scene} scene - The main scene. + * @param {Camera} camera - The main camera. + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function. Use `BlendFunction.ALPHA` for dark outlines. + * @param {Texture} [options.patternTexture=null] - A pattern texture. + * @param {Number} [options.patternScale=1.0] - The pattern scale. + * @param {Number} [options.edgeStrength=1.0] - The edge strength. + * @param {Number} [options.pulseSpeed=0.0] - The pulse speed. A value of zero disables the pulse effect. + * @param {Number} [options.visibleEdgeColor=0xffffff] - The color of visible edges. + * @param {Number} [options.hiddenEdgeColor=0x22090a] - The color of hidden edges. + * @param {KernelSize} [options.kernelSize=KernelSize.VERY_SMALL] - The blur kernel size. + * @param {Boolean} [options.blur=false] - Whether the outline should be blurred. + * @param {Boolean} [options.xRay=true] - Whether occluded parts of selected objects should be visible. + * @param {Number} [options.multisampling=0] - The number of samples used for multisample antialiasing. Requires WebGL 2. + * @param {Number} [options.resolutionScale=0.5] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + */ + constructor(scene, camera, { + blendFunction = BlendFunction.SCREEN, + patternTexture = null, + patternScale = 1, + edgeStrength = 1, + pulseSpeed = 0, + visibleEdgeColor = 16777215, + hiddenEdgeColor = 2230538, + kernelSize = KernelSize.VERY_SMALL, + blur = false, + xRay = true, + multisampling = 0, + resolutionScale = 0.5, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("OutlineEffect", outline_default3, { + uniforms: /* @__PURE__ */ new Map([ + ["maskTexture", new Uniform(null)], + ["edgeTexture", new Uniform(null)], + ["edgeStrength", new Uniform(edgeStrength)], + ["visibleEdgeColor", new Uniform(new Color(visibleEdgeColor))], + ["hiddenEdgeColor", new Uniform(new Color(hiddenEdgeColor))], + ["pulse", new Uniform(1)], + ["patternScale", new Uniform(patternScale)], + ["patternTexture", new Uniform(null)] + ]) + }); + this.blendMode.addEventListener("change", (event) => { + if (this.blendMode.blendFunction === BlendFunction.ALPHA) { + this.defines.set("ALPHA", "1"); + } else { + this.defines.delete("ALPHA"); + } + this.setChanged(); + }); + this.blendMode.blendFunction = blendFunction; + this.patternTexture = patternTexture; + this.xRay = xRay; + this.scene = scene; + this.camera = camera; + this.renderTargetMask = new WebGLRenderTarget(1, 1); + this.renderTargetMask.samples = multisampling; + this.renderTargetMask.texture.name = "Outline.Mask"; + this.uniforms.get("maskTexture").value = this.renderTargetMask.texture; + this.renderTargetOutline = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetOutline.texture.name = "Outline.Edges"; + this.uniforms.get("edgeTexture").value = this.renderTargetOutline.texture; + this.clearPass = new ClearPass(); + this.clearPass.overrideClearColor = new Color(0); + this.clearPass.overrideClearAlpha = 1; + this.depthPass = new DepthPass(scene, camera); + this.maskPass = new RenderPass(scene, camera, new DepthComparisonMaterial(this.depthPass.texture, camera)); + const clearPass = this.maskPass.clearPass; + clearPass.overrideClearColor = new Color(16777215); + clearPass.overrideClearAlpha = 1; + this.blurPass = new KawaseBlurPass({ resolutionScale, resolutionX, resolutionY, kernelSize }); + this.blurPass.enabled = blur; + const resolution = this.blurPass.resolution; + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + this.outlinePass = new ShaderPass(new OutlineMaterial()); + const outlineMaterial = this.outlinePass.fullscreenMaterial; + outlineMaterial.inputBuffer = this.renderTargetMask.texture; + this.time = 0; + this.forceUpdate = true; + this.selection = new Selection(); + this.pulseSpeed = pulseSpeed; + } + set mainScene(value) { + this.scene = value; + this.depthPass.mainScene = value; + this.maskPass.mainScene = value; + } + set mainCamera(value) { + this.camera = value; + this.depthPass.mainCamera = value; + this.maskPass.mainCamera = value; + this.maskPass.overrideMaterial.copyCameraSettings(value); + } + /** + * The resolution of this effect. + * + * @type {Resolution} + */ + get resolution() { + return this.blurPass.resolution; + } + /** + * Returns the resolution. + * + * @return {Resizer} The resolution. + */ + getResolution() { + return this.blurPass.getResolution(); + } + /** + * The amount of MSAA samples. + * + * Requires WebGL 2. Set to zero to disable multisampling. + * + * @experimental Requires three >= r138. + * @type {Number} + */ + get multisampling() { + return this.renderTargetMask.samples; + } + set multisampling(value) { + this.renderTargetMask.samples = value; + this.renderTargetMask.dispose(); + } + /** + * The pattern scale. + * + * @type {Number} + */ + get patternScale() { + return this.uniforms.get("patternScale").value; + } + set patternScale(value) { + this.uniforms.get("patternScale").value = value; + } + /** + * The edge strength. + * + * @type {Number} + */ + get edgeStrength() { + return this.uniforms.get("edgeStrength").value; + } + set edgeStrength(value) { + this.uniforms.get("edgeStrength").value = value; + } + /** + * The visible edge color. + * + * @type {Color} + */ + get visibleEdgeColor() { + return this.uniforms.get("visibleEdgeColor").value; + } + set visibleEdgeColor(value) { + this.uniforms.get("visibleEdgeColor").value = value; + } + /** + * The hidden edge color. + * + * @type {Color} + */ + get hiddenEdgeColor() { + return this.uniforms.get("hiddenEdgeColor").value; + } + set hiddenEdgeColor(value) { + this.uniforms.get("hiddenEdgeColor").value = value; + } + /** + * Returns the blur pass. + * + * @deprecated Use blurPass instead. + * @return {KawaseBlurPass} The blur pass. + */ + getBlurPass() { + return this.blurPass; + } + /** + * Returns the selection. + * + * @deprecated Use selection instead. + * @return {Selection} The selection. + */ + getSelection() { + return this.selection; + } + /** + * Returns the pulse speed. + * + * @deprecated Use pulseSpeed instead. + * @return {Number} The speed. + */ + getPulseSpeed() { + return this.pulseSpeed; + } + /** + * Sets the pulse speed. Set to zero to disable. + * + * @deprecated Use pulseSpeed instead. + * @param {Number} value - The speed. + */ + setPulseSpeed(value) { + this.pulseSpeed = value; + } + /** + * The current width of the internal render targets. + * + * @type {Number} + * @deprecated Use resolution.width instead. + */ + get width() { + return this.resolution.width; + } + set width(value) { + this.resolution.preferredWidth = value; + } + /** + * The current height of the internal render targets. + * + * @type {Number} + * @deprecated Use resolution.height instead. + */ + get height() { + return this.resolution.height; + } + set height(value) { + this.resolution.preferredHeight = value; + } + /** + * The selection layer. + * + * @type {Number} + * @deprecated Use selection.layer instead. + */ + get selectionLayer() { + return this.selection.layer; + } + set selectionLayer(value) { + this.selection.layer = value; + } + /** + * Indicates whether dithering is enabled. + * + * @type {Boolean} + * @deprecated + */ + get dithering() { + return this.blurPass.dithering; + } + set dithering(value) { + this.blurPass.dithering = value; + } + /** + * The blur kernel size. + * + * @type {KernelSize} + * @deprecated Use blurPass.kernelSize instead. + */ + get kernelSize() { + return this.blurPass.kernelSize; + } + set kernelSize(value) { + this.blurPass.kernelSize = value; + } + /** + * Indicates whether the outlines should be blurred. + * + * @type {Boolean} + * @deprecated Use blurPass.enabled instead. + */ + get blur() { + return this.blurPass.enabled; + } + set blur(value) { + this.blurPass.enabled = value; + } + /** + * Indicates whether X-ray mode is enabled. + * + * @type {Boolean} + */ + get xRay() { + return this.defines.has("X_RAY"); + } + set xRay(value) { + if (this.xRay !== value) { + if (value) { + this.defines.set("X_RAY", "1"); + } else { + this.defines.delete("X_RAY"); + } + this.setChanged(); + } + } + /** + * Indicates whether X-ray mode is enabled. + * + * @deprecated Use xRay instead. + * @return {Boolean} Whether X-ray mode is enabled. + */ + isXRayEnabled() { + return this.xRay; + } + /** + * Enables or disables X-ray outlines. + * + * @deprecated Use xRay instead. + * @param {Boolean} value - Whether X-ray should be enabled. + */ + setXRayEnabled(value) { + this.xRay = value; + } + /** + * The pattern texture. Set to `null` to disable. + * + * @type {Texture} + */ + get patternTexture() { + return this.uniforms.get("patternTexture").value; + } + set patternTexture(value) { + if (value !== null) { + value.wrapS = value.wrapT = RepeatWrapping; + this.defines.set("USE_PATTERN", "1"); + this.setVertexShader(outline_default4); + } else { + this.defines.delete("USE_PATTERN"); + this.setVertexShader(null); + } + this.uniforms.get("patternTexture").value = value; + this.setChanged(); + } + /** + * Sets the pattern texture. + * + * @deprecated Use patternTexture instead. + * @param {Texture} value - The new texture. + */ + setPatternTexture(value) { + this.patternTexture = value; + } + /** + * Returns the current resolution scale. + * + * @return {Number} The resolution scale. + * @deprecated Use resolution instead. + */ + getResolutionScale() { + return this.resolution.scale; + } + /** + * Sets the resolution scale. + * + * @param {Number} scale - The new resolution scale. + * @deprecated Use resolution instead. + */ + setResolutionScale(scale) { + this.resolution.scale = scale; + } + /** + * Clears the current selection and selects a list of objects. + * + * @param {Object3D[]} objects - The objects that should be outlined. This array will be copied. + * @return {OutlinePass} This pass. + * @deprecated Use selection.set() instead. + */ + setSelection(objects) { + this.selection.set(objects); + return this; + } + /** + * Clears the list of selected objects. + * + * @return {OutlinePass} This pass. + * @deprecated Use selection.clear() instead. + */ + clearSelection() { + this.selection.clear(); + return this; + } + /** + * Selects an object. + * + * @param {Object3D} object - The object that should be outlined. + * @return {OutlinePass} This pass. + * @deprecated Use selection.add() instead. + */ + selectObject(object) { + this.selection.add(object); + return this; + } + /** + * Deselects an object. + * + * @param {Object3D} object - The object that should no longer be outlined. + * @return {OutlinePass} This pass. + * @deprecated Use selection.delete() instead. + */ + deselectObject(object) { + this.selection.delete(object); + return this; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const scene = this.scene; + const camera = this.camera; + const selection = this.selection; + const uniforms = this.uniforms; + const pulse = uniforms.get("pulse"); + const background = scene.background; + const mask = camera.layers.mask; + if (this.forceUpdate || selection.size > 0) { + scene.background = null; + pulse.value = 1; + if (this.pulseSpeed > 0) { + pulse.value = Math.cos(this.time * this.pulseSpeed * 10) * 0.375 + 0.625; + } + this.time += deltaTime; + selection.setVisible(false); + this.depthPass.render(renderer); + selection.setVisible(true); + camera.layers.set(selection.layer); + this.maskPass.render(renderer, this.renderTargetMask); + camera.layers.mask = mask; + scene.background = background; + this.outlinePass.render(renderer, null, this.renderTargetOutline); + if (this.blurPass.enabled) { + this.blurPass.render(renderer, this.renderTargetOutline, this.renderTargetOutline); + } + } + this.forceUpdate = selection.size > 0; + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.blurPass.setSize(width, height); + this.renderTargetMask.setSize(width, height); + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.depthPass.setSize(w, h); + this.renderTargetOutline.setSize(w, h); + this.outlinePass.fullscreenMaterial.setSize(w, h); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.blurPass.initialize(renderer, alpha, UnsignedByteType); + if (frameBufferType !== void 0) { + this.depthPass.initialize(renderer, alpha, frameBufferType); + this.maskPass.initialize(renderer, alpha, frameBufferType); + this.outlinePass.initialize(renderer, alpha, frameBufferType); + } + } +}; +var pixelation_default = `uniform bool active;uniform vec4 d;void mainUv(inout vec2 uv){if(active){uv=d.xy*(floor(uv*d.zw)+0.5);}}`; +var PixelationEffect = class extends Effect { + /** + * Constructs a new pixelation effect. + * + * @param {Object} [granularity=30.0] - The pixel granularity. + */ + constructor(granularity = 30) { + super("PixelationEffect", pixelation_default, { + uniforms: /* @__PURE__ */ new Map([ + ["active", new Uniform(false)], + ["d", new Uniform(new Vector4())] + ]) + }); + this.resolution = new Vector2(); + this._granularity = 0; + this.granularity = granularity; + } + /** + * The pixel granularity. + * + * A higher value yields coarser visuals. + * + * @type {Number} + */ + get granularity() { + return this._granularity; + } + set granularity(value) { + let d = Math.floor(value); + if (d % 2 > 0) { + d += 1; + } + this._granularity = d; + this.uniforms.get("active").value = d > 0; + this.setSize(this.resolution.width, this.resolution.height); + } + /** + * Returns the pixel granularity. + * + * @deprecated Use granularity instead. + * @return {Number} The granularity. + */ + getGranularity() { + return this.granularity; + } + /** + * Sets the pixel granularity. + * + * @deprecated Use granularity instead. + * @param {Number} value - The new granularity. + */ + setGranularity(value) { + this.granularity = value; + } + /** + * Updates the granularity. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.set(width, height); + const d = this.granularity; + const x = d / resolution.x; + const y = d / resolution.y; + this.uniforms.get("d").value.set(x, y, 1 / x, 1 / y); + } +}; +var realistic_bokeh_default = `uniform float focus;uniform float focalLength;uniform float fStop;uniform float maxBlur;uniform float luminanceThreshold;uniform float luminanceGain;uniform float bias;uniform float fringe; +#ifdef MANUAL_DOF +uniform vec4 dof; +#endif +#ifdef PENTAGON +float pentagon(const in vec2 coords){const vec4 HS0=vec4(1.0,0.0,0.0,1.0);const vec4 HS1=vec4(0.309016994,0.951056516,0.0,1.0);const vec4 HS2=vec4(-0.809016994,0.587785252,0.0,1.0);const vec4 HS3=vec4(-0.809016994,-0.587785252,0.0,1.0);const vec4 HS4=vec4(0.309016994,-0.951056516,0.0,1.0);const vec4 HS5=vec4(0.0,0.0,1.0,1.0);const vec4 ONE=vec4(1.0);const float P_FEATHER=0.4;const float N_FEATHER=-P_FEATHER;float inOrOut=-4.0;vec4 P=vec4(coords,vec2(RINGS_FLOAT-1.3));vec4 dist=vec4(dot(P,HS0),dot(P,HS1),dot(P,HS2),dot(P,HS3));dist=smoothstep(N_FEATHER,P_FEATHER,dist);inOrOut+=dot(dist,ONE);dist.x=dot(P,HS4);dist.y=HS5.w-abs(P.z);dist=smoothstep(N_FEATHER,P_FEATHER,dist);inOrOut+=dist.x;return clamp(inOrOut,0.0,1.0);} +#endif +vec3 processTexel(const in vec2 coords,const in float blur){vec2 scale=texelSize*fringe*blur;vec3 c=vec3(texture2D(inputBuffer,coords+vec2(0.0,1.0)*scale).r,texture2D(inputBuffer,coords+vec2(-0.866,-0.5)*scale).g,texture2D(inputBuffer,coords+vec2(0.866,-0.5)*scale).b);float luminance=linearToRelativeLuminance(c);float threshold=max((luminance-luminanceThreshold)*luminanceGain,0.0);return c+mix(vec3(0.0),c,threshold*blur);}float gather(const in float i,const in float j,const in float ringSamples,const in vec2 uv,const in vec2 blurFactor,const in float blur,inout vec3 color){float step=PI2/ringSamples;vec2 wh=vec2(cos(j*step)*i,sin(j*step)*i); +#ifdef PENTAGON +float p=pentagon(wh); +#else +float p=1.0; +#endif +color+=processTexel(wh*blurFactor+uv,blur)*mix(1.0,i/RINGS_FLOAT,bias)*p;return mix(1.0,i/RINGS_FLOAT,bias)*p;}void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){ +#ifdef PERSPECTIVE_CAMERA +float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); +#else +float linearDepth=depth; +#endif +#ifdef MANUAL_DOF +float focalPlane=linearDepth-focus;float farDoF=(focalPlane-dof.z)/dof.w;float nearDoF=(-focalPlane-dof.x)/dof.y;float blur=(focalPlane>0.0)?farDoF:nearDoF; +#else +const float CIRCLE_OF_CONFUSION=0.03;float focalPlaneMM=focus*1000.0;float depthMM=linearDepth*1000.0;float focalPlane=(depthMM*focalLength)/(depthMM-focalLength);float farDoF=(focalPlaneMM*focalLength)/(focalPlaneMM-focalLength);float nearDoF=(focalPlaneMM-focalLength)/(focalPlaneMM*fStop*CIRCLE_OF_CONFUSION);float blur=abs(focalPlane-farDoF)*nearDoF; +#endif +const int MAX_RING_SAMPLES=RINGS_INT*SAMPLES_INT;blur=clamp(blur,0.0,1.0);vec3 color=inputColor.rgb;if(blur>=0.05){vec2 blurFactor=blur*maxBlur*texelSize;float s=1.0;int ringSamples;for(int i=1;i<=RINGS_INT;i++){ringSamples=i*SAMPLES_INT;for(int j=0;j=ringSamples){break;}s+=gather(float(i),float(j),float(ringSamples),uv,blurFactor,blur,color);}}color/=s;} +#ifdef SHOW_FOCUS +float edge=0.002*linearDepth;float m=clamp(smoothstep(0.0,edge,blur),0.0,1.0);float e=clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);color=mix(color,vec3(1.0,0.5,0.0),(1.0-m)*0.6);color=mix(color,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2); +#endif +outputColor=vec4(color,inputColor.a);}`; +var RealisticBokehEffect = class extends Effect { + /** + * Constructs a new bokeh effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.focus=1.0] - The focus distance in world units. + * @param {Number} [options.focalLength=24.0] - The focal length of the main camera. + * @param {Number} [options.fStop=0.9] - The ratio of the lens focal length to the diameter of the entrance pupil (aperture). + * @param {Number} [options.luminanceThreshold=0.5] - A luminance threshold. + * @param {Number} [options.luminanceGain=2.0] - A luminance gain factor. + * @param {Number} [options.bias=0.5] - A blur bias. + * @param {Number} [options.fringe=0.7] - A blur offset. + * @param {Number} [options.maxBlur=1.0] - The maximum blur strength. + * @param {Boolean} [options.rings=3] - The number of blur iterations. + * @param {Boolean} [options.samples=2] - The amount of samples taken per ring. + * @param {Boolean} [options.showFocus=false] - Whether the focal point should be highlighted. Useful for debugging. + * @param {Boolean} [options.manualDoF=false] - Enables manual control over the depth of field. + * @param {Boolean} [options.pentagon=false] - Enables pentagonal blur shapes. Requires a high number of rings and samples. + */ + constructor({ + blendFunction, + focus = 1, + focalLength = 24, + fStop = 0.9, + luminanceThreshold = 0.5, + luminanceGain = 2, + bias = 0.5, + fringe = 0.7, + maxBlur = 1, + rings = 3, + samples = 2, + showFocus = false, + manualDoF = false, + pentagon = false + } = {}) { + super("RealisticBokehEffect", realistic_bokeh_default, { + blendFunction, + attributes: EffectAttribute.CONVOLUTION | EffectAttribute.DEPTH, + uniforms: /* @__PURE__ */ new Map([ + ["focus", new Uniform(focus)], + ["focalLength", new Uniform(focalLength)], + ["fStop", new Uniform(fStop)], + ["luminanceThreshold", new Uniform(luminanceThreshold)], + ["luminanceGain", new Uniform(luminanceGain)], + ["bias", new Uniform(bias)], + ["fringe", new Uniform(fringe)], + ["maxBlur", new Uniform(maxBlur)], + ["dof", new Uniform(null)] + ]) + }); + this.rings = rings; + this.samples = samples; + this.showFocus = showFocus; + this.manualDoF = manualDoF; + this.pentagon = pentagon; + } + /** + * The amount of blur iterations. + * + * @type {Number} + */ + get rings() { + return Number.parseInt(this.defines.get("RINGS_INT")); + } + set rings(value) { + const r = Math.floor(value); + this.defines.set("RINGS_INT", r.toFixed(0)); + this.defines.set("RINGS_FLOAT", r.toFixed(1)); + this.setChanged(); + } + /** + * The amount of blur samples per ring. + * + * @type {Number} + */ + get samples() { + return Number.parseInt(this.defines.get("SAMPLES_INT")); + } + set samples(value) { + const s = Math.floor(value); + this.defines.set("SAMPLES_INT", s.toFixed(0)); + this.defines.set("SAMPLES_FLOAT", s.toFixed(1)); + this.setChanged(); + } + /** + * Indicates whether the focal point will be highlighted. + * + * @type {Boolean} + */ + get showFocus() { + return this.defines.has("SHOW_FOCUS"); + } + set showFocus(value) { + if (this.showFocus !== value) { + if (value) { + this.defines.set("SHOW_FOCUS", "1"); + } else { + this.defines.delete("SHOW_FOCUS"); + } + this.setChanged(); + } + } + /** + * Indicates whether the Depth of Field should be calculated manually. + * + * If enabled, the Depth of Field can be adjusted via the `dof` uniform. + * + * @type {Boolean} + */ + get manualDoF() { + return this.defines.has("MANUAL_DOF"); + } + set manualDoF(value) { + if (this.manualDoF !== value) { + if (value) { + this.defines.set("MANUAL_DOF", "1"); + this.uniforms.get("dof").value = new Vector4(0.2, 1, 0.2, 2); + } else { + this.defines.delete("MANUAL_DOF"); + this.uniforms.get("dof").value = null; + } + this.setChanged(); + } + } + /** + * Indicates whether the blur shape should be pentagonal. + * + * @type {Boolean} + */ + get pentagon() { + return this.defines.has("PENTAGON"); + } + set pentagon(value) { + if (this.pentagon !== value) { + if (value) { + this.defines.set("PENTAGON", "1"); + } else { + this.defines.delete("PENTAGON"); + } + this.setChanged(); + } + } +}; +var scanlines_default = `uniform float count; +#ifdef SCROLL +uniform float scrollSpeed; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float y=uv.y; +#ifdef SCROLL +y+=time*scrollSpeed; +#endif +vec2 sl=vec2(sin(y*count),cos(y*count));outputColor=vec4(sl.xyx,inputColor.a);}`; +var ScanlineEffect = class extends Effect { + /** + * Constructs a new scanline effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.OVERLAY] - The blend function of this effect. + * @param {Number} [options.density=1.25] - The scanline density. + * @param {Number} [options.scrollSpeed=0.0] - The scanline scroll speed. + */ + constructor({ blendFunction = BlendFunction.OVERLAY, density = 1.25, scrollSpeed = 0 } = {}) { + super("ScanlineEffect", scanlines_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["count", new Uniform(0)], + ["scrollSpeed", new Uniform(0)] + ]) + }); + this.resolution = new Vector2(); + this.d = density; + this.scrollSpeed = scrollSpeed; + } + /** + * The scanline density. + * + * @type {Number} + */ + get density() { + return this.d; + } + set density(value) { + this.d = value; + this.setSize(this.resolution.width, this.resolution.height); + } + /** + * Returns the current scanline density. + * + * @deprecated Use density instead. + * @return {Number} The scanline density. + */ + getDensity() { + return this.density; + } + /** + * Sets the scanline density. + * + * @deprecated Use density instead. + * @param {Number} value - The new scanline density. + */ + setDensity(value) { + this.density = value; + } + /** + * The scanline scroll speed. Default is 0 (disabled). + * + * @type {Number} + */ + get scrollSpeed() { + return this.uniforms.get("scrollSpeed").value; + } + set scrollSpeed(value) { + this.uniforms.get("scrollSpeed").value = value; + if (value === 0) { + if (this.defines.delete("SCROLL")) { + this.setChanged(); + } + } else if (!this.defines.has("SCROLL")) { + this.defines.set("SCROLL", "1"); + this.setChanged(); + } + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.resolution.set(width, height); + this.uniforms.get("count").value = Math.round(height * this.density); + } +}; +var shock_wave_default = `uniform bool active;uniform vec2 center;uniform float waveSize;uniform float radius;uniform float maxRadius;uniform float amplitude;varying float vSize;void mainUv(inout vec2 uv){if(active){vec2 aspectCorrection=vec2(aspect,1.0);vec2 difference=uv*aspectCorrection-center*aspectCorrection;float distance=sqrt(dot(difference,difference))*vSize;if(distance>radius){if(distance HALF_PI; + if (uActive.value) { + uniforms.get("cameraDistance").value = camera.position.distanceTo(position); + v2.copy(position).project(camera); + this.screenPosition.set((v2.x + 1) * 0.5, (v2.y + 1) * 0.5); + } + this.time += delta * this.speed; + const radius = this.time - waveSize; + uniforms.get("radius").value = radius; + if (radius >= (uniforms.get("maxRadius").value + waveSize) * 2) { + this.active = false; + uActive.value = false; + } + } + } +}; +var SelectiveBloomEffect = class extends BloomEffect { + /** + * Constructs a new selective bloom effect. + * + * @param {Scene} scene - The main scene. + * @param {Camera} camera - The main camera. + * @param {Object} [options] - The options. See {@link BloomEffect} for details. + */ + constructor(scene, camera, options) { + super(options); + this.setAttributes(this.getAttributes() | EffectAttribute.DEPTH); + this.camera = camera; + this.depthPass = new DepthPass(scene, camera); + this.clearPass = new ClearPass(true, false, false); + this.clearPass.overrideClearColor = new Color(0); + this.depthMaskPass = new ShaderPass(new DepthMaskMaterial()); + const depthMaskMaterial = this.depthMaskMaterial; + depthMaskMaterial.copyCameraSettings(camera); + depthMaskMaterial.depthBuffer1 = this.depthPass.texture; + depthMaskMaterial.depthPacking1 = RGBADepthPacking; + depthMaskMaterial.depthMode = EqualDepth; + this.renderTargetMasked = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetMasked.texture.name = "Bloom.Masked"; + this.selection = new Selection(); + this._inverted = false; + this._ignoreBackground = false; + } + set mainScene(value) { + this.depthPass.mainScene = value; + } + set mainCamera(value) { + this.camera = value; + this.depthPass.mainCamera = value; + this.depthMaskMaterial.copyCameraSettings(value); + } + /** + * Returns the selection. + * + * @deprecated Use selection instead. + * @return {Selection} The selection. + */ + getSelection() { + return this.selection; + } + /** + * The depth mask material. + * + * @type {DepthMaskMaterial} + * @private + */ + get depthMaskMaterial() { + return this.depthMaskPass.fullscreenMaterial; + } + /** + * Indicates whether the selection should be considered inverted. + * + * @type {Boolean} + */ + get inverted() { + return this._inverted; + } + set inverted(value) { + this._inverted = value; + this.depthMaskMaterial.depthMode = value ? NotEqualDepth : EqualDepth; + } + /** + * Indicates whether the mask is inverted. + * + * @deprecated Use inverted instead. + * @return {Boolean} Whether the mask is inverted. + */ + isInverted() { + return this.inverted; + } + /** + * Enables or disable mask inversion. + * + * @deprecated Use inverted instead. + * @param {Boolean} value - Whether the mask should be inverted. + */ + setInverted(value) { + this.inverted = value; + } + /** + * Indicates whether the background colors will be ignored. + * + * @type {Boolean} + */ + get ignoreBackground() { + return this._ignoreBackground; + } + set ignoreBackground(value) { + this._ignoreBackground = value; + this.depthMaskMaterial.maxDepthStrategy = value ? DepthTestStrategy.DISCARD_MAX_DEPTH : DepthTestStrategy.KEEP_MAX_DEPTH; + } + /** + * Indicates whether the background is disabled. + * + * @deprecated Use ignoreBackground instead. + * @return {Boolean} Whether the background is disabled. + */ + isBackgroundDisabled() { + return this.ignoreBackground; + } + /** + * Enables or disables the background. + * + * @deprecated Use ignoreBackground instead. + * @param {Boolean} value - Whether the background should be disabled. + */ + setBackgroundDisabled(value) { + this.ignoreBackground = value; + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.depthMaskMaterial.depthBuffer0 = depthTexture; + this.depthMaskMaterial.depthPacking0 = depthPacking; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const camera = this.camera; + const selection = this.selection; + const inverted = this.inverted; + let renderTarget = inputBuffer; + if (this.ignoreBackground || !inverted || selection.size > 0) { + const mask = camera.layers.mask; + camera.layers.set(selection.layer); + this.depthPass.render(renderer); + camera.layers.mask = mask; + renderTarget = this.renderTargetMasked; + this.clearPass.render(renderer, renderTarget); + this.depthMaskPass.render(renderer, inputBuffer, renderTarget); + } + super.update(renderer, renderTarget, deltaTime); + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + super.setSize(width, height); + this.renderTargetMasked.setSize(width, height); + this.depthPass.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + super.initialize(renderer, alpha, frameBufferType); + this.clearPass.initialize(renderer, alpha, frameBufferType); + this.depthPass.initialize(renderer, alpha, frameBufferType); + this.depthMaskPass.initialize(renderer, alpha, frameBufferType); + if (renderer !== null && renderer.capabilities.logarithmicDepthBuffer) { + this.depthMaskPass.fullscreenMaterial.defines.LOG_DEPTH = "1"; + } + if (frameBufferType !== void 0) { + this.renderTargetMasked.texture.type = frameBufferType; + if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTargetMasked.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var sepia_default = `uniform vec3 weightsR;uniform vec3 weightsG;uniform vec3 weightsB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,weightsR),dot(inputColor.rgb,weightsG),dot(inputColor.rgb,weightsB));outputColor=vec4(color,inputColor.a);}`; +var SepiaEffect = class extends Effect { + /** + * Constructs a new sepia effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.intensity=1.0] - The intensity of the effect. + */ + constructor({ blendFunction, intensity = 1 } = {}) { + super("SepiaEffect", sepia_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["weightsR", new Uniform(new Vector3(0.393, 0.769, 0.189))], + ["weightsG", new Uniform(new Vector3(0.349, 0.686, 0.168))], + ["weightsB", new Uniform(new Vector3(0.272, 0.534, 0.131))] + ]) + }); + } + /** + * The intensity. + * + * @deprecated Use blendMode.opacity instead. + * @type {Number} + */ + get intensity() { + return this.blendMode.opacity.value; + } + set intensity(value) { + this.blendMode.opacity.value = value; + } + /** + * Returns the current sepia intensity. + * + * @deprecated Use blendMode.opacity instead. + * @return {Number} The intensity. + */ + getIntensity() { + return this.intensity; + } + /** + * Sets the sepia intensity. + * + * @deprecated Use blendMode.opacity instead. + * @param {Number} value - The intensity. + */ + setIntensity(value) { + this.intensity = value; + } + /** + * The weights for the red channel. Default is `(0.393, 0.769, 0.189)`. + * + * @type {Vector3} + */ + get weightsR() { + return this.uniforms.get("weightsR").value; + } + /** + * The weights for the green channel. Default is `(0.349, 0.686, 0.168)`. + * + * @type {Vector3} + */ + get weightsG() { + return this.uniforms.get("weightsG").value; + } + /** + * The weights for the blue channel. Default is `(0.272, 0.534, 0.131)`. + * + * @type {Vector3} + */ + get weightsB() { + return this.uniforms.get("weightsB").value; + } +}; +var edge_detection_default = `varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; +#if EDGE_DETECTION_MODE != 0 +varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; +#endif +#if EDGE_DETECTION_MODE == 1 +#include +#endif +#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} +#elif PREDICATION_MODE == 2 +uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} +#endif +#if PREDICATION_MODE != 0 +vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} +#endif +#if EDGE_DETECTION_MODE != 0 +uniform sampler2D inputBuffer; +#endif +void main(){ +#if EDGE_DETECTION_MODE == 0 +const vec2 threshold=vec2(DEPTH_THRESHOLD); +#elif PREDICATION_MODE != 0 +vec2 threshold=calculatePredicatedThreshold(); +#else +const vec2 threshold=vec2(EDGE_THRESHOLD); +#endif +#if EDGE_DETECTION_MODE == 0 +vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); +#elif EDGE_DETECTION_MODE == 1 +float l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); +#elif EDGE_DETECTION_MODE == 2 +vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); +#endif +}`; +var edge_detection_default2 = `uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; +#if EDGE_DETECTION_MODE != 0 +varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; +#endif +void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); +#if EDGE_DETECTION_MODE != 0 +vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); +#endif +gl_Position=vec4(position.xy,1.0,1.0);}`; +var EdgeDetectionMaterial = class extends ShaderMaterial { + /** + * Constructs a new edge detection material. + * + * TODO Remove parameters. + * @param {Vector2} [texelSize] - The screen texel size. + * @param {EdgeDetectionMode} [mode=EdgeDetectionMode.COLOR] - The edge detection mode. + */ + constructor(texelSize = new Vector2(), mode = EdgeDetectionMode.COLOR) { + super({ + name: "EdgeDetectionMaterial", + defines: { + THREE_REVISION: REVISION.replace(/\D+/g, ""), + LOCAL_CONTRAST_ADAPTATION_FACTOR: "2.0", + EDGE_THRESHOLD: "0.1", + DEPTH_THRESHOLD: "0.01", + PREDICATION_MODE: "0", + PREDICATION_THRESHOLD: "0.01", + PREDICATION_SCALE: "2.0", + PREDICATION_STRENGTH: "1.0", + DEPTH_PACKING: "0" + }, + uniforms: { + inputBuffer: new Uniform(null), + depthBuffer: new Uniform(null), + predicationBuffer: new Uniform(null), + texelSize: new Uniform(texelSize) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: edge_detection_default, + vertexShader: edge_detection_default2 + }); + this.edgeDetectionMode = mode; + } + /** + * The depth buffer. + * + * @type {Texture} + */ + set depthBuffer(value) { + this.uniforms.depthBuffer.value = value; + } + /** + * The depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set depthPacking(value) { + this.defines.DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the depth buffer. + * + * @deprecated Use depthBuffer and depthPacking instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthBuffer(buffer, depthPacking = BasicDepthPacking) { + this.depthBuffer = buffer; + this.depthPacking = depthPacking; + } + /** + * The edge detection mode. + * + * @type {EdgeDetectionMode} + */ + get edgeDetectionMode() { + return Number(this.defines.EDGE_DETECTION_MODE); + } + set edgeDetectionMode(value) { + this.defines.EDGE_DETECTION_MODE = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Returns the edge detection mode. + * + * @deprecated Use edgeDetectionMode instead. + * @return {EdgeDetectionMode} The mode. + */ + getEdgeDetectionMode() { + return this.edgeDetectionMode; + } + /** + * Sets the edge detection mode. + * + * @deprecated Use edgeDetectionMode instead. + * @param {EdgeDetectionMode} value - The edge detection mode. + */ + setEdgeDetectionMode(value) { + this.edgeDetectionMode = value; + } + /** + * The local contrast adaptation factor. Has no effect if the edge detection mode is set to DEPTH. Default is 2.0. + * + * If a neighbor edge has _factor_ times bigger contrast than the current edge, the edge will be discarded. + * + * This allows to eliminate spurious crossing edges and is based on the fact that if there is too much contrast in a + * direction, the perceptual contrast in the other neighbors will be hidden. + * + * @type {Number} + */ + get localContrastAdaptationFactor() { + return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR); + } + set localContrastAdaptationFactor(value) { + this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR = value.toFixed("6"); + this.needsUpdate = true; + } + /** + * Returns the local contrast adaptation factor. + * + * @deprecated Use localContrastAdaptationFactor instead. + * @return {Number} The factor. + */ + getLocalContrastAdaptationFactor() { + return this.localContrastAdaptationFactor; + } + /** + * Sets the local contrast adaptation factor. Has no effect if the edge detection mode is set to DEPTH. + * + * @deprecated Use localContrastAdaptationFactor instead. + * @param {Number} value - The local contrast adaptation factor. Default is 2.0. + */ + setLocalContrastAdaptationFactor(value) { + this.localContrastAdaptationFactor = value; + } + /** + * The edge detection threshold. Range: [0.0, 0.5]. + * + * A lower value results in more edges being detected at the expense of performance. + * + * For luma- and chroma-based edge detection, 0.1 is a reasonable value and allows to catch most visible edges. 0.05 + * is a rather overkill value that allows to catch 'em all. Darker scenes may require an even lower threshold. + * + * If depth-based edge detection is used, the threshold will depend on the scene depth. + * + * @type {Number} + */ + get edgeDetectionThreshold() { + return Number(this.defines.EDGE_THRESHOLD); + } + set edgeDetectionThreshold(value) { + this.defines.EDGE_THRESHOLD = value.toFixed("6"); + this.defines.DEPTH_THRESHOLD = (value * 0.1).toFixed("6"); + this.needsUpdate = true; + } + /** + * Returns the edge detection threshold. + * + * @deprecated Use edgeDetectionThreshold instead. + * @return {Number} The threshold. + */ + getEdgeDetectionThreshold() { + return this.edgeDetectionThreshold; + } + /** + * Sets the edge detection threshold. + * + * @deprecated Use edgeDetectionThreshold instead. + * @param {Number} value - The edge detection threshold. Range: [0.0, 0.5]. + */ + setEdgeDetectionThreshold(value) { + this.edgeDetectionThreshold = value; + } + /** + * The predication mode. + * + * Predicated thresholding allows to better preserve texture details and to improve edge detection using an additional + * buffer such as a light accumulation or depth buffer. + * + * @type {PredicationMode} + */ + get predicationMode() { + return Number(this.defines.PREDICATION_MODE); + } + set predicationMode(value) { + this.defines.PREDICATION_MODE = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Returns the predication mode. + * + * @deprecated Use predicationMode instead. + * @return {PredicationMode} The mode. + */ + getPredicationMode() { + return this.predicationMode; + } + /** + * Sets the predication mode. + * + * @deprecated Use predicationMode instead. + * @param {PredicationMode} value - The predication mode. + */ + setPredicationMode(value) { + this.predicationMode = value; + } + /** + * The predication buffer. + * + * @type {Texture} + */ + set predicationBuffer(value) { + this.uniforms.predicationBuffer.value = value; + } + /** + * Sets a custom predication buffer. + * + * @deprecated Use predicationBuffer instead. + * @param {Texture} value - The predication buffer. + */ + setPredicationBuffer(value) { + this.uniforms.predicationBuffer.value = value; + } + /** + * The predication threshold. + * + * @type {Number} + */ + get predicationThreshold() { + return Number(this.defines.PREDICATION_THRESHOLD); + } + set predicationThreshold(value) { + this.defines.PREDICATION_THRESHOLD = value.toFixed("6"); + this.needsUpdate = true; + } + /** + * Returns the predication threshold. + * + * @deprecated Use predicationThreshold instead. + * @return {Number} The threshold. + */ + getPredicationThreshold() { + return this.predicationThreshold; + } + /** + * Sets the predication threshold. + * + * @deprecated Use predicationThreshold instead. + * @param {Number} value - The threshold. + */ + setPredicationThreshold(value) { + this.predicationThreshold = value; + } + /** + * The predication scale. Range: [1.0, 5.0]. + * + * Determines how much the edge detection threshold should be scaled when using predication. + * + * @type {Boolean|Texture|Number} + */ + get predicationScale() { + return Number(this.defines.PREDICATION_SCALE); + } + set predicationScale(value) { + this.defines.PREDICATION_SCALE = value.toFixed("6"); + this.needsUpdate = true; + } + /** + * Returns the predication scale. + * + * @deprecated Use predicationScale instead. + * @return {Number} The scale. + */ + getPredicationScale() { + return this.predicationScale; + } + /** + * Sets the predication scale. + * + * @deprecated Use predicationScale instead. + * @param {Number} value - The scale. Range: [1.0, 5.0]. + */ + setPredicationScale(value) { + this.predicationScale = value; + } + /** + * The predication strength. Range: [0.0, 1.0]. + * + * Determines how much the edge detection threshold should be decreased locally when using predication. + * + * @type {Number} + */ + get predicationStrength() { + return Number(this.defines.PREDICATION_STRENGTH); + } + set predicationStrength(value) { + this.defines.PREDICATION_STRENGTH = value.toFixed("6"); + this.needsUpdate = true; + } + /** + * Returns the predication strength. + * + * @deprecated Use predicationStrength instead. + * @return {Number} The strength. + */ + getPredicationStrength() { + return this.predicationStrength; + } + /** + * Sets the predication strength. + * + * @deprecated Use predicationStrength instead. + * @param {Number} value - The strength. Range: [0.0, 1.0]. + */ + setPredicationStrength(value) { + this.predicationStrength = value; + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +var smaa_weights_default = `#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) +#if __VERSION__ < 300 +#define round(v) floor(v + 0.5) +#endif +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ +#if !defined(DISABLE_CORNER_DETECTION) +vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); +#endif +}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ +#if !defined(DISABLE_CORNER_DETECTION) +vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); +#endif +}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ +#if !defined(DISABLE_DIAG_DETECTION) +weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ +#endif +vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); +#if !defined(DISABLE_DIAG_DETECTION) +}else{e.r=0.0;} +#endif +}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`; +var smaa_weights_default2 = `uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}`; +var SMAAWeightsMaterial = class extends ShaderMaterial { + /** + * Constructs a new SMAA weights material. + * + * @param {Vector2} [texelSize] - The absolute screen texel size. + * @param {Vector2} [resolution] - The resolution. + */ + constructor(texelSize = new Vector2(), resolution = new Vector2()) { + super({ + name: "SMAAWeightsMaterial", + defines: { + // Configurable settings: + MAX_SEARCH_STEPS_INT: "16", + MAX_SEARCH_STEPS_FLOAT: "16.0", + MAX_SEARCH_STEPS_DIAG_INT: "8", + MAX_SEARCH_STEPS_DIAG_FLOAT: "8.0", + CORNER_ROUNDING: "25", + CORNER_ROUNDING_NORM: "0.25", + // Non-configurable settings: + AREATEX_MAX_DISTANCE: "16.0", + AREATEX_MAX_DISTANCE_DIAG: "20.0", + AREATEX_PIXEL_SIZE: "(1.0 / vec2(160.0, 560.0))", + AREATEX_SUBTEX_SIZE: "(1.0 / 7.0)", + SEARCHTEX_SIZE: "vec2(66.0, 33.0)", + SEARCHTEX_PACKED_SIZE: "vec2(64.0, 16.0)" + }, + uniforms: { + inputBuffer: new Uniform(null), + searchTexture: new Uniform(null), + areaTexture: new Uniform(null), + resolution: new Uniform(resolution), + texelSize: new Uniform(texelSize) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: smaa_weights_default, + vertexShader: smaa_weights_default2 + }); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The search lookup texture. + * + * @type {Texture} + */ + get searchTexture() { + return this.uniforms.searchTexture.value; + } + set searchTexture(value) { + this.uniforms.searchTexture.value = value; + } + /** + * The area lookup texture. + * + * @type {Texture} + */ + get areaTexture() { + return this.uniforms.areaTexture.value; + } + set areaTexture(value) { + this.uniforms.areaTexture.value = value; + } + /** + * Sets the search and area lookup textures. + * + * @deprecated Use searchTexture and areaTexture instead. + * @param {Texture} search - The search lookup texture. + * @param {Texture} area - The area lookup texture. + */ + setLookupTextures(search, area2) { + this.searchTexture = search; + this.areaTexture = area2; + } + /** + * The maximum amount of steps performed in the horizontal/vertical pattern searches, at each side of the pixel. + * Range: [0, 112]. + * + * In number of pixels, it's actually the double. So the maximum line length perfectly handled by, for example 16, is + * 64 (perfectly means that longer lines won't look as good, but are still antialiased). + * + * @type {Number} + */ + get orthogonalSearchSteps() { + return Number(this.defines.MAX_SEARCH_STEPS_INT); + } + set orthogonalSearchSteps(value) { + const s = Math.min(Math.max(value, 0), 112); + this.defines.MAX_SEARCH_STEPS_INT = s.toFixed("0"); + this.defines.MAX_SEARCH_STEPS_FLOAT = s.toFixed("1"); + this.needsUpdate = true; + } + /** + * Sets the maximum amount of steps performed in the horizontal/vertical pattern searches, at each side of the pixel. + * + * @deprecated Use orthogonalSearchSteps instead. + * @param {Number} value - The search steps. Range: [0, 112]. + */ + setOrthogonalSearchSteps(value) { + this.orthogonalSearchSteps = value; + } + /** + * The maximum steps performed in the diagonal pattern searches, at each side of the pixel. This search + * jumps one pixel at a time. Range: [0, 20]. + * + * On high-end machines this search is cheap (between 0.8x and 0.9x slower for 16 steps), but it can have a + * significant impact on older machines. + * + * @type {Number} + */ + get diagonalSearchSteps() { + return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT); + } + set diagonalSearchSteps(value) { + const s = Math.min(Math.max(value, 0), 20); + this.defines.MAX_SEARCH_STEPS_DIAG_INT = s.toFixed("0"); + this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT = s.toFixed("1"); + this.needsUpdate = true; + } + /** + * Specifies the maximum steps performed in the diagonal pattern searches, at each side of the pixel. + * + * @deprecated Use diagonalSearchSteps instead. + * @param {Number} value - The search steps. Range: [0, 20]. + */ + setDiagonalSearchSteps(value) { + this.diagonalSearchSteps = value; + } + /** + * Indicates whether diagonal pattern detection is enabled. + * + * @type {Boolean} + */ + get diagonalDetection() { + return this.defines.DISABLE_DIAG_DETECTION === void 0; + } + set diagonalDetection(value) { + if (value) { + delete this.defines.DISABLE_DIAG_DETECTION; + } else { + this.defines.DISABLE_DIAG_DETECTION = "1"; + } + this.needsUpdate = true; + } + /** + * Indicates whether diagonal pattern detection is enabled. + * + * @deprecated Use diagonalDetection instead. + * @return {Boolean} Whether diagonal pattern detection is enabled. + */ + isDiagonalDetectionEnabled() { + return this.diagonalDetection; + } + /** + * Enables or disables diagonal pattern detection. + * + * @deprecated Use diagonalDetection instead. + * @param {Boolean} value - Whether diagonal pattern detection should be enabled. + */ + setDiagonalDetectionEnabled(value) { + this.diagonalDetection = value; + } + /** + * Specifies how much sharp corners will be rounded. Range: [0, 100]. + * + * @type {Number} + */ + get cornerRounding() { + return Number(this.defines.CORNER_ROUNDING); + } + set cornerRounding(value) { + const r = Math.min(Math.max(value, 0), 100); + this.defines.CORNER_ROUNDING = r.toFixed("4"); + this.defines.CORNER_ROUNDING_NORM = (r / 100).toFixed("4"); + this.needsUpdate = true; + } + /** + * Specifies how much sharp corners will be rounded. + * + * @deprecated Use cornerRounding instead. + * @param {Number} value - The corner rounding amount. Range: [0, 100]. + */ + setCornerRounding(value) { + this.cornerRounding = value; + } + /** + * Indicates whether corner detection is enabled. + * + * @type {Number} + */ + get cornerDetection() { + return this.defines.DISABLE_CORNER_DETECTION === void 0; + } + set cornerDetection(value) { + if (value) { + delete this.defines.DISABLE_CORNER_DETECTION; + } else { + this.defines.DISABLE_CORNER_DETECTION = "1"; + } + this.needsUpdate = true; + } + /** + * Indicates whether corner rounding is enabled. + * + * @deprecated Use cornerDetection instead. + * @return {Boolean} Whether corner rounding is enabled. + */ + isCornerRoundingEnabled() { + return this.cornerDetection; + } + /** + * Enables or disables corner rounding. + * + * @deprecated Use cornerDetection instead. + * @param {Boolean} value - Whether corner rounding should be enabled. + */ + setCornerRoundingEnabled(value) { + this.cornerDetection = value; + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const uniforms = this.uniforms; + uniforms.texelSize.value.set(1 / width, 1 / height); + uniforms.resolution.value.set(width, height); + } +}; +var searchImageDataURL_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC"; +var areaImageDataURL_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA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0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC"; +var smaa_default = `uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}`; +var smaa_default2 = `varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}`; +var SMAAEffect = class extends Effect { + /** + * Constructs a new SMAA effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + * @param {SMAAPreset} [options.preset=SMAAPreset.MEDIUM] - The quality preset. + * @param {EdgeDetectionMode} [options.edgeDetectionMode=EdgeDetectionMode.COLOR] - The edge detection mode. + * @param {PredicationMode} [options.predicationMode=PredicationMode.DISABLED] - The predication mode. + */ + constructor({ + blendFunction = BlendFunction.SRC, + preset = SMAAPreset.MEDIUM, + edgeDetectionMode = EdgeDetectionMode.COLOR, + predicationMode = PredicationMode.DISABLED + } = {}) { + super("SMAAEffect", smaa_default, { + vertexShader: smaa_default2, + blendFunction, + attributes: EffectAttribute.CONVOLUTION | EffectAttribute.DEPTH, + uniforms: /* @__PURE__ */ new Map([ + ["weightMap", new Uniform(null)] + ]) + }); + let searchImage, areaImage; + if (arguments.length > 1) { + searchImage = arguments[0]; + areaImage = arguments[1]; + if (arguments.length > 2) { + preset = arguments[2]; + } + if (arguments.length > 3) { + edgeDetectionMode = arguments[3]; + } + } + this.renderTargetEdges = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetEdges.texture.name = "SMAA.Edges"; + this.renderTargetWeights = this.renderTargetEdges.clone(); + this.renderTargetWeights.texture.name = "SMAA.Weights"; + this.uniforms.get("weightMap").value = this.renderTargetWeights.texture; + this.clearPass = new ClearPass(true, false, false); + this.clearPass.overrideClearColor = new Color(0); + this.clearPass.overrideClearAlpha = 1; + this.edgeDetectionPass = new ShaderPass(new EdgeDetectionMaterial()); + this.edgeDetectionMaterial.edgeDetectionMode = edgeDetectionMode; + this.edgeDetectionMaterial.predicationMode = predicationMode; + this.weightsPass = new ShaderPass(new SMAAWeightsMaterial()); + const loadingManager = new LoadingManager(); + loadingManager.onLoad = () => { + const searchTexture = new Texture(searchImage); + searchTexture.name = "SMAA.Search"; + searchTexture.magFilter = NearestFilter; + searchTexture.minFilter = NearestFilter; + searchTexture.generateMipmaps = false; + searchTexture.needsUpdate = true; + searchTexture.flipY = true; + this.weightsMaterial.searchTexture = searchTexture; + const areaTexture = new Texture(areaImage); + areaTexture.name = "SMAA.Area"; + areaTexture.magFilter = LinearFilter; + areaTexture.minFilter = LinearFilter; + areaTexture.generateMipmaps = false; + areaTexture.needsUpdate = true; + areaTexture.flipY = false; + this.weightsMaterial.areaTexture = areaTexture; + this.dispatchEvent({ type: "load" }); + }; + loadingManager.itemStart("search"); + loadingManager.itemStart("area"); + if (searchImage !== void 0 && areaImage !== void 0) { + loadingManager.itemEnd("search"); + loadingManager.itemEnd("area"); + } else if (typeof Image !== "undefined") { + searchImage = new Image(); + areaImage = new Image(); + searchImage.addEventListener("load", () => loadingManager.itemEnd("search")); + areaImage.addEventListener("load", () => loadingManager.itemEnd("area")); + searchImage.src = searchImageDataURL_default; + areaImage.src = areaImageDataURL_default; + } + this.applyPreset(preset); + } + /** + * The edges texture. + * + * @type {Texture} + */ + get edgesTexture() { + return this.renderTargetEdges.texture; + } + /** + * Returns the edges texture. + * + * @deprecated Use edgesTexture instead. + * @return {Texture} The texture. + */ + getEdgesTexture() { + return this.edgesTexture; + } + /** + * The edge weights texture. + * + * @type {Texture} + */ + get weightsTexture() { + return this.renderTargetWeights.texture; + } + /** + * Returns the edge weights texture. + * + * @deprecated Use weightsTexture instead. + * @return {Texture} The texture. + */ + getWeightsTexture() { + return this.weightsTexture; + } + /** + * The edge detection material. + * + * @type {EdgeDetectionMaterial} + */ + get edgeDetectionMaterial() { + return this.edgeDetectionPass.fullscreenMaterial; + } + /** + * The edge detection material. + * + * @type {EdgeDetectionMaterial} + * @deprecated Use edgeDetectionMaterial instead. + */ + get colorEdgesMaterial() { + return this.edgeDetectionMaterial; + } + /** + * Returns the edge detection material. + * + * @deprecated Use edgeDetectionMaterial instead. + * @return {EdgeDetectionMaterial} The material. + */ + getEdgeDetectionMaterial() { + return this.edgeDetectionMaterial; + } + /** + * The edge weights material. + * + * @type {SMAAWeightsMaterial} + */ + get weightsMaterial() { + return this.weightsPass.fullscreenMaterial; + } + /** + * Returns the edge weights material. + * + * @deprecated Use weightsMaterial instead. + * @return {SMAAWeightsMaterial} The material. + */ + getWeightsMaterial() { + return this.weightsMaterial; + } + /** + * Sets the edge detection sensitivity. + * + * See {@link EdgeDetectionMaterial#setEdgeDetectionThreshold} for more details. + * + * @deprecated Use edgeDetectionMaterial instead. + * @param {Number} threshold - The edge detection sensitivity. Range: [0.05, 0.5]. + */ + setEdgeDetectionThreshold(threshold) { + this.edgeDetectionMaterial.edgeDetectionThreshold = threshold; + } + /** + * Sets the maximum amount of horizontal/vertical search steps. + * + * See {@link SMAAWeightsMaterial#setOrthogonalSearchSteps} for more details. + * + * @deprecated Use weightsMaterial instead. + * @param {Number} steps - The search steps. Range: [0, 112]. + */ + setOrthogonalSearchSteps(steps) { + this.weightsMaterial.orthogonalSearchSteps = steps; + } + /** + * Applies the given quality preset. + * + * @param {SMAAPreset} preset - The preset. + */ + applyPreset(preset) { + const edgeDetectionMaterial = this.edgeDetectionMaterial; + const weightsMaterial = this.weightsMaterial; + switch (preset) { + case SMAAPreset.LOW: + edgeDetectionMaterial.edgeDetectionThreshold = 0.15; + weightsMaterial.orthogonalSearchSteps = 4; + weightsMaterial.diagonalDetection = false; + weightsMaterial.cornerDetection = false; + break; + case SMAAPreset.MEDIUM: + edgeDetectionMaterial.edgeDetectionThreshold = 0.1; + weightsMaterial.orthogonalSearchSteps = 8; + weightsMaterial.diagonalDetection = false; + weightsMaterial.cornerDetection = false; + break; + case SMAAPreset.HIGH: + edgeDetectionMaterial.edgeDetectionThreshold = 0.1; + weightsMaterial.orthogonalSearchSteps = 16; + weightsMaterial.diagonalSearchSteps = 8; + weightsMaterial.cornerRounding = 25; + weightsMaterial.diagonalDetection = true; + weightsMaterial.cornerDetection = true; + break; + case SMAAPreset.ULTRA: + edgeDetectionMaterial.edgeDetectionThreshold = 0.05; + weightsMaterial.orthogonalSearchSteps = 32; + weightsMaterial.diagonalSearchSteps = 16; + weightsMaterial.cornerRounding = 25; + weightsMaterial.diagonalDetection = true; + weightsMaterial.cornerDetection = true; + break; + } + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.edgeDetectionMaterial.depthBuffer = depthTexture; + this.edgeDetectionMaterial.depthPacking = depthPacking; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + this.clearPass.render(renderer, this.renderTargetEdges); + this.edgeDetectionPass.render(renderer, inputBuffer, this.renderTargetEdges); + this.weightsPass.render(renderer, this.renderTargetEdges, this.renderTargetWeights); + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.edgeDetectionMaterial.setSize(width, height); + this.weightsMaterial.setSize(width, height); + this.renderTargetEdges.setSize(width, height); + this.renderTargetWeights.setSize(width, height); + } + /** + * Deletes internal render targets and textures. + */ + dispose() { + const { searchTexture, areaTexture } = this.weightsMaterial; + if (searchTexture !== null && areaTexture !== null) { + searchTexture.dispose(); + areaTexture.dispose(); + } + super.dispose(); + } + /** + * The SMAA search image, encoded as a base64 data URL. + * + * @type {String} + * @deprecated + */ + static get searchImageDataURL() { + return searchImageDataURL_default; + } + /** + * The SMAA area image, encoded as a base64 data URL. + * + * @type {String} + * @deprecated + */ + static get areaImageDataURL() { + return areaImageDataURL_default; + } +}; +var ssao_default = `#include +#include +#ifdef NORMAL_DEPTH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D normalDepthBuffer; +#else +uniform mediump sampler2D normalDepthBuffer; +#endif +float readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;} +#else +uniform lowp sampler2D normalBuffer; +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +} +#endif +uniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform vec2 cameraNearFar;uniform float intensity;uniform float minRadiusScale;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#else +return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#endif +}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){float radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;float noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i1.0||coords.t<0.0||coords.t>1.0){continue;}float sampleDepth=readDepth(coords);float viewZ=getViewZ(sampleDepth); +#ifdef PERSPECTIVE_CAMERA +float linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y); +#else +float linearSampleDepth=sampleDepth; +#endif +float proximity=abs(depth-linearSampleDepth);if(proximity +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +#ifdef DOWNSAMPLE_NORMALS +uniform lowp sampler2D normalBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i] this.setSize(resolution.baseWidth, resolution.baseHeight)); + } + /** + * The normal(RGB) + depth(A) texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * Returns the normal(RGB) + depth(A) texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTarget.texture; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.fullscreenMaterial.depthBuffer = depthTexture; + this.fullscreenMaterial.depthPacking = depthPacking; + } + /** + * Downsamples depth and scene normals. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget); + renderer.render(this.scene, this.camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + this.renderTarget.setSize(resolution.width, resolution.height); + this.fullscreenMaterial.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + const gl = renderer.getContext(); + const renderable = gl.getExtension("EXT_color_buffer_float") || gl.getExtension("EXT_color_buffer_half_float"); + if (!renderable) { + throw new Error("Rendering to float texture is not supported."); + } + } +}; +var ssao_default3 = `uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity; +#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D normalDepthBuffer; +#else +uniform mediump sampler2D normalDepthBuffer; +#endif +#endif +#ifdef COLORIZE +uniform vec3 color; +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r; +#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300 +vec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distance this.setSize(resolution.baseWidth, resolution.baseHeight)); + this.camera = camera; + this.depthDownsamplingPass = new DepthDownsamplingPass({ normalBuffer, resolutionScale }); + this.depthDownsamplingPass.enabled = normalDepthBuffer === null; + this.ssaoPass = new ShaderPass(new SSAOMaterial(camera)); + const noiseTexture = new NoiseTexture(NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, RGBAFormat); + noiseTexture.wrapS = noiseTexture.wrapT = RepeatWrapping; + const ssaoMaterial = this.ssaoMaterial; + ssaoMaterial.normalBuffer = normalBuffer; + ssaoMaterial.noiseTexture = noiseTexture; + ssaoMaterial.minRadiusScale = minRadiusScale; + ssaoMaterial.samples = samples; + ssaoMaterial.radius = radius; + ssaoMaterial.rings = rings; + ssaoMaterial.fade = fade; + ssaoMaterial.bias = bias; + ssaoMaterial.distanceThreshold = distanceThreshold; + ssaoMaterial.distanceFalloff = distanceFalloff; + ssaoMaterial.proximityThreshold = rangeThreshold; + ssaoMaterial.proximityFalloff = rangeFalloff; + if (worldDistanceThreshold !== void 0) { + ssaoMaterial.worldDistanceThreshold = worldDistanceThreshold; + } + if (worldDistanceFalloff !== void 0) { + ssaoMaterial.worldDistanceFalloff = worldDistanceFalloff; + } + if (worldProximityThreshold !== void 0) { + ssaoMaterial.worldProximityThreshold = worldProximityThreshold; + } + if (worldProximityFalloff !== void 0) { + ssaoMaterial.worldProximityFalloff = worldProximityFalloff; + } + if (normalDepthBuffer !== null) { + this.ssaoMaterial.normalDepthBuffer = normalDepthBuffer; + this.defines.set("NORMAL_DEPTH", "1"); + } + this.depthAwareUpsampling = depthAwareUpsampling; + this.color = color2; + } + set mainCamera(value) { + this.camera = value; + this.ssaoMaterial.copyCameraSettings(value); + } + /** + * Sets the normal buffer. + * + * @type {Texture} + */ + get normalBuffer() { + return this.ssaoMaterial.normalBuffer; + } + set normalBuffer(value) { + this.ssaoMaterial.normalBuffer = value; + this.depthDownsamplingPass.fullscreenMaterial.normalBuffer = value; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * The SSAO material. + * + * @type {SSAOMaterial} + */ + get ssaoMaterial() { + return this.ssaoPass.fullscreenMaterial; + } + /** + * Returns the SSAO material. + * + * @deprecated Use ssaoMaterial instead. + * @return {SSAOMaterial} The material. + */ + getSSAOMaterial() { + return this.ssaoMaterial; + } + /** + * The amount of occlusion samples per pixel. + * + * @type {Number} + * @deprecated Use ssaoMaterial.samples instead. + */ + get samples() { + return this.ssaoMaterial.samples; + } + set samples(value) { + this.ssaoMaterial.samples = value; + } + /** + * The amount of spiral turns in the occlusion sampling pattern. + * + * @type {Number} + * @deprecated Use ssaoMaterial.rings instead. + */ + get rings() { + return this.ssaoMaterial.rings; + } + set rings(value) { + this.ssaoMaterial.rings = value; + } + /** + * The occlusion sampling radius. + * + * @type {Number} + * @deprecated Use ssaoMaterial.radius instead. + */ + get radius() { + return this.ssaoMaterial.radius; + } + set radius(value) { + this.ssaoMaterial.radius = value; + } + /** + * Indicates whether depth-aware upsampling is enabled. + * + * @type {Boolean} + */ + get depthAwareUpsampling() { + return this.defines.has("DEPTH_AWARE_UPSAMPLING"); + } + set depthAwareUpsampling(value) { + if (this.depthAwareUpsampling !== value) { + if (value) { + this.defines.set("DEPTH_AWARE_UPSAMPLING", "1"); + } else { + this.defines.delete("DEPTH_AWARE_UPSAMPLING"); + } + this.setChanged(); + } + } + /** + * Indicates whether depth-aware upsampling is enabled. + * + * @deprecated Use depthAwareUpsampling instead. + * @return {Boolean} Whether depth-aware upsampling is enabled. + */ + isDepthAwareUpsamplingEnabled() { + return this.depthAwareUpsampling; + } + /** + * Enables or disables depth-aware upsampling. + * + * @deprecated Use depthAwareUpsampling instead. + * @param {Boolean} value - Whether depth-aware upsampling should be enabled. + */ + setDepthAwareUpsamplingEnabled(value) { + this.depthAwareUpsampling = value; + } + /** + * Indicates whether distance-based radius scaling is enabled. + * + * @type {Boolean} + * @deprecated + */ + get distanceScaling() { + return true; + } + set distanceScaling(value) { + } + /** + * The color of the ambient occlusion. Set to `null` to disable. + * + * @type {Color} + */ + get color() { + return this.uniforms.get("color").value; + } + set color(value) { + const uniforms = this.uniforms; + const defines = this.defines; + if (value !== null) { + if (defines.has("COLORIZE")) { + uniforms.get("color").value.set(value); + } else { + defines.set("COLORIZE", "1"); + uniforms.get("color").value = new Color(value); + this.setChanged(); + } + } else if (defines.has("COLORIZE")) { + defines.delete("COLORIZE"); + uniforms.get("color").value = null; + this.setChanged(); + } + } + /** + * The luminance influence factor. Range: [0.0, 1.0]. + * + * @type {Boolean} + */ + get luminanceInfluence() { + return this.uniforms.get("luminanceInfluence").value; + } + set luminanceInfluence(value) { + this.uniforms.get("luminanceInfluence").value = value; + } + /** + * The intensity. + * + * @type {Number} + */ + get intensity() { + return this.uniforms.get("intensity").value; + } + set intensity(value) { + this.uniforms.get("intensity").value = value; + } + /** + * Returns the color of the ambient occlusion. + * + * @deprecated Use color instead. + * @return {Color} The color. + */ + getColor() { + return this.color; + } + /** + * Sets the color of the ambient occlusion. Set to `null` to disable colorization. + * + * @deprecated Use color instead. + * @param {Color} value - The color. + */ + setColor(value) { + this.color = value; + } + /** + * Sets the occlusion distance cutoff. + * + * @deprecated Use ssaoMaterial instead. + * @param {Number} threshold - The distance threshold. Range [0.0, 1.0]. + * @param {Number} falloff - The falloff. Range [0.0, 1.0]. + */ + setDistanceCutoff(threshold, falloff) { + this.ssaoMaterial.distanceThreshold = threshold; + this.ssaoMaterial.distanceFalloff = falloff; + } + /** + * Sets the occlusion proximity cutoff. + * + * @deprecated Use ssaoMaterial instead. + * @param {Number} threshold - The proximity threshold. Range [0.0, 1.0]. + * @param {Number} falloff - The falloff. Range [0.0, 1.0]. + */ + setProximityCutoff(threshold, falloff) { + this.ssaoMaterial.proximityThreshold = threshold; + this.ssaoMaterial.proximityFalloff = falloff; + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.depthDownsamplingPass.setDepthTexture(depthTexture, depthPacking); + this.ssaoMaterial.depthBuffer = depthTexture; + this.ssaoMaterial.depthPacking = depthPacking; + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + const renderTarget = this.renderTarget; + if (this.depthDownsamplingPass.enabled) { + this.depthDownsamplingPass.render(renderer); + } + this.ssaoPass.render(renderer, null, renderTarget); + } + /** + * Sets the size. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.ssaoMaterial.copyCameraSettings(this.camera); + this.ssaoMaterial.setSize(w, h); + this.renderTarget.setSize(w, h); + this.depthDownsamplingPass.resolution.scale = resolution.scale; + this.depthDownsamplingPass.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + try { + let normalDepthBuffer = this.uniforms.get("normalDepthBuffer").value; + if (normalDepthBuffer === null) { + this.depthDownsamplingPass.initialize(renderer, alpha, frameBufferType); + normalDepthBuffer = this.depthDownsamplingPass.texture; + this.uniforms.get("normalDepthBuffer").value = normalDepthBuffer; + this.ssaoMaterial.normalDepthBuffer = normalDepthBuffer; + this.defines.set("NORMAL_DEPTH", "1"); + } + } catch (e) { + this.depthDownsamplingPass.enabled = false; + } + } +}; +var texture_default = `#ifdef TEXTURE_PRECISION_HIGH +uniform mediump sampler2D map; +#else +uniform lowp sampler2D map; +#endif +varying vec2 vUv2;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){ +#ifdef UV_TRANSFORM +vec4 texel=texture2D(map,vUv2); +#else +vec4 texel=texture2D(map,uv); +#endif +outputColor=TEXEL;outputColor.a=max(inputColor.a,outputColor.a);}`; +var texture_default2 = `#ifdef ASPECT_CORRECTION +uniform float scale; +#else +uniform mat3 uvTransform; +#endif +varying vec2 vUv2;void mainSupport(const in vec2 uv){ +#ifdef ASPECT_CORRECTION +vUv2=uv*vec2(aspect,1.0)*scale; +#else +vUv2=(uvTransform*vec3(uv,1.0)).xy; +#endif +}`; +var TextureEffect = class extends Effect { + /** + * Constructs a new texture effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Texture} [options.texture] - A texture. + * @param {Boolean} [options.aspectCorrection=false] - Deprecated. Adjust the texture's offset, repeat and center instead. + */ + constructor({ blendFunction, texture = null, aspectCorrection = false } = {}) { + super("TextureEffect", texture_default, { + blendFunction, + defines: /* @__PURE__ */ new Map([ + ["TEXEL", "texel"] + ]), + uniforms: /* @__PURE__ */ new Map([ + ["map", new Uniform(null)], + ["scale", new Uniform(1)], + ["uvTransform", new Uniform(null)] + ]) + }); + this.texture = texture; + this.aspectCorrection = aspectCorrection; + } + /** + * The texture. + * + * @type {Texture} + */ + get texture() { + return this.uniforms.get("map").value; + } + set texture(value) { + const prevTexture = this.texture; + const uniforms = this.uniforms; + const defines = this.defines; + if (prevTexture !== value) { + uniforms.get("map").value = value; + uniforms.get("uvTransform").value = value.matrix; + defines.delete("TEXTURE_PRECISION_HIGH"); + if (value !== null) { + if (value.matrixAutoUpdate) { + defines.set("UV_TRANSFORM", "1"); + this.setVertexShader(texture_default2); + } else { + defines.delete("UV_TRANSFORM"); + this.setVertexShader(null); + } + if (value.type !== UnsignedByteType) { + defines.set("TEXTURE_PRECISION_HIGH", "1"); + } + if (prevTexture === null || prevTexture.type !== value.type || prevTexture.encoding !== value.encoding) { + this.setChanged(); + } + } + } + } + /** + * Returns the texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.texture; + } + /** + * Sets the texture. + * + * @deprecated Use texture instead. + * @param {Texture} value - The texture. + */ + setTexture(value) { + this.texture = value; + } + /** + * Indicates whether aspect correction is enabled. + * + * @type {Number} + * @deprecated Adjust the texture's offset, repeat, rotation and center instead. + */ + get aspectCorrection() { + return this.defines.has("ASPECT_CORRECTION"); + } + set aspectCorrection(value) { + if (this.aspectCorrection !== value) { + if (value) { + this.defines.set("ASPECT_CORRECTION", "1"); + } else { + this.defines.delete("ASPECT_CORRECTION"); + } + this.setChanged(); + } + } + /** + * Indicates whether the texture UV coordinates will be transformed using the transformation matrix of the texture. + * + * @type {Boolean} + * @deprecated Use texture.matrixAutoUpdate instead. + */ + get uvTransform() { + const texture = this.texture; + return texture !== null && texture.matrixAutoUpdate; + } + set uvTransform(value) { + const texture = this.texture; + if (texture !== null) { + texture.matrixAutoUpdate = value; + } + } + /** + * Sets the swizzles that will be applied to the components of a texel before it is written to the output color. + * + * @param {ColorChannel} r - The swizzle for the `r` component. + * @param {ColorChannel} [g=r] - The swizzle for the `g` component. + * @param {ColorChannel} [b=r] - The swizzle for the `b` component. + * @param {ColorChannel} [a=r] - The swizzle for the `a` component. + */ + setTextureSwizzleRGBA(r, g = r, b = r, a = r) { + const rgba = "rgba"; + let swizzle = ""; + if (r !== ColorChannel.RED || g !== ColorChannel.GREEN || b !== ColorChannel.BLUE || a !== ColorChannel.ALPHA) { + swizzle = [".", rgba[r], rgba[g], rgba[b], rgba[a]].join(""); + } + this.defines.set("TEXEL", "texel" + swizzle); + this.setChanged(); + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + if (this.texture.matrixAutoUpdate) { + this.texture.updateMatrix(); + } + } +}; +var convolution_tilt_shift_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform vec4 maskParams;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;float linearGradientMask(const in float x){return smoothstep(maskParams.x,maskParams.y,x)-smoothstep(maskParams.w,maskParams.z,x);}void main(){vec2 dUv=vOffset*(1.0-linearGradientMask(vUv2.y));vec4 sum=texture2D(inputBuffer,vec2(vUv.x-dUv.x,vUv.y+dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x+dUv.x,vUv.y+dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x+dUv.x,vUv.y-dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x-dUv.x,vUv.y-dUv.y));gl_FragColor=sum*0.25; +#include +}`; +var convolution_tilt_shift_default2 = `uniform vec4 texelSize;uniform float kernel;uniform float scale;uniform float aspect;uniform vec2 rotation;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;void main(){vec2 uv=position.xy*0.5+0.5;vUv=uv;vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));vOffset=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;gl_Position=vec4(position.xy,1.0,1.0);}`; +var TiltShiftBlurMaterial = class extends KawaseBlurMaterial { + /** + * Constructs a new tilt shift blur material. + * + * @param {Object} [options] - The options. + * @param {Number} [options.offset=0.0] - The relative offset of the focus area. + * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians. + * @param {Number} [options.focusArea=0.4] - The relative size of the focus area. + * @param {Number} [options.feather=0.3] - The softness of the focus area edges. + */ + constructor({ + kernelSize = KernelSize.MEDIUM, + offset = 0, + rotation = 0, + focusArea = 0.4, + feather = 0.3 + } = {}) { + super(); + this.fragmentShader = convolution_tilt_shift_default; + this.vertexShader = convolution_tilt_shift_default2; + this.kernelSize = kernelSize; + this.uniforms.aspect = new Uniform(1); + this.uniforms.rotation = new Uniform(new Vector2()); + this.uniforms.maskParams = new Uniform(new Vector4()); + this._offset = offset; + this._focusArea = focusArea; + this._feather = feather; + this.rotation = rotation; + this.updateParams(); + } + /** + * The relative offset of the focus area. + * + * @private + */ + updateParams() { + const params = this.uniforms.maskParams.value; + const a = Math.max(this.focusArea, 0); + const b = Math.max(a - this.feather, 0); + params.set( + this.offset - a, + this.offset - b, + this.offset + a, + this.offset + b + ); + } + /** + * The rotation of the focus area in radians. + * + * @type {Number} + */ + get rotation() { + return Math.acos(this.uniforms.rotation.value.x); + } + set rotation(value) { + this.uniforms.rotation.value.set(Math.cos(value), Math.sin(value)); + } + /** + * The relative offset of the focus area. + * + * @type {Number} + */ + get offset() { + return this._offset; + } + set offset(value) { + this._offset = value; + this.updateParams(); + } + /** + * The relative size of the focus area. + * + * @type {Number} + */ + get focusArea() { + return this._focusArea; + } + set focusArea(value) { + this._focusArea = value; + this.updateParams(); + } + /** + * The softness of the focus area edges. + * + * @type {Number} + */ + get feather() { + return this._feather; + } + set feather(value) { + this._feather = value; + this.updateParams(); + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + super.setSize(width, height); + this.uniforms.aspect.value = width / height; + } +}; +var TiltShiftBlurPass = class extends KawaseBlurPass { + /** + * Constructs a new Kawase blur pass. + * + * @param {Object} [options] - The options. + * @param {Number} [options.offset=0.0] - The relative offset of the focus area. + * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians. + * @param {Number} [options.focusArea=0.4] - The relative size of the focus area. + * @param {Number} [options.feather=0.3] - The softness of the focus area edges. + * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size. + * @param {Number} [options.resolutionScale=0.5] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + */ + constructor({ + offset = 0, + rotation = 0, + focusArea = 0.4, + feather = 0.3, + kernelSize = KernelSize.MEDIUM, + resolutionScale = 0.5, + resolutionX = Resolution.AUTO_SIZE, + resolutionY = Resolution.AUTO_SIZE + } = {}) { + super({ kernelSize, resolutionScale, resolutionX, resolutionY }); + this.blurMaterial = new TiltShiftBlurMaterial({ kernelSize, offset, rotation, focusArea, feather }); + } +}; +var tilt_shift_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D map; +#else +uniform lowp sampler2D map; +#endif +uniform vec2 maskParams;varying vec2 vUv2;float linearGradientMask(const in float x){return step(maskParams.x,x)-step(maskParams.y,x);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float mask=linearGradientMask(vUv2.y);vec4 texel=texture2D(map,uv);outputColor=mix(texel,inputColor,mask);}`; +var tilt_shift_default2 = `uniform vec2 rotation;varying vec2 vUv2;void mainSupport(const in vec2 uv){vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));}`; +var TiltShiftEffect = class extends Effect { + /** + * Constructs a new tilt shift Effect + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {Number} [options.offset=0.0] - The relative offset of the focus area. + * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians. + * @param {Number} [options.focusArea=0.4] - The relative size of the focus area. + * @param {Number} [options.feather=0.3] - The softness of the focus area edges. + * @param {Number} [options.bias=0.06] - Deprecated. + * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size. + * @param {Number} [options.resolutionScale=0.5] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + */ + constructor({ + blendFunction, + offset = 0, + rotation = 0, + focusArea = 0.4, + feather = 0.3, + kernelSize = KernelSize.MEDIUM, + resolutionScale = 0.5, + resolutionX = Resolution.AUTO_SIZE, + resolutionY = Resolution.AUTO_SIZE + } = {}) { + super("TiltShiftEffect", tilt_shift_default, { + vertexShader: tilt_shift_default2, + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["rotation", new Uniform(new Vector2())], + ["maskParams", new Uniform(new Vector2())], + ["map", new Uniform(null)] + ]) + }); + this._offset = offset; + this._focusArea = focusArea; + this._feather = feather; + this.renderTarget = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTarget.texture.name = "TiltShift.Target"; + this.uniforms.get("map").value = this.renderTarget.texture; + this.blurPass = new TiltShiftBlurPass({ + kernelSize, + resolutionScale, + resolutionX, + resolutionY, + offset, + rotation, + focusArea, + feather + }); + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + this.rotation = rotation; + this.updateParams(); + } + /** + * Updates the mask params. + * + * @private + */ + updateParams() { + const params = this.uniforms.get("maskParams").value; + const x = Math.max(this.focusArea - this.feather, 0); + params.set(this.offset - x, this.offset + x); + } + /** + * The rotation of the focus area in radians. + * + * @type {Number} + */ + get rotation() { + return Math.acos(this.uniforms.get("rotation").value.x); + } + set rotation(value) { + this.uniforms.get("rotation").value.set(Math.cos(value), Math.sin(value)); + this.blurPass.blurMaterial.rotation = value; + } + /** + * The relative offset of the focus area. + * + * @type {Number} + */ + get offset() { + return this._offset; + } + set offset(value) { + this._offset = value; + this.blurPass.blurMaterial.offset = value; + this.updateParams(); + } + /** + * The relative size of the focus area. + * + * @type {Number} + */ + get focusArea() { + return this._focusArea; + } + set focusArea(value) { + this._focusArea = value; + this.blurPass.blurMaterial.focusArea = value; + this.updateParams(); + } + /** + * The softness of the focus area edges. + * + * @type {Number} + */ + get feather() { + return this._feather; + } + set feather(value) { + this._feather = value; + this.blurPass.blurMaterial.feather = value; + this.updateParams(); + } + /** + * A blend bias. + * + * @type {Number} + * @deprecated + */ + get bias() { + return 0; + } + set bias(value) { + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + this.blurPass.render(renderer, inputBuffer, this.renderTarget); + } + /** + * Updates the size of internal render targets. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + this.renderTarget.setSize(resolution.width, resolution.height); + this.blurPass.resolution.copy(resolution); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.blurPass.initialize(renderer, alpha, frameBufferType); + if (frameBufferType !== void 0) { + this.renderTarget.texture.type = frameBufferType; + if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTarget.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var adaptive_luminance_default = `#include +#define packFloatToRGBA(v) packDepthToRGBA(v) +#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) +uniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv)); +#if __VERSION__ < 300 +float l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r; +#else +float l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r; +#endif +l0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`; +var AdaptiveLuminanceMaterial = class extends ShaderMaterial { + /** + * Constructs a new adaptive luminance material. + */ + constructor() { + super({ + name: "AdaptiveLuminanceMaterial", + defines: { + MIP_LEVEL_1X1: "0.0" + }, + uniforms: { + luminanceBuffer0: new Uniform(null), + luminanceBuffer1: new Uniform(null), + minLuminance: new Uniform(0.01), + deltaTime: new Uniform(0), + tau: new Uniform(1) + }, + extensions: { + shaderTextureLOD: true + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: adaptive_luminance_default, + vertexShader: common_default + }); + } + /** + * The primary luminance buffer that contains the downsampled average luminance. + * + * @type {Texture} + */ + set luminanceBuffer0(value) { + this.uniforms.luminanceBuffer0.value = value; + } + /** + * Sets the primary luminance buffer that contains the downsampled average luminance. + * + * @deprecated Use luminanceBuffer0 instead. + * @param {Texture} value - The buffer. + */ + setLuminanceBuffer0(value) { + this.uniforms.luminanceBuffer0.value = value; + } + /** + * The secondary luminance buffer. + * + * @type {Texture} + */ + set luminanceBuffer1(value) { + this.uniforms.luminanceBuffer1.value = value; + } + /** + * Sets the secondary luminance buffer. + * + * @deprecated Use luminanceBuffer1 instead. + * @param {Texture} value - The buffer. + */ + setLuminanceBuffer1(value) { + this.uniforms.luminanceBuffer1.value = value; + } + /** + * The 1x1 mipmap level. + * + * This level is used to identify the smallest mipmap of the primary luminance buffer. + * + * @type {Number} + */ + set mipLevel1x1(value) { + this.defines.MIP_LEVEL_1X1 = value.toFixed(1); + this.needsUpdate = true; + } + /** + * Sets the 1x1 mipmap level. + * + * @deprecated Use mipLevel1x1 instead. + * @param {Number} value - The level. + */ + setMipLevel1x1(value) { + this.mipLevel1x1 = value; + } + /** + * The delta time. + * + * @type {Number} + */ + set deltaTime(value) { + this.uniforms.deltaTime.value = value; + } + /** + * Sets the delta time. + * + * @deprecated Use deltaTime instead. + * @param {Number} value - The delta time. + */ + setDeltaTime(value) { + this.uniforms.deltaTime.value = value; + } + /** + * The lowest possible luminance value. + * + * @type {Number} + */ + get minLuminance() { + return this.uniforms.minLuminance.value; + } + set minLuminance(value) { + this.uniforms.minLuminance.value = value; + } + /** + * Returns the lowest possible luminance value. + * + * @deprecated Use minLuminance instead. + * @return {Number} The minimum luminance. + */ + getMinLuminance() { + return this.uniforms.minLuminance.value; + } + /** + * Sets the minimum luminance. + * + * @deprecated Use minLuminance instead. + * @param {Number} value - The minimum luminance. + */ + setMinLuminance(value) { + this.uniforms.minLuminance.value = value; + } + /** + * The luminance adaptation rate. + * + * @type {Number} + */ + get adaptationRate() { + return this.uniforms.tau.value; + } + set adaptationRate(value) { + this.uniforms.tau.value = value; + } + /** + * Returns the luminance adaptation rate. + * + * @deprecated Use adaptationRate instead. + * @return {Number} The adaptation rate. + */ + getAdaptationRate() { + return this.uniforms.tau.value; + } + /** + * Sets the luminance adaptation rate. + * + * @deprecated Use adaptationRate instead. + * @param {Number} value - The adaptation rate. + */ + setAdaptationRate(value) { + this.uniforms.tau.value = value; + } +}; +var AdaptiveLuminancePass = class extends Pass { + /** + * Constructs a new adaptive luminance pass. + * + * @param {Texture} luminanceBuffer - A buffer that contains the current scene luminance. + * @param {Object} [options] - The options. + * @param {Number} [options.minLuminance=0.01] - The minimum luminance. + * @param {Number} [options.adaptationRate=1.0] - The luminance adaptation rate. + */ + constructor(luminanceBuffer, { minLuminance = 0.01, adaptationRate = 1 } = {}) { + super("AdaptiveLuminancePass"); + this.fullscreenMaterial = new AdaptiveLuminanceMaterial(); + this.needsSwap = false; + this.renderTargetPrevious = new WebGLRenderTarget(1, 1, { + minFilter: NearestFilter, + magFilter: NearestFilter, + depthBuffer: false + }); + this.renderTargetPrevious.texture.name = "Luminance.Previous"; + const material = this.fullscreenMaterial; + material.luminanceBuffer0 = this.renderTargetPrevious.texture; + material.luminanceBuffer1 = luminanceBuffer; + material.minLuminance = minLuminance; + material.adaptationRate = adaptationRate; + this.renderTargetAdapted = this.renderTargetPrevious.clone(); + this.renderTargetAdapted.texture.name = "Luminance.Adapted"; + this.copyPass = new CopyPass(this.renderTargetPrevious, false); + } + /** + * The adaptive luminance texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTargetAdapted.texture; + } + /** + * Returns the adaptive 1x1 luminance texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTargetAdapted.texture; + } + /** + * Sets the 1x1 mipmap level. + * + * This level is used to identify the smallest mipmap of the main luminance texture which contains the downsampled + * average scene luminance. + * + * @type {Number} + * @deprecated Use fullscreenMaterial.mipLevel1x1 instead. + */ + set mipLevel1x1(value) { + this.fullscreenMaterial.mipLevel1x1 = value; + } + /** + * The luminance adaptation rate. + * + * @type {Number} + * @deprecated Use fullscreenMaterial.adaptationRate instead. + */ + get adaptationRate() { + return this.fullscreenMaterial.adaptationRate; + } + /** + * @type {Number} + * @deprecated Use fullscreenMaterial.adaptationRate instead. + */ + set adaptationRate(value) { + this.fullscreenMaterial.adaptationRate = value; + } + /** + * Renders the scene normals. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + this.fullscreenMaterial.deltaTime = deltaTime; + renderer.setRenderTarget(this.renderToScreen ? null : this.renderTargetAdapted); + renderer.render(this.scene, this.camera); + this.copyPass.render(renderer, this.renderTargetAdapted); + } +}; +var tone_mapping_default = `#include +uniform float whitePoint; +#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3 +uniform float middleGrey; +#if TONE_MAPPING_MODE == 3 +uniform lowp sampler2D luminanceBuffer; +#else +uniform float averageLuminance; +#endif +vec3 Reinhard2ToneMapping(vec3 color){color*=toneMappingExposure;float l=luminance(color); +#if TONE_MAPPING_MODE == 3 +float lumAvg=unpackRGBAToFloat(texture2D(luminanceBuffer,vec2(0.5))); +#else +float lumAvg=averageLuminance; +#endif +float lumScaled=(l*middleGrey)/max(lumAvg,1e-6);float lumCompressed=lumScaled*(1.0+lumScaled/(whitePoint*whitePoint));lumCompressed/=(1.0+lumScaled);return clamp(lumCompressed*color,0.0,1.0);} +#elif TONE_MAPPING_MODE == 4 +#define A 0.15 +#define B 0.50 +#define C 0.10 +#define D 0.20 +#define E 0.02 +#define F 0.30 +vec3 Uncharted2Helper(const in vec3 x){return((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}vec3 Uncharted2ToneMapping(vec3 color){color*=toneMappingExposure;return clamp(Uncharted2Helper(color)/Uncharted2Helper(vec3(whitePoint)),0.0,1.0);} +#endif +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){ +#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3 +outputColor=vec4(Reinhard2ToneMapping(inputColor.rgb),inputColor.a); +#elif TONE_MAPPING_MODE == 4 +outputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a); +#else +outputColor=vec4(toneMapping(inputColor.rgb),inputColor.a); +#endif +}`; +var ToneMappingEffect = class extends Effect { + /** + * Constructs a new tone mapping effect. + * + * The additional parameters only affect the Reinhard2 operator. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect. + * @param {Boolean} [options.adaptive=false] - Deprecated. Use mode instead. + * @param {ToneMappingMode} [options.mode=ToneMappingMode.AGX] - The tone mapping mode. + * @param {Number} [options.resolution=256] - The resolution of the luminance texture. Must be a power of two. + * @param {Number} [options.maxLuminance=4.0] - Deprecated. Same as whitePoint. + * @param {Number} [options.whitePoint=4.0] - The white point. + * @param {Number} [options.middleGrey=0.6] - The middle grey factor. + * @param {Number} [options.minLuminance=0.01] - The minimum luminance. Prevents very high exposure in dark scenes. + * @param {Number} [options.averageLuminance=1.0] - The average luminance. Used for the non-adaptive Reinhard operator. + * @param {Number} [options.adaptationRate=1.0] - The luminance adaptation rate. + */ + constructor({ + blendFunction = BlendFunction.SRC, + adaptive = false, + mode = adaptive ? ToneMappingMode.REINHARD2_ADAPTIVE : ToneMappingMode.AGX, + resolution = 256, + maxLuminance = 4, + whitePoint = maxLuminance, + middleGrey = 0.6, + minLuminance = 0.01, + averageLuminance = 1, + adaptationRate = 1 + } = {}) { + super("ToneMappingEffect", tone_mapping_default, { + blendFunction, + uniforms: /* @__PURE__ */ new Map([ + ["luminanceBuffer", new Uniform(null)], + ["maxLuminance", new Uniform(maxLuminance)], + // Unused + ["whitePoint", new Uniform(whitePoint)], + ["middleGrey", new Uniform(middleGrey)], + ["averageLuminance", new Uniform(averageLuminance)] + ]) + }); + this.renderTargetLuminance = new WebGLRenderTarget(1, 1, { + minFilter: LinearMipmapLinearFilter, + depthBuffer: false + }); + this.renderTargetLuminance.texture.generateMipmaps = true; + this.renderTargetLuminance.texture.name = "Luminance"; + this.luminancePass = new LuminancePass({ + renderTarget: this.renderTargetLuminance + }); + this.adaptiveLuminancePass = new AdaptiveLuminancePass(this.luminancePass.texture, { + minLuminance, + adaptationRate + }); + this.uniforms.get("luminanceBuffer").value = this.adaptiveLuminancePass.texture; + this.resolution = resolution; + this.mode = mode; + } + /** + * The tone mapping mode. + * + * @type {ToneMappingMode} + */ + get mode() { + return Number(this.defines.get("TONE_MAPPING_MODE")); + } + set mode(value) { + if (this.mode === value) { + return; + } + const revision = REVISION.replace(/\D+/g, ""); + const cineonToneMapping = revision >= 168 ? "CineonToneMapping(texel)" : "OptimizedCineonToneMapping(texel)"; + this.defines.clear(); + this.defines.set("TONE_MAPPING_MODE", value.toFixed(0)); + switch (value) { + case ToneMappingMode.LINEAR: + this.defines.set("toneMapping(texel)", "LinearToneMapping(texel)"); + break; + case ToneMappingMode.REINHARD: + this.defines.set("toneMapping(texel)", "ReinhardToneMapping(texel)"); + break; + case ToneMappingMode.CINEON: + case ToneMappingMode.OPTIMIZED_CINEON: + this.defines.set("toneMapping(texel)", cineonToneMapping); + break; + case ToneMappingMode.ACES_FILMIC: + this.defines.set("toneMapping(texel)", "ACESFilmicToneMapping(texel)"); + break; + case ToneMappingMode.AGX: + this.defines.set("toneMapping(texel)", "AgXToneMapping(texel)"); + break; + case ToneMappingMode.NEUTRAL: + this.defines.set("toneMapping(texel)", "NeutralToneMapping(texel)"); + break; + default: + this.defines.set("toneMapping(texel)", "texel"); + break; + } + this.adaptiveLuminancePass.enabled = value === ToneMappingMode.REINHARD2_ADAPTIVE; + this.setChanged(); + } + /** + * Returns the current tone mapping mode. + * + * @deprecated Use mode instead. + * @return {ToneMappingMode} The tone mapping mode. + */ + getMode() { + return this.mode; + } + /** + * Sets the tone mapping mode. + * + * @deprecated Use mode instead. + * @param {ToneMappingMode} value - The tone mapping mode. + */ + setMode(value) { + this.mode = value; + } + /** + * The white point. Default is `4.0`. + * + * Only applies to Reinhard2 (Modified & Adaptive). + * + * @type {Number} + */ + get whitePoint() { + return this.uniforms.get("whitePoint").value; + } + set whitePoint(value) { + this.uniforms.get("whitePoint").value = value; + } + /** + * The middle grey factor. Default is `0.6`. + * + * Only applies to Reinhard2 (Modified & Adaptive). + * + * @type {Number} + */ + get middleGrey() { + return this.uniforms.get("middleGrey").value; + } + set middleGrey(value) { + this.uniforms.get("middleGrey").value = value; + } + /** + * The average luminance. + * + * Only applies to Reinhard2 (Modified). + * + * @type {Number} + */ + get averageLuminance() { + return this.uniforms.get("averageLuminance").value; + } + set averageLuminance(value) { + this.uniforms.get("averageLuminance").value = value; + } + /** + * The adaptive luminance material. + * + * @type {AdaptiveLuminanceMaterial} + */ + get adaptiveLuminanceMaterial() { + return this.adaptiveLuminancePass.fullscreenMaterial; + } + /** + * Returns the adaptive luminance material. + * + * @deprecated Use adaptiveLuminanceMaterial instead. + * @return {AdaptiveLuminanceMaterial} The material. + */ + getAdaptiveLuminanceMaterial() { + return this.adaptiveLuminanceMaterial; + } + /** + * The resolution of the luminance texture. Must be a power of two. + * + * @type {Number} + */ + get resolution() { + return this.luminancePass.resolution.width; + } + set resolution(value) { + const exponent = Math.max(0, Math.ceil(Math.log2(value))); + const size = Math.pow(2, exponent); + this.luminancePass.resolution.setPreferredSize(size, size); + this.adaptiveLuminanceMaterial.mipLevel1x1 = exponent; + } + /** + * Returns the resolution of the luminance texture. + * + * @deprecated Use resolution instead. + * @return {Number} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * Sets the resolution of the luminance texture. Must be a power of two. + * + * @deprecated Use resolution instead. + * @param {Number} value - The resolution. + */ + setResolution(value) { + this.resolution = value; + } + /** + * Indicates whether this pass uses adaptive luminance. + * + * @type {Boolean} + * @deprecated Use mode instead. + */ + get adaptive() { + return this.mode === ToneMappingMode.REINHARD2_ADAPTIVE; + } + set adaptive(value) { + this.mode = value ? ToneMappingMode.REINHARD2_ADAPTIVE : ToneMappingMode.REINHARD2; + } + /** + * The luminance adaptation rate. + * + * @type {Number} + * @deprecated Use adaptiveLuminanceMaterial.adaptationRate instead. + */ + get adaptationRate() { + return this.adaptiveLuminanceMaterial.adaptationRate; + } + set adaptationRate(value) { + this.adaptiveLuminanceMaterial.adaptationRate = value; + } + /** + * @type {Number} + * @deprecated + */ + get distinction() { + console.warn(this.name, "distinction was removed."); + return 1; + } + set distinction(value) { + console.warn(this.name, "distinction was removed."); + } + /** + * Updates this effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + */ + update(renderer, inputBuffer, deltaTime) { + if (this.adaptiveLuminancePass.enabled) { + this.luminancePass.render(renderer, inputBuffer); + this.adaptiveLuminancePass.render(renderer, null, null, deltaTime); + } + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.adaptiveLuminancePass.initialize(renderer, alpha, frameBufferType); + } +}; +var vignette_default = `uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; +#if VIGNETTE_TECHNIQUE == 0 +float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); +#else +vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); +#endif +outputColor=vec4(color,inputColor.a);}`; +var VignetteEffect = class extends Effect { + /** + * Constructs a new Vignette effect. + * + * @param {Object} [options] - The options. + * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. + * @param {VignetteTechnique} [options.technique=VignetteTechnique.DEFAULT] - The Vignette technique. + * @param {Boolean} [options.eskil=false] - Deprecated. Use technique instead. + * @param {Number} [options.offset=0.5] - The Vignette offset. + * @param {Number} [options.darkness=0.5] - The Vignette darkness. + */ + constructor({ + blendFunction, + eskil = false, + technique = eskil ? VignetteTechnique.ESKIL : VignetteTechnique.DEFAULT, + offset = 0.5, + darkness = 0.5 + } = {}) { + super("VignetteEffect", vignette_default, { + blendFunction, + defines: /* @__PURE__ */ new Map([ + ["VIGNETTE_TECHNIQUE", technique.toFixed(0)] + ]), + uniforms: /* @__PURE__ */ new Map([ + ["offset", new Uniform(offset)], + ["darkness", new Uniform(darkness)] + ]) + }); + } + /** + * The Vignette technique. + * + * @type {VignetteTechnique} + */ + get technique() { + return Number(this.defines.get("VIGNETTE_TECHNIQUE")); + } + set technique(value) { + if (this.technique !== value) { + this.defines.set("VIGNETTE_TECHNIQUE", value.toFixed(0)); + this.setChanged(); + } + } + /** + * Indicates whether Eskil's Vignette technique is enabled. + * + * @type {Boolean} + * @deprecated Use technique instead. + */ + get eskil() { + return this.technique === VignetteTechnique.ESKIL; + } + /** + * Indicates whether Eskil's Vignette technique is enabled. + * + * @type {Boolean} + * @deprecated Use technique instead. + */ + set eskil(value) { + this.technique = value ? VignetteTechnique.ESKIL : VignetteTechnique.DEFAULT; + } + /** + * Returns the Vignette technique. + * + * @deprecated Use technique instead. + * @return {VignetteTechnique} The technique. + */ + getTechnique() { + return this.technique; + } + /** + * Sets the Vignette technique. + * + * @deprecated Use technique instead. + * @param {VignetteTechnique} value - The technique. + */ + setTechnique(value) { + this.technique = value; + } + /** + * The Vignette offset. + * + * @type {Number} + */ + get offset() { + return this.uniforms.get("offset").value; + } + set offset(value) { + this.uniforms.get("offset").value = value; + } + /** + * Returns the Vignette offset. + * + * @deprecated Use offset instead. + * @return {Number} The offset. + */ + getOffset() { + return this.offset; + } + /** + * Sets the Vignette offset. + * + * @deprecated Use offset instead. + * @param {Number} value - The offset. + */ + setOffset(value) { + this.offset = value; + } + /** + * The Vignette darkness. + * + * @type {Number} + */ + get darkness() { + return this.uniforms.get("darkness").value; + } + set darkness(value) { + this.uniforms.get("darkness").value = value; + } + /** + * Returns the Vignette darkness. + * + * @deprecated Use darkness instead. + * @return {Number} The darkness. + */ + getDarkness() { + return this.darkness; + } + /** + * Sets the Vignette darkness. + * + * @deprecated Use darkness instead. + * @param {Number} value - The darkness. + */ + setDarkness(value) { + this.darkness = value; + } +}; +var LUT3dlLoader = class extends Loader { + /** + * Loads a LUT. + * + * @param {String} url - The URL of the 3dl-file. + * @param {Function} [onLoad] - A callback that receives the loaded lookup texture. + * @param {Function} [onProgress] - A progress callback that receives the XMLHttpRequest instance. + * @param {Function} [onError] - An error callback that receives the URL of the file that failed to load. + * @return {Promise} A promise that returns the lookup texture. + */ + load(url, onLoad = () => { + }, onProgress = () => { + }, onError = null) { + const externalManager = this.manager; + const internalManager = new LoadingManager(); + const loader = new FileLoader(internalManager); + loader.setPath(this.path); + loader.setResponseType("text"); + return new Promise((resolve, reject) => { + internalManager.onError = (url2) => { + externalManager.itemError(url2); + if (onError !== null) { + onError(`Failed to load ${url2}`); + resolve(); + } else { + reject(`Failed to load ${url2}`); + } + }; + externalManager.itemStart(url); + loader.load(url, (data) => { + try { + const result = this.parse(data); + externalManager.itemEnd(url); + onLoad(result); + resolve(result); + } catch (e) { + console.error(e); + internalManager.onError(url); + } + }, onProgress); + }); + } + /** + * Parses the given data. + * + * @param {String} input - The LUT data. + * @return {LookupTexture} The lookup texture. + * @throws {Error} Fails if the data is invalid. + */ + parse(input) { + const regExpGridInfo = /^[\d ]+$/m; + const regExpDataPoints = /^([\d.e+-]+) +([\d.e+-]+) +([\d.e+-]+) *$/gm; + let result = regExpGridInfo.exec(input); + if (result === null) { + throw new Error("Missing grid information"); + } + const gridLines = result[0].trim().split(/\s+/g).map((n) => Number(n)); + const gridStep = gridLines[1] - gridLines[0]; + const size = gridLines.length; + const sizeSq = size ** 2; + for (let i = 1, l = gridLines.length; i < l; ++i) { + if (gridStep !== gridLines[i] - gridLines[i - 1]) { + throw new Error("Inconsistent grid size"); + } + } + const data = new Float32Array(size ** 3 * 4); + let maxValue = 0; + let index = 0; + while ((result = regExpDataPoints.exec(input)) !== null) { + const r = Number(result[1]); + const g = Number(result[2]); + const b = Number(result[3]); + maxValue = Math.max(maxValue, r, g, b); + const bLayer = index % size; + const gLayer = Math.floor(index / size) % size; + const rLayer = Math.floor(index / sizeSq) % size; + const d4 = (bLayer * sizeSq + gLayer * size + rLayer) * 4; + data[d4 + 0] = r; + data[d4 + 1] = g; + data[d4 + 2] = b; + data[d4 + 3] = 1; + ++index; + } + const bits = Math.ceil(Math.log2(maxValue)); + const maxBitValue = Math.pow(2, bits); + for (let i = 0, l = data.length; i < l; i += 4) { + data[i + 0] /= maxBitValue; + data[i + 1] /= maxBitValue; + data[i + 2] /= maxBitValue; + } + return new LookupTexture(data, size); + } +}; +var LUTCubeLoader = class extends Loader { + /** + * Loads a LUT. + * + * @param {String} url - The URL of the CUBE-file. + * @param {Function} [onLoad] - A callback that receives the loaded lookup texture. + * @param {Function} [onProgress] - A progress callback that receives the XMLHttpRequest instance. + * @param {Function} [onError] - An error callback that receives the URL of the file that failed to load. + * @return {Promise} A promise that returns the lookup texture. + */ + load(url, onLoad = () => { + }, onProgress = () => { + }, onError = null) { + const externalManager = this.manager; + const internalManager = new LoadingManager(); + const loader = new FileLoader(internalManager); + loader.setPath(this.path); + loader.setResponseType("text"); + return new Promise((resolve, reject) => { + internalManager.onError = (url2) => { + externalManager.itemError(url2); + if (onError !== null) { + onError(`Failed to load ${url2}`); + resolve(); + } else { + reject(`Failed to load ${url2}`); + } + }; + externalManager.itemStart(url); + loader.load(url, (data) => { + try { + const result = this.parse(data); + externalManager.itemEnd(url); + onLoad(result); + resolve(result); + } catch (e) { + console.error(e); + internalManager.onError(url); + } + }, onProgress); + }); + } + /** + * Parses the given data. + * + * @param {String} input - The LUT data. + * @return {LookupTexture} The lookup texture. + * @throws {Error} Fails if the data is invalid. + */ + parse(input) { + const regExpTitle = /TITLE +"([^"]*)"/; + const regExpSize = /LUT_3D_SIZE +(\d+)/; + const regExpDomainMin = /DOMAIN_MIN +([\d.]+) +([\d.]+) +([\d.]+)/; + const regExpDomainMax = /DOMAIN_MAX +([\d.]+) +([\d.]+) +([\d.]+)/; + const regExpDataPoints = /^([\d.e+-]+) +([\d.e+-]+) +([\d.e+-]+) *$/gm; + let result = regExpTitle.exec(input); + const title = result !== null ? result[1] : null; + result = regExpSize.exec(input); + if (result === null) { + throw new Error("Missing LUT_3D_SIZE information"); + } + const size = Number(result[1]); + const data = new Float32Array(size ** 3 * 4); + const domainMin = new Vector3(0, 0, 0); + const domainMax = new Vector3(1, 1, 1); + result = regExpDomainMin.exec(input); + if (result !== null) { + domainMin.set(Number(result[1]), Number(result[2]), Number(result[3])); + } + result = regExpDomainMax.exec(input); + if (result !== null) { + domainMax.set(Number(result[1]), Number(result[2]), Number(result[3])); + } + if (domainMin.x > domainMax.x || domainMin.y > domainMax.y || domainMin.z > domainMax.z) { + domainMin.set(0, 0, 0); + domainMax.set(1, 1, 1); + throw new Error("Invalid input domain"); + } + let i = 0; + while ((result = regExpDataPoints.exec(input)) !== null) { + data[i++] = Number(result[1]); + data[i++] = Number(result[2]); + data[i++] = Number(result[3]); + data[i++] = 1; + } + const lut = new LookupTexture(data, size); + lut.domainMin.copy(domainMin); + lut.domainMax.copy(domainMax); + if (title !== null) { + lut.name = title; + } + return lut; + } +}; +var SMAAImageLoader = class extends Loader { + /** + * Loads the SMAA data images. + * + * @param {Function} [onLoad] - A callback that receives the search image and area image as a pair. + * @param {Function} [onError] - An error callback that receives the URL of the image that failed to load. + * @return {Promise} A promise that returns the search image and area image as a pair. + */ + load(onLoad = () => { + }, onError = null) { + if (arguments.length === 4) { + onLoad = arguments[1]; + onError = arguments[3]; + } else if (arguments.length === 3 || typeof arguments[0] !== "function") { + onLoad = arguments[1]; + onError = null; + } + const externalManager = this.manager; + const internalManager = new LoadingManager(); + return new Promise((resolve, reject) => { + const searchImage = new Image(); + const areaImage = new Image(); + internalManager.onError = (url) => { + externalManager.itemError(url); + if (onError !== null) { + onError(`Failed to load ${url}`); + resolve(); + } else { + reject(`Failed to load ${url}`); + } + }; + internalManager.onLoad = () => { + const result = [searchImage, areaImage]; + onLoad(result); + resolve(result); + }; + searchImage.addEventListener("error", (e) => { + internalManager.itemError("smaa-search"); + }); + areaImage.addEventListener("error", (e) => { + internalManager.itemError("smaa-area"); + }); + searchImage.addEventListener("load", () => { + externalManager.itemEnd("smaa-search"); + internalManager.itemEnd("smaa-search"); + }); + areaImage.addEventListener("load", () => { + externalManager.itemEnd("smaa-area"); + internalManager.itemEnd("smaa-area"); + }); + externalManager.itemStart("smaa-search"); + externalManager.itemStart("smaa-area"); + internalManager.itemStart("smaa-search"); + internalManager.itemStart("smaa-area"); + searchImage.src = searchImageDataURL_default; + areaImage.src = areaImageDataURL_default; + }); + } +}; +var convolution_box_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef BILATERAL +#include +uniform vec2 cameraNearFar; +#ifdef NORMAL_DEPTH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D normalDepthBuffer; +#else +uniform mediump sampler2D normalDepthBuffer; +#endif +float readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;} +#else +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +} +#endif +float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#else +return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y); +#endif +} +#ifdef PERSPECTIVE_CAMERA +#define linearDepth(v) viewZToOrthographicDepth(getViewZ(readDepth(v)), cameraNearFar.x, cameraNearFar.y) +#else +#define linearDepth(v) readDepth(v) +#endif +#endif +#define getTexel(v) texture2D(inputBuffer, v) +#if KERNEL_SIZE == 3 +varying vec2 vUv00,vUv01,vUv02;varying vec2 vUv03,vUv04,vUv05;varying vec2 vUv06,vUv07,vUv08; +#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13 +varying vec2 vUv00,vUv01,vUv02,vUv03,vUv04;varying vec2 vUv05,vUv06,vUv07,vUv08,vUv09;varying vec2 vUv10,vUv11,vUv12,vUv13,vUv14;varying vec2 vUv15,vUv16,vUv17,vUv18,vUv19;varying vec2 vUv20,vUv21,vUv22,vUv23,vUv24; +#else +uniform vec2 texelSize;uniform float scale;varying vec2 vUv; +#endif +void main(){ +#if KERNEL_SIZE == 3 +vec4 c[]=vec4[KERNEL_SIZE_SQ](getTexel(vUv00),getTexel(vUv01),getTexel(vUv02),getTexel(vUv03),getTexel(vUv04),getTexel(vUv05),getTexel(vUv06),getTexel(vUv07),getTexel(vUv08)); +#ifdef BILATERAL +float z[]=float[KERNEL_SIZE_SQ](linearDepth(vUv00),linearDepth(vUv01),linearDepth(vUv02),linearDepth(vUv03),linearDepth(vUv04),linearDepth(vUv05),linearDepth(vUv06),linearDepth(vUv07),linearDepth(vUv08)); +#endif +#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13 +vec4 c[]=vec4[KERNEL_SIZE_SQ](getTexel(vUv00),getTexel(vUv01),getTexel(vUv02),getTexel(vUv03),getTexel(vUv04),getTexel(vUv05),getTexel(vUv06),getTexel(vUv07),getTexel(vUv08),getTexel(vUv09),getTexel(vUv10),getTexel(vUv11),getTexel(vUv12),getTexel(vUv13),getTexel(vUv14),getTexel(vUv15),getTexel(vUv16),getTexel(vUv17),getTexel(vUv18),getTexel(vUv19),getTexel(vUv20),getTexel(vUv21),getTexel(vUv22),getTexel(vUv23),getTexel(vUv24)); +#ifdef BILATERAL +float z[]=float[KERNEL_SIZE_SQ](linearDepth(vUv00),linearDepth(vUv01),linearDepth(vUv02),linearDepth(vUv03),linearDepth(vUv04),linearDepth(vUv05),linearDepth(vUv06),linearDepth(vUv07),linearDepth(vUv08),linearDepth(vUv09),linearDepth(vUv10),linearDepth(vUv11),linearDepth(vUv12),linearDepth(vUv13),linearDepth(vUv14),linearDepth(vUv15),linearDepth(vUv16),linearDepth(vUv17),linearDepth(vUv18),linearDepth(vUv19),linearDepth(vUv20),linearDepth(vUv21),linearDepth(vUv22),linearDepth(vUv23),linearDepth(vUv24)); +#endif +#endif +vec4 result=vec4(0.0); +#ifdef BILATERAL +float w=0.0; +#if KERNEL_SIZE == 3 || (KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13) +float centerDepth=z[KERNEL_SIZE_SQ_HALF];for(int i=0;i= 13) +for(int i=0;i= 13 +varying vec2 vUv00,vUv01,vUv02,vUv03,vUv04;varying vec2 vUv05,vUv06,vUv07,vUv08,vUv09;varying vec2 vUv10,vUv11,vUv12,vUv13,vUv14;varying vec2 vUv15,vUv16,vUv17,vUv18,vUv19;varying vec2 vUv20,vUv21,vUv22,vUv23,vUv24; +#else +varying vec2 vUv; +#endif +void main(){vec2 uv=position.xy*0.5+0.5; +#if KERNEL_SIZE == 3 +vec2 s=texelSize*scale;vUv00=uv+s*vec2(-1.0,-1.0);vUv01=uv+s*vec2(0.0,-1.0);vUv02=uv+s*vec2(1.0,-1.0);vUv03=uv+s*vec2(-1.0,0.0);vUv04=uv;vUv05=uv+s*vec2(1.0,0.0);vUv06=uv+s*vec2(-1.0,1.0);vUv07=uv+s*vec2(0.0,1.0);vUv08=uv+s*vec2(1.0,1.0); +#elif KERNEL_SIZE == 5 +vec2 s=texelSize*scale;vUv00=uv+s*vec2(-2.0,-2.0);vUv01=uv+s*vec2(-1.0,-2.0);vUv02=uv+s*vec2(0.0,-2.0);vUv03=uv+s*vec2(1.0,-2.0);vUv04=uv+s*vec2(2.0,-2.0);vUv05=uv+s*vec2(-2.0,-1.0);vUv06=uv+s*vec2(-1.0,-1.0);vUv07=uv+s*vec2(0.0,-1.0);vUv08=uv+s*vec2(1.0,-1.0);vUv09=uv+s*vec2(2.0,-1.0);vUv10=uv+s*vec2(-2.0,0.0);vUv11=uv+s*vec2(-1.0,0.0);vUv12=uv;vUv13=uv+s*vec2(1.0,0.0);vUv14=uv+s*vec2(2.0,0.0);vUv15=uv+s*vec2(-2.0,1.0);vUv16=uv+s*vec2(-1.0,1.0);vUv17=uv+s*vec2(0.0,1.0);vUv18=uv+s*vec2(1.0,1.0);vUv19=uv+s*vec2(2.0,1.0);vUv20=uv+s*vec2(-2.0,2.0);vUv21=uv+s*vec2(-1.0,2.0);vUv22=uv+s*vec2(0.0,2.0);vUv23=uv+s*vec2(1.0,2.0);vUv24=uv+s*vec2(2.0,2.0); +#else +vUv=uv; +#endif +gl_Position=vec4(position.xy,1.0,1.0);}`; +var BoxBlurMaterial = class extends ShaderMaterial { + /** + * Constructs a new box blur material. + * + * @param {Object} [options] - The options. + * @param {Number} [options.bilateral=false] - Enables or disables bilateral blurring. + * @param {Number} [options.kernelSize=5] - The kernel size. + */ + constructor({ bilateral = false, kernelSize = 5 } = {}) { + super({ + name: "BoxBlurMaterial", + defines: { + DEPTH_PACKING: "0", + DISTANCE_THRESHOLD: "0.1" + }, + uniforms: { + inputBuffer: new Uniform(null), + depthBuffer: new Uniform(null), + normalDepthBuffer: new Uniform(null), + texelSize: new Uniform(new Vector2()), + cameraNearFar: new Uniform(new Vector2()), + scale: new Uniform(1) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_box_default, + vertexShader: convolution_box_default2 + }); + this.bilateral = bilateral; + this.kernelSize = kernelSize; + this.maxVaryingVectors = 8; + } + /** + * The maximum amount of varying vectors. + * + * Should be synced with `renderer.capabilities.maxVaryings`. Default is 8. + * + * @type {Number} + */ + set maxVaryingVectors(value) { + this.defines.MAX_VARYING_VECTORS = value.toFixed(0); + } + /** + * The kernel size. + * + * - Must be an odd number + * - Kernel size 3 and 5 use optimized code paths + * - Default is 5 + * + * @type {Number} + */ + get kernelSize() { + return Number(this.defines.KERNEL_SIZE); + } + set kernelSize(value) { + if (value % 2 === 0) { + throw new Error("The kernel size must be an odd number"); + } + this.defines.KERNEL_SIZE = value.toFixed(0); + this.defines.KERNEL_SIZE_HALF = Math.floor(value / 2).toFixed(0); + this.defines.KERNEL_SIZE_SQ = (value ** 2).toFixed(0); + this.defines.KERNEL_SIZE_SQ_HALF = Math.floor(value ** 2 / 2).toFixed(0); + this.defines.INV_KERNEL_SIZE_SQ = (1 / value ** 2).toFixed(6); + this.needsUpdate = true; + } + /** + * The blur scale. + * + * @type {Number} + */ + get scale() { + return this.uniforms.scale.value; + } + set scale(value) { + this.uniforms.scale.value = value; + } + /** + * The current near plane setting. + * + * @type {Number} + * @private + */ + get near() { + return this.uniforms.cameraNearFar.value.x; + } + /** + * The current far plane setting. + * + * @type {Number} + * @private + */ + get far() { + return this.uniforms.cameraNearFar.value.y; + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The depth buffer. + * + * @type {Texture} + */ + set depthBuffer(value) { + this.uniforms.depthBuffer.value = value; + } + /** + * A combined normal-depth buffer. Overrides {@link depthBuffer} if set. + * + * @type {Texture} + */ + set normalDepthBuffer(value) { + this.uniforms.normalDepthBuffer.value = value; + if (value !== null) { + this.defines.NORMAL_DEPTH = "1"; + } else { + delete this.defines.NORMAL_DEPTH; + } + this.needsUpdate = true; + } + /** + * The depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set depthPacking(value) { + this.defines.DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Indicates whether bilateral filtering is enabled. + * + * @type {Boolean} + */ + get bilateral() { + return this.defines.BILATERAL !== void 0; + } + set bilateral(value) { + if (value !== null) { + this.defines.BILATERAL = "1"; + } else { + delete this.defines.BILATERAL; + } + this.needsUpdate = true; + } + /** + * The bilateral filter distance threshold in world units. + * + * @type {Number} + */ + get worldDistanceThreshold() { + return -orthographicDepthToViewZ(Number(this.defines.DISTANCE_THRESHOLD), this.near, this.far); + } + set worldDistanceThreshold(value) { + const threshold = viewZToOrthographicDepth(-value, this.near, this.far); + this.defines.DISTANCE_THRESHOLD = threshold.toFixed(12); + this.needsUpdate = true; + } + /** + * Copies the settings of the given camera. + * + * @param {Camera} camera - A camera. + */ + copyCameraSettings(camera) { + if (camera) { + this.uniforms.cameraNearFar.value.set(camera.near, camera.far); + if (camera instanceof PerspectiveCamera) { + this.defines.PERSPECTIVE_CAMERA = "1"; + } else { + delete this.defines.PERSPECTIVE_CAMERA; + } + this.needsUpdate = true; + } + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +var depth_copy_default = `#include +varying vec2 vUv; +#ifdef NORMAL_DEPTH +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D normalDepthBuffer; +#else +uniform mediump sampler2D normalDepthBuffer; +#endif +float readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;} +#else +#if INPUT_DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if INPUT_DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +} +#endif +void main(){ +#if INPUT_DEPTH_PACKING == OUTPUT_DEPTH_PACKING +gl_FragColor=texture2D(depthBuffer,vUv); +#else +float depth=readDepth(vUv); +#if OUTPUT_DEPTH_PACKING == 3201 +gl_FragColor=(depth==1.0)?vec4(1.0):packDepthToRGBA(depth); +#else +gl_FragColor=vec4(vec3(depth),1.0); +#endif +#endif +}`; +var depth_copy_default2 = `varying vec2 vUv; +#if DEPTH_COPY_MODE == 1 +uniform vec2 texelPosition; +#endif +void main(){ +#if DEPTH_COPY_MODE == 1 +vUv=texelPosition; +#else +vUv=position.xy*0.5+0.5; +#endif +gl_Position=vec4(position.xy,1.0,1.0);}`; +var DepthCopyMaterial = class extends ShaderMaterial { + /** + * Constructs a new depth copy material. + */ + constructor() { + super({ + name: "DepthCopyMaterial", + defines: { + INPUT_DEPTH_PACKING: "0", + OUTPUT_DEPTH_PACKING: "0", + DEPTH_COPY_MODE: "0" + }, + uniforms: { + depthBuffer: new Uniform(null), + texelPosition: new Uniform(new Vector2()) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: depth_copy_default, + vertexShader: depth_copy_default2 + }); + this.depthCopyMode = DepthCopyMode.FULL; + } + /** + * The input depth buffer. + * + * @type {Texture} + */ + get depthBuffer() { + return this.uniforms.depthBuffer.value; + } + set depthBuffer(value) { + this.uniforms.depthBuffer.value = value; + } + /** + * The input depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + set inputDepthPacking(value) { + this.defines.INPUT_DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * The output depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + get outputDepthPacking() { + return Number(this.defines.OUTPUT_DEPTH_PACKING); + } + set outputDepthPacking(value) { + this.defines.OUTPUT_DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the input depth buffer. + * + * @deprecated Use depthBuffer and inputDepthPacking instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthBuffer(buffer, depthPacking = BasicDepthPacking) { + this.depthBuffer = buffer; + this.inputDepthPacking = depthPacking; + } + /** + * Returns the current input depth packing strategy. + * + * @deprecated + * @return {DepthPackingStrategies} The input depth packing strategy. + */ + getInputDepthPacking() { + return Number(this.defines.INPUT_DEPTH_PACKING); + } + /** + * Sets the input depth packing strategy. + * + * @deprecated Use inputDepthPacking instead. + * @param {DepthPackingStrategies} value - The new input depth packing strategy. + */ + setInputDepthPacking(value) { + this.defines.INPUT_DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Returns the current output depth packing strategy. + * + * @deprecated Use outputDepthPacking instead. + * @return {DepthPackingStrategies} The output depth packing strategy. + */ + getOutputDepthPacking() { + return Number(this.defines.OUTPUT_DEPTH_PACKING); + } + /** + * Sets the output depth packing strategy. + * + * @deprecated Use outputDepthPacking instead. + * @param {DepthPackingStrategies} value - The new output depth packing strategy. + */ + setOutputDepthPacking(value) { + this.defines.OUTPUT_DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * The screen space position used for single-texel copy operations. + * + * @type {Vector2} + */ + get texelPosition() { + return this.uniforms.texelPosition.value; + } + /** + * Returns the screen space position used for single-texel copy operations. + * + * @deprecated Use texelPosition instead. + * @return {Vector2} The position. + */ + getTexelPosition() { + return this.uniforms.texelPosition.value; + } + /** + * Sets the screen space position used for single-texel copy operations. + * + * @deprecated + * @param {Vector2} value - The position. + */ + setTexelPosition(value) { + this.uniforms.texelPosition.value = value; + } + /** + * The depth copy mode. + * + * @type {DepthCopyMode} + */ + get mode() { + return this.depthCopyMode; + } + set mode(value) { + this.depthCopyMode = value; + this.defines.DEPTH_COPY_MODE = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Returns the depth copy mode. + * + * @deprecated Use mode instead. + * @return {DepthCopyMode} The depth copy mode. + */ + getMode() { + return this.mode; + } + /** + * Sets the depth copy mode. + * + * @deprecated Use mode instead. + * @param {DepthCopyMode} value - The new mode. + */ + setMode(value) { + this.mode = value; + } +}; +var effect_default = `#include +#include +#include +#define packFloatToRGBA(v) packDepthToRGBA(v) +#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); +#else +return orthographicDepthToViewZ(depth,cameraNear,cameraFar); +#endif +}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; +#ifdef ENCODE_OUTPUT +#include +#endif +#include +}`; +var effect_default2 = `uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}`; +var EffectMaterial = class extends ShaderMaterial { + /** + * Constructs a new effect material. + * + * @param {Map} [shaderParts] - Deprecated. Use setShaderData instead. + * @param {Map} [defines] - Deprecated. Use setShaderData instead. + * @param {Map} [uniforms] - Deprecated. Use setShaderData instead. + * @param {Camera} [camera] - A camera. + * @param {Boolean} [dithering=false] - Deprecated. + */ + constructor(shaderParts, defines, uniforms, camera, dithering = false) { + super({ + name: "EffectMaterial", + defines: { + THREE_REVISION: REVISION.replace(/\D+/g, ""), + DEPTH_PACKING: "0", + ENCODE_OUTPUT: "1" + }, + uniforms: { + inputBuffer: new Uniform(null), + depthBuffer: new Uniform(null), + resolution: new Uniform(new Vector2()), + texelSize: new Uniform(new Vector2()), + cameraNear: new Uniform(0.3), + cameraFar: new Uniform(1e3), + aspect: new Uniform(1), + time: new Uniform(0) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + dithering + }); + if (shaderParts) { + this.setShaderParts(shaderParts); + } + if (defines) { + this.setDefines(defines); + } + if (uniforms) { + this.setUniforms(uniforms); + } + this.copyCameraSettings(camera); + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * Sets the input buffer. + * + * @deprecated Use inputBuffer instead. + * @param {Texture} value - The input buffer. + */ + setInputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The depth buffer. + * + * @type {Texture} + */ + get depthBuffer() { + return this.uniforms.depthBuffer.value; + } + set depthBuffer(value) { + this.uniforms.depthBuffer.value = value; + } + /** + * The depth packing strategy. + * + * @type {DepthPackingStrategies} + */ + get depthPacking() { + return Number(this.defines.DEPTH_PACKING); + } + set depthPacking(value) { + this.defines.DEPTH_PACKING = value.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the depth buffer. + * + * @deprecated Use depthBuffer and depthPacking instead. + * @param {Texture} buffer - The depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthBuffer(buffer, depthPacking = BasicDepthPacking) { + this.depthBuffer = buffer; + this.depthPacking = depthPacking; + } + /** + * Sets the shader data. + * + * @param {EffectShaderData} data - The shader data. + * @return {EffectMaterial} This material. + */ + setShaderData(data) { + this.setShaderParts(data.shaderParts); + this.setDefines(data.defines); + this.setUniforms(data.uniforms); + this.setExtensions(data.extensions); + } + /** + * Sets the shader parts. + * + * @deprecated Use setShaderData instead. + * @param {Map} shaderParts - A collection of shader snippets. See {@link EffectShaderSection}. + * @return {EffectMaterial} This material. + */ + setShaderParts(shaderParts) { + this.fragmentShader = effect_default.replace(EffectShaderSection.FRAGMENT_HEAD, shaderParts.get(EffectShaderSection.FRAGMENT_HEAD) || "").replace(EffectShaderSection.FRAGMENT_MAIN_UV, shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV) || "").replace(EffectShaderSection.FRAGMENT_MAIN_IMAGE, shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE) || ""); + this.vertexShader = effect_default2.replace(EffectShaderSection.VERTEX_HEAD, shaderParts.get(EffectShaderSection.VERTEX_HEAD) || "").replace(EffectShaderSection.VERTEX_MAIN_SUPPORT, shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT) || ""); + this.needsUpdate = true; + return this; + } + /** + * Sets the shader macros. + * + * @deprecated Use setShaderData instead. + * @param {Map} defines - A collection of preprocessor macro definitions. + * @return {EffectMaterial} This material. + */ + setDefines(defines) { + for (const entry of defines.entries()) { + this.defines[entry[0]] = entry[1]; + } + this.needsUpdate = true; + return this; + } + /** + * Sets the shader uniforms. + * + * @deprecated Use setShaderData instead. + * @param {Map} uniforms - A collection of uniforms. + * @return {EffectMaterial} This material. + */ + setUniforms(uniforms) { + for (const entry of uniforms.entries()) { + this.uniforms[entry[0]] = entry[1]; + } + return this; + } + /** + * Sets the required shader extensions. + * + * @deprecated Use setShaderData instead. + * @param {Set} extensions - A collection of extensions. + * @return {EffectMaterial} This material. + */ + setExtensions(extensions) { + this.extensions = {}; + for (const extension of extensions) { + this.extensions[extension] = true; + } + return this; + } + /** + * Indicates whether output encoding is enabled. + * + * @type {Boolean} + */ + get encodeOutput() { + return this.defines.ENCODE_OUTPUT !== void 0; + } + set encodeOutput(value) { + if (this.encodeOutput !== value) { + if (value) { + this.defines.ENCODE_OUTPUT = "1"; + } else { + delete this.defines.ENCODE_OUTPUT; + } + this.needsUpdate = true; + } + } + /** + * Indicates whether output encoding is enabled. + * + * @deprecated Use encodeOutput instead. + * @return {Boolean} Whether output encoding is enabled. + */ + isOutputEncodingEnabled(value) { + return this.encodeOutput; + } + /** + * Enables or disables output encoding. + * + * @deprecated Use encodeOutput instead. + * @param {Boolean} value - Whether output encoding should be enabled. + */ + setOutputEncodingEnabled(value) { + this.encodeOutput = value; + } + /** + * The time in seconds. + * + * @type {Number} + */ + get time() { + return this.uniforms.time.value; + } + set time(value) { + this.uniforms.time.value = value; + } + /** + * Sets the delta time. + * + * @deprecated Use time instead. + * @param {Number} value - The delta time in seconds. + */ + setDeltaTime(value) { + this.uniforms.time.value += value; + } + /** + * Copies the settings of the given camera. + * + * @deprecated Use copyCameraSettings instead. + * @param {Camera} camera - A camera. + */ + adoptCameraSettings(camera) { + this.copyCameraSettings(camera); + } + /** + * Copies the settings of the given camera. + * + * @param {Camera} camera - A camera. + */ + copyCameraSettings(camera) { + if (camera) { + this.uniforms.cameraNear.value = camera.near; + this.uniforms.cameraFar.value = camera.far; + if (camera instanceof PerspectiveCamera) { + this.defines.PERSPECTIVE_CAMERA = "1"; + } else { + delete this.defines.PERSPECTIVE_CAMERA; + } + this.needsUpdate = true; + } + } + /** + * Sets the resolution. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const uniforms = this.uniforms; + uniforms.resolution.value.set(width, height); + uniforms.texelSize.value.set(1 / width, 1 / height); + uniforms.aspect.value = width / height; + } + /** + * An enumeration of shader code placeholders. + * + * @deprecated Use EffectShaderSection instead. + * @type {Object} + */ + static get Section() { + return EffectShaderSection; + } +}; +var convolution_gaussian_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +uniform vec2 kernel[STEPS];varying vec2 vOffset;varying vec2 vUv;void main(){vec4 result=texture2D(inputBuffer,vUv)*kernel[0].y;for(int i=1;i +}`; +var convolution_gaussian_default2 = `uniform vec2 texelSize;uniform vec2 direction;uniform float scale;varying vec2 vOffset;varying vec2 vUv;void main(){vOffset=direction*texelSize*scale;vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`; +var GaussianBlurMaterial = class extends ShaderMaterial { + /** + * Constructs a new convolution material. + * + * @param {Object} [options] - The options. + * @param {Number} [options.kernelSize=35] - The kernel size. + */ + constructor({ kernelSize = 35 } = {}) { + super({ + name: "GaussianBlurMaterial", + uniforms: { + inputBuffer: new Uniform(null), + texelSize: new Uniform(new Vector2()), + direction: new Uniform(new Vector2()), + kernel: new Uniform(null), + scale: new Uniform(1) + }, + blending: NoBlending, + toneMapped: false, + depthWrite: false, + depthTest: false, + fragmentShader: convolution_gaussian_default, + vertexShader: convolution_gaussian_default2 + }); + this._kernelSize = 0; + this.kernelSize = kernelSize; + } + /** + * The input buffer. + * + * @type {Texture} + */ + set inputBuffer(value) { + this.uniforms.inputBuffer.value = value; + } + /** + * The kernel size. + * + * @type {Number} + */ + get kernelSize() { + return this._kernelSize; + } + set kernelSize(value) { + this._kernelSize = value; + this.generateKernel(value); + } + /** + * The blur direction. + * + * @type {Vector2} + */ + get direction() { + return this.uniforms.direction.value; + } + /** + * The blur kernel scale. Values greater than 1.0 may introduce artifacts. + * + * @type {Number} + */ + get scale() { + return this.uniforms.scale.value; + } + set scale(value) { + this.uniforms.scale.value = value; + } + /** + * Generates the Gauss kernel. + * + * @param {KernelSize} kernelSize - The kernel size. Should be an odd number. + * @private + */ + generateKernel(kernelSize) { + const kernel = new GaussKernel(kernelSize); + const steps = kernel.linearSteps; + const kernelData = new Float64Array(steps * 2); + for (let i = 0, j = 0; i < steps; ++i) { + kernelData[j++] = kernel.linearOffsets[i]; + kernelData[j++] = kernel.linearWeights[i]; + } + this.uniforms.kernel.value = kernelData; + this.defines.STEPS = steps.toFixed(0); + this.needsUpdate = true; + } + /** + * Sets the size of this object. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.uniforms.texelSize.value.set(1 / width, 1 / height); + } +}; +var BoxBlurPass = class extends Pass { + /** + * Constructs a new box blur pass. + * + * @param {Object} [options] - The options. + * @param {Number} [options.kernelSize=5] - Must be an odd number. The sizes 3 and 5 use optimized code paths. + * @param {Number} [options.iterations=1] - The amount of times the blur should be applied. + * @param {Number} [options.bilateral=false] - Enables or disables bilateral blurring. + * @param {Number} [options.resolutionScale=1.0] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + */ + constructor({ + kernelSize = 5, + iterations = 1, + bilateral = false, + resolutionScale = 1, + resolutionX = Resolution.AUTO_SIZE, + resolutionY = Resolution.AUTO_SIZE + } = {}) { + super("BoxBlurPass"); + this.needsDepthTexture = bilateral; + this.renderTargetA = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetA.texture.name = "Blur.Target.A"; + this.renderTargetB = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetB.texture.name = "Blur.Target.B"; + this.blurMaterial = new BoxBlurMaterial({ bilateral, kernelSize }); + this.copyMaterial = new CopyMaterial(); + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + this.iterations = iterations; + } + set mainCamera(value) { + this.blurMaterial.copyCameraSettings(value); + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.blurMaterial.depthBuffer = depthTexture; + this.blurMaterial.depthPacking = depthPacking; + } + /** + * Renders the blur. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const scene = this.scene; + const camera = this.camera; + const renderTargetA = this.renderTargetA; + const renderTargetB = this.renderTargetB; + const blurMaterial = this.blurMaterial; + this.fullscreenMaterial = blurMaterial; + let previousBuffer = inputBuffer; + for (let i = 0, l = Math.max(this.iterations, 1); i < l; ++i) { + const buffer = (i & 1) === 0 ? renderTargetA : renderTargetB; + blurMaterial.inputBuffer = previousBuffer.texture; + renderer.setRenderTarget(buffer); + renderer.render(scene, camera); + previousBuffer = buffer; + } + this.copyMaterial.inputBuffer = previousBuffer.texture; + this.fullscreenMaterial = this.copyMaterial; + renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer); + renderer.render(scene, camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.renderTargetA.setSize(w, h); + this.renderTargetB.setSize(w, h); + this.blurMaterial.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (renderer !== null) { + this.blurMaterial.maxVaryingVectors = renderer.capabilities.maxVaryings; + } + if (frameBufferType !== void 0) { + this.renderTargetA.texture.type = frameBufferType; + this.renderTargetB.texture.type = frameBufferType; + if (frameBufferType !== UnsignedByteType) { + this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTargetA.texture.colorSpace = SRGBColorSpace; + this.renderTargetB.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var DepthCopyPass = class extends Pass { + /** + * Constructs a new depth save pass. + * + * @param {Object} [options] - The options. + * @param {DepthPackingStrategies} [options.depthPacking=RGBADepthPacking] - The output depth packing. + */ + constructor({ depthPacking = RGBADepthPacking } = {}) { + super("DepthCopyPass"); + const material = new DepthCopyMaterial(); + material.outputDepthPacking = depthPacking; + this.fullscreenMaterial = material; + this.needsDepthTexture = true; + this.needsSwap = false; + this.renderTarget = new WebGLRenderTarget(1, 1, { + type: depthPacking === RGBADepthPacking ? UnsignedByteType : FloatType, + minFilter: NearestFilter, + magFilter: NearestFilter, + depthBuffer: false + }); + this.renderTarget.texture.name = "DepthCopyPass.Target"; + } + /** + * The output depth texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * Returns the output depth texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTarget.texture; + } + /** + * The output depth packing. + * + * @type {DepthPackingStrategies} + */ + get depthPacking() { + return this.fullscreenMaterial.outputDepthPacking; + } + /** + * Returns the output depth packing. + * + * @deprecated Use depthPacking instead. + * @return {DepthPackingStrategies} The depth packing. + */ + getDepthPacking() { + return this.fullscreenMaterial.outputDepthPacking; + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.fullscreenMaterial.depthBuffer = depthTexture; + this.fullscreenMaterial.inputDepthPacking = depthPacking; + } + /** + * Copies depth from a depth texture. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget); + renderer.render(this.scene, this.camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.renderTarget.setSize(width, height); + } +}; +var threeRevision = Number(REVISION.replace(/\D+/g, "")); +var unpackDownscale = 255 / 256; +var unpackFactorsLegacy = new Float32Array([ + unpackDownscale / 256 ** 3, + unpackDownscale / 256 ** 2, + unpackDownscale / 256, + unpackDownscale +]); +var unpackFactors = new Float32Array([ + unpackDownscale, + unpackDownscale / 256, + unpackDownscale / 256 ** 2, + 1 / 256 ** 3 +]); +function unpackRGBAToDepth(packedDepth) { + const f = threeRevision >= 167 ? unpackFactors : unpackFactorsLegacy; + return (packedDepth[0] * f[0] + packedDepth[1] * f[1] + packedDepth[2] * f[2] + packedDepth[3] * f[3]) / 255; +} +var DepthPickingPass = class extends DepthCopyPass { + /** + * Constructs a new depth picking pass. + * + * @param {Object} [options] - The options. + * @param {DepthPackingStrategies} [options.depthPacking=RGBADepthPacking] - The depth packing. + * @param {Number} [options.mode=DepthCopyMode.SINGLE] - The depth copy mode. + */ + constructor({ depthPacking = RGBADepthPacking, mode = DepthCopyMode.SINGLE } = {}) { + if (depthPacking !== RGBADepthPacking && depthPacking !== BasicDepthPacking) { + throw new Error(`Unsupported depth packing: ${depthPacking}`); + } + super({ depthPacking }); + this.name = "DepthPickingPass"; + this.fullscreenMaterial.mode = mode; + this.pixelBuffer = depthPacking === RGBADepthPacking ? new Uint8Array(4) : new Float32Array(4); + this.callback = null; + } + /** + * Reads depth at a specific screen position. + * + * Only one depth value can be picked per frame. Calling this method multiple times per frame will overwrite the + * picking coordinates. Unresolved promises will be abandoned. + * + * @example + * const ndc = new Vector3(); + * const clientRect = myViewport.getBoundingClientRect(); + * const clientX = pointerEvent.clientX - clientRect.left; + * const clientY = pointerEvent.clientY - clientRect.top; + * ndc.x = (clientX / myViewport.clientWidth) * 2.0 - 1.0; + * ndc.y = -(clientY / myViewport.clientHeight) * 2.0 + 1.0; + * const depth = await depthPickingPass.readDepth(ndc); + * ndc.z = depth * 2.0 - 1.0; + * + * const worldPosition = ndc.unproject(camera); + * + * @param {Vector2|Vector3} ndc - Normalized device coordinates. Only X and Y are relevant. + * @return {Promise} A promise that returns the depth on the next frame. + */ + readDepth(ndc) { + this.fullscreenMaterial.texelPosition.set(ndc.x * 0.5 + 0.5, ndc.y * 0.5 + 0.5); + return new Promise((resolve) => { + this.callback = resolve; + }); + } + /** + * Copies depth and resolves depth picking promises. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const material = this.fullscreenMaterial; + const mode = material.mode; + if (mode === DepthCopyMode.FULL) { + super.render(renderer); + } + if (this.callback !== null) { + const renderTarget = this.renderTarget; + const pixelBuffer = this.pixelBuffer; + const packed = renderTarget.texture.type !== FloatType; + let x = 0, y = 0; + if (mode === DepthCopyMode.SINGLE) { + super.render(renderer); + } else { + const texelPosition = material.texelPosition; + x = Math.round(texelPosition.x * renderTarget.width); + y = Math.round(texelPosition.y * renderTarget.height); + } + renderer.readRenderTargetPixels(renderTarget, x, y, 1, 1, pixelBuffer); + this.callback(packed ? unpackRGBAToDepth(pixelBuffer) : pixelBuffer[0]); + this.callback = null; + } + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + if (this.fullscreenMaterial.mode === DepthCopyMode.FULL) { + super.setSize(width, height); + } + } +}; +function prefixSubstrings(prefix, substrings, strings) { + for (const substring of substrings) { + const prefixed = "$1" + prefix + substring.charAt(0).toUpperCase() + substring.slice(1); + const regExp = new RegExp("([^\\.])(\\b" + substring + "\\b)", "g"); + for (const entry of strings.entries()) { + if (entry[1] !== null) { + strings.set(entry[0], entry[1].replace(regExp, prefixed)); + } + } + } +} +function integrateEffect(prefix, effect, data) { + let fragmentShader = effect.getFragmentShader(); + let vertexShader = effect.getVertexShader(); + const mainImageExists = fragmentShader !== void 0 && /mainImage/.test(fragmentShader); + const mainUvExists = fragmentShader !== void 0 && /mainUv/.test(fragmentShader); + data.attributes |= effect.getAttributes(); + if (fragmentShader === void 0) { + throw new Error(`Missing fragment shader (${effect.name})`); + } else if (mainUvExists && (data.attributes & EffectAttribute.CONVOLUTION) !== 0) { + throw new Error(`Effects that transform UVs are incompatible with convolution effects (${effect.name})`); + } else if (!mainImageExists && !mainUvExists) { + throw new Error(`Could not find mainImage or mainUv function (${effect.name})`); + } else { + const functionRegExp = /\w+\s+(\w+)\([\w\s,]*\)\s*{/g; + const shaderParts = data.shaderParts; + let fragmentHead = shaderParts.get(EffectShaderSection.FRAGMENT_HEAD) || ""; + let fragmentMainUv = shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV) || ""; + let fragmentMainImage = shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE) || ""; + let vertexHead = shaderParts.get(EffectShaderSection.VERTEX_HEAD) || ""; + let vertexMainSupport = shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT) || ""; + const varyings = /* @__PURE__ */ new Set(); + const names = /* @__PURE__ */ new Set(); + if (mainUvExists) { + fragmentMainUv += ` ${prefix}MainUv(UV); +`; + data.uvTransformation = true; + } + if (vertexShader !== null && /mainSupport/.test(vertexShader)) { + const needsUv = /mainSupport *\([\w\s]*?uv\s*?\)/.test(vertexShader); + vertexMainSupport += ` ${prefix}MainSupport(`; + vertexMainSupport += needsUv ? "vUv);\n" : ");\n"; + for (const m2 of vertexShader.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g)) { + for (const n of m2[1].split(/\s*,\s*/)) { + data.varyings.add(n); + varyings.add(n); + names.add(n); + } + } + for (const m2 of vertexShader.matchAll(functionRegExp)) { + names.add(m2[1]); + } + } + for (const m2 of fragmentShader.matchAll(functionRegExp)) { + names.add(m2[1]); + } + for (const d of effect.defines.keys()) { + names.add(d.replace(/\([\w\s,]*\)/g, "")); + } + for (const u of effect.uniforms.keys()) { + names.add(u); + } + names.delete("while"); + names.delete("for"); + names.delete("if"); + effect.uniforms.forEach((val, key) => data.uniforms.set(prefix + key.charAt(0).toUpperCase() + key.slice(1), val)); + effect.defines.forEach((val, key) => data.defines.set(prefix + key.charAt(0).toUpperCase() + key.slice(1), val)); + const shaders = /* @__PURE__ */ new Map([["fragment", fragmentShader], ["vertex", vertexShader]]); + prefixSubstrings(prefix, names, data.defines); + prefixSubstrings(prefix, names, shaders); + fragmentShader = shaders.get("fragment"); + vertexShader = shaders.get("vertex"); + const blendMode = effect.blendMode; + data.blendModes.set(blendMode.blendFunction, blendMode); + if (mainImageExists) { + if (effect.inputColorSpace !== null && effect.inputColorSpace !== data.colorSpace) { + fragmentMainImage += effect.inputColorSpace === SRGBColorSpace ? "color0 = sRGBTransferOETF(color0);\n " : "color0 = sRGBToLinear(color0);\n "; + } + if (effect.outputColorSpace !== NoColorSpace) { + data.colorSpace = effect.outputColorSpace; + } else if (effect.inputColorSpace !== null) { + data.colorSpace = effect.inputColorSpace; + } + const depthParamRegExp = /MainImage *\([\w\s,]*?depth[\w\s,]*?\)/; + fragmentMainImage += `${prefix}MainImage(color0, UV, `; + if ((data.attributes & EffectAttribute.DEPTH) !== 0 && depthParamRegExp.test(fragmentShader)) { + fragmentMainImage += "depth, "; + data.readDepth = true; + } + fragmentMainImage += "color1);\n "; + const blendOpacity = prefix + "BlendOpacity"; + data.uniforms.set(blendOpacity, blendMode.opacity); + fragmentMainImage += `color0 = blend${blendMode.blendFunction}(color0, color1, ${blendOpacity}); + + `; + fragmentHead += `uniform float ${blendOpacity}; + +`; + } + fragmentHead += fragmentShader + "\n"; + if (vertexShader !== null) { + vertexHead += vertexShader + "\n"; + } + shaderParts.set(EffectShaderSection.FRAGMENT_HEAD, fragmentHead); + shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV, fragmentMainUv); + shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE, fragmentMainImage); + shaderParts.set(EffectShaderSection.VERTEX_HEAD, vertexHead); + shaderParts.set(EffectShaderSection.VERTEX_MAIN_SUPPORT, vertexMainSupport); + if (effect.extensions !== null) { + for (const extension of effect.extensions) { + data.extensions.add(extension); + } + } + } +} +var EffectPass = class extends Pass { + /** + * Constructs a new effect pass. + * + * @param {Camera} camera - The main camera. + * @param {...Effect} effects - The effects that will be rendered by this pass. + */ + constructor(camera, ...effects) { + super("EffectPass"); + this.fullscreenMaterial = new EffectMaterial(null, null, null, camera); + this.listener = (event) => this.handleEvent(event); + this.effects = []; + this.setEffects(effects); + this.skipRendering = false; + this.minTime = 1; + this.maxTime = Number.POSITIVE_INFINITY; + this.timeScale = 1; + } + set mainScene(value) { + for (const effect of this.effects) { + effect.mainScene = value; + } + } + set mainCamera(value) { + this.fullscreenMaterial.copyCameraSettings(value); + for (const effect of this.effects) { + effect.mainCamera = value; + } + } + /** + * Indicates whether this pass encodes its output when rendering to screen. + * + * @type {Boolean} + * @deprecated Use fullscreenMaterial.encodeOutput instead. + */ + get encodeOutput() { + return this.fullscreenMaterial.encodeOutput; + } + set encodeOutput(value) { + this.fullscreenMaterial.encodeOutput = value; + } + /** + * Indicates whether dithering is enabled. + * + * @type {Boolean} + */ + get dithering() { + return this.fullscreenMaterial.dithering; + } + set dithering(value) { + const material = this.fullscreenMaterial; + material.dithering = value; + material.needsUpdate = true; + } + /** + * Sets the effects. + * + * @param {Effect[]} effects - The effects. + * @protected + */ + setEffects(effects) { + for (const effect of this.effects) { + effect.removeEventListener("change", this.listener); + } + this.effects = effects.sort((a, b) => b.attributes - a.attributes); + for (const effect of this.effects) { + effect.addEventListener("change", this.listener); + } + } + /** + * Updates the compound shader material. + * + * @protected + */ + updateMaterial() { + const data = new EffectShaderData(); + let id = 0; + for (const effect of this.effects) { + if (effect.blendMode.blendFunction === BlendFunction.DST) { + data.attributes |= effect.getAttributes() & EffectAttribute.DEPTH; + } else if ((data.attributes & effect.getAttributes() & EffectAttribute.CONVOLUTION) !== 0) { + throw new Error(`Convolution effects cannot be merged (${effect.name})`); + } else { + integrateEffect("e" + id++, effect, data); + } + } + let fragmentHead = data.shaderParts.get(EffectShaderSection.FRAGMENT_HEAD); + let fragmentMainImage = data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE); + let fragmentMainUv = data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV); + const blendRegExp = /\bblend\b/g; + for (const blendMode of data.blendModes.values()) { + fragmentHead += blendMode.getShaderCode().replace(blendRegExp, `blend${blendMode.blendFunction}`) + "\n"; + } + if ((data.attributes & EffectAttribute.DEPTH) !== 0) { + if (data.readDepth) { + fragmentMainImage = "float depth = readDepth(UV);\n\n " + fragmentMainImage; + } + this.needsDepthTexture = this.getDepthTexture() === null; + } else { + this.needsDepthTexture = false; + } + if (data.colorSpace === SRGBColorSpace) { + fragmentMainImage += "color0 = sRGBToLinear(color0);\n "; + } + if (data.uvTransformation) { + fragmentMainUv = "vec2 transformedUv = vUv;\n" + fragmentMainUv; + data.defines.set("UV", "transformedUv"); + } else { + data.defines.set("UV", "vUv"); + } + data.shaderParts.set(EffectShaderSection.FRAGMENT_HEAD, fragmentHead); + data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE, fragmentMainImage); + data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV, fragmentMainUv); + for (const [key, value] of data.shaderParts) { + if (value !== null) { + data.shaderParts.set(key, value.trim().replace(/^#/, "\n#")); + } + } + this.skipRendering = id === 0; + this.needsSwap = !this.skipRendering; + this.fullscreenMaterial.setShaderData(data); + } + /** + * Rebuilds the shader material. + */ + recompile() { + this.updateMaterial(); + } + /** + * Returns the current depth texture. + * + * @return {Texture} The current depth texture, or null if there is none. + */ + getDepthTexture() { + return this.fullscreenMaterial.depthBuffer; + } + /** + * Sets the depth texture. + * + * @param {Texture} depthTexture - A depth texture. + * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing. + */ + setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) { + this.fullscreenMaterial.depthBuffer = depthTexture; + this.fullscreenMaterial.depthPacking = depthPacking; + for (const effect of this.effects) { + effect.setDepthTexture(depthTexture, depthPacking); + } + } + /** + * Renders the effect. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + for (const effect of this.effects) { + effect.update(renderer, inputBuffer, deltaTime); + } + if (!this.skipRendering || this.renderToScreen) { + const material = this.fullscreenMaterial; + material.inputBuffer = inputBuffer.texture; + material.time += deltaTime * this.timeScale; + renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer); + renderer.render(this.scene, this.camera); + } + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + this.fullscreenMaterial.setSize(width, height); + for (const effect of this.effects) { + effect.setSize(width, height); + } + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + this.renderer = renderer; + for (const effect of this.effects) { + effect.initialize(renderer, alpha, frameBufferType); + } + this.updateMaterial(); + if (frameBufferType !== void 0 && frameBufferType !== UnsignedByteType) { + this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } + } + /** + * Deletes disposable objects. + */ + dispose() { + super.dispose(); + for (const effect of this.effects) { + effect.removeEventListener("change", this.listener); + effect.dispose(); + } + } + /** + * Handles events. + * + * @param {Event} event - An event. + */ + handleEvent(event) { + switch (event.type) { + case "change": + this.recompile(); + break; + } + } +}; +var GaussianBlurPass = class extends Pass { + /** + * Constructs a new Gaussian blur pass. + * + * @param {Object} [options] - The options. + * @param {Number} [options.kernelSize=35] - The kernel size. Should be an odd number in the range [3, 1020]. + * @param {Number} [options.iterations=1] - The amount of times the blur should be applied. + * @param {Number} [options.resolutionScale=1.0] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + */ + constructor({ + kernelSize = 35, + iterations = 1, + resolutionScale = 1, + resolutionX = Resolution.AUTO_SIZE, + resolutionY = Resolution.AUTO_SIZE + } = {}) { + super("GaussianBlurPass"); + this.renderTargetA = new WebGLRenderTarget(1, 1, { depthBuffer: false }); + this.renderTargetA.texture.name = "Blur.Target.A"; + this.renderTargetB = this.renderTargetA.clone(); + this.renderTargetB.texture.name = "Blur.Target.B"; + this.blurMaterial = new GaussianBlurMaterial({ kernelSize }); + this.copyMaterial = new CopyMaterial(); + this.copyMaterial.inputBuffer = this.renderTargetB.texture; + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + this.iterations = iterations; + } + /** + * Renders the blur. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const scene = this.scene; + const camera = this.camera; + const renderTargetA = this.renderTargetA; + const renderTargetB = this.renderTargetB; + const blurMaterial = this.blurMaterial; + this.fullscreenMaterial = blurMaterial; + let previousBuffer = inputBuffer; + for (let i = 0, l = Math.max(this.iterations, 1); i < l; ++i) { + blurMaterial.direction.set(1, 0); + blurMaterial.inputBuffer = previousBuffer.texture; + renderer.setRenderTarget(renderTargetA); + renderer.render(scene, camera); + blurMaterial.direction.set(0, 1); + blurMaterial.inputBuffer = renderTargetA.texture; + renderer.setRenderTarget(renderTargetB); + renderer.render(scene, camera); + if (i === 0 && l > 1) { + previousBuffer = renderTargetB; + } + } + this.fullscreenMaterial = this.copyMaterial; + renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer); + renderer.render(scene, camera); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + const w = resolution.width, h = resolution.height; + this.renderTargetA.setSize(w, h); + this.renderTargetB.setSize(w, h); + this.blurMaterial.setSize(width, height); + } + /** + * Performs initialization tasks. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. + * @param {Number} frameBufferType - The type of the main frame buffers. + */ + initialize(renderer, alpha, frameBufferType) { + if (frameBufferType !== void 0) { + this.renderTargetA.texture.type = frameBufferType; + this.renderTargetB.texture.type = frameBufferType; + if (frameBufferType !== UnsignedByteType) { + this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1"; + } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) { + this.renderTargetA.texture.colorSpace = SRGBColorSpace; + this.renderTargetB.texture.colorSpace = SRGBColorSpace; + } + } + } +}; +var LambdaPass = class extends Pass { + /** + * Constructs a new lambda pass. + * + * @param {Function} f - A function. + */ + constructor(f) { + super("LambdaPass", null, null); + this.needsSwap = false; + this.f = f; + } + /** + * Executes the function. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + this.f(); + } +}; +var NormalPass = class extends Pass { + /** + * Constructs a new normal pass. + * + * @param {Scene} scene - The scene to render. + * @param {Camera} camera - The camera to use to render the scene. + * @param {Object} [options] - The options. + * @param {WebGLRenderTarget} [options.renderTarget] - A custom render target. + * @param {Number} [options.resolutionScale=1.0] - The resolution scale. + * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution. + * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution. + * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead. + * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead. + */ + constructor(scene, camera, { + renderTarget, + resolutionScale = 1, + width = Resolution.AUTO_SIZE, + height = Resolution.AUTO_SIZE, + resolutionX = width, + resolutionY = height + } = {}) { + super("NormalPass"); + this.needsSwap = false; + this.renderPass = new RenderPass(scene, camera, new MeshNormalMaterial()); + const renderPass = this.renderPass; + renderPass.ignoreBackground = true; + renderPass.skipShadowMapUpdate = true; + const clearPass = renderPass.getClearPass(); + clearPass.overrideClearColor = new Color(7829503); + clearPass.overrideClearAlpha = 1; + this.renderTarget = renderTarget; + if (this.renderTarget === void 0) { + this.renderTarget = new WebGLRenderTarget(1, 1, { + minFilter: NearestFilter, + magFilter: NearestFilter + }); + this.renderTarget.texture.name = "NormalPass.Target"; + } + const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale); + resolution.addEventListener("change", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight)); + } + set mainScene(value) { + this.renderPass.mainScene = value; + } + set mainCamera(value) { + this.renderPass.mainCamera = value; + } + /** + * The normal texture. + * + * @type {Texture} + */ + get texture() { + return this.renderTarget.texture; + } + /** + * The normal texture. + * + * @deprecated Use texture instead. + * @return {Texture} The texture. + */ + getTexture() { + return this.renderTarget.texture; + } + /** + * Returns the resolution settings. + * + * @deprecated Use resolution instead. + * @return {Resolution} The resolution. + */ + getResolution() { + return this.resolution; + } + /** + * Returns the current resolution scale. + * + * @return {Number} The resolution scale. + * @deprecated Use resolution.preferredWidth or resolution.preferredHeight instead. + */ + getResolutionScale() { + return this.resolution.scale; + } + /** + * Sets the resolution scale. + * + * @param {Number} scale - The new resolution scale. + * @deprecated Use resolution.preferredWidth or resolution.preferredHeight instead. + */ + setResolutionScale(scale) { + this.resolution.scale = scale; + } + /** + * Renders the scene normals. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass. + * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen. + * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds. + * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active. + */ + render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) { + const renderTarget = this.renderToScreen ? null : this.renderTarget; + this.renderPass.render(renderer, renderTarget, renderTarget); + } + /** + * Updates the size of this pass. + * + * @param {Number} width - The width. + * @param {Number} height - The height. + */ + setSize(width, height) { + const resolution = this.resolution; + resolution.setBaseSize(width, height); + this.renderTarget.setSize(resolution.width, resolution.height); + } +}; +var P = [ + new Float32Array(3), + new Float32Array(3) +]; +var C = [ + new Float32Array(3), + new Float32Array(3), + new Float32Array(3), + new Float32Array(3) +]; +var T = [ + [ + new Float32Array([0, 0, 0]), + new Float32Array([1, 0, 0]), + new Float32Array([1, 1, 0]), + new Float32Array([1, 1, 1]) + ], + [ + new Float32Array([0, 0, 0]), + new Float32Array([1, 0, 0]), + new Float32Array([1, 0, 1]), + new Float32Array([1, 1, 1]) + ], + [ + new Float32Array([0, 0, 0]), + new Float32Array([0, 0, 1]), + new Float32Array([1, 0, 1]), + new Float32Array([1, 1, 1]) + ], + [ + new Float32Array([0, 0, 0]), + new Float32Array([0, 1, 0]), + new Float32Array([1, 1, 0]), + new Float32Array([1, 1, 1]) + ], + [ + new Float32Array([0, 0, 0]), + new Float32Array([0, 1, 0]), + new Float32Array([0, 1, 1]), + new Float32Array([1, 1, 1]) + ], + [ + new Float32Array([0, 0, 0]), + new Float32Array([0, 0, 1]), + new Float32Array([0, 1, 1]), + new Float32Array([1, 1, 1]) + ] +]; +function calculateTetrahedronVolume(a, b, c2, d) { + const bcX = c2[0] - b[0]; + const bcY = c2[1] - b[1]; + const bcZ = c2[2] - b[2]; + const baX = a[0] - b[0]; + const baY = a[1] - b[1]; + const baZ = a[2] - b[2]; + const crossX = bcY * baZ - bcZ * baY; + const crossY = bcZ * baX - bcX * baZ; + const crossZ = bcX * baY - bcY * baX; + const length = Math.sqrt(crossX * crossX + crossY * crossY + crossZ * crossZ); + const triangleArea = length * 0.5; + const normalX = crossX / length; + const normalY = crossY / length; + const normalZ = crossZ / length; + const constant = -(a[0] * normalX + a[1] * normalY + a[2] * normalZ); + const dot = d[0] * normalX + d[1] * normalY + d[2] * normalZ; + const height = Math.abs(dot + constant); + return height * triangleArea / 3; +} +function sample(data, size, x, y, z, color2) { + const i4 = (x + y * size + z * size * size) * 4; + color2[0] = data[i4 + 0]; + color2[1] = data[i4 + 1]; + color2[2] = data[i4 + 2]; +} +function tetrahedralSample(data, size, u, v3, w, color2) { + const px = u * (size - 1); + const py = v3 * (size - 1); + const pz = w * (size - 1); + const minX = Math.floor(px); + const minY = Math.floor(py); + const minZ = Math.floor(pz); + const maxX = Math.ceil(px); + const maxY = Math.ceil(py); + const maxZ = Math.ceil(pz); + const su = px - minX; + const sv = py - minY; + const sw = pz - minZ; + if (minX === px && minY === py && minZ === pz) { + sample(data, size, px, py, pz, color2); + } else { + let vertices; + if (su >= sv && sv >= sw) { + vertices = T[0]; + } else if (su >= sw && sw >= sv) { + vertices = T[1]; + } else if (sw >= su && su >= sv) { + vertices = T[2]; + } else if (sv >= su && su >= sw) { + vertices = T[3]; + } else if (sv >= sw && sw >= su) { + vertices = T[4]; + } else if (sw >= sv && sv >= su) { + vertices = T[5]; + } + const [P0, P1, P2, P3] = vertices; + const coords = P[0]; + coords[0] = su; + coords[1] = sv; + coords[2] = sw; + const tmp = P[1]; + const diffX = maxX - minX; + const diffY = maxY - minY; + const diffZ = maxZ - minZ; + tmp[0] = diffX * P0[0] + minX; + tmp[1] = diffY * P0[1] + minY; + tmp[2] = diffZ * P0[2] + minZ; + sample(data, size, tmp[0], tmp[1], tmp[2], C[0]); + tmp[0] = diffX * P1[0] + minX; + tmp[1] = diffY * P1[1] + minY; + tmp[2] = diffZ * P1[2] + minZ; + sample(data, size, tmp[0], tmp[1], tmp[2], C[1]); + tmp[0] = diffX * P2[0] + minX; + tmp[1] = diffY * P2[1] + minY; + tmp[2] = diffZ * P2[2] + minZ; + sample(data, size, tmp[0], tmp[1], tmp[2], C[2]); + tmp[0] = diffX * P3[0] + minX; + tmp[1] = diffY * P3[1] + minY; + tmp[2] = diffZ * P3[2] + minZ; + sample(data, size, tmp[0], tmp[1], tmp[2], C[3]); + const V0 = calculateTetrahedronVolume(P1, P2, P3, coords) * 6; + const V1 = calculateTetrahedronVolume(P0, P2, P3, coords) * 6; + const V2 = calculateTetrahedronVolume(P0, P1, P3, coords) * 6; + const V3 = calculateTetrahedronVolume(P0, P1, P2, coords) * 6; + C[0][0] *= V0; + C[0][1] *= V0; + C[0][2] *= V0; + C[1][0] *= V1; + C[1][1] *= V1; + C[1][2] *= V1; + C[2][0] *= V2; + C[2][1] *= V2; + C[2][2] *= V2; + C[3][0] *= V3; + C[3][1] *= V3; + C[3][2] *= V3; + color2[0] = C[0][0] + C[1][0] + C[2][0] + C[3][0]; + color2[1] = C[0][1] + C[1][1] + C[2][1] + C[3][1]; + color2[2] = C[0][2] + C[1][2] + C[2][2] + C[3][2]; + } +} +var TetrahedralUpscaler = class { + /** + * Expands the given data to the target size. + * + * @param {TypedArray} data - The input RGBA data. Assumed to be cubic. + * @param {Number} size - The target size. + * @return {TypedArray} The new data. + */ + static expand(data, size) { + const originalSize = Math.cbrt(data.length / 4); + const rgb = new Float32Array(3); + const array = new data.constructor(size ** 3 * 4); + const maxValue = data instanceof Uint8Array ? 255 : 1; + const sizeSq = size ** 2; + const s = 1 / (size - 1); + for (let z = 0; z < size; ++z) { + for (let y = 0; y < size; ++y) { + for (let x = 0; x < size; ++x) { + const u = x * s; + const v3 = y * s; + const w = z * s; + const i4 = Math.round(x + y * size + z * sizeSq) * 4; + tetrahedralSample(data, originalSize, u, v3, w, rgb); + array[i4 + 0] = rgb[0]; + array[i4 + 1] = rgb[1]; + array[i4 + 2] = rgb[2]; + array[i4 + 3] = maxValue; + } + } + } + return array; + } +}; +var area = [ + new Float32Array(2), + new Float32Array(2) +]; +var ORTHOGONAL_SIZE = 16; +var DIAGONAL_SIZE = 20; +var DIAGONAL_SAMPLES = 30; +var SMOOTH_MAX_DISTANCE = 32; +var orthogonalSubsamplingOffsets = new Float32Array([ + 0, + -0.25, + 0.25, + -0.125, + 0.125, + -0.375, + 0.375 +]); +var diagonalSubsamplingOffsets = [ + new Float32Array([0, 0]), + new Float32Array([0.25, -0.25]), + new Float32Array([-0.25, 0.25]), + new Float32Array([0.125, -0.125]), + new Float32Array([-0.125, 0.125]) +]; +var orthogonalEdges = [ + new Uint8Array([0, 0]), + new Uint8Array([3, 0]), + new Uint8Array([0, 3]), + new Uint8Array([3, 3]), + new Uint8Array([1, 0]), + new Uint8Array([4, 0]), + new Uint8Array([1, 3]), + new Uint8Array([4, 3]), + new Uint8Array([0, 1]), + new Uint8Array([3, 1]), + new Uint8Array([0, 4]), + new Uint8Array([3, 4]), + new Uint8Array([1, 1]), + new Uint8Array([4, 1]), + new Uint8Array([1, 4]), + new Uint8Array([4, 4]) +]; +var diagonalEdges = [ + new Uint8Array([0, 0]), + new Uint8Array([1, 0]), + new Uint8Array([0, 2]), + new Uint8Array([1, 2]), + new Uint8Array([2, 0]), + new Uint8Array([3, 0]), + new Uint8Array([2, 2]), + new Uint8Array([3, 2]), + new Uint8Array([0, 1]), + new Uint8Array([1, 1]), + new Uint8Array([0, 3]), + new Uint8Array([1, 3]), + new Uint8Array([2, 1]), + new Uint8Array([3, 1]), + new Uint8Array([2, 3]), + new Uint8Array([3, 3]) +]; +function lerp(a, b, p) { + return a + (b - a) * p; +} +function saturate(a) { + return Math.min(Math.max(a, 0), 1); +} +function smoothArea(d) { + const a1 = area[0]; + const a2 = area[1]; + const b1X = Math.sqrt(a1[0] * 2) * 0.5; + const b1Y = Math.sqrt(a1[1] * 2) * 0.5; + const b2X = Math.sqrt(a2[0] * 2) * 0.5; + const b2Y = Math.sqrt(a2[1] * 2) * 0.5; + const p = saturate(d / SMOOTH_MAX_DISTANCE); + a1[0] = lerp(b1X, a1[0], p); + a1[1] = lerp(b1Y, a1[1], p); + a2[0] = lerp(b2X, a2[0], p); + a2[1] = lerp(b2Y, a2[1], p); +} +function getOrthArea(p1X, p1Y, p2X, p2Y, x, result) { + const dX = p2X - p1X; + const dY = p2Y - p1Y; + const x1 = x; + const x2 = x + 1; + const y1 = p1Y + dY * (x1 - p1X) / dX; + const y2 = p1Y + dY * (x2 - p1X) / dX; + if (x1 >= p1X && x1 < p2X || x2 > p1X && x2 <= p2X) { + if (Math.sign(y1) === Math.sign(y2) || Math.abs(y1) < 1e-4 || Math.abs(y2) < 1e-4) { + const a = (y1 + y2) / 2; + if (a < 0) { + result[0] = Math.abs(a); + result[1] = 0; + } else { + result[0] = 0; + result[1] = Math.abs(a); + } + } else { + const t = -p1Y * dX / dY + p1X; + const tInt = Math.trunc(t); + const a1 = t > p1X ? y1 * (t - tInt) / 2 : 0; + const a2 = t < p2X ? y2 * (1 - (t - tInt)) / 2 : 0; + const a = Math.abs(a1) > Math.abs(a2) ? a1 : -a2; + if (a < 0) { + result[0] = Math.abs(a1); + result[1] = Math.abs(a2); + } else { + result[0] = Math.abs(a2); + result[1] = Math.abs(a1); + } + } + } else { + result[0] = 0; + result[1] = 0; + } + return result; +} +function getOrthAreaForPattern(pattern, left, right, offset, result) { + const a1 = area[0]; + const a2 = area[1]; + const o1 = 0.5 + offset; + const o2 = 0.5 + offset - 1; + const d = left + right + 1; + switch (pattern) { + case 0: { + result[0] = 0; + result[1] = 0; + break; + } + case 1: { + if (left <= right) { + getOrthArea(0, o2, d / 2, 0, left, result); + } else { + result[0] = 0; + result[1] = 0; + } + break; + } + case 2: { + if (left >= right) { + getOrthArea(d / 2, 0, d, o2, left, result); + } else { + result[0] = 0; + result[1] = 0; + } + break; + } + case 3: { + getOrthArea(0, o2, d / 2, 0, left, a1); + getOrthArea(d / 2, 0, d, o2, left, a2); + smoothArea(d, area); + result[0] = a1[0] + a2[0]; + result[1] = a1[1] + a2[1]; + break; + } + case 4: { + if (left <= right) { + getOrthArea(0, o1, d / 2, 0, left, result); + } else { + result[0] = 0; + result[1] = 0; + } + break; + } + case 5: { + result[0] = 0; + result[1] = 0; + break; + } + case 6: { + if (Math.abs(offset) > 0) { + getOrthArea(0, o1, d, o2, left, a1); + getOrthArea(0, o1, d / 2, 0, left, a2); + getOrthArea(d / 2, 0, d, o2, left, result); + a2[0] = a2[0] + result[0]; + a2[1] = a2[1] + result[1]; + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + } else { + getOrthArea(0, o1, d, o2, left, result); + } + break; + } + case 7: { + getOrthArea(0, o1, d, o2, left, result); + break; + } + case 8: { + if (left >= right) { + getOrthArea(d / 2, 0, d, o1, left, result); + } else { + result[0] = 0; + result[1] = 0; + } + break; + } + case 9: { + if (Math.abs(offset) > 0) { + getOrthArea(0, o2, d, o1, left, a1); + getOrthArea(0, o2, d / 2, 0, left, a2); + getOrthArea(d / 2, 0, d, o1, left, result); + a2[0] = a2[0] + result[0]; + a2[1] = a2[1] + result[1]; + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + } else { + getOrthArea(0, o2, d, o1, left, result); + } + break; + } + case 10: { + result[0] = 0; + result[1] = 0; + break; + } + case 11: { + getOrthArea(0, o2, d, o1, left, result); + break; + } + case 12: { + getOrthArea(0, o1, d / 2, 0, left, a1); + getOrthArea(d / 2, 0, d, o1, left, a2); + smoothArea(d, area); + result[0] = a1[0] + a2[0]; + result[1] = a1[1] + a2[1]; + break; + } + case 13: { + getOrthArea(0, o2, d, o1, left, result); + break; + } + case 14: { + getOrthArea(0, o1, d, o2, left, result); + break; + } + case 15: { + result[0] = 0; + result[1] = 0; + break; + } + } + return result; +} +function isInsideArea(a1X, a1Y, a2X, a2Y, x, y) { + let result = a1X === a2X && a1Y === a2Y; + if (!result) { + const xm = (a1X + a2X) / 2; + const ym = (a1Y + a2Y) / 2; + const a = a2Y - a1Y; + const b = a1X - a2X; + const c2 = a * (x - xm) + b * (y - ym); + result = c2 > 0; + } + return result; +} +function getDiagAreaForPixel(a1X, a1Y, a2X, a2Y, pX, pY) { + let n = 0; + for (let y = 0; y < DIAGONAL_SAMPLES; ++y) { + for (let x = 0; x < DIAGONAL_SAMPLES; ++x) { + const offsetX = x / (DIAGONAL_SAMPLES - 1); + const offsetY = y / (DIAGONAL_SAMPLES - 1); + if (isInsideArea(a1X, a1Y, a2X, a2Y, pX + offsetX, pY + offsetY)) { + ++n; + } + } + } + return n / (DIAGONAL_SAMPLES * DIAGONAL_SAMPLES); +} +function getDiagArea(pattern, a1X, a1Y, a2X, a2Y, left, offset, result) { + const e = diagonalEdges[pattern]; + const e1 = e[0]; + const e2 = e[1]; + if (e1 > 0) { + a1X += offset[0]; + a1Y += offset[1]; + } + if (e2 > 0) { + a2X += offset[0]; + a2Y += offset[1]; + } + result[0] = 1 - getDiagAreaForPixel(a1X, a1Y, a2X, a2Y, 1 + left, 0 + left); + result[1] = getDiagAreaForPixel(a1X, a1Y, a2X, a2Y, 1 + left, 1 + left); + return result; +} +function getDiagAreaForPattern(pattern, left, right, offset, result) { + const a1 = area[0]; + const a2 = area[1]; + const d = left + right + 1; + switch (pattern) { + case 0: { + getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 1: { + getDiagArea(pattern, 1, 0, 0 + d, 0 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 2: { + getDiagArea(pattern, 0, 0, 1 + d, 0 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 3: { + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, result); + break; + } + case 4: { + getDiagArea(pattern, 1, 1, 0 + d, 0 + d, left, offset, a1); + getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 5: { + getDiagArea(pattern, 1, 1, 0 + d, 0 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 6: { + getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, result); + break; + } + case 7: { + getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 8: { + getDiagArea(pattern, 0, 0, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 9: { + getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, result); + getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, result); + break; + } + case 10: { + getDiagArea(pattern, 0, 0, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 11: { + getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 12: { + getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, result); + break; + } + case 13: { + getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 14: { + getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + case 15: { + getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1); + getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2); + result[0] = (a1[0] + a2[0]) / 2; + result[1] = (a1[1] + a2[1]) / 2; + break; + } + } + return result; +} +function generatePatterns(patterns, offset, orthogonal) { + const result = new Float32Array(2); + for (let i = 0, l = patterns.length; i < l; ++i) { + const pattern = patterns[i]; + const data = pattern.data; + const size = pattern.width; + for (let y = 0; y < size; ++y) { + for (let x = 0; x < size; ++x) { + if (orthogonal) { + getOrthAreaForPattern(i, x, y, offset, result); + } else { + getDiagAreaForPattern(i, x, y, offset, result); + } + const c2 = (y * size + x) * 2; + data[c2] = result[0] * 255; + data[c2 + 1] = result[1] * 255; + } + } + } +} +function assemble(baseX, baseY, patterns, edges2, size, orthogonal, target) { + const dstData = target.data; + const dstWidth = target.width; + for (let i = 0, l = patterns.length; i < l; ++i) { + const edge = edges2[i]; + const pattern = patterns[i]; + const srcData = pattern.data; + const srcWidth = pattern.width; + for (let y = 0; y < size; ++y) { + for (let x = 0; x < size; ++x) { + const pX = edge[0] * size + baseX + x; + const pY = edge[1] * size + baseY + y; + const c2 = (pY * dstWidth + pX) * 4; + const d = orthogonal ? (y * y * srcWidth + x * x) * 2 : (y * srcWidth + x) * 2; + dstData[c2] = srcData[d]; + dstData[c2 + 1] = srcData[d + 1]; + dstData[c2 + 2] = 0; + dstData[c2 + 3] = 255; + } + } + } +} +var SMAAAreaImageData = class { + /** + * Creates a new area image. + * + * @return {RawImageData} The generated image data. + */ + static generate() { + const width = 2 * 5 * ORTHOGONAL_SIZE; + const height = orthogonalSubsamplingOffsets.length * 5 * ORTHOGONAL_SIZE; + const data = new Uint8ClampedArray(width * height * 4); + const result = new RawImageData(width, height, data); + const orthPatternSize = Math.pow(ORTHOGONAL_SIZE - 1, 2) + 1; + const diagPatternSize = DIAGONAL_SIZE; + const orthogonalPatterns = []; + const diagonalPatterns = []; + for (let i = 3, l = data.length; i < l; i += 4) { + data[i] = 255; + } + for (let i = 0; i < 16; ++i) { + orthogonalPatterns.push(new RawImageData( + orthPatternSize, + orthPatternSize, + new Uint8ClampedArray(orthPatternSize * orthPatternSize * 2), + 2 + )); + diagonalPatterns.push(new RawImageData( + diagPatternSize, + diagPatternSize, + new Uint8ClampedArray(diagPatternSize * diagPatternSize * 2), + 2 + )); + } + for (let i = 0, l = orthogonalSubsamplingOffsets.length; i < l; ++i) { + generatePatterns(orthogonalPatterns, orthogonalSubsamplingOffsets[i], true); + assemble( + 0, + 5 * ORTHOGONAL_SIZE * i, + orthogonalPatterns, + orthogonalEdges, + ORTHOGONAL_SIZE, + true, + result + ); + } + for (let i = 0, l = diagonalSubsamplingOffsets.length; i < l; ++i) { + generatePatterns(diagonalPatterns, diagonalSubsamplingOffsets[i], false); + assemble( + 5 * ORTHOGONAL_SIZE, + 4 * DIAGONAL_SIZE * i, + diagonalPatterns, + diagonalEdges, + DIAGONAL_SIZE, + false, + result + ); + } + return result; + } +}; +var worker_default2 = '"use strict";(()=>{function q(t,a,s){let e=document.createElement("canvas"),n=e.getContext("2d");if(e.width=t,e.height=a,s instanceof Image)n.drawImage(s,0,0);else{let r=n.createImageData(t,a);r.data.set(s),n.putImageData(r,0,0)}return e}var F=class t{constructor(a=0,s=0,e=null){this.width=a,this.height=s,this.data=e}toCanvas(){return typeof document=="undefined"?null:q(this.width,this.height,this.data)}static from(a){let{width:s,height:e}=a,n;if(a instanceof Image){let r=q(s,e,a);r!==null&&(n=r.getContext("2d").getImageData(0,0,s,e).data)}else n=a.data;return new t(s,e,n)}};var M=[new Float32Array(2),new Float32Array(2)],D=16,W=20,I=30,j=32,v=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),N=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],z=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],p=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];function C(t,a,s){return t+(a-t)*s}function B(t){return Math.min(Math.max(t,0),1)}function _(t){let a=M[0],s=M[1],e=Math.sqrt(a[0]*2)*.5,n=Math.sqrt(a[1]*2)*.5,r=Math.sqrt(s[0]*2)*.5,o=Math.sqrt(s[1]*2)*.5,c=B(t/j);a[0]=C(e,a[0],c),a[1]=C(n,a[1],c),s[0]=C(r,s[0],c),s[1]=C(o,s[1],c)}function d(t,a,s,e,n,r){let o=s-t,c=e-a,h=n,i=n+1,w=a+c*(h-t)/o,b=a+c*(i-t)/o;if(h>=t&&ht&&i<=s)if(Math.sign(w)===Math.sign(b)||Math.abs(w)<1e-4||Math.abs(b)<1e-4){let g=(w+b)/2;g<0?(r[0]=Math.abs(g),r[1]=0):(r[0]=0,r[1]=Math.abs(g))}else{let g=-a*o/c+t,k=Math.trunc(g),m=g>t?w*(g-k)/2:0,U=gMath.abs(U)?m:-U)<0?(r[0]=Math.abs(m),r[1]=Math.abs(U)):(r[0]=Math.abs(U),r[1]=Math.abs(m))}else r[0]=0,r[1]=0;return r}function J(t,a,s,e,n){let r=M[0],o=M[1],c=.5+e,h=.5+e-1,i=a+s+1;switch(t){case 0:{n[0]=0,n[1]=0;break}case 1:{a<=s?d(0,h,i/2,0,a,n):(n[0]=0,n[1]=0);break}case 2:{a>=s?d(i/2,0,i,h,a,n):(n[0]=0,n[1]=0);break}case 3:{d(0,h,i/2,0,a,r),d(i/2,0,i,h,a,o),_(i,M),n[0]=r[0]+o[0],n[1]=r[1]+o[1];break}case 4:{a<=s?d(0,c,i/2,0,a,n):(n[0]=0,n[1]=0);break}case 5:{n[0]=0,n[1]=0;break}case 6:{Math.abs(e)>0?(d(0,c,i,h,a,r),d(0,c,i/2,0,a,o),d(i/2,0,i,h,a,n),o[0]=o[0]+n[0],o[1]=o[1]+n[1],n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2):d(0,c,i,h,a,n);break}case 7:{d(0,c,i,h,a,n);break}case 8:{a>=s?d(i/2,0,i,c,a,n):(n[0]=0,n[1]=0);break}case 9:{Math.abs(e)>0?(d(0,h,i,c,a,r),d(0,h,i/2,0,a,o),d(i/2,0,i,c,a,n),o[0]=o[0]+n[0],o[1]=o[1]+n[1],n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2):d(0,h,i,c,a,n);break}case 10:{n[0]=0,n[1]=0;break}case 11:{d(0,h,i,c,a,n);break}case 12:{d(0,c,i/2,0,a,r),d(i/2,0,i,c,a,o),_(i,M),n[0]=r[0]+o[0],n[1]=r[1]+o[1];break}case 13:{d(0,h,i,c,a,n);break}case 14:{d(0,c,i,h,a,n);break}case 15:{n[0]=0,n[1]=0;break}}return n}function K(t,a,s,e,n,r){let o=t===s&&a===e;if(!o){let c=(t+s)/2,h=(a+e)/2,i=e-a,w=t-s;o=i*(n-c)+w*(r-h)>0}return o}function G(t,a,s,e,n,r){let o=0;for(let c=0;c0&&(a+=o[0],s+=o[1]),w>0&&(e+=o[0],n+=o[1]),c[0]=1-G(a,s,e,n,1+r,0+r),c[1]=G(a,s,e,n,1+r,1+r),c}function Q(t,a,s,e,n){let r=M[0],o=M[1],c=a+s+1;switch(t){case 0:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 1:{A(t,1,0,0+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 2:{A(t,0,0,1+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 3:{A(t,1,0,1+c,0+c,a,e,n);break}case 4:{A(t,1,1,0+c,0+c,a,e,r),A(t,1,1,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 5:{A(t,1,1,0+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 6:{A(t,1,1,1+c,0+c,a,e,n);break}case 7:{A(t,1,1,1+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 8:{A(t,0,0,1+c,1+c,a,e,r),A(t,1,0,1+c,1+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 9:{A(t,1,0,1+c,1+c,a,e,n),A(t,1,0,1+c,1+c,a,e,n);break}case 10:{A(t,0,0,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 11:{A(t,1,0,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 12:{A(t,1,1,1+c,1+c,a,e,n);break}case 13:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,1+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 14:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,1,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 15:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}}return n}function R(t,a,s){let e=new Float32Array(2);for(let n=0,r=t.length;n{let a=S.generate(),s=E.generate();postMessage({areaImageData:a,searchImageData:s},[a.data.buffer,s.data.buffer]),close()});})();\n'; +function generate(useCache = true) { + const workerURL = URL.createObjectURL(new Blob([worker_default2], { + type: "text/javascript" + })); + const worker = new Worker(workerURL); + URL.revokeObjectURL(workerURL); + return new Promise((resolve, reject) => { + worker.addEventListener("error", (event) => reject(event.error)); + worker.addEventListener("message", (event) => { + const searchImageData = RawImageData.from(event.data.searchImageData); + const areaImageData = RawImageData.from(event.data.areaImageData); + const urls = [ + searchImageData.toCanvas().toDataURL("image/png", 1), + areaImageData.toCanvas().toDataURL("image/png", 1) + ]; + if (useCache) { + localStorage.setItem("smaa-search", urls[0]); + localStorage.setItem("smaa-area", urls[1]); + } + resolve(urls); + }); + worker.postMessage(null); + }); +} +var SMAAImageGenerator = class { + /** + * Constructs a new SMAA image generator. + */ + constructor() { + this.disableCache = false; + } + /** + * Enables or disables caching via localStorage. + * + * @param {Boolean} value - Whether the cache should be enabled. + */ + setCacheEnabled(value) { + this.disableCache = !value; + } + /** + * Generates the SMAA data images. + * + * @example + * SMAAImageGenerator.generate().then(([search, area]) => { + * const smaaEffect = new SMAAEffect(search, area); + * }); + * @return {Promise} A promise that returns the search image and area image as a pair. + */ + generate() { + const useCache = !this.disableCache && window.localStorage !== void 0; + const cachedURLs = useCache ? [ + localStorage.getItem("smaa-search"), + localStorage.getItem("smaa-area") + ] : [null, null]; + const promise = cachedURLs[0] !== null && cachedURLs[1] !== null ? Promise.resolve(cachedURLs) : generate(useCache); + return promise.then((urls) => { + return new Promise((resolve, reject) => { + const searchImage = new Image(); + const areaImage = new Image(); + const manager = new LoadingManager(); + manager.onLoad = () => resolve([searchImage, areaImage]); + manager.onError = reject; + searchImage.addEventListener("error", (e) => manager.itemError("smaa-search")); + areaImage.addEventListener("error", (e) => manager.itemError("smaa-area")); + searchImage.addEventListener("load", () => manager.itemEnd("smaa-search")); + areaImage.addEventListener("load", () => manager.itemEnd("smaa-area")); + manager.itemStart("smaa-search"); + manager.itemStart("smaa-area"); + searchImage.src = urls[0]; + areaImage.src = urls[1]; + }); + }); + } +}; +var edges = /* @__PURE__ */ new Map([ + [bilinear(0, 0, 0, 0), new Float32Array([0, 0, 0, 0])], + [bilinear(0, 0, 0, 1), new Float32Array([0, 0, 0, 1])], + [bilinear(0, 0, 1, 0), new Float32Array([0, 0, 1, 0])], + [bilinear(0, 0, 1, 1), new Float32Array([0, 0, 1, 1])], + [bilinear(0, 1, 0, 0), new Float32Array([0, 1, 0, 0])], + [bilinear(0, 1, 0, 1), new Float32Array([0, 1, 0, 1])], + [bilinear(0, 1, 1, 0), new Float32Array([0, 1, 1, 0])], + [bilinear(0, 1, 1, 1), new Float32Array([0, 1, 1, 1])], + [bilinear(1, 0, 0, 0), new Float32Array([1, 0, 0, 0])], + [bilinear(1, 0, 0, 1), new Float32Array([1, 0, 0, 1])], + [bilinear(1, 0, 1, 0), new Float32Array([1, 0, 1, 0])], + [bilinear(1, 0, 1, 1), new Float32Array([1, 0, 1, 1])], + [bilinear(1, 1, 0, 0), new Float32Array([1, 1, 0, 0])], + [bilinear(1, 1, 0, 1), new Float32Array([1, 1, 0, 1])], + [bilinear(1, 1, 1, 0), new Float32Array([1, 1, 1, 0])], + [bilinear(1, 1, 1, 1), new Float32Array([1, 1, 1, 1])] +]); +function lerp2(a, b, p) { + return a + (b - a) * p; +} +function bilinear(e0, e1, e2, e3) { + const a = lerp2(e0, e1, 1 - 0.25); + const b = lerp2(e2, e3, 1 - 0.25); + return lerp2(a, b, 1 - 0.125); +} +function deltaLeft(left, top) { + let d = 0; + if (top[3] === 1) { + d += 1; + } + if (d === 1 && top[2] === 1 && left[1] !== 1 && left[3] !== 1) { + d += 1; + } + return d; +} +function deltaRight(left, top) { + let d = 0; + if (top[3] === 1 && left[1] !== 1 && left[3] !== 1) { + d += 1; + } + if (d === 1 && top[2] === 1 && left[0] !== 1 && left[2] !== 1) { + d += 1; + } + return d; +} +var SMAASearchImageData = class { + /** + * Creates a new search image. + * + * @return {RawImageData} The generated image data. + */ + static generate() { + const width = 66; + const height = 33; + const halfWidth = width / 2; + const croppedWidth = 64; + const croppedHeight = 16; + const data = new Uint8ClampedArray(width * height); + const croppedData = new Uint8ClampedArray(croppedWidth * croppedHeight * 4); + for (let y = 0; y < height; ++y) { + for (let x = 0; x < width; ++x) { + const s = 0.03125 * x; + const t = 0.03125 * y; + if (edges.has(s) && edges.has(t)) { + const e1 = edges.get(s); + const e2 = edges.get(t); + const i = y * width + x; + data[i] = 127 * deltaLeft(e1, e2); + data[i + halfWidth] = 127 * deltaRight(e1, e2); + } + } + } + for (let i = 0, y = height - croppedHeight; y < height; ++y) { + for (let x = 0; x < croppedWidth; ++x, i += 4) { + croppedData[i] = data[y * width + x]; + croppedData[i + 3] = 255; + } + } + return new RawImageData(croppedWidth, croppedHeight, croppedData); + } +}; +export { + ASCIIEffect, + ASCIITexture, + AdaptiveLuminanceMaterial, + AdaptiveLuminancePass, + BlendFunction, + BlendMode, + BloomEffect, + KawaseBlurPass as BlurPass, + BokehEffect, + BokehMaterial, + BoxBlurMaterial, + BoxBlurPass, + BrightnessContrastEffect, + ChromaticAberrationEffect, + CircleOfConfusionMaterial, + ClearMaskPass, + ClearPass, + ColorAverageEffect, + ColorChannel, + ColorDepthEffect, + EdgeDetectionMaterial as ColorEdgesMaterial, + KawaseBlurMaterial as ConvolutionMaterial, + CopyMaterial, + CopyPass, + DepthComparisonMaterial, + DepthCopyMaterial, + DepthCopyMode, + DepthCopyPass, + DepthDownsamplingMaterial, + DepthDownsamplingPass, + DepthEffect, + DepthMaskMaterial, + DepthOfFieldEffect, + DepthPass, + DepthPickingPass, + DepthCopyPass as DepthSavePass, + DepthTestStrategy, + Disposable, + DotScreenEffect, + DownsamplingMaterial, + EdgeDetectionMaterial, + EdgeDetectionMode, + Effect, + EffectAttribute, + EffectComposer, + EffectMaterial, + EffectPass, + EffectShaderData, + EffectShaderSection, + FXAAEffect, + GammaCorrectionEffect, + GaussKernel, + GaussianBlurMaterial, + GaussianBlurPass, + GlitchEffect, + GlitchMode, + GodRaysEffect, + GodRaysMaterial, + GridEffect, + HueSaturationEffect, + ImmutableTimer, + Initializable, + KawaseBlurMaterial, + KawaseBlurPass, + KernelSize, + LUT1DEffect, + LUT3DEffect, + LUT3dlLoader, + LUTCubeLoader, + LUT3DEffect as LUTEffect, + LUTOperation, + LambdaPass, + LensDistortionEffect, + LookupTexture, + LookupTexture as LookupTexture3D, + LuminanceMaterial, + LuminancePass, + MaskFunction, + MaskMaterial, + MaskPass, + MipmapBlurPass, + NoiseEffect, + NoiseTexture, + NormalPass, + OutlineMaterial as OutlineEdgesMaterial, + OutlineEffect, + OutlineMaterial, + OverrideMaterialManager, + Pass, + PixelationEffect, + PredicationMode, + RawImageData, + RealisticBokehEffect, + RenderPass, + Resizable, + Resolution as Resizer, + Resolution, + SMAAAreaImageData, + SMAAEffect, + SMAAImageGenerator, + SMAAImageLoader, + SMAAPreset, + SMAASearchImageData, + SMAAWeightsMaterial, + SSAOEffect, + SSAOMaterial, + CopyPass as SavePass, + ScanlineEffect, + EffectShaderSection as Section, + Selection, + SelectiveBloomEffect, + SepiaEffect, + ShaderPass, + ShockWaveEffect, + TetrahedralUpscaler, + TextureEffect, + TiltShiftBlurMaterial, + TiltShiftBlurPass, + TiltShiftEffect, + Timer, + ToneMappingEffect, + ToneMappingMode, + UpsamplingMaterial, + VignetteEffect, + VignetteTechnique, + WebGLExtension, + version +}; +/*! Bundled license information: + +postprocessing/build/index.js: + (** + * postprocessing v6.37.6 build Fri Jul 04 2025 + * https://github.com/pmndrs/postprocessing + * Copyright 2015-2025 Raoul van Rüschen + * @license Zlib + *) +*/ +//# sourceMappingURL=postprocessing.js.map diff --git a/app/node_modules/.vite/deps/postprocessing.js.map b/app/node_modules/.vite/deps/postprocessing.js.map new file mode 100644 index 0000000..0331377 --- /dev/null +++ b/app/node_modules/.vite/deps/postprocessing.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../postprocessing/build/index.js"], + "sourcesContent": ["/**\n * postprocessing v6.37.6 build Fri Jul 04 2025\n * https://github.com/pmndrs/postprocessing\n * Copyright 2015-2025 Raoul van Rüschen\n * @license Zlib\n */\n\n// package.json\nvar version = \"6.37.6\";\n\n// src/core/Disposable.js\nvar Disposable = class {\n /**\n * Frees internal resources.\n */\n dispose() {\n }\n};\n\n// src/core/EffectComposer.js\nimport {\n DepthStencilFormat,\n DepthTexture,\n LinearFilter as LinearFilter2,\n SRGBColorSpace as SRGBColorSpace2,\n UnsignedByteType as UnsignedByteType2,\n UnsignedIntType,\n UnsignedInt248Type,\n Vector2,\n WebGLRenderTarget as WebGLRenderTarget3\n} from \"three\";\n\n// src/core/Timer.js\nvar MILLISECONDS_TO_SECONDS = 1 / 1e3;\nvar SECONDS_TO_MILLISECONDS = 1e3;\nvar Timer = class {\n /**\n * Constructs a new timer.\n */\n constructor() {\n this.startTime = performance.now();\n this.previousTime = 0;\n this.currentTime = 0;\n this._delta = 0;\n this._elapsed = 0;\n this._fixedDelta = 1e3 / 60;\n this.timescale = 1;\n this.useFixedDelta = false;\n this._autoReset = false;\n }\n /**\n * Enables or disables auto reset based on page visibility.\n *\n * If enabled, the timer will be reset when the page becomes visible. This effectively pauses the timer when the page\n * is hidden. Has no effect if the API is not supported.\n *\n * @type {Boolean}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n */\n get autoReset() {\n return this._autoReset;\n }\n set autoReset(value) {\n if (typeof document !== \"undefined\" && document.hidden !== void 0) {\n if (value) {\n document.addEventListener(\"visibilitychange\", this);\n } else {\n document.removeEventListener(\"visibilitychange\", this);\n }\n this._autoReset = value;\n }\n }\n get delta() {\n return this._delta * MILLISECONDS_TO_SECONDS;\n }\n get fixedDelta() {\n return this._fixedDelta * MILLISECONDS_TO_SECONDS;\n }\n set fixedDelta(value) {\n this._fixedDelta = value * SECONDS_TO_MILLISECONDS;\n }\n get elapsed() {\n return this._elapsed * MILLISECONDS_TO_SECONDS;\n }\n /**\n * Updates this timer.\n *\n * @param {Boolean} [timestamp] - The current time in milliseconds.\n */\n update(timestamp) {\n if (this.useFixedDelta) {\n this._delta = this.fixedDelta;\n } else {\n this.previousTime = this.currentTime;\n this.currentTime = (timestamp !== void 0 ? timestamp : performance.now()) - this.startTime;\n this._delta = this.currentTime - this.previousTime;\n }\n this._delta *= this.timescale;\n this._elapsed += this._delta;\n }\n /**\n * Resets this timer.\n */\n reset() {\n this._delta = 0;\n this._elapsed = 0;\n this.currentTime = performance.now() - this.startTime;\n }\n getDelta() {\n return this.delta;\n }\n getElapsed() {\n return this.elapsed;\n }\n handleEvent(e) {\n if (!document.hidden) {\n this.currentTime = performance.now() - this.startTime;\n }\n }\n dispose() {\n this.autoReset = false;\n }\n};\n\n// src/passes/Pass.js\nimport {\n BasicDepthPacking,\n BufferAttribute,\n BufferGeometry,\n Camera,\n Material,\n Mesh,\n Scene,\n Texture,\n WebGLRenderTarget\n} from \"three\";\nvar fullscreenGeometry = /* @__PURE__ */ (() => {\n const vertices = new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]);\n const uvs = new Float32Array([0, 0, 2, 0, 0, 2]);\n const geometry = new BufferGeometry();\n geometry.setAttribute(\"position\", new BufferAttribute(vertices, 3));\n geometry.setAttribute(\"uv\", new BufferAttribute(uvs, 2));\n return geometry;\n})();\nvar Pass = class _Pass {\n /**\n * A shared fullscreen triangle.\n *\n * The screen size is 2x2 units (NDC). A triangle needs to be 4x4 units to fill the screen.\n * @see https://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/\n * @type {BufferGeometry}\n * @internal\n */\n static get fullscreenGeometry() {\n return fullscreenGeometry;\n }\n /**\n * Constructs a new pass.\n *\n * @param {String} [name] - The name of this pass. Does not have to be unique.\n * @param {Scene} [scene] - The scene to render. The default scene contains a single mesh that fills the screen.\n * @param {Camera} [camera] - A camera. Fullscreen effect passes don't require a camera.\n */\n constructor(name = \"Pass\", scene = new Scene(), camera = new Camera()) {\n this.name = name;\n this.renderer = null;\n this.scene = scene;\n this.camera = camera;\n this.screen = null;\n this.rtt = true;\n this.needsSwap = true;\n this.needsDepthTexture = false;\n this.enabled = true;\n }\n /**\n * Sets the render to screen flag.\n *\n * If this flag is changed, the fullscreen material will be updated as well.\n *\n * @type {Boolean}\n */\n get renderToScreen() {\n return !this.rtt;\n }\n set renderToScreen(value) {\n if (this.rtt === value) {\n const material = this.fullscreenMaterial;\n if (material !== null) {\n material.needsUpdate = true;\n }\n this.rtt = !value;\n }\n }\n /**\n * Sets the main scene.\n *\n * @type {Scene}\n */\n set mainScene(value) {\n }\n /**\n * Sets the main camera.\n *\n * @type {Camera}\n */\n set mainCamera(value) {\n }\n /**\n * Sets the renderer\n *\n * @deprecated\n * @param {WebGLRenderer} renderer - The renderer.\n */\n setRenderer(renderer) {\n this.renderer = renderer;\n }\n /**\n * Indicates whether this pass is enabled.\n *\n * @deprecated Use enabled instead.\n * @return {Boolean} Whether this pass is enabled.\n */\n isEnabled() {\n return this.enabled;\n }\n /**\n * Enables or disables this pass.\n *\n * @deprecated Use enabled instead.\n * @param {Boolean} value - Whether the pass should be enabled.\n */\n setEnabled(value) {\n this.enabled = value;\n }\n /**\n * The fullscreen material.\n *\n * @type {Material}\n */\n get fullscreenMaterial() {\n return this.screen !== null ? this.screen.material : null;\n }\n set fullscreenMaterial(value) {\n let screen = this.screen;\n if (screen !== null) {\n screen.material = value;\n } else {\n screen = new Mesh(_Pass.fullscreenGeometry, value);\n screen.frustumCulled = false;\n if (this.scene === null) {\n this.scene = new Scene();\n }\n this.scene.add(screen);\n this.screen = screen;\n }\n }\n /**\n * Returns the current fullscreen material.\n *\n * @deprecated Use fullscreenMaterial instead.\n * @return {Material} The current fullscreen material, or null if there is none.\n */\n getFullscreenMaterial() {\n return this.fullscreenMaterial;\n }\n /**\n * Sets the fullscreen material.\n *\n * @deprecated Use fullscreenMaterial instead.\n * @protected\n * @param {Material} value - A fullscreen material.\n */\n setFullscreenMaterial(value) {\n this.fullscreenMaterial = value;\n }\n /**\n * Returns the current depth texture.\n *\n * @return {Texture} The current depth texture, or null if there is none.\n */\n getDepthTexture() {\n return null;\n }\n /**\n * Sets the depth texture.\n *\n * This method will be called automatically by the {@link EffectComposer}.\n * You may override this method if your pass relies on the depth information of a preceding {@link RenderPass}.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategy} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking) {\n }\n /**\n * Renders this pass.\n *\n * This is an abstract method that must be overridden.\n *\n * @abstract\n * @throws {Error} An error is thrown if the method is not overridden.\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n throw new Error(\"Render method not implemented!\");\n }\n /**\n * Sets the size.\n *\n * You may override this method if you want to be informed about the size of the backbuffer/canvas.\n * This method is called before {@link initialize} and every time the size of the {@link EffectComposer} changes.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n }\n /**\n * Performs initialization tasks.\n *\n * This method is called when this pass is added to an {@link EffectComposer}.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n }\n /**\n * Performs a shallow search for disposable properties and deletes them.\n *\n * The {@link EffectComposer} calls this method when it is being destroyed. You can use it independently to free\n * memory when you're certain that you don't need this pass anymore.\n */\n dispose() {\n for (const key of Object.keys(this)) {\n const property = this[key];\n const isDisposable = property instanceof WebGLRenderTarget || property instanceof Material || property instanceof Texture || property instanceof _Pass;\n if (isDisposable) {\n this[key].dispose();\n }\n }\n if (this.fullscreenMaterial !== null) {\n this.fullscreenMaterial.dispose();\n }\n }\n};\n\n// src/passes/ClearMaskPass.js\nvar ClearMaskPass = class extends Pass {\n /**\n * Constructs a new clear mask pass.\n */\n constructor() {\n super(\"ClearMaskPass\", null, null);\n this.needsSwap = false;\n }\n /**\n * Disables the global stencil test.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const stencil = renderer.state.buffers.stencil;\n stencil.setLocked(false);\n stencil.setTest(false);\n }\n};\n\n// src/passes/CopyPass.js\nimport { LinearFilter, SRGBColorSpace, UnsignedByteType, WebGLRenderTarget as WebGLRenderTarget2 } from \"three\";\n\n// src/materials/CopyMaterial.js\nimport { NoBlending, ShaderMaterial, Uniform } from \"three\";\n\n// src/materials/glsl/copy.frag\nvar copy_default = `#include \n#include \n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include \n#include \n}`;\n\n// src/materials/glsl/common.vert\nvar common_default = `varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/CopyMaterial.js\nvar CopyMaterial = class extends ShaderMaterial {\n /**\n * Constructs a new copy material.\n */\n constructor() {\n super({\n name: \"CopyMaterial\",\n uniforms: {\n inputBuffer: new Uniform(null),\n opacity: new Uniform(1)\n },\n blending: NoBlending,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: copy_default,\n vertexShader: common_default\n });\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Number} value - The buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Returns the opacity.\n *\n * @deprecated Use opacity instead.\n * @return {Number} The opacity.\n */\n getOpacity(value) {\n return this.uniforms.opacity.value;\n }\n /**\n * Sets the opacity.\n *\n * @deprecated Use opacity instead.\n * @param {Number} value - The opacity.\n */\n setOpacity(value) {\n this.uniforms.opacity.value = value;\n }\n};\n\n// src/passes/CopyPass.js\nvar CopyPass = class extends Pass {\n /**\n * Constructs a new save pass.\n *\n * @param {WebGLRenderTarget} [renderTarget] - A render target.\n * @param {Boolean} [autoResize=true] - Whether the render target size should be updated automatically.\n */\n constructor(renderTarget, autoResize = true) {\n super(\"CopyPass\");\n this.fullscreenMaterial = new CopyMaterial();\n this.needsSwap = false;\n this.renderTarget = renderTarget;\n if (renderTarget === void 0) {\n this.renderTarget = new WebGLRenderTarget2(1, 1, {\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n stencilBuffer: false,\n depthBuffer: false\n });\n this.renderTarget.texture.name = \"CopyPass.Target\";\n }\n this.autoResize = autoResize;\n }\n /**\n * Enables or disables auto resizing of the render target.\n *\n * @deprecated Use autoResize instead.\n * @type {Boolean}\n */\n get resize() {\n return this.autoResize;\n }\n set resize(value) {\n this.autoResize = value;\n }\n /**\n * The output texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the output texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTarget.texture;\n }\n /**\n * Enables or disables auto resizing of the render target.\n *\n * @deprecated Use autoResize instead.\n * @param {Boolean} value - Whether the render target size should be updated automatically.\n */\n setAutoResizeEnabled(value) {\n this.autoResize = value;\n }\n /**\n * Saves the input buffer.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n this.fullscreenMaterial.inputBuffer = inputBuffer.texture;\n renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget);\n renderer.render(this.scene, this.camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n if (this.autoResize) {\n this.renderTarget.setSize(width, height);\n }\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - A renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (frameBufferType !== void 0) {\n this.renderTarget.texture.type = frameBufferType;\n if (frameBufferType !== UnsignedByteType) {\n this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {\n this.renderTarget.texture.colorSpace = SRGBColorSpace;\n }\n }\n }\n};\n\n// src/passes/ClearPass.js\nimport { Color } from \"three\";\nvar color = /* @__PURE__ */ new Color();\nvar ClearPass = class extends Pass {\n /**\n * Constructs a new clear pass.\n *\n * @param {Boolean} [color=true] - Determines whether the color buffer should be cleared.\n * @param {Boolean} [depth=true] - Determines whether the depth buffer should be cleared.\n * @param {Boolean} [stencil=false] - Determines whether the stencil buffer should be cleared.\n */\n constructor(color2 = true, depth = true, stencil = false) {\n super(\"ClearPass\", null, null);\n this.needsSwap = false;\n this.color = color2;\n this.depth = depth;\n this.stencil = stencil;\n this.overrideClearColor = null;\n this.overrideClearAlpha = -1;\n }\n /**\n * Sets the clear flags.\n *\n * @param {Boolean} color - Whether the color buffer should be cleared.\n * @param {Boolean} depth - Whether the depth buffer should be cleared.\n * @param {Boolean} stencil - Whether the stencil buffer should be cleared.\n */\n setClearFlags(color2, depth, stencil) {\n this.color = color2;\n this.depth = depth;\n this.stencil = stencil;\n }\n /**\n * Returns the override clear color. Default is null.\n *\n * @deprecated Use overrideClearColor instead.\n * @return {Color} The clear color.\n */\n getOverrideClearColor() {\n return this.overrideClearColor;\n }\n /**\n * Sets the override clear color.\n *\n * @deprecated Use overrideClearColor instead.\n * @param {Color} value - The clear color.\n */\n setOverrideClearColor(value) {\n this.overrideClearColor = value;\n }\n /**\n * Returns the override clear alpha. Default is -1.\n *\n * @deprecated Use overrideClearAlpha instead.\n * @return {Number} The clear alpha.\n */\n getOverrideClearAlpha() {\n return this.overrideClearAlpha;\n }\n /**\n * Sets the override clear alpha.\n *\n * @deprecated Use overrideClearAlpha instead.\n * @param {Number} value - The clear alpha.\n */\n setOverrideClearAlpha(value) {\n this.overrideClearAlpha = value;\n }\n /**\n * Clears the input buffer or the screen.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const overrideClearColor = this.overrideClearColor;\n const overrideClearAlpha = this.overrideClearAlpha;\n const clearAlpha = renderer.getClearAlpha();\n const hasOverrideClearColor = overrideClearColor !== null;\n const hasOverrideClearAlpha = overrideClearAlpha >= 0;\n if (hasOverrideClearColor) {\n renderer.getClearColor(color);\n renderer.setClearColor(overrideClearColor, hasOverrideClearAlpha ? overrideClearAlpha : clearAlpha);\n } else if (hasOverrideClearAlpha) {\n renderer.setClearAlpha(overrideClearAlpha);\n }\n renderer.setRenderTarget(this.renderToScreen ? null : inputBuffer);\n renderer.clear(this.color, this.depth, this.stencil);\n if (hasOverrideClearColor) {\n renderer.setClearColor(color, clearAlpha);\n } else if (hasOverrideClearAlpha) {\n renderer.setClearAlpha(clearAlpha);\n }\n }\n};\n\n// src/passes/MaskPass.js\nvar MaskPass = class extends Pass {\n /**\n * Constructs a new mask pass.\n *\n * @param {Scene} scene - The scene to render.\n * @param {Camera} camera - The camera to use.\n */\n constructor(scene, camera) {\n super(\"MaskPass\", scene, camera);\n this.needsSwap = false;\n this.clearPass = new ClearPass(false, false, true);\n this.inverse = false;\n }\n set mainScene(value) {\n this.scene = value;\n }\n set mainCamera(value) {\n this.camera = value;\n }\n /**\n * Indicates whether the mask should be inverted.\n *\n * @type {Boolean}\n */\n get inverted() {\n return this.inverse;\n }\n set inverted(value) {\n this.inverse = value;\n }\n /**\n * Indicates whether this pass should clear the stencil buffer.\n *\n * @type {Boolean}\n * @deprecated Use clearPass.enabled instead.\n */\n get clear() {\n return this.clearPass.enabled;\n }\n set clear(value) {\n this.clearPass.enabled = value;\n }\n /**\n * Returns the internal clear pass.\n *\n * @deprecated Use clearPass.enabled instead.\n * @return {ClearPass} The clear pass.\n */\n getClearPass() {\n return this.clearPass;\n }\n /**\n * Indicates whether the mask is inverted.\n *\n * @deprecated Use inverted instead.\n * @return {Boolean} Whether the mask is inverted.\n */\n isInverted() {\n return this.inverted;\n }\n /**\n * Enables or disable mask inversion.\n *\n * @deprecated Use inverted instead.\n * @param {Boolean} value - Whether the mask should be inverted.\n */\n setInverted(value) {\n this.inverted = value;\n }\n /**\n * Renders the effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const context = renderer.getContext();\n const buffers = renderer.state.buffers;\n const scene = this.scene;\n const camera = this.camera;\n const clearPass = this.clearPass;\n const writeValue = this.inverted ? 0 : 1;\n const clearValue = 1 - writeValue;\n buffers.color.setMask(false);\n buffers.depth.setMask(false);\n buffers.color.setLocked(true);\n buffers.depth.setLocked(true);\n buffers.stencil.setTest(true);\n buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE);\n buffers.stencil.setFunc(context.ALWAYS, writeValue, 4294967295);\n buffers.stencil.setClear(clearValue);\n buffers.stencil.setLocked(true);\n if (this.clearPass.enabled) {\n if (this.renderToScreen) {\n clearPass.render(renderer, null);\n } else {\n clearPass.render(renderer, inputBuffer);\n clearPass.render(renderer, outputBuffer);\n }\n }\n if (this.renderToScreen) {\n renderer.setRenderTarget(null);\n renderer.render(scene, camera);\n } else {\n renderer.setRenderTarget(inputBuffer);\n renderer.render(scene, camera);\n renderer.setRenderTarget(outputBuffer);\n renderer.render(scene, camera);\n }\n buffers.color.setLocked(false);\n buffers.depth.setLocked(false);\n buffers.stencil.setLocked(false);\n buffers.stencil.setFunc(context.EQUAL, 1, 4294967295);\n buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP);\n buffers.stencil.setLocked(true);\n }\n};\n\n// src/core/EffectComposer.js\nvar EffectComposer = class {\n /**\n * Constructs a new effect composer.\n *\n * @param {WebGLRenderer} renderer - The renderer that should be used.\n * @param {Object} [options] - The options.\n * @param {Boolean} [options.depthBuffer=true] - Whether the main render targets should have a depth buffer.\n * @param {Boolean} [options.stencilBuffer=false] - Whether the main render targets should have a stencil buffer.\n * @param {Boolean} [options.alpha] - Deprecated. Buffers are always RGBA since three r137.\n * @param {Number} [options.multisampling=0] - The number of samples used for multisample antialiasing. Requires WebGL 2.\n * @param {Number} [options.frameBufferType] - The type of the internal frame buffers. It's recommended to use HalfFloatType if possible.\n */\n constructor(renderer = null, {\n depthBuffer = true,\n stencilBuffer = false,\n multisampling = 0,\n frameBufferType\n } = {}) {\n this.renderer = null;\n this.inputBuffer = this.createBuffer(depthBuffer, stencilBuffer, frameBufferType, multisampling);\n this.outputBuffer = this.inputBuffer.clone();\n this.copyPass = new CopyPass();\n this.depthTexture = null;\n this.passes = [];\n this.timer = new Timer();\n this.autoRenderToScreen = true;\n this.setRenderer(renderer);\n }\n /**\n * The current amount of samples used for multisample anti-aliasing.\n *\n * @type {Number}\n */\n get multisampling() {\n return this.inputBuffer.samples || 0;\n }\n /**\n * Sets the amount of MSAA samples.\n *\n * Requires WebGL 2. Set to zero to disable multisampling.\n *\n * @type {Number}\n */\n set multisampling(value) {\n const buffer = this.inputBuffer;\n const multisampling = this.multisampling;\n if (multisampling > 0 && value > 0) {\n this.inputBuffer.samples = value;\n this.outputBuffer.samples = value;\n this.inputBuffer.dispose();\n this.outputBuffer.dispose();\n } else if (multisampling !== value) {\n this.inputBuffer.dispose();\n this.outputBuffer.dispose();\n this.inputBuffer = this.createBuffer(\n buffer.depthBuffer,\n buffer.stencilBuffer,\n buffer.texture.type,\n value\n );\n this.inputBuffer.depthTexture = this.depthTexture;\n this.outputBuffer = this.inputBuffer.clone();\n }\n }\n /**\n * Returns the internal timer.\n *\n * @return {Timer} The timer.\n */\n getTimer() {\n return this.timer;\n }\n /**\n * Returns the renderer.\n *\n * @return {WebGLRenderer} The renderer.\n */\n getRenderer() {\n return this.renderer;\n }\n /**\n * Sets the renderer.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n */\n setRenderer(renderer) {\n this.renderer = renderer;\n if (renderer !== null) {\n const size = renderer.getSize(new Vector2());\n const alpha = renderer.getContext().getContextAttributes().alpha;\n const frameBufferType = this.inputBuffer.texture.type;\n if (frameBufferType === UnsignedByteType2 && renderer.outputColorSpace === SRGBColorSpace2) {\n this.inputBuffer.texture.colorSpace = SRGBColorSpace2;\n this.outputBuffer.texture.colorSpace = SRGBColorSpace2;\n this.inputBuffer.dispose();\n this.outputBuffer.dispose();\n }\n renderer.autoClear = false;\n this.setSize(size.width, size.height);\n for (const pass of this.passes) {\n pass.initialize(renderer, alpha, frameBufferType);\n }\n }\n }\n /**\n * Replaces the current renderer with the given one.\n *\n * The auto clear mechanism of the provided renderer will be disabled. If the new render size differs from the\n * previous one, all passes will be updated.\n *\n * By default, the DOM element of the current renderer will automatically be removed from its parent node and the DOM\n * element of the new renderer will take its place.\n *\n * @deprecated Use setRenderer instead.\n * @param {WebGLRenderer} renderer - The new renderer.\n * @param {Boolean} updateDOM - Indicates whether the old canvas should be replaced by the new one in the DOM.\n * @return {WebGLRenderer} The old renderer.\n */\n replaceRenderer(renderer, updateDOM = true) {\n const oldRenderer = this.renderer;\n const parent = oldRenderer.domElement.parentNode;\n this.setRenderer(renderer);\n if (updateDOM && parent !== null) {\n parent.removeChild(oldRenderer.domElement);\n parent.appendChild(renderer.domElement);\n }\n return oldRenderer;\n }\n /**\n * Creates a depth texture attachment that will be provided to all passes.\n *\n * Note: When a shader reads from a depth texture and writes to a render target that uses the same depth texture\n * attachment, the depth information will be lost. This happens even if `depthWrite` is disabled.\n *\n * @private\n * @return {DepthTexture} The depth texture.\n */\n createDepthTexture() {\n const depthTexture = this.depthTexture = new DepthTexture();\n this.inputBuffer.depthTexture = depthTexture;\n this.inputBuffer.dispose();\n if (this.inputBuffer.stencilBuffer) {\n depthTexture.format = DepthStencilFormat;\n depthTexture.type = UnsignedInt248Type;\n } else {\n depthTexture.type = UnsignedIntType;\n }\n return depthTexture;\n }\n /**\n * Deletes the current depth texture.\n *\n * @private\n */\n deleteDepthTexture() {\n if (this.depthTexture !== null) {\n this.depthTexture.dispose();\n this.depthTexture = null;\n this.inputBuffer.depthTexture = null;\n this.inputBuffer.dispose();\n for (const pass of this.passes) {\n pass.setDepthTexture(null);\n }\n }\n }\n /**\n * Creates a new render target.\n *\n * @deprecated Create buffers manually via WebGLRenderTarget instead.\n * @param {Boolean} depthBuffer - Whether the render target should have a depth buffer.\n * @param {Boolean} stencilBuffer - Whether the render target should have a stencil buffer.\n * @param {Number} type - The frame buffer type.\n * @param {Number} multisampling - The number of samples to use for antialiasing.\n * @return {WebGLRenderTarget} A new render target that equals the renderer's canvas.\n */\n createBuffer(depthBuffer, stencilBuffer, type, multisampling) {\n const renderer = this.renderer;\n const size = renderer === null ? new Vector2() : renderer.getDrawingBufferSize(new Vector2());\n const options = {\n minFilter: LinearFilter2,\n magFilter: LinearFilter2,\n stencilBuffer,\n depthBuffer,\n type\n };\n const renderTarget = new WebGLRenderTarget3(size.width, size.height, options);\n if (multisampling > 0) {\n renderTarget.ignoreDepthForMultisampleCopy = false;\n renderTarget.samples = multisampling;\n }\n if (type === UnsignedByteType2 && renderer !== null && renderer.outputColorSpace === SRGBColorSpace2) {\n renderTarget.texture.colorSpace = SRGBColorSpace2;\n }\n renderTarget.texture.name = \"EffectComposer.Buffer\";\n renderTarget.texture.generateMipmaps = false;\n return renderTarget;\n }\n /**\n * Can be used to change the main scene for all registered passes and effects.\n *\n * @param {Scene} scene - The scene.\n */\n setMainScene(scene) {\n for (const pass of this.passes) {\n pass.mainScene = scene;\n }\n }\n /**\n * Can be used to change the main camera for all registered passes and effects.\n *\n * @param {Camera} camera - The camera.\n */\n setMainCamera(camera) {\n for (const pass of this.passes) {\n pass.mainCamera = camera;\n }\n }\n /**\n * Adds a pass, optionally at a specific index.\n *\n * @param {Pass} pass - A new pass.\n * @param {Number} [index] - An index at which the pass should be inserted.\n */\n addPass(pass, index) {\n const passes = this.passes;\n const renderer = this.renderer;\n const drawingBufferSize = renderer.getDrawingBufferSize(new Vector2());\n const alpha = renderer.getContext().getContextAttributes().alpha;\n const frameBufferType = this.inputBuffer.texture.type;\n pass.setRenderer(renderer);\n pass.setSize(drawingBufferSize.width, drawingBufferSize.height);\n pass.initialize(renderer, alpha, frameBufferType);\n if (this.autoRenderToScreen) {\n if (passes.length > 0) {\n passes[passes.length - 1].renderToScreen = false;\n }\n if (pass.renderToScreen) {\n this.autoRenderToScreen = false;\n }\n }\n if (index !== void 0) {\n passes.splice(index, 0, pass);\n } else {\n passes.push(pass);\n }\n if (this.autoRenderToScreen) {\n passes[passes.length - 1].renderToScreen = true;\n }\n if (pass.needsDepthTexture || this.depthTexture !== null) {\n if (this.depthTexture === null) {\n const depthTexture = this.createDepthTexture();\n for (pass of passes) {\n pass.setDepthTexture(depthTexture);\n }\n } else {\n pass.setDepthTexture(this.depthTexture);\n }\n }\n }\n /**\n * Removes a pass.\n *\n * @param {Pass} pass - The pass.\n */\n removePass(pass) {\n const passes = this.passes;\n const index = passes.indexOf(pass);\n const exists = index !== -1;\n const removed = exists && passes.splice(index, 1).length > 0;\n if (removed) {\n if (this.depthTexture !== null) {\n const reducer = (a, b) => a || b.needsDepthTexture;\n const depthTextureRequired = passes.reduce(reducer, false);\n if (!depthTextureRequired) {\n if (pass.getDepthTexture() === this.depthTexture) {\n pass.setDepthTexture(null);\n }\n this.deleteDepthTexture();\n }\n }\n if (this.autoRenderToScreen) {\n if (index === passes.length) {\n pass.renderToScreen = false;\n if (passes.length > 0) {\n passes[passes.length - 1].renderToScreen = true;\n }\n }\n }\n }\n }\n /**\n * Removes all passes.\n */\n removeAllPasses() {\n const passes = this.passes;\n this.deleteDepthTexture();\n if (passes.length > 0) {\n if (this.autoRenderToScreen) {\n passes[passes.length - 1].renderToScreen = false;\n }\n this.passes = [];\n }\n }\n /**\n * Renders all enabled passes in the order in which they were added.\n *\n * @param {Number} [deltaTime] - The time since the last frame in seconds.\n */\n render(deltaTime) {\n const renderer = this.renderer;\n const copyPass = this.copyPass;\n let inputBuffer = this.inputBuffer;\n let outputBuffer = this.outputBuffer;\n let stencilTest = false;\n let context, stencil, buffer;\n if (deltaTime === void 0) {\n this.timer.update();\n deltaTime = this.timer.getDelta();\n }\n for (const pass of this.passes) {\n if (pass.enabled) {\n pass.render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest);\n if (pass.needsSwap) {\n if (stencilTest) {\n copyPass.renderToScreen = pass.renderToScreen;\n context = renderer.getContext();\n stencil = renderer.state.buffers.stencil;\n stencil.setFunc(context.NOTEQUAL, 1, 4294967295);\n copyPass.render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest);\n stencil.setFunc(context.EQUAL, 1, 4294967295);\n }\n buffer = inputBuffer;\n inputBuffer = outputBuffer;\n outputBuffer = buffer;\n }\n if (pass instanceof MaskPass) {\n stencilTest = true;\n } else if (pass instanceof ClearMaskPass) {\n stencilTest = false;\n }\n }\n }\n }\n /**\n * Sets the size of the buffers, passes and the renderer.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n * @param {Boolean} [updateStyle] - Determines whether the style of the canvas should be updated.\n */\n setSize(width, height, updateStyle) {\n const renderer = this.renderer;\n const currentSize = renderer.getSize(new Vector2());\n if (width === void 0 || height === void 0) {\n width = currentSize.width;\n height = currentSize.height;\n }\n if (currentSize.width !== width || currentSize.height !== height) {\n renderer.setSize(width, height, updateStyle);\n }\n const drawingBufferSize = renderer.getDrawingBufferSize(new Vector2());\n this.inputBuffer.setSize(drawingBufferSize.width, drawingBufferSize.height);\n this.outputBuffer.setSize(drawingBufferSize.width, drawingBufferSize.height);\n for (const pass of this.passes) {\n pass.setSize(drawingBufferSize.width, drawingBufferSize.height);\n }\n }\n /**\n * Resets this composer by deleting all passes and creating new buffers.\n */\n reset() {\n this.dispose();\n this.autoRenderToScreen = true;\n }\n /**\n * Disposes this composer and all passes.\n */\n dispose() {\n for (const pass of this.passes) {\n pass.dispose();\n }\n this.passes = [];\n if (this.inputBuffer !== null) {\n this.inputBuffer.dispose();\n }\n if (this.outputBuffer !== null) {\n this.outputBuffer.dispose();\n }\n this.deleteDepthTexture();\n this.copyPass.dispose();\n this.timer.dispose();\n Pass.fullscreenGeometry.dispose();\n }\n};\n\n// src/core/EffectShaderData.js\nimport { LinearSRGBColorSpace } from \"three\";\n\n// src/enums/EffectAttribute.js\nvar EffectAttribute = {\n NONE: 0,\n DEPTH: 1,\n CONVOLUTION: 2\n};\n\n// src/enums/EffectShaderSection.js\nvar EffectShaderSection = {\n FRAGMENT_HEAD: \"FRAGMENT_HEAD\",\n FRAGMENT_MAIN_UV: \"FRAGMENT_MAIN_UV\",\n FRAGMENT_MAIN_IMAGE: \"FRAGMENT_MAIN_IMAGE\",\n VERTEX_HEAD: \"VERTEX_HEAD\",\n VERTEX_MAIN_SUPPORT: \"VERTEX_MAIN_SUPPORT\"\n};\n\n// src/core/EffectShaderData.js\nvar EffectShaderData = class {\n /**\n * Constructs new shader data.\n */\n constructor() {\n this.shaderParts = /* @__PURE__ */ new Map([\n [EffectShaderSection.FRAGMENT_HEAD, null],\n [EffectShaderSection.FRAGMENT_MAIN_UV, null],\n [EffectShaderSection.FRAGMENT_MAIN_IMAGE, null],\n [EffectShaderSection.VERTEX_HEAD, null],\n [EffectShaderSection.VERTEX_MAIN_SUPPORT, null]\n ]);\n this.defines = /* @__PURE__ */ new Map();\n this.uniforms = /* @__PURE__ */ new Map();\n this.blendModes = /* @__PURE__ */ new Map();\n this.extensions = /* @__PURE__ */ new Set();\n this.attributes = EffectAttribute.NONE;\n this.varyings = /* @__PURE__ */ new Set();\n this.uvTransformation = false;\n this.readDepth = false;\n this.colorSpace = LinearSRGBColorSpace;\n }\n};\n\n// src/core/GaussKernel.js\nfunction getCoefficients(n) {\n let result;\n if (n === 0) {\n result = new Float64Array(0);\n } else if (n === 1) {\n result = new Float64Array([1]);\n } else if (n > 1) {\n let row0 = new Float64Array(n);\n let row1 = new Float64Array(n);\n for (let y = 1; y <= n; ++y) {\n for (let x = 0; x < y; ++x) {\n row1[x] = x === 0 || x === y - 1 ? 1 : row0[x - 1] + row0[x];\n }\n result = row1;\n row1 = row0;\n row0 = result;\n }\n }\n return result;\n}\nvar GaussKernel = class {\n /**\n * Constructs a new Gauss kernel.\n *\n * @param {Number} kernelSize - The kernel size. Should be an odd number in the range [3, 1020].\n * @param {Number} [edgeBias=2] - Determines how many edge coefficients should be cut off for increased accuracy.\n */\n constructor(kernelSize, edgeBias = 2) {\n this.weights = null;\n this.offsets = null;\n this.linearWeights = null;\n this.linearOffsets = null;\n this.generate(kernelSize, edgeBias);\n }\n /**\n * The number of steps for discrete sampling.\n *\n * @type {Number}\n */\n get steps() {\n return this.offsets === null ? 0 : this.offsets.length;\n }\n /**\n * The number of steps for linear sampling.\n *\n * @type {Number}\n */\n get linearSteps() {\n return this.linearOffsets === null ? 0 : this.linearOffsets.length;\n }\n /**\n * Generates the kernel.\n *\n * @private\n * @param {Number} kernelSize - The kernel size.\n * @param {Number} edgeBias - The amount of edge coefficients to ignore.\n */\n generate(kernelSize, edgeBias) {\n if (kernelSize < 3 || kernelSize > 1020) {\n throw new Error(\"The kernel size must be in the range [3, 1020]\");\n }\n const n = kernelSize + edgeBias * 2;\n const coefficients = edgeBias > 0 ? getCoefficients(n).slice(edgeBias, -edgeBias) : getCoefficients(n);\n const mid = Math.floor((coefficients.length - 1) / 2);\n const sum = coefficients.reduce((a, b) => a + b, 0);\n const weights = coefficients.slice(mid);\n const offsets = [...Array(mid + 1).keys()];\n const linearWeights = new Float64Array(Math.floor(offsets.length / 2));\n const linearOffsets = new Float64Array(linearWeights.length);\n linearWeights[0] = weights[0] / sum;\n for (let i = 1, j = 1, l = offsets.length - 1; i < l; i += 2, ++j) {\n const offset0 = offsets[i], offset1 = offsets[i + 1];\n const weight0 = weights[i], weight1 = weights[i + 1];\n const w = weight0 + weight1;\n const o = (offset0 * weight0 + offset1 * weight1) / w;\n linearWeights[j] = w / sum;\n linearOffsets[j] = o;\n }\n for (let i = 0, l = weights.length, s = 1 / sum; i < l; ++i) {\n weights[i] *= s;\n }\n const linearWeightSum = (linearWeights.reduce((a, b) => a + b, 0) - linearWeights[0] * 0.5) * 2;\n if (linearWeightSum !== 0) {\n for (let i = 0, l = linearWeights.length, s = 1 / linearWeightSum; i < l; ++i) {\n linearWeights[i] *= s;\n }\n }\n this.offsets = offsets;\n this.weights = weights;\n this.linearOffsets = linearOffsets;\n this.linearWeights = linearWeights;\n }\n};\n\n// src/core/ImmutableTimer.js\nvar ImmutableTimer = class {\n /**\n * The current delta time in seconds.\n *\n * @type {Number}\n */\n getDelta() {\n return NaN;\n }\n /**\n * The elapsed time in seconds.\n *\n * @type {Number}\n */\n getElapsed() {\n return NaN;\n }\n};\n\n// src/core/Initializable.js\nvar Initializable = class {\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - A renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n }\n};\n\n// src/core/OverrideMaterialManager.js\nimport { BackSide, DoubleSide, FrontSide, ShaderMaterial as ShaderMaterial2 } from \"three\";\nvar workaroundEnabled = false;\nvar OverrideMaterialManager = class {\n /**\n * Constructs a new override material manager.\n *\n * @param {Material} [material=null] - An override material.\n */\n constructor(material = null) {\n this.originalMaterials = /* @__PURE__ */ new Map();\n this.material = null;\n this.materials = null;\n this.materialsBackSide = null;\n this.materialsDoubleSide = null;\n this.materialsFlatShaded = null;\n this.materialsFlatShadedBackSide = null;\n this.materialsFlatShadedDoubleSide = null;\n this.setMaterial(material);\n this.meshCount = 0;\n this.replaceMaterial = (node) => {\n if (node.isMesh) {\n let materials;\n if (node.material.flatShading) {\n switch (node.material.side) {\n case DoubleSide:\n materials = this.materialsFlatShadedDoubleSide;\n break;\n case BackSide:\n materials = this.materialsFlatShadedBackSide;\n break;\n default:\n materials = this.materialsFlatShaded;\n break;\n }\n } else {\n switch (node.material.side) {\n case DoubleSide:\n materials = this.materialsDoubleSide;\n break;\n case BackSide:\n materials = this.materialsBackSide;\n break;\n default:\n materials = this.materials;\n break;\n }\n }\n this.originalMaterials.set(node, node.material);\n if (node.isSkinnedMesh) {\n node.material = materials[2];\n } else if (node.isInstancedMesh) {\n node.material = materials[1];\n } else {\n node.material = materials[0];\n }\n ++this.meshCount;\n }\n };\n }\n /**\n * Clones the given material.\n *\n * @private\n * @param {Material} material - The material.\n * @return {Material} The cloned material.\n */\n cloneMaterial(material) {\n if (!(material instanceof ShaderMaterial2)) {\n return material.clone();\n }\n const uniforms = material.uniforms;\n const textureUniforms = /* @__PURE__ */ new Map();\n for (const key in uniforms) {\n const value = uniforms[key].value;\n if (value.isRenderTargetTexture) {\n uniforms[key].value = null;\n textureUniforms.set(key, value);\n }\n }\n const clone = material.clone();\n for (const entry of textureUniforms) {\n uniforms[entry[0]].value = entry[1];\n clone.uniforms[entry[0]].value = entry[1];\n }\n return clone;\n }\n /**\n * Sets the override material.\n *\n * @param {Material} material - The material.\n */\n setMaterial(material) {\n this.disposeMaterials();\n this.material = material;\n if (material !== null) {\n const materials = this.materials = [\n this.cloneMaterial(material),\n this.cloneMaterial(material),\n this.cloneMaterial(material)\n ];\n for (const m2 of materials) {\n m2.uniforms = Object.assign({}, material.uniforms);\n m2.side = FrontSide;\n }\n materials[2].skinning = true;\n this.materialsBackSide = materials.map((m2) => {\n const c2 = this.cloneMaterial(m2);\n c2.uniforms = Object.assign({}, material.uniforms);\n c2.side = BackSide;\n return c2;\n });\n this.materialsDoubleSide = materials.map((m2) => {\n const c2 = this.cloneMaterial(m2);\n c2.uniforms = Object.assign({}, material.uniforms);\n c2.side = DoubleSide;\n return c2;\n });\n this.materialsFlatShaded = materials.map((m2) => {\n const c2 = this.cloneMaterial(m2);\n c2.uniforms = Object.assign({}, material.uniforms);\n c2.flatShading = true;\n return c2;\n });\n this.materialsFlatShadedBackSide = materials.map((m2) => {\n const c2 = this.cloneMaterial(m2);\n c2.uniforms = Object.assign({}, material.uniforms);\n c2.flatShading = true;\n c2.side = BackSide;\n return c2;\n });\n this.materialsFlatShadedDoubleSide = materials.map((m2) => {\n const c2 = this.cloneMaterial(m2);\n c2.uniforms = Object.assign({}, material.uniforms);\n c2.flatShading = true;\n c2.side = DoubleSide;\n return c2;\n });\n }\n }\n /**\n * Renders the scene with the override material.\n *\n * @private\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Scene} scene - A scene.\n * @param {Camera} camera - A camera.\n */\n render(renderer, scene, camera) {\n const shadowMapEnabled = renderer.shadowMap.enabled;\n renderer.shadowMap.enabled = false;\n if (workaroundEnabled) {\n const originalMaterials = this.originalMaterials;\n this.meshCount = 0;\n scene.traverse(this.replaceMaterial);\n renderer.render(scene, camera);\n for (const entry of originalMaterials) {\n entry[0].material = entry[1];\n }\n if (this.meshCount !== originalMaterials.size) {\n originalMaterials.clear();\n }\n } else {\n const overrideMaterial = scene.overrideMaterial;\n scene.overrideMaterial = this.material;\n renderer.render(scene, camera);\n scene.overrideMaterial = overrideMaterial;\n }\n renderer.shadowMap.enabled = shadowMapEnabled;\n }\n /**\n * Deletes cloned override materials.\n *\n * @private\n */\n disposeMaterials() {\n if (this.material !== null) {\n const materials = this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);\n for (const m2 of materials) {\n m2.dispose();\n }\n }\n }\n /**\n * Performs cleanup tasks.\n */\n dispose() {\n this.originalMaterials.clear();\n this.disposeMaterials();\n }\n /**\n * Indicates whether the override material workaround is enabled.\n *\n * @type {Boolean}\n */\n static get workaroundEnabled() {\n return workaroundEnabled;\n }\n /**\n * Enables or disables the override material workaround globally.\n *\n * This only affects post processing passes and effects.\n *\n * @type {Boolean}\n */\n static set workaroundEnabled(value) {\n workaroundEnabled = value;\n }\n};\n\n// src/core/Resizable.js\nvar Resizable = class {\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n }\n};\n\n// src/core/Resolution.js\nimport { EventDispatcher, Vector2 as Vector22 } from \"three\";\nvar AUTO_SIZE = -1;\nvar Resolution = class extends EventDispatcher {\n /**\n * Constructs a new resolution.\n *\n * TODO Remove resizable param.\n * @param {Resizable} resizable - A resizable object.\n * @param {Number} [width=Resolution.AUTO_SIZE] - The preferred width.\n * @param {Number} [height=Resolution.AUTO_SIZE] - The preferred height.\n * @param {Number} [scale=1.0] - A resolution scale.\n */\n constructor(resizable, width = AUTO_SIZE, height = AUTO_SIZE, scale = 1) {\n super();\n this.resizable = resizable;\n this.baseSize = new Vector22(1, 1);\n this.preferredSize = new Vector22(width, height);\n this.target = this.preferredSize;\n this.s = scale;\n this.effectiveSize = new Vector22();\n this.addEventListener(\"change\", () => this.updateEffectiveSize());\n this.updateEffectiveSize();\n }\n /**\n * Calculates the effective size.\n *\n * @private\n */\n updateEffectiveSize() {\n const base = this.baseSize;\n const preferred = this.preferredSize;\n const effective = this.effectiveSize;\n const scale = this.scale;\n if (preferred.width !== AUTO_SIZE) {\n effective.width = preferred.width;\n } else if (preferred.height !== AUTO_SIZE) {\n effective.width = Math.round(preferred.height * (base.width / Math.max(base.height, 1)));\n } else {\n effective.width = Math.round(base.width * scale);\n }\n if (preferred.height !== AUTO_SIZE) {\n effective.height = preferred.height;\n } else if (preferred.width !== AUTO_SIZE) {\n effective.height = Math.round(preferred.width / Math.max(base.width / Math.max(base.height, 1), 1));\n } else {\n effective.height = Math.round(base.height * scale);\n }\n }\n /**\n * The effective width.\n *\n * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base width will be returned.\n *\n * @type {Number}\n */\n get width() {\n return this.effectiveSize.width;\n }\n set width(value) {\n this.preferredWidth = value;\n }\n /**\n * The effective height.\n *\n * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base height will be returned.\n *\n * @type {Number}\n */\n get height() {\n return this.effectiveSize.height;\n }\n set height(value) {\n this.preferredHeight = value;\n }\n /**\n * Returns the effective width.\n *\n * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base width will be returned.\n *\n * @deprecated Use width instead.\n * @return {Number} The effective width.\n */\n getWidth() {\n return this.width;\n }\n /**\n * Returns the effective height.\n *\n * If the preferred width and height are set to {@link Resizer.AUTO_SIZE}, the base height will be returned.\n *\n * @deprecated Use height instead.\n * @return {Number} The effective height.\n */\n getHeight() {\n return this.height;\n }\n /**\n * The resolution scale.\n *\n * @type {Number}\n */\n get scale() {\n return this.s;\n }\n set scale(value) {\n if (this.s !== value) {\n this.s = value;\n this.preferredSize.setScalar(AUTO_SIZE);\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * Returns the current resolution scale.\n *\n * @deprecated Use scale instead.\n * @return {Number} The scale.\n */\n getScale() {\n return this.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * Also sets the preferred resolution to {@link Resizer.AUTO_SIZE}.\n *\n * @deprecated Use scale instead.\n * @param {Number} value - The scale.\n */\n setScale(value) {\n this.scale = value;\n }\n /**\n * The base width.\n *\n * @type {Number}\n */\n get baseWidth() {\n return this.baseSize.width;\n }\n set baseWidth(value) {\n if (this.baseSize.width !== value) {\n this.baseSize.width = value;\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * Returns the base width.\n *\n * @deprecated Use baseWidth instead.\n * @return {Number} The base width.\n */\n getBaseWidth() {\n return this.baseWidth;\n }\n /**\n * Sets the base width.\n *\n * @deprecated Use baseWidth instead.\n * @param {Number} value - The width.\n */\n setBaseWidth(value) {\n this.baseWidth = value;\n }\n /**\n * The base height.\n *\n * @type {Number}\n */\n get baseHeight() {\n return this.baseSize.height;\n }\n set baseHeight(value) {\n if (this.baseSize.height !== value) {\n this.baseSize.height = value;\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * Returns the base height.\n *\n * @deprecated Use baseHeight instead.\n * @return {Number} The base height.\n */\n getBaseHeight() {\n return this.baseHeight;\n }\n /**\n * Sets the base height.\n *\n * @deprecated Use baseHeight instead.\n * @param {Number} value - The height.\n */\n setBaseHeight(value) {\n this.baseHeight = value;\n }\n /**\n * Sets the base size.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setBaseSize(width, height) {\n if (this.baseSize.width !== width || this.baseSize.height !== height) {\n this.baseSize.set(width, height);\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * The preferred width.\n *\n * @type {Number}\n */\n get preferredWidth() {\n return this.preferredSize.width;\n }\n set preferredWidth(value) {\n if (this.preferredSize.width !== value) {\n this.preferredSize.width = value;\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * Returns the preferred width.\n *\n * @deprecated Use preferredWidth instead.\n * @return {Number} The preferred width.\n */\n getPreferredWidth() {\n return this.preferredWidth;\n }\n /**\n * Sets the preferred width.\n *\n * Use {@link Resizer.AUTO_SIZE} to automatically calculate the width based on the height and aspect ratio.\n *\n * @deprecated Use preferredWidth instead.\n * @param {Number} value - The width.\n */\n setPreferredWidth(value) {\n this.preferredWidth = value;\n }\n /**\n * The preferred height.\n *\n * @type {Number}\n */\n get preferredHeight() {\n return this.preferredSize.height;\n }\n set preferredHeight(value) {\n if (this.preferredSize.height !== value) {\n this.preferredSize.height = value;\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * Returns the preferred height.\n *\n * @deprecated Use preferredHeight instead.\n * @return {Number} The preferred height.\n */\n getPreferredHeight() {\n return this.preferredHeight;\n }\n /**\n * Sets the preferred height.\n *\n * Use {@link Resizer.AUTO_SIZE} to automatically calculate the height based on the width and aspect ratio.\n *\n * @deprecated Use preferredHeight instead.\n * @param {Number} value - The height.\n */\n setPreferredHeight(value) {\n this.preferredHeight = value;\n }\n /**\n * Sets the preferred size.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setPreferredSize(width, height) {\n if (this.preferredSize.width !== width || this.preferredSize.height !== height) {\n this.preferredSize.set(width, height);\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n }\n /**\n * Copies the given resolution.\n *\n * @param {Resolution} resolution - The resolution.\n */\n copy(resolution) {\n this.s = resolution.scale;\n this.baseSize.set(resolution.baseWidth, resolution.baseHeight);\n this.preferredSize.set(resolution.preferredWidth, resolution.preferredHeight);\n this.dispatchEvent({ type: \"change\" });\n this.resizable.setSize(this.baseSize.width, this.baseSize.height);\n }\n /**\n * An auto sizing constant.\n *\n * Can be used to automatically calculate the width or height based on the original aspect ratio.\n *\n * @type {Number}\n */\n static get AUTO_SIZE() {\n return AUTO_SIZE;\n }\n};\n\n// src/utils/IdManager.js\nvar IdManager = class {\n /**\n * Constructs a new ID manager.\n *\n * @param initialId - The first ID.\n */\n constructor(initialId = 0) {\n this.nextId = initialId;\n }\n /**\n * Returns the next unique ID.\n *\n * @return The ID.\n */\n getNextId() {\n return this.nextId++;\n }\n /**\n * Resets the ID counter.\n *\n * @param initialId - The first ID.\n * @return This manager.\n */\n reset(initialId = 0) {\n this.nextId = initialId;\n return this;\n }\n};\n\n// src/core/Selection.js\nvar idManager = /* @__PURE__ */ new IdManager(2);\nvar Selection = class extends Set {\n /**\n * Constructs a new selection.\n *\n * @param {Iterable} [iterable] - A collection of objects that should be added to this selection.\n * @param {Number} [layer] - A dedicated render layer for selected objects. Range is `[2, 31]`. Starts at 2 if omitted.\n */\n constructor(iterable, layer = idManager.getNextId()) {\n super();\n this.exclusive = false;\n this._layer = layer;\n if (this._layer < 1 || this._layer > 31) {\n console.warn(\"Layer out of range, resetting to 2\");\n idManager.reset(2);\n this._layer = idManager.getNextId();\n }\n if (iterable !== void 0) {\n this.set(iterable);\n }\n }\n /**\n * The render layer for selected objects.\n *\n * @type {Number}\n */\n get layer() {\n return this._layer;\n }\n set layer(value) {\n const currentLayer = this._layer;\n for (const object of this) {\n object.layers.disable(currentLayer);\n object.layers.enable(value);\n }\n this._layer = value;\n }\n /**\n * Returns the current render layer for selected objects.\n *\n * The default layer is 2. If this collides with your own custom layers, please change it before rendering!\n *\n * @deprecated Use layer instead.\n * @return {Number} The layer.\n */\n getLayer() {\n return this.layer;\n }\n /**\n * Sets the render layer for selected objects.\n *\n * The current selection will be updated accordingly.\n *\n * @deprecated Use layer instead.\n * @param {Number} value - The layer. Range is [0, 31].\n */\n setLayer(value) {\n this.layer = value;\n }\n /**\n * Indicates whether objects that are added to this selection will be removed from all other layers.\n *\n * @deprecated Use exclusive instead.\n * @return {Number} Whether this selection is exclusive. Default is false.\n */\n isExclusive() {\n return this.exclusive;\n }\n /**\n * Controls whether objects that are added to this selection should be removed from all other layers.\n *\n * @deprecated Use exclusive instead.\n * @param {Number} value - Whether this selection should be exclusive.\n */\n setExclusive(value) {\n this.exclusive = value;\n }\n /**\n * Clears this selection.\n *\n * @return {Selection} This selection.\n */\n clear() {\n const layer = this.layer;\n for (const object of this) {\n object.layers.disable(layer);\n }\n return super.clear();\n }\n /**\n * Clears this selection and adds the given objects.\n *\n * @param {Iterable} objects - The objects that should be selected.\n * @return {Selection} This selection.\n */\n set(objects) {\n this.clear();\n for (const object of objects) {\n this.add(object);\n }\n return this;\n }\n /**\n * An alias for {@link has}.\n *\n * @param {Object3D} object - An object.\n * @return {Number} Returns 0 if the given object is currently selected, or -1 otherwise.\n * @deprecated Added for backward-compatibility.\n */\n indexOf(object) {\n return this.has(object) ? 0 : -1;\n }\n /**\n * Adds an object to this selection.\n *\n * If {@link exclusive} is set to `true`, the object will also be removed from all other layers.\n *\n * @param {Object3D} object - The object that should be selected.\n * @return {Selection} This selection.\n */\n add(object) {\n if (this.exclusive) {\n object.layers.set(this.layer);\n } else {\n object.layers.enable(this.layer);\n }\n return super.add(object);\n }\n /**\n * Removes an object from this selection.\n *\n * @param {Object3D} object - The object that should be deselected.\n * @return {Boolean} Returns true if an object has successfully been removed from this selection; otherwise false.\n */\n delete(object) {\n if (this.has(object)) {\n object.layers.disable(this.layer);\n }\n return super.delete(object);\n }\n /**\n * Removes an existing object from the selection. If the object doesn't exist it's added instead.\n *\n * @param {Object3D} object - The object.\n * @return {Boolean} Returns true if the object is added, false otherwise.\n */\n toggle(object) {\n let result;\n if (this.has(object)) {\n this.delete(object);\n result = false;\n } else {\n this.add(object);\n result = true;\n }\n return result;\n }\n /**\n * Sets the visibility of all selected objects.\n *\n * This method enables or disables render layer 0 of all selected objects.\n *\n * @param {Boolean} visible - Whether the selected objects should be visible.\n * @return {Selection} This selection.\n */\n setVisible(visible) {\n for (const object of this) {\n if (visible) {\n object.layers.enable(0);\n } else {\n object.layers.disable(0);\n }\n }\n return this;\n }\n};\n\n// src/effects/blending/BlendMode.js\nimport { EventDispatcher as EventDispatcher2, Uniform as Uniform2 } from \"three\";\n\n// src/enums/BlendFunction.js\nvar BlendFunction = {\n SKIP: 9,\n SET: 30,\n ADD: 0,\n ALPHA: 1,\n AVERAGE: 2,\n COLOR: 3,\n COLOR_BURN: 4,\n COLOR_DODGE: 5,\n DARKEN: 6,\n DIFFERENCE: 7,\n DIVIDE: 8,\n DST: 9,\n EXCLUSION: 10,\n HARD_LIGHT: 11,\n HARD_MIX: 12,\n HUE: 13,\n INVERT: 14,\n INVERT_RGB: 15,\n LIGHTEN: 16,\n LINEAR_BURN: 17,\n LINEAR_DODGE: 18,\n LINEAR_LIGHT: 19,\n LUMINOSITY: 20,\n MULTIPLY: 21,\n NEGATION: 22,\n NORMAL: 23,\n OVERLAY: 24,\n PIN_LIGHT: 25,\n REFLECT: 26,\n SATURATION: 27,\n SCREEN: 28,\n SOFT_LIGHT: 29,\n SRC: 30,\n SUBTRACT: 31,\n VIVID_LIGHT: 32\n};\n\n// src/effects/blending/glsl/add.frag\nvar add_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),opacity);}`;\n\n// src/effects/blending/glsl/alpha.frag\nvar alpha_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}`;\n\n// src/effects/blending/glsl/average.frag\nvar average_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),opacity);}`;\n\n// src/effects/blending/glsl/color.frag\nvar color_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/color-burn.frag\nvar color_burn_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/color-dodge.frag\nvar color_dodge_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/darken.frag\nvar darken_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/difference.frag\nvar difference_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/divide.frag\nvar divide_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),opacity);}`;\n\n// src/effects/blending/glsl/exclusion.frag\nvar exclusion_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/hard-light.frag\nvar hard_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/hard-mix.frag\nvar hard_mix_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/hue.frag\nvar hue_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/invert.frag\nvar invert_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),opacity);}`;\n\n// src/effects/blending/glsl/invert-rgb.frag\nvar invert_rgb_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/lighten.frag\nvar lighten_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/linear-burn.frag\nvar linear_burn_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),opacity);}`;\n\n// src/effects/blending/glsl/linear-dodge.frag\nvar linear_dodge_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),opacity);}`;\n\n// src/effects/blending/glsl/linear-light.frag\nvar linear_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),opacity);}`;\n\n// src/effects/blending/glsl/luminosity.frag\nvar luminosity_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/multiply.frag\nvar multiply_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),opacity);}`;\n\n// src/effects/blending/glsl/negation.frag\nvar negation_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),opacity);}`;\n\n// src/effects/blending/glsl/normal.frag\nvar normal_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}`;\n\n// src/effects/blending/glsl/overlay.frag\nvar overlay_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/pin-light.frag\nvar pin_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/reflect.frag\nvar reflect_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/saturation.frag\nvar saturation_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/screen.frag\nvar screen_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),opacity);}`;\n\n// src/effects/blending/glsl/soft-light.frag\nvar soft_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/glsl/src.frag\nvar src_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}`;\n\n// src/effects/blending/glsl/subtract.frag\nvar subtract_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),opacity);}`;\n\n// src/effects/blending/glsl/vivid-light.frag\nvar vivid_light_default = `vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),opacity);}`;\n\n// src/effects/blending/BlendMode.js\nvar blendFunctions = /* @__PURE__ */ new Map([\n [BlendFunction.ADD, add_default],\n [BlendFunction.ALPHA, alpha_default],\n [BlendFunction.AVERAGE, average_default],\n [BlendFunction.COLOR, color_default],\n [BlendFunction.COLOR_BURN, color_burn_default],\n [BlendFunction.COLOR_DODGE, color_dodge_default],\n [BlendFunction.DARKEN, darken_default],\n [BlendFunction.DIFFERENCE, difference_default],\n [BlendFunction.DIVIDE, divide_default],\n [BlendFunction.DST, null],\n [BlendFunction.EXCLUSION, exclusion_default],\n [BlendFunction.HARD_LIGHT, hard_light_default],\n [BlendFunction.HARD_MIX, hard_mix_default],\n [BlendFunction.HUE, hue_default],\n [BlendFunction.INVERT, invert_default],\n [BlendFunction.INVERT_RGB, invert_rgb_default],\n [BlendFunction.LIGHTEN, lighten_default],\n [BlendFunction.LINEAR_BURN, linear_burn_default],\n [BlendFunction.LINEAR_DODGE, linear_dodge_default],\n [BlendFunction.LINEAR_LIGHT, linear_light_default],\n [BlendFunction.LUMINOSITY, luminosity_default],\n [BlendFunction.MULTIPLY, multiply_default],\n [BlendFunction.NEGATION, negation_default],\n [BlendFunction.NORMAL, normal_default],\n [BlendFunction.OVERLAY, overlay_default],\n [BlendFunction.PIN_LIGHT, pin_light_default],\n [BlendFunction.REFLECT, reflect_default],\n [BlendFunction.SATURATION, saturation_default],\n [BlendFunction.SCREEN, screen_default],\n [BlendFunction.SOFT_LIGHT, soft_light_default],\n [BlendFunction.SRC, src_default],\n [BlendFunction.SUBTRACT, subtract_default],\n [BlendFunction.VIVID_LIGHT, vivid_light_default]\n]);\nvar BlendMode = class extends EventDispatcher2 {\n /**\n * Constructs a new blend mode.\n *\n * @param {BlendFunction} blendFunction - The blend function.\n * @param {Number} opacity - The opacity of the color that will be blended with the base color.\n */\n constructor(blendFunction, opacity = 1) {\n super();\n this._blendFunction = blendFunction;\n this.opacity = new Uniform2(opacity);\n }\n /**\n * Returns the opacity.\n *\n * @return {Number} The opacity.\n */\n getOpacity() {\n return this.opacity.value;\n }\n /**\n * Sets the opacity.\n *\n * @param {Number} value - The opacity.\n */\n setOpacity(value) {\n this.opacity.value = value;\n }\n /**\n * The blend function.\n *\n * @type {BlendFunction}\n */\n get blendFunction() {\n return this._blendFunction;\n }\n set blendFunction(value) {\n this._blendFunction = value;\n this.dispatchEvent({ type: \"change\" });\n }\n /**\n * Returns the blend function.\n *\n * @deprecated Use blendFunction instead.\n * @return {BlendFunction} The blend function.\n */\n getBlendFunction() {\n return this.blendFunction;\n }\n /**\n * Sets the blend function.\n *\n * @deprecated Use blendFunction instead.\n * @param {BlendFunction} value - The blend function.\n */\n setBlendFunction(value) {\n this.blendFunction = value;\n }\n /**\n * Returns the blend function shader code.\n *\n * @return {String} The blend function shader code.\n */\n getShaderCode() {\n return blendFunctions.get(this.blendFunction);\n }\n};\n\n// src/effects/ASCIIEffect.js\nimport { Color as Color2, Uniform as Uniform3, Vector2 as Vector23, Vector4 } from \"three\";\n\n// src/textures/ASCIITexture.js\nimport { CanvasTexture, RepeatWrapping } from \"three\";\nvar ASCIITexture = class extends CanvasTexture {\n /**\n * Constructs a new ASCII texture.\n *\n * @param {Object} [options] - The options.\n * @param {String} [options.characters] - The character set to render. Defaults to a common ASCII art charset.\n * @param {String} [options.font=\"Arial\"] - The font.\n * @param {Number} [options.fontSize=54] - The font size in pixels.\n * @param {Number} [options.size=1024] - The texture size.\n * @param {Number} [options.cellCount=16] - The cell count along each side of the texture.\n */\n constructor({\n characters = \" .:,'-^=*+?!|0#X%WM@\",\n font = \"Arial\",\n fontSize = 54,\n size = 1024,\n cellCount = 16\n } = {}) {\n super(\n document.createElement(\"canvas\"),\n void 0,\n RepeatWrapping,\n RepeatWrapping\n );\n const canvas = this.image;\n canvas.width = canvas.height = size;\n const context = canvas.getContext(\"2d\");\n const cellSize = size / cellCount;\n context.font = `${fontSize}px ${font}`;\n context.textAlign = \"center\";\n context.textBaseline = \"middle\";\n context.fillStyle = \"#ffffff\";\n for (let i = 0, l = characters.length; i < l; ++i) {\n const char = characters[i];\n const x = i % cellCount;\n const y = Math.floor(i / cellCount);\n context.fillText(char, x * cellSize + cellSize / 2, y * cellSize + cellSize / 2);\n }\n this.characterCount = characters.length;\n this.cellCount = cellCount;\n }\n};\n\n// src/effects/Effect.js\nimport {\n BasicDepthPacking as BasicDepthPacking2,\n EventDispatcher as EventDispatcher3,\n LinearSRGBColorSpace as LinearSRGBColorSpace2,\n Material as Material2,\n NoColorSpace,\n Texture as Texture2,\n WebGLRenderTarget as WebGLRenderTarget4\n} from \"three\";\nvar Effect = class extends EventDispatcher3 {\n /**\n * Constructs a new effect.\n *\n * @param {String} name - The name of this effect. Doesn't have to be unique.\n * @param {String} fragmentShader - The fragment shader. This shader is required.\n * @param {Object} [options] - Additional options.\n * @param {EffectAttribute} [options.attributes=EffectAttribute.NONE] - The effect attributes that determine the execution priority and resource requirements.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.NORMAL] - The blend function of this effect.\n * @param {Map} [options.defines] - Custom preprocessor macro definitions. Keys are names and values are code.\n * @param {Map} [options.uniforms] - Custom shader uniforms. Keys are names and values are uniforms.\n * @param {Set} [options.extensions] - WebGL extensions.\n * @param {String} [options.vertexShader=null] - The vertex shader. Most effects don't need one.\n */\n constructor(name, fragmentShader, {\n attributes = EffectAttribute.NONE,\n blendFunction = BlendFunction.NORMAL,\n defines = /* @__PURE__ */ new Map(),\n uniforms = /* @__PURE__ */ new Map(),\n extensions = null,\n vertexShader = null\n } = {}) {\n super();\n this.name = name;\n this.renderer = null;\n this.attributes = attributes;\n this.fragmentShader = fragmentShader;\n this.vertexShader = vertexShader;\n this.defines = defines;\n this.uniforms = uniforms;\n this.extensions = extensions;\n this.blendMode = new BlendMode(blendFunction);\n this.blendMode.addEventListener(\"change\", (event) => this.setChanged());\n this._inputColorSpace = LinearSRGBColorSpace2;\n this._outputColorSpace = NoColorSpace;\n }\n /**\n * The input color space.\n *\n * @type {ColorSpace}\n * @experimental\n */\n get inputColorSpace() {\n return this._inputColorSpace;\n }\n /**\n * @type {ColorSpace}\n * @protected\n * @experimental\n */\n set inputColorSpace(value) {\n this._inputColorSpace = value;\n this.setChanged();\n }\n /**\n * The output color space.\n *\n * Should only be changed if this effect converts the input colors to a different color space.\n *\n * @type {ColorSpace}\n * @experimental\n */\n get outputColorSpace() {\n return this._outputColorSpace;\n }\n /**\n * @type {ColorSpace}\n * @protected\n * @experimental\n */\n set outputColorSpace(value) {\n this._outputColorSpace = value;\n this.setChanged();\n }\n /**\n * Sets the main scene.\n *\n * @type {Scene}\n */\n set mainScene(value) {\n }\n /**\n * Sets the main camera.\n *\n * @type {Camera}\n */\n set mainCamera(value) {\n }\n /**\n * Returns the name of this effect.\n *\n * @deprecated Use name instead.\n * @return {String} The name.\n */\n getName() {\n return this.name;\n }\n /**\n * Sets the renderer.\n *\n * @deprecated\n * @param {WebGLRenderer} renderer - The renderer.\n */\n setRenderer(renderer) {\n this.renderer = renderer;\n }\n /**\n * Returns the preprocessor macro definitions.\n *\n * @deprecated Use defines instead.\n * @return {Map} The extensions.\n */\n getDefines() {\n return this.defines;\n }\n /**\n * Returns the uniforms of this effect.\n *\n * @deprecated Use uniforms instead.\n * @return {Map} The extensions.\n */\n getUniforms() {\n return this.uniforms;\n }\n /**\n * Returns the WebGL extensions that are required by this effect.\n *\n * @deprecated Use extensions instead.\n * @return {Set} The extensions.\n */\n getExtensions() {\n return this.extensions;\n }\n /**\n * Returns the blend mode.\n *\n * The result of this effect will be blended with the result of the previous effect using this blend mode.\n *\n * @deprecated Use blendMode instead.\n * @return {BlendMode} The blend mode.\n */\n getBlendMode() {\n return this.blendMode;\n }\n /**\n * Returns the effect attributes.\n *\n * @return {EffectAttribute} The attributes.\n */\n getAttributes() {\n return this.attributes;\n }\n /**\n * Sets the effect attributes.\n *\n * Effects that have the same attributes will be executed in the order in which they were registered. Some attributes\n * imply a higher priority.\n *\n * @protected\n * @param {EffectAttribute} attributes - The attributes.\n */\n setAttributes(attributes) {\n this.attributes = attributes;\n this.setChanged();\n }\n /**\n * Returns the fragment shader.\n *\n * @return {String} The fragment shader.\n */\n getFragmentShader() {\n return this.fragmentShader;\n }\n /**\n * Sets the fragment shader.\n *\n * @protected\n * @param {String} fragmentShader - The fragment shader.\n */\n setFragmentShader(fragmentShader) {\n this.fragmentShader = fragmentShader;\n this.setChanged();\n }\n /**\n * Returns the vertex shader.\n *\n * @return {String} The vertex shader.\n */\n getVertexShader() {\n return this.vertexShader;\n }\n /**\n * Sets the vertex shader.\n *\n * @protected\n * @param {String} vertexShader - The vertex shader.\n */\n setVertexShader(vertexShader) {\n this.vertexShader = vertexShader;\n this.setChanged();\n }\n /**\n * Informs the associated {@link EffectPass} that this effect requires a shader recompilation.\n *\n * Should be called after changing macros or extensions and after adding/removing uniforms.\n *\n * @protected\n */\n setChanged() {\n this.dispatchEvent({ type: \"change\" });\n }\n /**\n * Sets the depth texture.\n *\n * You may override this method if your effect requires direct access to the depth texture that is bound to the\n * associated {@link EffectPass}.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking2) {\n }\n /**\n * Updates this effect by performing supporting operations.\n *\n * This method is called by the {@link EffectPass} right before the main fullscreen render operation, even if the\n * blend function is set to `SKIP`.\n *\n * You may override this method if you need to update custom uniforms or render additional off-screen textures.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n }\n /**\n * Updates the size of this effect.\n *\n * You may override this method if you want to be informed about the size of the backbuffer/canvas.\n * This method is called before {@link initialize} and every time the size of the {@link EffectComposer} changes.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n }\n /**\n * Performs initialization tasks.\n *\n * This method is called when the associated {@link EffectPass} is added to an {@link EffectComposer}.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n * @example if(!alpha && frameBufferType === UnsignedByteType) { this.myRenderTarget.texture.format = RGBFormat; }\n */\n initialize(renderer, alpha, frameBufferType) {\n }\n /**\n * Performs a shallow search for properties that define a dispose method and deletes them.\n *\n * The {@link EffectComposer} calls this method when it is being destroyed.\n */\n dispose() {\n for (const key of Object.keys(this)) {\n const property = this[key];\n const isDisposable = property instanceof WebGLRenderTarget4 || property instanceof Material2 || property instanceof Texture2 || property instanceof Pass;\n if (isDisposable) {\n this[key].dispose();\n }\n }\n }\n};\n\n// src/effects/glsl/ascii.frag\nvar ascii_default = `uniform sampler2D asciiTexture;uniform vec4 cellCount;\n#ifdef USE_COLOR\nuniform vec3 color;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 pixelizedUv=cellCount.zw*(0.5+floor(uv*cellCount.xy));vec4 texel=texture(inputBuffer,pixelizedUv);float lum=min(luminance(texel.rgb),1.0);\n#ifdef INVERTED\nlum=1.0-lum;\n#endif\nfloat characterIndex=floor(CHAR_COUNT_MINUS_ONE*lum);vec2 characterPosition=vec2(mod(characterIndex,TEX_CELL_COUNT),floor(characterIndex*INV_TEX_CELL_COUNT));vec2 offset=vec2(characterPosition.x,-characterPosition.y)*INV_TEX_CELL_COUNT;vec2 characterUv=mod(uv*(cellCount.xy*INV_TEX_CELL_COUNT),INV_TEX_CELL_COUNT);characterUv=characterUv-vec2(0.0,INV_TEX_CELL_COUNT)+offset;float asciiCharacter=texture(asciiTexture,characterUv).r;\n#ifdef USE_COLOR\noutputColor=vec4(color*asciiCharacter,inputColor.a);\n#else\noutputColor=vec4(texel.rgb*asciiCharacter,inputColor.a);\n#endif\n}`;\n\n// src/effects/ASCIIEffect.js\nvar ASCIIEffect = class extends Effect {\n /**\n * Constructs a new ASCII effect.\n *\n * @param {Object} [options] - The options.\n * @param {ASCIITexture} [options.asciiTexture] - An ASCII character lookup texture.\n * @param {Number} [options.cellSize=16] - The cell size. It's recommended to use even numbers.\n * @param {Number} [options.color=null] - A color to use instead of the scene colors.\n * @param {Boolean} [options.inverted=false] - Inverts the effect.\n */\n constructor({\n asciiTexture = new ASCIITexture(),\n cellSize = 16,\n color: color2 = null,\n inverted = false\n } = {}) {\n super(\"ASCIIEffect\", ascii_default, {\n uniforms: /* @__PURE__ */ new Map([\n [\"asciiTexture\", new Uniform3(null)],\n [\"cellCount\", new Uniform3(new Vector4())],\n [\"color\", new Uniform3(new Color2())]\n ])\n });\n this._cellSize = -1;\n this.resolution = new Vector23();\n this.asciiTexture = asciiTexture;\n this.cellSize = cellSize;\n this.color = color2;\n this.inverted = inverted;\n }\n /**\n * The current ASCII lookup texture.\n *\n * @type {ASCIITexture}\n */\n get asciiTexture() {\n return this.uniforms.get(\"asciiTexture\").value;\n }\n set asciiTexture(value) {\n const currentTexture = this.uniforms.get(\"asciiTexture\").value;\n this.uniforms.get(\"asciiTexture\").value = value;\n if (currentTexture !== null && currentTexture !== value) {\n currentTexture.dispose();\n }\n if (value !== null) {\n const cellCount = value.cellCount;\n this.defines.set(\"CHAR_COUNT_MINUS_ONE\", (value.characterCount - 1).toFixed(1));\n this.defines.set(\"TEX_CELL_COUNT\", cellCount.toFixed(1));\n this.defines.set(\"INV_TEX_CELL_COUNT\", (1 / cellCount).toFixed(9));\n this.setChanged();\n }\n }\n /**\n * A color that overrides the scene colors.\n *\n * @type {Color | String | Number | null}\n */\n get color() {\n return this.uniforms.get(\"color\").value;\n }\n set color(value) {\n if (value !== null) {\n this.uniforms.get(\"color\").value.set(value);\n }\n if (this.defines.has(\"USE_COLOR\") && value === null) {\n this.defines.delete(\"USE_COLOR\");\n this.setChanged();\n } else if (!this.defines.has(\"USE_COLOR\") && value !== null) {\n this.defines.set(\"USE_COLOR\", \"1\");\n this.setChanged();\n }\n }\n /**\n * Controls whether the effect should be inverted.\n *\n * @type {Boolean}\n */\n get inverted() {\n return this.defines.has(\"INVERTED\");\n }\n set inverted(value) {\n if (this.inverted !== value) {\n if (value) {\n this.defines.set(\"INVERTED\", \"1\");\n } else {\n this.defines.delete(\"INVERTED\");\n }\n this.setChanged();\n }\n }\n /**\n * The cell size.\n *\n * @type {Number}\n */\n get cellSize() {\n return this._cellSize;\n }\n set cellSize(value) {\n if (this._cellSize !== value) {\n this._cellSize = value;\n this.updateCellCount();\n }\n }\n /**\n * Updates the cell count uniform.\n *\n * @private\n */\n updateCellCount() {\n const cellCount = this.uniforms.get(\"cellCount\").value;\n const resolution = this.resolution;\n cellCount.x = resolution.width / this.cellSize;\n cellCount.y = resolution.height / this.cellSize;\n cellCount.z = 1 / cellCount.x;\n cellCount.w = 1 / cellCount.y;\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.resolution.set(width, height);\n this.updateCellCount();\n }\n /**\n * Deletes internal render targets and textures.\n */\n dispose() {\n if (this.asciiTexture !== null) {\n this.asciiTexture.dispose();\n }\n super.dispose();\n }\n};\n\n// src/effects/BloomEffect.js\nimport { SRGBColorSpace as SRGBColorSpace5, Uniform as Uniform8, WebGLRenderTarget as WebGLRenderTarget8 } from \"three\";\n\n// src/enums/KernelSize.js\nvar KernelSize = {\n VERY_SMALL: 0,\n SMALL: 1,\n MEDIUM: 2,\n LARGE: 3,\n VERY_LARGE: 4,\n HUGE: 5\n};\n\n// src/passes/KawaseBlurPass.js\nimport { SRGBColorSpace as SRGBColorSpace3, UnsignedByteType as UnsignedByteType3, WebGLRenderTarget as WebGLRenderTarget5 } from \"three\";\n\n// src/materials/KawaseBlurMaterial.js\nimport { NoBlending as NoBlending2, ShaderMaterial as ShaderMaterial3, Uniform as Uniform4, Vector4 as Vector42 } from \"three\";\n\n// src/materials/glsl/convolution.kawase.frag\nvar convolution_kawase_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include \n}`;\n\n// src/materials/glsl/convolution.kawase.vert\nvar convolution_kawase_default2 = `uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/KawaseBlurMaterial.js\nvar kernelPresets = [\n new Float32Array([0, 0]),\n new Float32Array([0, 1, 1]),\n new Float32Array([0, 1, 1, 2]),\n new Float32Array([0, 1, 2, 2, 3]),\n new Float32Array([0, 1, 2, 3, 4, 4, 5]),\n new Float32Array([0, 1, 2, 3, 4, 5, 7, 8, 9, 10])\n];\nvar KawaseBlurMaterial = class extends ShaderMaterial3 {\n /**\n * Constructs a new convolution material.\n *\n * TODO Remove texelSize param.\n * @param {Vector4} [texelSize] - Deprecated.\n */\n constructor(texelSize = new Vector42()) {\n super({\n name: \"KawaseBlurMaterial\",\n uniforms: {\n inputBuffer: new Uniform4(null),\n texelSize: new Uniform4(new Vector42()),\n scale: new Uniform4(1),\n kernel: new Uniform4(0)\n },\n blending: NoBlending2,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_kawase_default,\n vertexShader: convolution_kawase_default2\n });\n this.setTexelSize(texelSize.x, texelSize.y);\n this.kernelSize = KernelSize.MEDIUM;\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.inputBuffer = value;\n }\n /**\n * The kernel sequence for the current kernel size.\n *\n * @type {Float32Array}\n */\n get kernelSequence() {\n return kernelPresets[this.kernelSize];\n }\n /**\n * The blur scale.\n *\n * @type {Number}\n */\n get scale() {\n return this.uniforms.scale.value;\n }\n set scale(value) {\n this.uniforms.scale.value = value;\n }\n /**\n * Returns the blur scale.\n *\n * @deprecated Use scale instead.\n * @return {Number} The scale.\n */\n getScale() {\n return this.uniforms.scale.value;\n }\n /**\n * Sets the blur scale.\n *\n * @deprecated Use scale instead.\n * @return {Number} value - The scale.\n */\n setScale(value) {\n this.uniforms.scale.value = value;\n }\n /**\n * Returns the kernel.\n *\n * @return {Float32Array} The kernel.\n * @deprecated Implementation detail, removed with no replacement.\n */\n getKernel() {\n return null;\n }\n /**\n * The current kernel.\n *\n * @type {Number}\n */\n get kernel() {\n return this.uniforms.kernel.value;\n }\n set kernel(value) {\n this.uniforms.kernel.value = value;\n }\n /**\n * Sets the current kernel.\n *\n * @deprecated Use kernel instead.\n * @param {Number} value - The kernel.\n */\n setKernel(value) {\n this.kernel = value;\n }\n /**\n * Sets the texel size.\n *\n * @deprecated Use setSize() instead.\n * @param {Number} x - The texel width.\n * @param {Number} y - The texel height.\n */\n setTexelSize(x, y) {\n this.uniforms.texelSize.value.set(x, y, x * 0.5, y * 0.5);\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const x = 1 / width, y = 1 / height;\n this.uniforms.texelSize.value.set(x, y, x * 0.5, y * 0.5);\n }\n};\n\n// src/passes/KawaseBlurPass.js\nvar KawaseBlurPass = class extends Pass {\n /**\n * Constructs a new Kawase blur pass.\n *\n * @param {Object} [options] - The options.\n * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size.\n * @param {Number} [options.resolutionScale=0.5] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n */\n constructor({\n kernelSize = KernelSize.MEDIUM,\n resolutionScale = 0.5,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"KawaseBlurPass\");\n this.renderTargetA = new WebGLRenderTarget5(1, 1, { depthBuffer: false });\n this.renderTargetA.texture.name = \"Blur.Target.A\";\n this.renderTargetB = this.renderTargetA.clone();\n this.renderTargetB.texture.name = \"Blur.Target.B\";\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n this._blurMaterial = new KawaseBlurMaterial();\n this._blurMaterial.kernelSize = kernelSize;\n this.copyMaterial = new CopyMaterial();\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * The blur material.\n *\n * @type {KawaseBlurMaterial}\n */\n get blurMaterial() {\n return this._blurMaterial;\n }\n /**\n * The blur material.\n *\n * @type {KawaseBlurMaterial}\n * @protected\n */\n set blurMaterial(value) {\n this._blurMaterial = value;\n }\n /**\n * Indicates whether dithering is enabled.\n *\n * @type {Boolean}\n * @deprecated Use copyMaterial.dithering instead.\n */\n get dithering() {\n return this.copyMaterial.dithering;\n }\n set dithering(value) {\n this.copyMaterial.dithering = value;\n }\n /**\n * The kernel size.\n *\n * @type {KernelSize}\n * @deprecated Use blurMaterial.kernelSize instead.\n */\n get kernelSize() {\n return this.blurMaterial.kernelSize;\n }\n set kernelSize(value) {\n this.blurMaterial.kernelSize = value;\n }\n /**\n * The current width of the internal render targets.\n *\n * @type {Number}\n * @deprecated Use resolution.width instead.\n */\n get width() {\n return this.resolution.width;\n }\n /**\n * Sets the render width.\n *\n * @type {Number}\n * @deprecated Use resolution.preferredWidth instead.\n */\n set width(value) {\n this.resolution.preferredWidth = value;\n }\n /**\n * The current height of the internal render targets.\n *\n * @type {Number}\n * @deprecated Use resolution.height instead.\n */\n get height() {\n return this.resolution.height;\n }\n /**\n * Sets the render height.\n *\n * @type {Number}\n * @deprecated Use resolution.preferredHeight instead.\n */\n set height(value) {\n this.resolution.preferredHeight = value;\n }\n /**\n * The current blur scale.\n *\n * @type {Number}\n * @deprecated Use blurMaterial.scale instead.\n */\n get scale() {\n return this.blurMaterial.scale;\n }\n set scale(value) {\n this.blurMaterial.scale = value;\n }\n /**\n * Returns the current blur scale.\n *\n * @deprecated Use blurMaterial.scale instead.\n * @return {Number} The scale.\n */\n getScale() {\n return this.blurMaterial.scale;\n }\n /**\n * Sets the blur scale.\n *\n * @deprecated Use blurMaterial.scale instead.\n * @param {Number} value - The scale.\n */\n setScale(value) {\n this.blurMaterial.scale = value;\n }\n /**\n * Returns the kernel size.\n *\n * @deprecated Use blurMaterial.kernelSize instead.\n * @return {KernelSize} The kernel size.\n */\n getKernelSize() {\n return this.kernelSize;\n }\n /**\n * Sets the kernel size.\n *\n * Larger kernels require more processing power but scale well with larger render resolutions.\n *\n * @deprecated Use blurMaterial.kernelSize instead.\n * @param {KernelSize} value - The kernel size.\n */\n setKernelSize(value) {\n this.kernelSize = value;\n }\n /**\n * Returns the current resolution scale.\n *\n * @return {Number} The resolution scale.\n * @deprecated Use resolution instead.\n */\n getResolutionScale() {\n return this.resolution.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * @param {Number} scale - The new resolution scale.\n * @deprecated Use resolution instead.\n */\n setResolutionScale(scale) {\n this.resolution.scale = scale;\n }\n /**\n * Renders the blur.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const scene = this.scene;\n const camera = this.camera;\n const renderTargetA = this.renderTargetA;\n const renderTargetB = this.renderTargetB;\n const material = this.blurMaterial;\n const kernelSequence = material.kernelSequence;\n let previousBuffer = inputBuffer;\n this.fullscreenMaterial = material;\n for (let i = 0, l = kernelSequence.length; i < l; ++i) {\n const buffer = (i & 1) === 0 ? renderTargetA : renderTargetB;\n material.kernel = kernelSequence[i];\n material.inputBuffer = previousBuffer.texture;\n renderer.setRenderTarget(buffer);\n renderer.render(scene, camera);\n previousBuffer = buffer;\n }\n this.fullscreenMaterial = this.copyMaterial;\n this.copyMaterial.inputBuffer = previousBuffer.texture;\n renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);\n renderer.render(scene, camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.renderTargetA.setSize(w, h);\n this.renderTargetB.setSize(w, h);\n this.blurMaterial.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (frameBufferType !== void 0) {\n this.renderTargetA.texture.type = frameBufferType;\n this.renderTargetB.texture.type = frameBufferType;\n if (frameBufferType !== UnsignedByteType3) {\n this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace3) {\n this.renderTargetA.texture.colorSpace = SRGBColorSpace3;\n this.renderTargetB.texture.colorSpace = SRGBColorSpace3;\n }\n }\n }\n /**\n * An auto sizing flag.\n *\n * @type {Number}\n * @deprecated Use {@link Resolution.AUTO_SIZE} instead.\n */\n static get AUTO_SIZE() {\n return Resolution.AUTO_SIZE;\n }\n};\n\n// src/passes/LuminancePass.js\nimport { UnsignedByteType as UnsignedByteType4, WebGLRenderTarget as WebGLRenderTarget6 } from \"three\";\n\n// src/materials/LuminanceMaterial.js\nimport { NoBlending as NoBlending3, REVISION, ShaderMaterial as ShaderMaterial4, Uniform as Uniform5 } from \"three\";\n\n// src/materials/glsl/luminance.frag\nvar luminance_default = `#include \n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef RANGE\nuniform vec2 range;\n#elif defined(THRESHOLD)\nuniform float threshold;uniform float smoothing;\n#endif\nvarying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);\n#ifdef RANGE\nfloat low=step(range.x,l);float high=step(l,range.y);l*=low*high;\n#elif defined(THRESHOLD)\nl=smoothstep(threshold,threshold+smoothing,l)*l;\n#endif\n#ifdef COLOR\ngl_FragColor=vec4(texel.rgb*clamp(l,0.0,1.0),l);\n#else\ngl_FragColor=vec4(l);\n#endif\n}`;\n\n// src/materials/LuminanceMaterial.js\nvar LuminanceMaterial = class extends ShaderMaterial4 {\n /**\n * Constructs a new luminance material.\n *\n * @param {Boolean} [colorOutput=false] - Defines whether the shader should output colors scaled with their luminance value.\n * @param {Vector2} [luminanceRange] - If provided, the shader will mask out texels that aren't in the specified luminance range.\n */\n constructor(colorOutput = false, luminanceRange = null) {\n super({\n name: \"LuminanceMaterial\",\n defines: {\n THREE_REVISION: REVISION.replace(/\\D+/g, \"\")\n },\n uniforms: {\n inputBuffer: new Uniform5(null),\n threshold: new Uniform5(0),\n smoothing: new Uniform5(1),\n range: new Uniform5(null)\n },\n blending: NoBlending3,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: luminance_default,\n vertexShader: common_default\n });\n this.colorOutput = colorOutput;\n this.luminanceRange = luminanceRange;\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The luminance threshold.\n *\n * @type {Number}\n */\n get threshold() {\n return this.uniforms.threshold.value;\n }\n set threshold(value) {\n if (this.smoothing > 0 || value > 0) {\n this.defines.THRESHOLD = \"1\";\n } else {\n delete this.defines.THRESHOLD;\n }\n this.uniforms.threshold.value = value;\n }\n /**\n * Returns the luminance threshold.\n *\n * @deprecated Use threshold instead.\n * @return {Number} The threshold.\n */\n getThreshold() {\n return this.threshold;\n }\n /**\n * Sets the luminance threshold.\n *\n * @deprecated Use threshold instead.\n * @param {Number} value - The threshold.\n */\n setThreshold(value) {\n this.threshold = value;\n }\n /**\n * The luminance threshold smoothing.\n *\n * @type {Number}\n */\n get smoothing() {\n return this.uniforms.smoothing.value;\n }\n set smoothing(value) {\n if (this.threshold > 0 || value > 0) {\n this.defines.THRESHOLD = \"1\";\n } else {\n delete this.defines.THRESHOLD;\n }\n this.uniforms.smoothing.value = value;\n }\n /**\n * Returns the luminance threshold smoothing factor.\n *\n * @deprecated Use smoothing instead.\n * @return {Number} The smoothing factor.\n */\n getSmoothingFactor() {\n return this.smoothing;\n }\n /**\n * Sets the luminance threshold smoothing factor.\n *\n * @deprecated Use smoothing instead.\n * @param {Number} value - The smoothing factor.\n */\n setSmoothingFactor(value) {\n this.smoothing = value;\n }\n /**\n * Indicates whether the luminance threshold is enabled.\n *\n * @type {Boolean}\n * @deprecated Adjust the threshold or smoothing factor instead.\n */\n get useThreshold() {\n return this.threshold > 0 || this.smoothing > 0;\n }\n set useThreshold(value) {\n }\n /**\n * Indicates whether color output is enabled.\n *\n * @type {Boolean}\n */\n get colorOutput() {\n return this.defines.COLOR !== void 0;\n }\n set colorOutput(value) {\n if (value) {\n this.defines.COLOR = \"1\";\n } else {\n delete this.defines.COLOR;\n }\n this.needsUpdate = true;\n }\n /**\n * Indicates whether color output is enabled.\n *\n * @deprecated Use colorOutput instead.\n * @return {Boolean} Whether color output is enabled.\n */\n isColorOutputEnabled(value) {\n return this.colorOutput;\n }\n /**\n * Enables or disables color output.\n *\n * @deprecated Use colorOutput instead.\n * @param {Boolean} value - Whether color output should be enabled.\n */\n setColorOutputEnabled(value) {\n this.colorOutput = value;\n }\n /**\n * Indicates whether luminance masking is enabled.\n *\n * @type {Boolean}\n * @deprecated\n */\n get useRange() {\n return this.luminanceRange !== null;\n }\n set useRange(value) {\n this.luminanceRange = null;\n }\n /**\n * The luminance range. Set to null to disable.\n *\n * @type {Boolean}\n */\n get luminanceRange() {\n return this.uniforms.range.value;\n }\n set luminanceRange(value) {\n if (value !== null) {\n this.defines.RANGE = \"1\";\n } else {\n delete this.defines.RANGE;\n }\n this.uniforms.range.value = value;\n this.needsUpdate = true;\n }\n /**\n * Returns the current luminance range.\n *\n * @deprecated Use luminanceRange instead.\n * @return {Vector2} The luminance range.\n */\n getLuminanceRange() {\n return this.luminanceRange;\n }\n /**\n * Sets a luminance range. Set to null to disable.\n *\n * @deprecated Use luminanceRange instead.\n * @param {Vector2} value - The luminance range.\n */\n setLuminanceRange(value) {\n this.luminanceRange = value;\n }\n};\n\n// src/passes/LuminancePass.js\nvar LuminancePass = class extends Pass {\n /**\n * Constructs a new luminance pass.\n *\n * @param {Object} [options] - The options. See {@link LuminanceMaterial} for additional options.\n * @param {WebGLRenderTarget} [options.renderTarget] - A custom render target.\n * @param {Number} [options.resolutionScale=1.0] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n */\n constructor({\n renderTarget,\n luminanceRange,\n colorOutput,\n resolutionScale = 1,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"LuminancePass\");\n this.fullscreenMaterial = new LuminanceMaterial(colorOutput, luminanceRange);\n this.needsSwap = false;\n this.renderTarget = renderTarget;\n if (this.renderTarget === void 0) {\n this.renderTarget = new WebGLRenderTarget6(1, 1, { depthBuffer: false });\n this.renderTarget.texture.name = \"LuminancePass.Target\";\n }\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n }\n /**\n * The luminance texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the luminance texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * Renders the luminance.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const material = this.fullscreenMaterial;\n material.inputBuffer = inputBuffer.texture;\n renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget);\n renderer.render(this.scene, this.camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n this.renderTarget.setSize(resolution.width, resolution.height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - A renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (frameBufferType !== void 0 && frameBufferType !== UnsignedByteType4) {\n this.renderTarget.texture.type = frameBufferType;\n this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n }\n }\n};\n\n// src/passes/MipmapBlurPass.js\nimport { SRGBColorSpace as SRGBColorSpace4, UnsignedByteType as UnsignedByteType5, Vector2 as Vector26, WebGLRenderTarget as WebGLRenderTarget7 } from \"three\";\n\n// src/materials/DownsamplingMaterial.js\nimport { NoBlending as NoBlending4, ShaderMaterial as ShaderMaterial5, Uniform as Uniform6, Vector2 as Vector24 } from \"three\";\n\n// src/materials/glsl/convolution.downsampling.frag\nvar convolution_downsampling_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#define WEIGHT_INNER 0.125\n#define WEIGHT_OUTER 0.0555555\nvarying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;\n#include \n}`;\n\n// src/materials/glsl/convolution.downsampling.vert\nvar convolution_downsampling_default2 = `uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/DownsamplingMaterial.js\nvar DownsamplingMaterial = class extends ShaderMaterial5 {\n /**\n * Constructs a new downsampling material.\n */\n constructor() {\n super({\n name: \"DownsamplingMaterial\",\n uniforms: {\n inputBuffer: new Uniform6(null),\n texelSize: new Uniform6(new Vector24())\n },\n blending: NoBlending4,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_downsampling_default,\n vertexShader: convolution_downsampling_default2\n });\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/materials/UpsamplingMaterial.js\nimport { NoBlending as NoBlending5, ShaderMaterial as ShaderMaterial6, Uniform as Uniform7, Vector2 as Vector25 } from \"three\";\n\n// src/materials/glsl/convolution.upsampling.frag\nvar convolution_upsampling_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;\n#else\nuniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;\n#endif\nuniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);\n#include \n}`;\n\n// src/materials/glsl/convolution.upsampling.vert\nvar convolution_upsampling_default2 = `uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/UpsamplingMaterial.js\nvar UpsamplingMaterial = class extends ShaderMaterial6 {\n /**\n * Constructs a new upsampling material.\n */\n constructor() {\n super({\n name: \"UpsamplingMaterial\",\n uniforms: {\n inputBuffer: new Uniform7(null),\n supportBuffer: new Uniform7(null),\n texelSize: new Uniform7(new Vector25()),\n radius: new Uniform7(0.85)\n },\n blending: NoBlending5,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_upsampling_default,\n vertexShader: convolution_upsampling_default2\n });\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * A support buffer.\n *\n * @type {Texture}\n */\n set supportBuffer(value) {\n this.uniforms.supportBuffer.value = value;\n }\n /**\n * The blur radius.\n *\n * @type {Number}\n */\n get radius() {\n return this.uniforms.radius.value;\n }\n set radius(value) {\n this.uniforms.radius.value = value;\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/passes/MipmapBlurPass.js\nvar MipmapBlurPass = class extends Pass {\n /**\n * Constructs a new mipmap blur pass.\n *\n * @param {Object} [options] - The options.\n */\n constructor() {\n super(\"MipmapBlurPass\");\n this.needsSwap = false;\n this.renderTarget = new WebGLRenderTarget7(1, 1, { depthBuffer: false });\n this.renderTarget.texture.name = \"Upsampling.Mipmap0\";\n this.downsamplingMipmaps = [];\n this.upsamplingMipmaps = [];\n this.downsamplingMaterial = new DownsamplingMaterial();\n this.upsamplingMaterial = new UpsamplingMaterial();\n this.resolution = new Vector26();\n }\n /**\n * A texture that contains the blurred result.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * The MIP levels. Default is 8.\n *\n * @type {Number}\n */\n get levels() {\n return this.downsamplingMipmaps.length;\n }\n set levels(value) {\n if (this.levels !== value) {\n const renderTarget = this.renderTarget;\n this.dispose();\n this.downsamplingMipmaps = [];\n this.upsamplingMipmaps = [];\n for (let i = 0; i < value; ++i) {\n const mipmap = renderTarget.clone();\n mipmap.texture.name = \"Downsampling.Mipmap\" + i;\n this.downsamplingMipmaps.push(mipmap);\n }\n this.upsamplingMipmaps.push(renderTarget);\n for (let i = 1, l = value - 1; i < l; ++i) {\n const mipmap = renderTarget.clone();\n mipmap.texture.name = \"Upsampling.Mipmap\" + i;\n this.upsamplingMipmaps.push(mipmap);\n }\n this.setSize(this.resolution.x, this.resolution.y);\n }\n }\n /**\n * The blur radius.\n *\n * @type {Number}\n */\n get radius() {\n return this.upsamplingMaterial.radius;\n }\n set radius(value) {\n this.upsamplingMaterial.radius = value;\n }\n /**\n * Renders the blur.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const { scene, camera } = this;\n const { downsamplingMaterial, upsamplingMaterial } = this;\n const { downsamplingMipmaps, upsamplingMipmaps } = this;\n let previousBuffer = inputBuffer;\n this.fullscreenMaterial = downsamplingMaterial;\n for (let i = 0, l = downsamplingMipmaps.length; i < l; ++i) {\n const mipmap = downsamplingMipmaps[i];\n downsamplingMaterial.setSize(previousBuffer.width, previousBuffer.height);\n downsamplingMaterial.inputBuffer = previousBuffer.texture;\n renderer.setRenderTarget(mipmap);\n renderer.render(scene, camera);\n previousBuffer = mipmap;\n }\n this.fullscreenMaterial = upsamplingMaterial;\n for (let i = upsamplingMipmaps.length - 1; i >= 0; --i) {\n const mipmap = upsamplingMipmaps[i];\n upsamplingMaterial.setSize(previousBuffer.width, previousBuffer.height);\n upsamplingMaterial.inputBuffer = previousBuffer.texture;\n upsamplingMaterial.supportBuffer = downsamplingMipmaps[i].texture;\n renderer.setRenderTarget(mipmap);\n renderer.render(scene, camera);\n previousBuffer = mipmap;\n }\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.set(width, height);\n let w = resolution.width, h = resolution.height;\n for (let i = 0, l = this.downsamplingMipmaps.length; i < l; ++i) {\n w = Math.round(w * 0.5);\n h = Math.round(h * 0.5);\n this.downsamplingMipmaps[i].setSize(w, h);\n if (i < this.upsamplingMipmaps.length) {\n this.upsamplingMipmaps[i].setSize(w, h);\n }\n }\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (frameBufferType !== void 0) {\n const mipmaps = this.downsamplingMipmaps.concat(this.upsamplingMipmaps);\n for (const mipmap of mipmaps) {\n mipmap.texture.type = frameBufferType;\n }\n if (frameBufferType !== UnsignedByteType5) {\n this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace4) {\n for (const mipmap of mipmaps) {\n mipmap.texture.colorSpace = SRGBColorSpace4;\n }\n }\n }\n }\n /**\n * Deletes internal render targets and textures.\n */\n dispose() {\n super.dispose();\n for (const mipmap of this.downsamplingMipmaps.concat(this.upsamplingMipmaps)) {\n mipmap.dispose();\n }\n }\n};\n\n// src/effects/glsl/bloom.frag\nvar bloom_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,max(inputColor.a,texel.a));}`;\n\n// src/effects/BloomEffect.js\nvar BloomEffect = class extends Effect {\n /**\n * Constructs a new bloom effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function of this effect.\n * @param {Number} [options.luminanceThreshold=1.0] - The luminance threshold. Raise this value to mask out darker elements in the scene.\n * @param {Number} [options.luminanceSmoothing=0.03] - Controls the smoothness of the luminance threshold.\n * @param {Boolean} [options.mipmapBlur=true] - Enables or disables mipmap blur.\n * @param {Number} [options.intensity=1.0] - The bloom intensity.\n * @param {Number} [options.radius=0.85] - The blur radius. Only applies to mipmap blur.\n * @param {Number} [options.levels=8] - The amount of MIP levels. Only applies to mipmap blur.\n * @param {KernelSize} [options.kernelSize=KernelSize.LARGE] - Deprecated. Use mipmapBlur instead.\n * @param {Number} [options.resolutionScale=0.5] - Deprecated. Use mipmapBlur instead.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use mipmapBlur instead.\n */\n constructor({\n blendFunction = BlendFunction.SCREEN,\n luminanceThreshold = 1,\n luminanceSmoothing = 0.03,\n mipmapBlur = true,\n intensity = 1,\n radius = 0.85,\n levels = 8,\n kernelSize = KernelSize.LARGE,\n resolutionScale = 0.5,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"BloomEffect\", bloom_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"map\", new Uniform8(null)],\n [\"intensity\", new Uniform8(intensity)]\n ])\n });\n this.renderTarget = new WebGLRenderTarget8(1, 1, { depthBuffer: false });\n this.renderTarget.texture.name = \"Bloom.Target\";\n this.blurPass = new KawaseBlurPass({ kernelSize });\n this.luminancePass = new LuminancePass({ colorOutput: true });\n this.luminanceMaterial.threshold = luminanceThreshold;\n this.luminanceMaterial.smoothing = luminanceSmoothing;\n this.mipmapBlurPass = new MipmapBlurPass();\n this.mipmapBlurPass.enabled = mipmapBlur;\n this.mipmapBlurPass.radius = radius;\n this.mipmapBlurPass.levels = levels;\n this.uniforms.get(\"map\").value = mipmapBlur ? this.mipmapBlurPass.texture : this.renderTarget.texture;\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n }\n /**\n * A texture that contains the intermediate result of this effect.\n *\n * @type {Texture}\n */\n get texture() {\n return this.mipmapBlurPass.enabled ? this.mipmapBlurPass.texture : this.renderTarget.texture;\n }\n /**\n * Returns the generated bloom texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.texture;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * Returns the blur pass.\n *\n * @deprecated\n * @return {KawaseBlurPass} The blur pass.\n */\n getBlurPass() {\n return this.blurPass;\n }\n /**\n * Returns the luminance pass.\n *\n * @deprecated Use luminancePass instead.\n * @return {LuminancePass} The luminance pass.\n */\n getLuminancePass() {\n return this.luminancePass;\n }\n /**\n * The luminance material.\n *\n * @type {LuminanceMaterial}\n */\n get luminanceMaterial() {\n return this.luminancePass.fullscreenMaterial;\n }\n /**\n * Returns the luminance material.\n *\n * @deprecated Use luminanceMaterial instead.\n * @return {LuminanceMaterial} The material.\n */\n getLuminanceMaterial() {\n return this.luminancePass.fullscreenMaterial;\n }\n /**\n * The current width of the internal render targets.\n *\n * @type {Number}\n * @deprecated\n */\n get width() {\n return this.resolution.width;\n }\n set width(value) {\n this.resolution.preferredWidth = value;\n }\n /**\n * The current height of the internal render targets.\n *\n * @type {Number}\n * @deprecated\n */\n get height() {\n return this.resolution.height;\n }\n set height(value) {\n this.resolution.preferredHeight = value;\n }\n /**\n * Indicates whether dithering is enabled.\n *\n * @type {Boolean}\n * @deprecated Use EffectPass.dithering instead.\n */\n get dithering() {\n return this.blurPass.dithering;\n }\n set dithering(value) {\n this.blurPass.dithering = value;\n }\n /**\n * The blur kernel size.\n *\n * @type {KernelSize}\n * @deprecated\n */\n get kernelSize() {\n return this.blurPass.kernelSize;\n }\n set kernelSize(value) {\n this.blurPass.kernelSize = value;\n }\n /**\n * @type {Number}\n * @deprecated\n */\n get distinction() {\n console.warn(this.name, \"distinction was removed\");\n return 1;\n }\n set distinction(value) {\n console.warn(this.name, \"distinction was removed\");\n }\n /**\n * The bloom intensity.\n *\n * @type {Number}\n */\n get intensity() {\n return this.uniforms.get(\"intensity\").value;\n }\n set intensity(value) {\n this.uniforms.get(\"intensity\").value = value;\n }\n /**\n * The bloom intensity.\n *\n * @deprecated Use intensity instead.\n * @return {Number} The intensity.\n */\n getIntensity() {\n return this.intensity;\n }\n /**\n * Sets the bloom intensity.\n *\n * @deprecated Use intensity instead.\n * @param {Number} value - The intensity.\n */\n setIntensity(value) {\n this.intensity = value;\n }\n /**\n * Returns the current resolution scale.\n *\n * @return {Number} The resolution scale.\n * @deprecated\n */\n getResolutionScale() {\n return this.resolution.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * @param {Number} scale - The new resolution scale.\n * @deprecated\n */\n setResolutionScale(scale) {\n this.resolution.scale = scale;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const renderTarget = this.renderTarget;\n const luminancePass = this.luminancePass;\n if (luminancePass.enabled) {\n luminancePass.render(renderer, inputBuffer);\n if (this.mipmapBlurPass.enabled) {\n this.mipmapBlurPass.render(renderer, luminancePass.renderTarget);\n } else {\n this.blurPass.render(renderer, luminancePass.renderTarget, renderTarget);\n }\n } else {\n if (this.mipmapBlurPass.enabled) {\n this.mipmapBlurPass.render(renderer, inputBuffer);\n } else {\n this.blurPass.render(renderer, inputBuffer, renderTarget);\n }\n }\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n this.renderTarget.setSize(resolution.width, resolution.height);\n this.blurPass.resolution.copy(resolution);\n this.luminancePass.setSize(width, height);\n this.mipmapBlurPass.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.blurPass.initialize(renderer, alpha, frameBufferType);\n this.luminancePass.initialize(renderer, alpha, frameBufferType);\n this.mipmapBlurPass.initialize(renderer, alpha, frameBufferType);\n if (frameBufferType !== void 0) {\n this.renderTarget.texture.type = frameBufferType;\n if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace5) {\n this.renderTarget.texture.colorSpace = SRGBColorSpace5;\n }\n }\n }\n};\n\n// src/effects/BokehEffect.js\nimport { Uniform as Uniform9 } from \"three\";\n\n// src/effects/glsl/bokeh.frag\nvar bokeh_default = `uniform float focus;uniform float dof;uniform float aperture;uniform float maxBlur;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec2 aspectCorrection=vec2(1.0,aspect);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat focusNear=clamp(focus-dof,0.0,1.0);float focusFar=clamp(focus+dof,0.0,1.0);float low=step(linearDepth,focusNear);float high=step(focusFar,linearDepth);float factor=(linearDepth-focusNear)*low+(linearDepth-focusFar)*high;vec2 dofBlur=vec2(clamp(factor*aperture,-maxBlur,maxBlur));vec2 dofblur9=dofBlur*0.9;vec2 dofblur7=dofBlur*0.7;vec2 dofblur4=dofBlur*0.4;vec4 color=inputColor;color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.37,0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.40,0.0)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.37,-0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.15,-0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.15,0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.37,0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.37,-0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,-0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.37,0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.37,-0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.15,-0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.15,0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.37,0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.37,-0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.15,-0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.40,0.0)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.4,0.0)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofblur4);outputColor=color/41.0;}`;\n\n// src/effects/BokehEffect.js\nvar BokehEffect = class extends Effect {\n /**\n * Constructs a new bokeh effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.focus=0.5] - The focus distance ratio, ranging from 0.0 to 1.0.\n * @param {Number} [options.dof=0.02] - Depth of field. An area in front of and behind the focal point that still appears sharp.\n * @param {Number} [options.aperture=0.015] - Camera aperture scale. Bigger values for stronger blur and shallower depth of field.\n * @param {Number} [options.maxBlur=1.0] - The maximum blur strength.\n */\n constructor({\n blendFunction,\n focus = 0.5,\n dof = 0.02,\n aperture = 0.015,\n maxBlur = 1\n } = {}) {\n super(\"BokehEffect\", bokeh_default, {\n blendFunction,\n attributes: EffectAttribute.CONVOLUTION | EffectAttribute.DEPTH,\n uniforms: /* @__PURE__ */ new Map([\n [\"focus\", new Uniform9(focus)],\n [\"dof\", new Uniform9(dof)],\n [\"aperture\", new Uniform9(aperture)],\n [\"maxBlur\", new Uniform9(maxBlur)]\n ])\n });\n }\n};\n\n// src/effects/BrightnessContrastEffect.js\nimport { SRGBColorSpace as SRGBColorSpace6, Uniform as Uniform10 } from \"three\";\n\n// src/effects/glsl/brightness-contrast.frag\nvar brightness_contrast_default = `uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(color+vec3(0.5),inputColor.a);}`;\n\n// src/effects/BrightnessContrastEffect.js\nvar BrightnessContrastEffect = class extends Effect {\n /**\n * Constructs a new brightness/contrast effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n * @param {Number} [options.brightness=0.0] - The brightness factor, ranging from -1 to 1, where 0 means no change.\n * @param {Number} [options.contrast=0.0] - The contrast factor, ranging from -1 to 1, where 0 means no change.\n */\n constructor({ blendFunction = BlendFunction.SRC, brightness = 0, contrast = 0 } = {}) {\n super(\"BrightnessContrastEffect\", brightness_contrast_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"brightness\", new Uniform10(brightness)],\n [\"contrast\", new Uniform10(contrast)]\n ])\n });\n this.inputColorSpace = SRGBColorSpace6;\n }\n /**\n * The brightness.\n *\n * @type {Number}\n */\n get brightness() {\n return this.uniforms.get(\"brightness\").value;\n }\n set brightness(value) {\n this.uniforms.get(\"brightness\").value = value;\n }\n /**\n * Returns the brightness.\n *\n * @deprecated Use brightness instead.\n * @return {Number} The brightness.\n */\n getBrightness() {\n return this.brightness;\n }\n /**\n * Sets the brightness.\n *\n * @deprecated Use brightness instead.\n * @param {Number} value - The brightness.\n */\n setBrightness(value) {\n this.brightness = value;\n }\n /**\n * The contrast.\n *\n * @type {Number}\n */\n get contrast() {\n return this.uniforms.get(\"contrast\").value;\n }\n set contrast(value) {\n this.uniforms.get(\"contrast\").value = value;\n }\n /**\n * Returns the contrast.\n *\n * @deprecated Use contrast instead.\n * @return {Number} The contrast.\n */\n getContrast() {\n return this.contrast;\n }\n /**\n * Sets the contrast.\n *\n * @deprecated Use contrast instead.\n * @param {Number} value - The contrast.\n */\n setContrast(value) {\n this.contrast = value;\n }\n};\n\n// src/effects/glsl/color-average.frag\nvar color_average_default = `void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}`;\n\n// src/effects/ColorAverageEffect.js\nvar ColorAverageEffect = class extends Effect {\n /**\n * Constructs a new color average effect.\n *\n * @param {BlendFunction} [blendFunction] - The blend function of this effect.\n */\n constructor(blendFunction) {\n super(\"ColorAverageEffect\", color_average_default, { blendFunction });\n }\n};\n\n// src/effects/ColorDepthEffect.js\nimport { Uniform as Uniform11 } from \"three\";\n\n// src/effects/glsl/color-depth.frag\nvar color_depth_default = `uniform float factor;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(floor(inputColor.rgb*factor+0.5)/factor,inputColor.a);}`;\n\n// src/effects/ColorDepthEffect.js\nvar ColorDepthEffect = class extends Effect {\n /**\n * Constructs a new color depth effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.bits=16] - The color bit depth.\n */\n constructor({ blendFunction, bits = 16 } = {}) {\n super(\"ColorDepthEffect\", color_depth_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"factor\", new Uniform11(1)]\n ])\n });\n this.bits = 0;\n this.bitDepth = bits;\n }\n /**\n * The virtual amount of color bits.\n *\n * Each color channel effectively uses a fourth of the total amount of bits. Alpha remains unaffected.\n *\n * @type {Number}\n */\n get bitDepth() {\n return this.bits;\n }\n set bitDepth(value) {\n this.bits = value;\n this.uniforms.get(\"factor\").value = Math.pow(2, value / 3);\n }\n /**\n * Returns the current color bit depth.\n *\n * @return {Number} The bit depth.\n */\n getBitDepth() {\n return this.bitDepth;\n }\n /**\n * Sets the virtual amount of color bits.\n *\n * @param {Number} value - The bit depth.\n */\n setBitDepth(value) {\n this.bitDepth = value;\n }\n};\n\n// src/effects/ChromaticAberrationEffect.js\nimport { Uniform as Uniform12, Vector2 as Vector27 } from \"three\";\n\n// src/effects/glsl/chromatic-aberration.frag\nvar chromatic_aberration_default = `#ifdef RADIAL_MODULATION\nuniform float modulationOffset;\n#endif\nvarying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=inputColor.ra;vec2 ba=inputColor.ba;\n#ifdef RADIAL_MODULATION\nconst vec2 center=vec2(0.5);float d=distance(uv,center)*2.0;d=max(d-modulationOffset,0.0);if(vActive>0.0&&d>0.0){ra=texture2D(inputBuffer,mix(uv,vUvR,d)).ra;ba=texture2D(inputBuffer,mix(uv,vUvB,d)).ba;}\n#else\nif(vActive>0.0){ra=texture2D(inputBuffer,vUvR).ra;ba=texture2D(inputBuffer,vUvB).ba;}\n#endif\noutputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}`;\n\n// src/effects/glsl/chromatic-aberration.vert\nvar chromatic_aberration_default2 = `uniform vec2 offset;varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vActive=(shift.x!=0.0||shift.y!=0.0)?1.0:0.0;vUvR=uv+shift;vUvB=uv-shift;}`;\n\n// src/effects/ChromaticAberrationEffect.js\nvar ChromaticAberrationEffect = class extends Effect {\n /**\n * Constructs a new chromatic aberration effect.\n *\n * @param {Object} [options] - The options.\n * @param {Vector2} [options.offset] - The color offset.\n * @param {Boolean} [options.radialModulation=false] - Whether the effect should be modulated with a radial gradient.\n * @param {Number} [options.modulationOffset=0.15] - The modulation offset. Only applies if `radialModulation` is enabled.\n */\n constructor({\n offset = new Vector27(1e-3, 5e-4),\n radialModulation = false,\n modulationOffset = 0.15\n } = {}) {\n super(\"ChromaticAberrationEffect\", chromatic_aberration_default, {\n vertexShader: chromatic_aberration_default2,\n attributes: EffectAttribute.CONVOLUTION,\n uniforms: /* @__PURE__ */ new Map([\n [\"offset\", new Uniform12(offset)],\n [\"modulationOffset\", new Uniform12(modulationOffset)]\n ])\n });\n this.radialModulation = radialModulation;\n }\n /**\n * The color offset.\n *\n * @type {Vector2}\n */\n get offset() {\n return this.uniforms.get(\"offset\").value;\n }\n set offset(value) {\n this.uniforms.get(\"offset\").value = value;\n }\n /**\n * Indicates whether radial modulation is enabled.\n *\n * When enabled, the effect will be weaker in the middle and stronger towards the screen edges.\n *\n * @type {Boolean}\n */\n get radialModulation() {\n return this.defines.has(\"RADIAL_MODULATION\");\n }\n set radialModulation(value) {\n if (value) {\n this.defines.set(\"RADIAL_MODULATION\", \"1\");\n } else {\n this.defines.delete(\"RADIAL_MODULATION\");\n }\n this.setChanged();\n }\n /**\n * The modulation offset.\n *\n * @type {Number}\n */\n get modulationOffset() {\n return this.uniforms.get(\"modulationOffset\").value;\n }\n set modulationOffset(value) {\n this.uniforms.get(\"modulationOffset\").value = value;\n }\n /**\n * Returns the color offset vector.\n *\n * @deprecated Use offset instead.\n * @return {Vector2} The offset.\n */\n getOffset() {\n return this.offset;\n }\n /**\n * Sets the color offset vector.\n *\n * @deprecated Use offset instead.\n * @param {Vector2} value - The offset.\n */\n setOffset(value) {\n this.offset = value;\n }\n};\n\n// src/effects/glsl/depth.frag\nvar depth_default = `void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){\n#ifdef INVERTED\nvec3 color=vec3(1.0-depth);\n#else\nvec3 color=vec3(depth);\n#endif\noutputColor=vec4(color,inputColor.a);}`;\n\n// src/effects/DepthEffect.js\nvar DepthEffect = class extends Effect {\n /**\n * Constructs a new depth effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n * @param {Boolean} [options.inverted=false] - Whether the depth should be inverted.\n */\n constructor({ blendFunction = BlendFunction.SRC, inverted = false } = {}) {\n super(\"DepthEffect\", depth_default, {\n blendFunction,\n attributes: EffectAttribute.DEPTH\n });\n this.inverted = inverted;\n }\n /**\n * Indicates whether depth should be inverted.\n *\n * @type {Boolean}\n */\n get inverted() {\n return this.defines.has(\"INVERTED\");\n }\n set inverted(value) {\n if (this.inverted !== value) {\n if (value) {\n this.defines.set(\"INVERTED\", \"1\");\n } else {\n this.defines.delete(\"INVERTED\");\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether the rendered depth is inverted.\n *\n * @deprecated Use inverted instead.\n * @return {Boolean} Whether the rendered depth is inverted.\n */\n isInverted() {\n return this.inverted;\n }\n /**\n * Enables or disables depth inversion.\n *\n * @deprecated Use inverted instead.\n * @param {Boolean} value - Whether depth should be inverted.\n */\n setInverted(value) {\n this.inverted = value;\n }\n};\n\n// src/effects/DepthOfFieldEffect.js\nimport { BasicDepthPacking as BasicDepthPacking4, SRGBColorSpace as SRGBColorSpace7, Uniform as Uniform16, UnsignedByteType as UnsignedByteType8, WebGLRenderTarget as WebGLRenderTarget9 } from \"three\";\n\n// src/enums/ColorChannel.js\nvar ColorChannel = {\n RED: 0,\n GREEN: 1,\n BLUE: 2,\n ALPHA: 3\n};\n\n// src/enums/MaskFunction.js\nvar MaskFunction = {\n DISCARD: 0,\n MULTIPLY: 1,\n MULTIPLY_RGB_SET_ALPHA: 2,\n MULTIPLY_RGB: 3\n};\n\n// src/materials/BokehMaterial.js\nimport { NoBlending as NoBlending6, ShaderMaterial as ShaderMaterial7, Uniform as Uniform13, Vector2 as Vector28 } from \"three\";\n\n// src/materials/glsl/convolution.bokeh.frag\nvar convolution_bokeh_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#if PASS == 1\nuniform vec4 kernel64[32];\n#else\nuniform vec4 kernel16[8];\n#endif\nuniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;varying vec2 vUv;void main(){\n#ifdef FOREGROUND\nvec2 cocNearFar=texture2D(cocBuffer,vUv).rg*scale;float coc=cocNearFar.x;\n#else\nfloat coc=texture2D(cocBuffer,vUv).g*scale;\n#endif\nif(coc==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{\n#ifdef FOREGROUND\nvec2 step=texelSize*max(cocNearFar.x,cocNearFar.y);\n#else\nvec2 step=texelSize*coc;\n#endif\n#if PASS == 1\nvec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;\n#else\nvec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;\n#endif\n}}`;\n\n// src/materials/BokehMaterial.js\nvar BokehMaterial = class extends ShaderMaterial7 {\n /**\n * Constructs a new bokeh material.\n *\n * @param {Boolean} [fill=false] - Enables or disables the bokeh highlight fill mode.\n * @param {Boolean} [foreground=false] - Determines whether this material will be applied to foreground colors.\n */\n constructor(fill = false, foreground = false) {\n super({\n name: \"BokehMaterial\",\n defines: {\n PASS: fill ? \"2\" : \"1\"\n },\n uniforms: {\n inputBuffer: new Uniform13(null),\n cocBuffer: new Uniform13(null),\n texelSize: new Uniform13(new Vector28()),\n kernel64: new Uniform13(null),\n kernel16: new Uniform13(null),\n scale: new Uniform13(1)\n },\n blending: NoBlending6,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_bokeh_default,\n vertexShader: common_default\n });\n if (foreground) {\n this.defines.FOREGROUND = \"1\";\n }\n this.generateKernel();\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The circle of confusion buffer.\n *\n * @type {Texture}\n */\n set cocBuffer(value) {\n this.uniforms.cocBuffer.value = value;\n }\n /**\n * Sets the circle of confusion buffer.\n *\n * @deprecated Use cocBuffer instead.\n * @param {Texture} value - The buffer.\n */\n setCoCBuffer(value) {\n this.uniforms.cocBuffer.value = value;\n }\n /**\n * The blur scale.\n *\n * @type {Number}\n */\n get scale() {\n return this.uniforms.scale.value;\n }\n set scale(value) {\n this.uniforms.scale.value = value;\n }\n /**\n * Returns the blur scale.\n *\n * @deprecated Use scale instead.\n * @return {Number} The scale.\n */\n getScale(value) {\n return this.scale;\n }\n /**\n * Sets the blur scale.\n *\n * @deprecated Use scale instead.\n * @param {Number} value - The scale.\n */\n setScale(value) {\n this.scale = value;\n }\n /**\n * Generates the blur kernel.\n *\n * @private\n */\n generateKernel() {\n const GOLDEN_ANGLE = 2.39996323;\n const points64 = new Float64Array(128);\n const points16 = new Float64Array(32);\n let i64 = 0, i16 = 0;\n for (let i = 0, sqrt80 = Math.sqrt(80); i < 80; ++i) {\n const theta = i * GOLDEN_ANGLE;\n const r = Math.sqrt(i) / sqrt80;\n const u = r * Math.cos(theta), v3 = r * Math.sin(theta);\n if (i % 5 === 0) {\n points16[i16++] = u;\n points16[i16++] = v3;\n } else {\n points64[i64++] = u;\n points64[i64++] = v3;\n }\n }\n this.uniforms.kernel64.value = points64;\n this.uniforms.kernel16.value = points16;\n }\n /**\n * Sets the texel size.\n *\n * @deprecated Use setSize() instead.\n * @param {Number} x - The texel width.\n * @param {Number} y - The texel height.\n */\n setTexelSize(x, y) {\n this.uniforms.texelSize.value.set(x, y);\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/materials/CircleOfConfusionMaterial.js\nimport { BasicDepthPacking as BasicDepthPacking3, NoBlending as NoBlending7, PerspectiveCamera, ShaderMaterial as ShaderMaterial8, Uniform as Uniform14 } from \"three\";\n\n// src/utils/orthographicDepthToViewZ.js\nfunction orthographicDepthToViewZ(depth, near, far) {\n return depth * (near - far) - near;\n}\n\n// src/utils/viewZToOrthographicDepth.js\nfunction viewZToOrthographicDepth(viewZ, near, far) {\n return Math.min(Math.max((viewZ + near) / (near - far), 0), 1);\n}\n\n// src/materials/glsl/circle-of-confusion.frag\nvar circle_of_confusion_default = `#include \n#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nfloat depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nfloat depth=texture2D(depthBuffer,uv).r;\n#endif\n#ifdef LOG_DEPTH\nfloat d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;\n#endif\nreturn depth;}void main(){float depth=readDepth(vUv);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`;\n\n// src/materials/CircleOfConfusionMaterial.js\nvar CircleOfConfusionMaterial = class extends ShaderMaterial8 {\n /**\n * Constructs a new CoC material.\n *\n * @param {Camera} camera - A camera.\n */\n constructor(camera) {\n super({\n name: \"CircleOfConfusionMaterial\",\n defines: {\n DEPTH_PACKING: \"0\"\n },\n uniforms: {\n depthBuffer: new Uniform14(null),\n focusDistance: new Uniform14(0),\n focusRange: new Uniform14(0),\n cameraNear: new Uniform14(0.3),\n cameraFar: new Uniform14(1e3)\n },\n blending: NoBlending7,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: circle_of_confusion_default,\n vertexShader: common_default\n });\n this.uniforms.focalLength = this.uniforms.focusRange;\n this.copyCameraSettings(camera);\n }\n /**\n * The current near plane setting.\n *\n * @type {Number}\n * @private\n */\n get near() {\n return this.uniforms.cameraNear.value;\n }\n /**\n * The current far plane setting.\n *\n * @type {Number}\n * @private\n */\n get far() {\n return this.uniforms.cameraFar.value;\n }\n /**\n * The depth buffer.\n *\n * @type {Texture}\n */\n set depthBuffer(value) {\n this.uniforms.depthBuffer.value = value;\n }\n /**\n * The depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set depthPacking(value) {\n this.defines.DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the depth buffer.\n *\n * @deprecated Use depthBuffer and depthPacking instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthBuffer(buffer, depthPacking = BasicDepthPacking3) {\n this.depthBuffer = buffer;\n this.depthPacking = depthPacking;\n }\n /**\n * The focus distance. Range: [0.0, 1.0].\n *\n * @type {Number}\n */\n get focusDistance() {\n return this.uniforms.focusDistance.value;\n }\n set focusDistance(value) {\n this.uniforms.focusDistance.value = value;\n }\n /**\n * The focus distance in world units.\n *\n * @type {Number}\n */\n get worldFocusDistance() {\n return -orthographicDepthToViewZ(this.focusDistance, this.near, this.far);\n }\n set worldFocusDistance(value) {\n this.focusDistance = viewZToOrthographicDepth(-value, this.near, this.far);\n }\n /**\n * Returns the focus distance.\n *\n * @deprecated Use focusDistance instead.\n * @return {Number} The focus distance.\n */\n getFocusDistance(value) {\n this.uniforms.focusDistance.value = value;\n }\n /**\n * Sets the focus distance.\n *\n * @deprecated Use focusDistance instead.\n * @param {Number} value - The focus distance.\n */\n setFocusDistance(value) {\n this.uniforms.focusDistance.value = value;\n }\n /**\n * The focal length.\n *\n * @deprecated Renamed to focusRange.\n * @type {Number}\n */\n get focalLength() {\n return this.focusRange;\n }\n set focalLength(value) {\n this.focusRange = value;\n }\n /**\n * The focus range. Range: [0.0, 1.0].\n *\n * @type {Number}\n */\n get focusRange() {\n return this.uniforms.focusRange.value;\n }\n set focusRange(value) {\n this.uniforms.focusRange.value = value;\n }\n /**\n * The focus range in world units.\n *\n * @type {Number}\n */\n get worldFocusRange() {\n return -orthographicDepthToViewZ(this.focusRange, this.near, this.far);\n }\n set worldFocusRange(value) {\n this.focusRange = viewZToOrthographicDepth(-value, this.near, this.far);\n }\n /**\n * Returns the focal length.\n *\n * @deprecated Use focusRange instead.\n * @return {Number} The focal length.\n */\n getFocalLength(value) {\n return this.focusRange;\n }\n /**\n * Sets the focal length.\n *\n * @deprecated Use focusRange instead.\n * @param {Number} value - The focal length.\n */\n setFocalLength(value) {\n this.focusRange = value;\n }\n /**\n * Copies the settings of the given camera.\n *\n * @deprecated Use copyCameraSettings instead.\n * @param {Camera} camera - A camera.\n */\n adoptCameraSettings(camera) {\n this.copyCameraSettings(camera);\n }\n /**\n * Copies the settings of the given camera.\n *\n * @param {Camera} camera - A camera.\n */\n copyCameraSettings(camera) {\n if (camera) {\n this.uniforms.cameraNear.value = camera.near;\n this.uniforms.cameraFar.value = camera.far;\n if (camera instanceof PerspectiveCamera) {\n this.defines.PERSPECTIVE_CAMERA = \"1\";\n } else {\n delete this.defines.PERSPECTIVE_CAMERA;\n }\n this.needsUpdate = true;\n }\n }\n};\n\n// src/materials/MaskMaterial.js\nimport { NoBlending as NoBlending8, ShaderMaterial as ShaderMaterial9, Uniform as Uniform15, UnsignedByteType as UnsignedByteType6 } from \"three\";\n\n// src/materials/glsl/mask.frag\nvar mask_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef MASK_PRECISION_HIGH\nuniform mediump sampler2D maskTexture;\n#else\nuniform lowp sampler2D maskTexture;\n#endif\n#if MASK_FUNCTION != 0\nuniform float strength;\n#endif\nvarying vec2 vUv;void main(){\n#if COLOR_CHANNEL == 0\nfloat mask=texture2D(maskTexture,vUv).r;\n#elif COLOR_CHANNEL == 1\nfloat mask=texture2D(maskTexture,vUv).g;\n#elif COLOR_CHANNEL == 2\nfloat mask=texture2D(maskTexture,vUv).b;\n#else\nfloat mask=texture2D(maskTexture,vUv).a;\n#endif\n#if MASK_FUNCTION == 0\n#ifdef INVERTED\nmask=step(mask,0.0);\n#else\nmask=1.0-step(mask,0.0);\n#endif\n#else\nmask=clamp(mask*strength,0.0,1.0);\n#ifdef INVERTED\nmask=1.0-mask;\n#endif\n#endif\n#if MASK_FUNCTION == 3\nvec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=vec4(mask*texel.rgb,texel.a);\n#elif MASK_FUNCTION == 2\ngl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);\n#else\ngl_FragColor=mask*texture2D(inputBuffer,vUv);\n#endif\n}`;\n\n// src/materials/MaskMaterial.js\nvar MaskMaterial = class extends ShaderMaterial9 {\n /**\n * Constructs a new mask material.\n *\n * @param {Texture} [maskTexture] - The mask texture.\n */\n constructor(maskTexture = null) {\n super({\n name: \"MaskMaterial\",\n uniforms: {\n maskTexture: new Uniform15(maskTexture),\n inputBuffer: new Uniform15(null),\n strength: new Uniform15(1)\n },\n blending: NoBlending8,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: mask_default,\n vertexShader: common_default\n });\n this.colorChannel = ColorChannel.RED;\n this.maskFunction = MaskFunction.DISCARD;\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The mask texture.\n *\n * @type {Texture}\n */\n set maskTexture(value) {\n this.uniforms.maskTexture.value = value;\n delete this.defines.MASK_PRECISION_HIGH;\n if (value.type !== UnsignedByteType6) {\n this.defines.MASK_PRECISION_HIGH = \"1\";\n }\n this.needsUpdate = true;\n }\n /**\n * Sets the mask texture.\n *\n * @deprecated Use maskTexture instead.\n * @param {Texture} value - The texture.\n */\n setMaskTexture(value) {\n this.maskTexture = value;\n }\n /**\n * Sets the color channel to use for masking. Default is `ColorChannel.RED`.\n *\n * @type {ColorChannel}\n */\n set colorChannel(value) {\n this.defines.COLOR_CHANNEL = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the color channel to use for masking. Default is `ColorChannel.RED`.\n *\n * @deprecated Use colorChannel instead.\n * @param {ColorChannel} value - The channel.\n */\n setColorChannel(value) {\n this.colorChannel = value;\n }\n /**\n * The masking technique. Default is `MaskFunction.DISCARD`.\n *\n * @type {MaskFunction}\n */\n set maskFunction(value) {\n this.defines.MASK_FUNCTION = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the masking technique. Default is `MaskFunction.DISCARD`.\n *\n * @deprecated Use maskFunction instead.\n * @param {MaskFunction} value - The function.\n */\n setMaskFunction(value) {\n this.maskFunction = value;\n }\n /**\n * Indicates whether the masking is inverted.\n *\n * @type {Boolean}\n */\n get inverted() {\n return this.defines.INVERTED !== void 0;\n }\n set inverted(value) {\n if (this.inverted && !value) {\n delete this.defines.INVERTED;\n } else if (value) {\n this.defines.INVERTED = \"1\";\n }\n this.needsUpdate = true;\n }\n /**\n * Indicates whether the masking is inverted.\n *\n * @deprecated Use inverted instead.\n * @return {Boolean} Whether the masking is inverted.\n */\n isInverted() {\n return this.inverted;\n }\n /**\n * Determines whether the masking should be inverted.\n *\n * @deprecated Use inverted instead.\n * @param {Boolean} value - Whether the masking should be inverted.\n */\n setInverted(value) {\n this.inverted = value;\n }\n /**\n * The current mask strength.\n *\n * Individual mask values will be clamped to [0.0, 1.0]. Has no effect when the mask function is set to `DISCARD`.\n *\n * @type {Number}\n */\n get strength() {\n return this.uniforms.strength.value;\n }\n set strength(value) {\n this.uniforms.strength.value = value;\n }\n /**\n * Returns the current mask strength.\n *\n * @deprecated Use strength instead.\n * @return {Number} The mask strength.\n */\n getStrength() {\n return this.strength;\n }\n /**\n * Sets the mask strength.\n *\n * Has no effect when the mask function is set to `DISCARD`.\n *\n * @deprecated Use strength instead.\n * @param {Number} value - The mask strength.\n */\n setStrength(value) {\n this.strength = value;\n }\n};\n\n// src/passes/ShaderPass.js\nimport { UnsignedByteType as UnsignedByteType7 } from \"three\";\nvar ShaderPass = class extends Pass {\n /**\n * Constructs a new shader pass.\n *\n * @param {ShaderMaterial} material - A shader material.\n * @param {String} [input=\"inputBuffer\"] - The name of the input buffer uniform.\n */\n constructor(material, input = \"inputBuffer\") {\n super(\"ShaderPass\");\n this.fullscreenMaterial = material;\n this.input = input;\n }\n /**\n * Sets the name of the input buffer uniform.\n *\n * @param {String} input - The name of the input buffer uniform.\n * @deprecated Use input instead.\n */\n setInput(input) {\n this.input = input;\n }\n /**\n * Renders the effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const uniforms = this.fullscreenMaterial.uniforms;\n if (inputBuffer !== null && uniforms !== void 0 && uniforms[this.input] !== void 0) {\n uniforms[this.input].value = inputBuffer.texture;\n }\n renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);\n renderer.render(this.scene, this.camera);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - A renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (frameBufferType !== void 0 && frameBufferType !== UnsignedByteType7) {\n this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n }\n }\n};\n\n// src/effects/glsl/depth-of-field.frag\nvar depth_of_field_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;\n#else\nuniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;\n#endif\nuniform lowp sampler2D nearCoCBuffer;uniform lowp sampler2D farCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);\n#if MASK_FUNCTION == 1\nvec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,colorFar.a);cocNearFar.x=min(cocNearFar.x*scale,1.0);\n#else\nvec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,texture2D(farCoCBuffer,uv).g);cocNearFar=min(cocNearFar*scale,1.0);\n#endif\nvec4 result=inputColor*(1.0-cocNearFar.y)+colorFar;result=mix(result,colorNear,cocNearFar.x);outputColor=result;}`;\n\n// src/effects/DepthOfFieldEffect.js\nvar DepthOfFieldEffect = class extends Effect {\n /**\n * Constructs a new depth of field effect.\n *\n * @param {Camera} camera - The main camera.\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.worldFocusDistance] - The focus distance in world units.\n * @param {Number} [options.worldFocusRange] - The focus distance in world units.\n * @param {Number} [options.focusDistance=0.0] - The normalized focus distance. Range is [0.0, 1.0].\n * @param {Number} [options.focusRange=0.1] - The focus range. Range is [0.0, 1.0].\n * @param {Number} [options.focalLength=0.1] - Deprecated.\n * @param {Number} [options.bokehScale=1.0] - The scale of the bokeh blur.\n * @param {Number} [options.resolutionScale=0.5] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n */\n constructor(camera, {\n blendFunction,\n worldFocusDistance,\n worldFocusRange,\n focusDistance = 0,\n focalLength = 0.1,\n focusRange = focalLength,\n bokehScale = 1,\n resolutionScale = 1,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"DepthOfFieldEffect\", depth_of_field_default, {\n blendFunction,\n attributes: EffectAttribute.DEPTH,\n uniforms: /* @__PURE__ */ new Map([\n [\"nearColorBuffer\", new Uniform16(null)],\n [\"farColorBuffer\", new Uniform16(null)],\n [\"nearCoCBuffer\", new Uniform16(null)],\n [\"farCoCBuffer\", new Uniform16(null)],\n [\"scale\", new Uniform16(1)]\n ])\n });\n this.camera = camera;\n this.renderTarget = new WebGLRenderTarget9(1, 1, { depthBuffer: false });\n this.renderTarget.texture.name = \"DoF.Intermediate\";\n this.renderTargetMasked = this.renderTarget.clone();\n this.renderTargetMasked.texture.name = \"DoF.Masked.Far\";\n this.renderTargetNear = this.renderTarget.clone();\n this.renderTargetNear.texture.name = \"DoF.Bokeh.Near\";\n this.uniforms.get(\"nearColorBuffer\").value = this.renderTargetNear.texture;\n this.renderTargetFar = this.renderTarget.clone();\n this.renderTargetFar.texture.name = \"DoF.Bokeh.Far\";\n this.uniforms.get(\"farColorBuffer\").value = this.renderTargetFar.texture;\n this.renderTargetCoC = this.renderTarget.clone();\n this.renderTargetCoC.texture.name = \"DoF.CoC\";\n this.uniforms.get(\"farCoCBuffer\").value = this.renderTargetCoC.texture;\n this.renderTargetCoCBlurred = this.renderTargetCoC.clone();\n this.renderTargetCoCBlurred.texture.name = \"DoF.CoC.Blurred\";\n this.uniforms.get(\"nearCoCBuffer\").value = this.renderTargetCoCBlurred.texture;\n this.cocPass = new ShaderPass(new CircleOfConfusionMaterial(camera));\n const cocMaterial = this.cocMaterial;\n cocMaterial.focusDistance = focusDistance;\n cocMaterial.focusRange = focusRange;\n if (worldFocusDistance !== void 0) {\n cocMaterial.worldFocusDistance = worldFocusDistance;\n }\n if (worldFocusRange !== void 0) {\n cocMaterial.worldFocusRange = worldFocusRange;\n }\n this.blurPass = new KawaseBlurPass({ resolutionScale, resolutionX, resolutionY, kernelSize: KernelSize.MEDIUM });\n this.maskPass = new ShaderPass(new MaskMaterial(this.renderTargetCoC.texture));\n const maskMaterial = this.maskPass.fullscreenMaterial;\n maskMaterial.colorChannel = ColorChannel.GREEN;\n this.maskFunction = MaskFunction.MULTIPLY_RGB;\n this.bokehNearBasePass = new ShaderPass(new BokehMaterial(false, true));\n this.bokehNearBasePass.fullscreenMaterial.cocBuffer = this.renderTargetCoCBlurred.texture;\n this.bokehNearFillPass = new ShaderPass(new BokehMaterial(true, true));\n this.bokehNearFillPass.fullscreenMaterial.cocBuffer = this.renderTargetCoCBlurred.texture;\n this.bokehFarBasePass = new ShaderPass(new BokehMaterial(false, false));\n this.bokehFarBasePass.fullscreenMaterial.cocBuffer = this.renderTargetCoC.texture;\n this.bokehFarFillPass = new ShaderPass(new BokehMaterial(true, false));\n this.bokehFarFillPass.fullscreenMaterial.cocBuffer = this.renderTargetCoC.texture;\n this.target = null;\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n this.bokehScale = bokehScale;\n }\n set mainCamera(value) {\n this.camera = value;\n this.cocMaterial.copyCameraSettings(value);\n }\n /**\n * The circle of confusion texture.\n *\n * @type {Texture}\n */\n get cocTexture() {\n return this.renderTargetCoC.texture;\n }\n /**\n * The mask function. Default is `MULTIPLY_RGB`.\n *\n * @type {MaskFunction}\n */\n get maskFunction() {\n return this.maskPass.fullscreenMaterial.maskFunction;\n }\n set maskFunction(value) {\n if (this.maskFunction !== value) {\n this.defines.set(\"MASK_FUNCTION\", value.toFixed(0));\n this.maskPass.fullscreenMaterial.maskFunction = value;\n this.setChanged();\n }\n }\n /**\n * The circle of confusion material.\n *\n * @type {CircleOfConfusionMaterial}\n */\n get cocMaterial() {\n return this.cocPass.fullscreenMaterial;\n }\n /**\n * The circle of confusion material.\n *\n * @deprecated Use cocMaterial instead.\n * @type {CircleOfConfusionMaterial}\n */\n get circleOfConfusionMaterial() {\n return this.cocMaterial;\n }\n /**\n * Returns the circle of confusion material.\n *\n * @deprecated Use cocMaterial instead.\n * @return {CircleOfConfusionMaterial} The material.\n */\n getCircleOfConfusionMaterial() {\n return this.cocMaterial;\n }\n /**\n * Returns the pass that blurs the foreground CoC buffer to soften edges.\n *\n * @deprecated Use blurPass instead.\n * @return {KawaseBlurPass} The blur pass.\n */\n getBlurPass() {\n return this.blurPass;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * The current bokeh scale.\n *\n * @type {Number}\n */\n get bokehScale() {\n return this.uniforms.get(\"scale\").value;\n }\n set bokehScale(value) {\n this.bokehNearBasePass.fullscreenMaterial.scale = value;\n this.bokehNearFillPass.fullscreenMaterial.scale = value;\n this.bokehFarBasePass.fullscreenMaterial.scale = value;\n this.bokehFarFillPass.fullscreenMaterial.scale = value;\n this.maskPass.fullscreenMaterial.strength = value;\n this.uniforms.get(\"scale\").value = value;\n }\n /**\n * Returns the current bokeh scale.\n *\n * @deprecated Use bokehScale instead.\n * @return {Number} The scale.\n */\n getBokehScale() {\n return this.bokehScale;\n }\n /**\n * Sets the bokeh scale.\n *\n * @deprecated Use bokehScale instead.\n * @param {Number} value - The scale.\n */\n setBokehScale(value) {\n this.bokehScale = value;\n }\n /**\n * Returns the current auto focus target.\n *\n * @deprecated Use target instead.\n * @return {Vector3} The target.\n */\n getTarget() {\n return this.target;\n }\n /**\n * Sets the auto focus target.\n *\n * @deprecated Use target instead.\n * @param {Vector3} value - The target.\n */\n setTarget(value) {\n this.target = value;\n }\n /**\n * Calculates the focus distance from the camera to the given position.\n *\n * @param {Vector3} target - The target.\n * @return {Number} The normalized focus distance.\n */\n calculateFocusDistance(target) {\n const camera = this.camera;\n const distance = camera.position.distanceTo(target);\n return viewZToOrthographicDepth(-distance, camera.near, camera.far);\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking4) {\n this.cocMaterial.depthBuffer = depthTexture;\n this.cocMaterial.depthPacking = depthPacking;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const renderTarget = this.renderTarget;\n const renderTargetCoC = this.renderTargetCoC;\n const renderTargetCoCBlurred = this.renderTargetCoCBlurred;\n const renderTargetMasked = this.renderTargetMasked;\n if (this.target !== null) {\n const distance = this.calculateFocusDistance(this.target);\n this.cocMaterial.focusDistance = distance;\n }\n this.cocPass.render(renderer, null, renderTargetCoC);\n this.blurPass.render(renderer, renderTargetCoC, renderTargetCoCBlurred);\n this.maskPass.render(renderer, inputBuffer, renderTargetMasked);\n this.bokehFarBasePass.render(renderer, renderTargetMasked, renderTarget);\n this.bokehFarFillPass.render(renderer, renderTarget, this.renderTargetFar);\n this.bokehNearBasePass.render(renderer, inputBuffer, renderTarget);\n this.bokehNearFillPass.render(renderer, renderTarget, this.renderTargetNear);\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.cocPass.setSize(width, height);\n this.blurPass.setSize(width, height);\n this.maskPass.setSize(width, height);\n this.renderTargetFar.setSize(width, height);\n this.renderTargetCoC.setSize(width, height);\n this.renderTargetMasked.setSize(width, height);\n this.renderTarget.setSize(w, h);\n this.renderTargetNear.setSize(w, h);\n this.renderTargetCoCBlurred.setSize(w, h);\n this.bokehNearBasePass.fullscreenMaterial.setSize(width, height);\n this.bokehNearFillPass.fullscreenMaterial.setSize(width, height);\n this.bokehFarBasePass.fullscreenMaterial.setSize(width, height);\n this.bokehFarFillPass.fullscreenMaterial.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.cocPass.initialize(renderer, alpha, frameBufferType);\n this.maskPass.initialize(renderer, alpha, frameBufferType);\n this.bokehNearBasePass.initialize(renderer, alpha, frameBufferType);\n this.bokehNearFillPass.initialize(renderer, alpha, frameBufferType);\n this.bokehFarBasePass.initialize(renderer, alpha, frameBufferType);\n this.bokehFarFillPass.initialize(renderer, alpha, frameBufferType);\n this.blurPass.initialize(renderer, alpha, UnsignedByteType8);\n if (renderer.capabilities.logarithmicDepthBuffer) {\n this.cocPass.fullscreenMaterial.defines.LOG_DEPTH = \"1\";\n }\n if (frameBufferType !== void 0) {\n this.renderTarget.texture.type = frameBufferType;\n this.renderTargetNear.texture.type = frameBufferType;\n this.renderTargetFar.texture.type = frameBufferType;\n this.renderTargetMasked.texture.type = frameBufferType;\n if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace7) {\n this.renderTarget.texture.colorSpace = SRGBColorSpace7;\n this.renderTargetNear.texture.colorSpace = SRGBColorSpace7;\n this.renderTargetFar.texture.colorSpace = SRGBColorSpace7;\n this.renderTargetMasked.texture.colorSpace = SRGBColorSpace7;\n }\n }\n }\n};\n\n// src/effects/DotScreenEffect.js\nimport { Uniform as Uniform17, Vector2 as Vector29 } from \"three\";\n\n// src/effects/glsl/dot-screen.frag\nvar dot_screen_default = `uniform vec2 angle;uniform float scale;float pattern(const in vec2 uv){vec2 point=scale*vec2(dot(angle.yx,vec2(uv.x,-uv.y)),dot(angle,uv));return(sin(point.x)*sin(point.y))*4.0;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(inputColor.rgb*10.0-5.0+pattern(uv*resolution));outputColor=vec4(color,inputColor.a);}`;\n\n// src/effects/DotScreenEffect.js\nvar DotScreenEffect = class extends Effect {\n /**\n * Constructs a new dot screen effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.angle=1.57] - The angle of the dot pattern.\n * @param {Number} [options.scale=1.0] - The scale of the dot pattern.\n */\n constructor({ blendFunction, angle = Math.PI * 0.5, scale = 1 } = {}) {\n super(\"DotScreenEffect\", dot_screen_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"angle\", new Uniform17(new Vector29())],\n [\"scale\", new Uniform17(scale)]\n ])\n });\n this.angle = angle;\n }\n /**\n * The angle.\n *\n * @type {Number}\n */\n get angle() {\n return Math.acos(this.uniforms.get(\"angle\").value.y);\n }\n set angle(value) {\n this.uniforms.get(\"angle\").value.set(Math.sin(value), Math.cos(value));\n }\n /**\n * Returns the pattern angle.\n *\n * @deprecated Use angle instead.\n * @return {Number} The angle in radians.\n */\n getAngle() {\n return this.angle;\n }\n /**\n * Sets the pattern angle.\n *\n * @deprecated Use angle instead.\n * @param {Number} value - The angle in radians.\n */\n setAngle(value) {\n this.angle = value;\n }\n /**\n * The scale.\n *\n * @type {Number}\n */\n get scale() {\n return this.uniforms.get(\"scale\").value;\n }\n set scale(value) {\n this.uniforms.get(\"scale\").value = value;\n }\n};\n\n// src/effects/glsl/fxaa.frag\nvar fxaa_default = `#define QUALITY(q) ((q) < 5 ? 1.0 : ((q) > 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5))\n#define ONE_OVER_TWELVE 0.08333333333333333\nvarying vec2 vUvDown;varying vec2 vUvUp;varying vec2 vUvLeft;varying vec2 vUvRight;varying vec2 vUvDownLeft;varying vec2 vUvUpRight;varying vec2 vUvUpLeft;varying vec2 vUvDownRight;vec4 fxaa(const in vec4 inputColor,const in vec2 uv){float lumaCenter=luminance(inputColor.rgb);float lumaDown=luminance(texture2D(inputBuffer,vUvDown).rgb);float lumaUp=luminance(texture2D(inputBuffer,vUvUp).rgb);float lumaLeft=luminance(texture2D(inputBuffer,vUvLeft).rgb);float lumaRight=luminance(texture2D(inputBuffer,vUvRight).rgb);float lumaMin=min(lumaCenter,min(min(lumaDown,lumaUp),min(lumaLeft,lumaRight)));float lumaMax=max(lumaCenter,max(max(lumaDown,lumaUp),max(lumaLeft,lumaRight)));float lumaRange=lumaMax-lumaMin;if(lumaRange=edgeVertical);float stepLength=isHorizontal?texelSize.y:texelSize.x;float luma1=isHorizontal?lumaDown:lumaLeft;float luma2=isHorizontal?lumaUp:lumaRight;float gradient1=abs(luma1-lumaCenter);float gradient2=abs(luma2-lumaCenter);bool is1Steepest=gradient1>=gradient2;float gradientScaled=0.25*max(gradient1,gradient2);float lumaLocalAverage=0.0;if(is1Steepest){stepLength=-stepLength;lumaLocalAverage=0.5*(luma1+lumaCenter);}else{lumaLocalAverage=0.5*(luma2+lumaCenter);}vec2 currentUv=uv;if(isHorizontal){currentUv.y+=stepLength*0.5;}else{currentUv.x+=stepLength*0.5;}vec2 offset=isHorizontal?vec2(texelSize.x,0.0):vec2(0.0,texelSize.y);vec2 uv1=currentUv-offset*QUALITY(0);vec2 uv2=currentUv+offset*QUALITY(0);float lumaEnd1=luminance(texture2D(inputBuffer,uv1).rgb);float lumaEnd2=luminance(texture2D(inputBuffer,uv2).rgb);lumaEnd1-=lumaLocalAverage;lumaEnd2-=lumaLocalAverage;bool reached1=abs(lumaEnd1)>=gradientScaled;bool reached2=abs(lumaEnd2)>=gradientScaled;bool reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(1);}if(!reached2){uv2+=offset*QUALITY(1);}if(!reachedBoth){for(int i=2;i=gradientScaled;reached2=abs(lumaEnd2)>=gradientScaled;reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(i);}if(!reached2){uv2+=offset*QUALITY(i);}if(reachedBoth){break;}}}float distance1=isHorizontal?(uv.x-uv1.x):(uv.y-uv1.y);float distance2=isHorizontal?(uv2.x-uv.x):(uv2.y-uv.y);bool isDirection1=distance1distortion.x-columns*random){float sx=clamp(ceil(seeds.x),0.0,1.0);uv.y=sx*(1.0-(uv.y+distortion.y))+(1.0-sx)*distortion.y;}if(uv.xdistortion.y-columns*random){float sy=clamp(ceil(seeds.y),0.0,1.0);uv.x=sy*distortion.x+(1.0-sy)*(1.0-(uv.x+distortion.x));}vec2 normal=texture2D(perturbationMap,uv*random*random).rg;uv+=normal*seeds*(random*0.2);}}`;\n\n// src/effects/GlitchEffect.js\nvar textureTag = \"Glitch.Generated\";\nfunction randomFloat(low, high) {\n return low + Math.random() * (high - low);\n}\nvar GlitchEffect = class extends Effect {\n /**\n * Constructs a new glitch effect.\n *\n * TODO Change ratio to 0.15.\n * @param {Object} [options] - The options.\n * @param {Vector2} [options.chromaticAberrationOffset] - A chromatic aberration offset. If provided, the glitch effect will influence this offset.\n * @param {Vector2} [options.delay] - The minimum and maximum delay between glitch activations in seconds.\n * @param {Vector2} [options.duration] - The minimum and maximum duration of a glitch in seconds.\n * @param {Vector2} [options.strength] - The strength of weak and strong glitches.\n * @param {Texture} [options.perturbationMap] - A perturbation map. If none is provided, a noise texture will be created.\n * @param {Number} [options.dtSize=64] - The size of the generated noise map. Will be ignored if a perturbation map is provided.\n * @param {Number} [options.columns=0.05] - The scale of the blocky glitch columns.\n * @param {Number} [options.ratio=0.85] - The threshold for strong glitches.\n */\n constructor({\n chromaticAberrationOffset = null,\n delay = new Vector210(1.5, 3.5),\n duration = new Vector210(0.6, 1),\n strength = new Vector210(0.3, 1),\n columns = 0.05,\n ratio = 0.85,\n perturbationMap = null,\n dtSize = 64\n } = {}) {\n super(\"GlitchEffect\", glitch_default, {\n uniforms: /* @__PURE__ */ new Map([\n [\"perturbationMap\", new Uniform19(null)],\n [\"columns\", new Uniform19(columns)],\n [\"active\", new Uniform19(false)],\n [\"random\", new Uniform19(1)],\n [\"seeds\", new Uniform19(new Vector210())],\n [\"distortion\", new Uniform19(new Vector210())]\n ])\n });\n if (perturbationMap === null) {\n const map = new NoiseTexture(dtSize, dtSize, RGBAFormat2);\n map.name = textureTag;\n this.perturbationMap = map;\n } else {\n this.perturbationMap = perturbationMap;\n }\n this.time = 0;\n this.distortion = this.uniforms.get(\"distortion\").value;\n this.delay = delay;\n this.duration = duration;\n this.breakPoint = new Vector210(\n randomFloat(this.delay.x, this.delay.y),\n randomFloat(this.duration.x, this.duration.y)\n );\n this.strength = strength;\n this.mode = GlitchMode.SPORADIC;\n this.ratio = ratio;\n this.chromaticAberrationOffset = chromaticAberrationOffset;\n }\n /**\n * Random number seeds.\n *\n * @type {Vector2}\n * @private\n */\n get seeds() {\n return this.uniforms.get(\"seeds\").value;\n }\n /**\n * Indicates whether the glitch effect is currently active.\n *\n * @type {Boolean}\n */\n get active() {\n return this.uniforms.get(\"active\").value;\n }\n /**\n * Indicates whether the glitch effect is currently active.\n *\n * @deprecated Use active instead.\n * @return {Boolean} Whether the glitch effect is active.\n */\n isActive() {\n return this.active;\n }\n /**\n * The minimum delay between glitch activations.\n *\n * @type {Number}\n */\n get minDelay() {\n return this.delay.x;\n }\n set minDelay(value) {\n this.delay.x = value;\n }\n /**\n * Returns the minimum delay between glitch activations.\n *\n * @deprecated Use minDelay instead.\n * @return {Number} The minimum delay in seconds.\n */\n getMinDelay() {\n return this.delay.x;\n }\n /**\n * Sets the minimum delay between glitch activations.\n *\n * @deprecated Use minDelay instead.\n * @param {Number} value - The minimum delay in seconds.\n */\n setMinDelay(value) {\n this.delay.x = value;\n }\n /**\n * The maximum delay between glitch activations.\n *\n * @type {Number}\n */\n get maxDelay() {\n return this.delay.y;\n }\n set maxDelay(value) {\n this.delay.y = value;\n }\n /**\n * Returns the maximum delay between glitch activations.\n *\n * @deprecated Use maxDelay instead.\n * @return {Number} The maximum delay in seconds.\n */\n getMaxDelay() {\n return this.delay.y;\n }\n /**\n * Sets the maximum delay between glitch activations.\n *\n * @deprecated Use maxDelay instead.\n * @param {Number} value - The maximum delay in seconds.\n */\n setMaxDelay(value) {\n this.delay.y = value;\n }\n /**\n * The minimum duration of sporadic glitches.\n *\n * @type {Number}\n */\n get minDuration() {\n return this.duration.x;\n }\n set minDuration(value) {\n this.duration.x = value;\n }\n /**\n * Returns the minimum duration of sporadic glitches.\n *\n * @deprecated Use minDuration instead.\n * @return {Number} The minimum duration in seconds.\n */\n getMinDuration() {\n return this.duration.x;\n }\n /**\n * Sets the minimum duration of sporadic glitches.\n *\n * @deprecated Use minDuration instead.\n * @param {Number} value - The minimum duration in seconds.\n */\n setMinDuration(value) {\n this.duration.x = value;\n }\n /**\n * The maximum duration of sporadic glitches.\n *\n * @type {Number}\n */\n get maxDuration() {\n return this.duration.y;\n }\n set maxDuration(value) {\n this.duration.y = value;\n }\n /**\n * Returns the maximum duration of sporadic glitches.\n *\n * @deprecated Use maxDuration instead.\n * @return {Number} The maximum duration in seconds.\n */\n getMaxDuration() {\n return this.duration.y;\n }\n /**\n * Sets the maximum duration of sporadic glitches.\n *\n * @deprecated Use maxDuration instead.\n * @param {Number} value - The maximum duration in seconds.\n */\n setMaxDuration(value) {\n this.duration.y = value;\n }\n /**\n * The strength of weak glitches.\n *\n * @type {Number}\n */\n get minStrength() {\n return this.strength.x;\n }\n set minStrength(value) {\n this.strength.x = value;\n }\n /**\n * Returns the strength of weak glitches.\n *\n * @deprecated Use minStrength instead.\n * @return {Number} The strength.\n */\n getMinStrength() {\n return this.strength.x;\n }\n /**\n * Sets the strength of weak glitches.\n *\n * @deprecated Use minStrength instead.\n * @param {Number} value - The strength.\n */\n setMinStrength(value) {\n this.strength.x = value;\n }\n /**\n * The strength of strong glitches.\n *\n * @type {Number}\n */\n get maxStrength() {\n return this.strength.y;\n }\n set maxStrength(value) {\n this.strength.y = value;\n }\n /**\n * Returns the strength of strong glitches.\n *\n * @deprecated Use maxStrength instead.\n * @return {Number} The strength.\n */\n getMaxStrength() {\n return this.strength.y;\n }\n /**\n * Sets the strength of strong glitches.\n *\n * @deprecated Use maxStrength instead.\n * @param {Number} value - The strength.\n */\n setMaxStrength(value) {\n this.strength.y = value;\n }\n /**\n * Returns the current glitch mode.\n *\n * @deprecated Use mode instead.\n * @return {GlitchMode} The mode.\n */\n getMode() {\n return this.mode;\n }\n /**\n * Sets the current glitch mode.\n *\n * @deprecated Use mode instead.\n * @param {GlitchMode} value - The mode.\n */\n setMode(value) {\n this.mode = value;\n }\n /**\n * Returns the glitch ratio.\n *\n * @deprecated Use ratio instead.\n * @return {Number} The ratio.\n */\n getGlitchRatio() {\n return 1 - this.ratio;\n }\n /**\n * Sets the ratio of weak (0.0) and strong (1.0) glitches.\n *\n * @deprecated Use ratio instead.\n * @param {Number} value - The ratio. Range is [0.0, 1.0].\n */\n setGlitchRatio(value) {\n this.ratio = Math.min(Math.max(1 - value, 0), 1);\n }\n /**\n * The glitch column size.\n *\n * @type {Number}\n */\n get columns() {\n return this.uniforms.get(\"columns\").value;\n }\n set columns(value) {\n this.uniforms.get(\"columns\").value = value;\n }\n /**\n * Returns the glitch column size.\n *\n * @deprecated Use columns instead.\n * @return {Number} The glitch column size.\n */\n getGlitchColumns() {\n return this.columns;\n }\n /**\n * Sets the glitch column size.\n *\n * @deprecated Use columns instead.\n * @param {Number} value - The glitch column size.\n */\n setGlitchColumns(value) {\n this.columns = value;\n }\n /**\n * Returns the chromatic aberration offset.\n *\n * @deprecated Use chromaticAberrationOffset instead.\n * @return {Vector2} The offset.\n */\n getChromaticAberrationOffset() {\n return this.chromaticAberrationOffset;\n }\n /**\n * Sets the chromatic aberration offset.\n *\n * @deprecated Use chromaticAberrationOffset instead.\n * @param {Vector2} value - The offset.\n */\n setChromaticAberrationOffset(value) {\n this.chromaticAberrationOffset = value;\n }\n /**\n * The perturbation map.\n *\n * @type {Texture}\n */\n get perturbationMap() {\n return this.uniforms.get(\"perturbationMap\").value;\n }\n set perturbationMap(value) {\n const currentMap = this.perturbationMap;\n if (currentMap !== null && currentMap.name === textureTag) {\n currentMap.dispose();\n }\n value.minFilter = value.magFilter = NearestFilter;\n value.wrapS = value.wrapT = RepeatWrapping2;\n value.generateMipmaps = false;\n this.uniforms.get(\"perturbationMap\").value = value;\n }\n /**\n * Returns the current perturbation map.\n *\n * @deprecated Use perturbationMap instead.\n * @return {Texture} The current perturbation map.\n */\n getPerturbationMap() {\n return this.perturbationMap;\n }\n /**\n * Replaces the current perturbation map with the given one.\n *\n * The current map will be disposed if it was generated by this effect.\n *\n * @deprecated Use perturbationMap instead.\n * @param {Texture} value - The new perturbation map.\n */\n setPerturbationMap(value) {\n this.perturbationMap = value;\n }\n /**\n * Generates a perturbation map.\n *\n * @deprecated Use NoiseTexture instead.\n * @param {Number} [value=64] - The texture size.\n * @return {DataTexture} The perturbation map.\n */\n generatePerturbationMap(value = 64) {\n const map = new NoiseTexture(value, value, RGBAFormat2);\n map.name = textureTag;\n return map;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const mode = this.mode;\n const breakPoint = this.breakPoint;\n const offset = this.chromaticAberrationOffset;\n const s = this.strength;\n let time = this.time;\n let active = false;\n let r = 0, a = 0;\n let trigger;\n if (mode !== GlitchMode.DISABLED) {\n if (mode === GlitchMode.SPORADIC) {\n time += deltaTime;\n trigger = time > breakPoint.x;\n if (time >= breakPoint.x + breakPoint.y) {\n breakPoint.set(\n randomFloat(this.delay.x, this.delay.y),\n randomFloat(this.duration.x, this.duration.y)\n );\n time = 0;\n }\n }\n r = Math.random();\n this.uniforms.get(\"random\").value = r;\n if (trigger && r > this.ratio || mode === GlitchMode.CONSTANT_WILD) {\n active = true;\n r *= s.y * 0.03;\n a = randomFloat(-Math.PI, Math.PI);\n this.seeds.set(randomFloat(-s.y, s.y), randomFloat(-s.y, s.y));\n this.distortion.set(randomFloat(0, 1), randomFloat(0, 1));\n } else if (trigger || mode === GlitchMode.CONSTANT_MILD) {\n active = true;\n r *= s.x * 0.03;\n a = randomFloat(-Math.PI, Math.PI);\n this.seeds.set(randomFloat(-s.x, s.x), randomFloat(-s.x, s.x));\n this.distortion.set(randomFloat(0, 1), randomFloat(0, 1));\n }\n this.time = time;\n }\n if (offset !== null) {\n if (active) {\n offset.set(Math.cos(a), Math.sin(a)).multiplyScalar(r);\n } else {\n offset.set(0, 0);\n }\n }\n this.uniforms.get(\"active\").value = active;\n }\n /**\n * Deletes generated resources.\n */\n dispose() {\n const map = this.perturbationMap;\n if (map !== null && map.name === textureTag) {\n map.dispose();\n }\n }\n};\n\n// src/effects/GodRaysEffect.js\nimport {\n BasicDepthPacking as BasicDepthPacking6,\n Color as Color3,\n DepthTexture as DepthTexture2,\n Matrix4,\n Scene as Scene2,\n SRGBColorSpace as SRGBColorSpace8,\n Uniform as Uniform22,\n Vector2 as Vector212,\n Vector3,\n WebGLRenderTarget as WebGLRenderTarget10\n} from \"three\";\n\n// src/materials/DepthMaskMaterial.js\nimport {\n AlwaysDepth,\n BasicDepthPacking as BasicDepthPacking5,\n EqualDepth,\n GreaterDepth,\n GreaterEqualDepth,\n LessDepth,\n LessEqualDepth,\n NeverDepth,\n NoBlending as NoBlending9,\n NotEqualDepth,\n PerspectiveCamera as PerspectiveCamera2,\n ShaderMaterial as ShaderMaterial10,\n Uniform as Uniform20,\n Vector2 as Vector211\n} from \"three\";\n\n// src/enums/DepthTestStrategy.js\nvar DepthTestStrategy = {\n DEFAULT: 0,\n KEEP_MAX_DEPTH: 1,\n DISCARD_MAX_DEPTH: 2\n};\n\n// src/materials/glsl/depth-mask.frag\nvar depth_mask_default = `#include \n#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer0;uniform highp sampler2D depthBuffer1;\n#else\nuniform mediump sampler2D depthBuffer0;uniform mediump sampler2D depthBuffer1;\n#endif\nuniform sampler2D inputBuffer;uniform vec2 cameraNearFar;float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}varying vec2 vUv;void main(){vec2 depth;\n#if DEPTH_PACKING_0 == 3201\ndepth.x=unpackRGBAToDepth(texture2D(depthBuffer0,vUv));\n#else\ndepth.x=texture2D(depthBuffer0,vUv).r;\n#ifdef LOG_DEPTH\nfloat d=pow(2.0,depth.x*log2(cameraNearFar.y+1.0))-1.0;float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);depth.x=a+b/d;\n#endif\n#endif\n#if DEPTH_PACKING_1 == 3201\ndepth.y=unpackRGBAToDepth(texture2D(depthBuffer1,vUv));\n#else\ndepth.y=texture2D(depthBuffer1,vUv).r;\n#ifdef LOG_DEPTH\nfloat d=pow(2.0,depth.y*log2(cameraNearFar.y+1.0))-1.0;float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);depth.y=a+b/d;\n#endif\n#endif\nbool isMaxDepth=(depth.x==1.0);\n#ifdef PERSPECTIVE_CAMERA\ndepth.x=viewZToOrthographicDepth(getViewZ(depth.x),cameraNearFar.x,cameraNearFar.y);depth.y=viewZToOrthographicDepth(getViewZ(depth.y),cameraNearFar.x,cameraNearFar.y);\n#endif\n#if DEPTH_TEST_STRATEGY == 0\nbool keep=depthTest(depth.x,depth.y);\n#elif DEPTH_TEST_STRATEGY == 1\nbool keep=isMaxDepth||depthTest(depth.x,depth.y);\n#else\nbool keep=!isMaxDepth&&depthTest(depth.x,depth.y);\n#endif\nif(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}`;\n\n// src/materials/DepthMaskMaterial.js\nvar DepthMaskMaterial = class extends ShaderMaterial10 {\n /**\n * Constructs a new depth mask material.\n */\n constructor() {\n super({\n name: \"DepthMaskMaterial\",\n defines: {\n DEPTH_EPSILON: \"0.0001\",\n DEPTH_PACKING_0: \"0\",\n DEPTH_PACKING_1: \"0\",\n DEPTH_TEST_STRATEGY: DepthTestStrategy.KEEP_MAX_DEPTH\n },\n uniforms: {\n inputBuffer: new Uniform20(null),\n depthBuffer0: new Uniform20(null),\n depthBuffer1: new Uniform20(null),\n cameraNearFar: new Uniform20(new Vector211(1, 1))\n },\n blending: NoBlending9,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: depth_mask_default,\n vertexShader: common_default\n });\n this.depthMode = LessDepth;\n }\n /**\n * The primary depth buffer.\n *\n * @type {Texture}\n */\n set depthBuffer0(value) {\n this.uniforms.depthBuffer0.value = value;\n }\n /**\n * The primary depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set depthPacking0(value) {\n this.defines.DEPTH_PACKING_0 = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the base depth buffer.\n *\n * @deprecated Use depthBuffer0 and depthPacking0 instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthBuffer0(buffer, depthPacking = BasicDepthPacking5) {\n this.depthBuffer0 = buffer;\n this.depthPacking0 = depthPacking;\n }\n /**\n * The secondary depth buffer.\n *\n * @type {Texture}\n */\n set depthBuffer1(value) {\n this.uniforms.depthBuffer1.value = value;\n }\n /**\n * The secondary depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set depthPacking1(value) {\n this.defines.DEPTH_PACKING_1 = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the depth buffer that will be compared with the base depth buffer.\n *\n * @deprecated Use depthBuffer1 and depthPacking1 instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthBuffer1(buffer, depthPacking = BasicDepthPacking5) {\n this.depthBuffer1 = buffer;\n this.depthPacking1 = depthPacking;\n }\n /**\n * The strategy for handling maximum depth.\n *\n * @type {DepthTestStrategy}\n */\n get maxDepthStrategy() {\n return Number(this.defines.DEPTH_TEST_STRATEGY);\n }\n set maxDepthStrategy(value) {\n this.defines.DEPTH_TEST_STRATEGY = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Indicates whether maximum depth values should be preserved.\n *\n * @type {Boolean}\n * @deprecated Use maxDepthStrategy instead.\n */\n get keepFar() {\n return this.maxDepthStrategy;\n }\n set keepFar(value) {\n this.maxDepthStrategy = value ? DepthTestStrategy.KEEP_MAX_DEPTH : DepthTestStrategy.DISCARD_MAX_DEPTH;\n }\n /**\n * Returns the strategy for dealing with maximum depth values.\n *\n * @deprecated Use maxDepthStrategy instead.\n * @return {DepthTestStrategy} The strategy.\n */\n getMaxDepthStrategy() {\n return this.maxDepthStrategy;\n }\n /**\n * Sets the strategy for dealing with maximum depth values.\n *\n * @deprecated Use maxDepthStrategy instead.\n * @param {DepthTestStrategy} value - The strategy.\n */\n setMaxDepthStrategy(value) {\n this.maxDepthStrategy = value;\n }\n /**\n * A small error threshold that is used for `EqualDepth` and `NotEqualDepth` tests. Default is `1e-4`.\n *\n * @type {Number}\n */\n get epsilon() {\n return Number(this.defines.DEPTH_EPSILON);\n }\n set epsilon(value) {\n this.defines.DEPTH_EPSILON = value.toFixed(16);\n this.needsUpdate = true;\n }\n /**\n * Returns the current error threshold for depth comparisons.\n *\n * @deprecated Use epsilon instead.\n * @return {Number} The error threshold.\n */\n getEpsilon() {\n return this.epsilon;\n }\n /**\n * Sets the depth comparison error threshold.\n *\n * @deprecated Use epsilon instead.\n * @param {Number} value - The new error threshold.\n */\n setEpsilon(value) {\n this.epsilon = value;\n }\n /**\n * The depth mode.\n *\n * @see https://threejs.org/docs/#api/en/constants/Materials\n * @type {DepthModes}\n */\n get depthMode() {\n return Number(this.defines.DEPTH_MODE);\n }\n set depthMode(value) {\n let depthTest;\n switch (value) {\n case NeverDepth:\n depthTest = \"false\";\n break;\n case AlwaysDepth:\n depthTest = \"true\";\n break;\n case EqualDepth:\n depthTest = \"abs(d1 - d0) <= DEPTH_EPSILON\";\n break;\n case NotEqualDepth:\n depthTest = \"abs(d1 - d0) > DEPTH_EPSILON\";\n break;\n case LessDepth:\n depthTest = \"d0 > d1\";\n break;\n case LessEqualDepth:\n depthTest = \"d0 >= d1\";\n break;\n case GreaterEqualDepth:\n depthTest = \"d0 <= d1\";\n break;\n case GreaterDepth:\n default:\n depthTest = \"d0 < d1\";\n break;\n }\n this.defines.DEPTH_MODE = value.toFixed(0);\n this.defines[\"depthTest(d0, d1)\"] = depthTest;\n this.needsUpdate = true;\n }\n /**\n * Returns the current depth mode.\n *\n * @deprecated Use depthMode instead.\n * @return {DepthModes} The depth mode. Default is `LessDepth`.\n */\n getDepthMode() {\n return this.depthMode;\n }\n /**\n * Sets the depth mode.\n *\n * @deprecated Use depthMode instead.\n * @param {DepthModes} mode - The depth mode.\n */\n setDepthMode(mode) {\n this.depthMode = mode;\n }\n /**\n * Copies the settings of the given camera.\n *\n * @deprecated Use copyCameraSettings instead.\n * @param {Camera} camera - A camera.\n */\n adoptCameraSettings(camera) {\n this.copyCameraSettings(camera);\n }\n /**\n * Copies the settings of the given camera.\n *\n * @param {Camera} camera - A camera.\n */\n copyCameraSettings(camera) {\n if (camera) {\n this.uniforms.cameraNearFar.value.set(camera.near, camera.far);\n if (camera instanceof PerspectiveCamera2) {\n this.defines.PERSPECTIVE_CAMERA = \"1\";\n } else {\n delete this.defines.PERSPECTIVE_CAMERA;\n }\n this.needsUpdate = true;\n }\n }\n};\n\n// src/materials/GodRaysMaterial.js\nimport { NoBlending as NoBlending10, ShaderMaterial as ShaderMaterial11, Uniform as Uniform21 } from \"three\";\n\n// src/materials/glsl/convolution.god-rays.frag\nvar convolution_god_rays_default = `#include \n#include \n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform vec2 lightPosition;uniform float exposure;uniform float decay;uniform float density;uniform float weight;uniform float clampMax;varying vec2 vUv;void main(){vec2 coord=vUv;vec2 delta=lightPosition-coord;delta*=1.0/SAMPLES_FLOAT*density;float illuminationDecay=1.0;vec4 color=vec4(0.0);for(int i=0;i\n}`;\n\n// src/materials/GodRaysMaterial.js\nvar GodRaysMaterial = class extends ShaderMaterial11 {\n /**\n * Constructs a new god rays material.\n *\n * TODO Remove lightPosition param.\n * @param {Vector2} lightPosition - Deprecated.\n */\n constructor(lightPosition) {\n super({\n name: \"GodRaysMaterial\",\n defines: {\n SAMPLES_INT: \"60\",\n SAMPLES_FLOAT: \"60.0\"\n },\n uniforms: {\n inputBuffer: new Uniform21(null),\n lightPosition: new Uniform21(lightPosition),\n density: new Uniform21(1),\n decay: new Uniform21(1),\n weight: new Uniform21(1),\n exposure: new Uniform21(1),\n clampMax: new Uniform21(1)\n },\n blending: NoBlending10,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_god_rays_default,\n vertexShader: common_default\n });\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The screen space position of the light source.\n *\n * @type {Vector2}\n */\n get lightPosition() {\n return this.uniforms.lightPosition.value;\n }\n /**\n * Returns the screen space position of the light source.\n *\n * @deprecated Use lightPosition instead.\n * @return {Vector2} The position.\n */\n getLightPosition() {\n return this.uniforms.lightPosition.value;\n }\n /**\n * Sets the screen space position of the light source.\n *\n * @deprecated Use lightPosition instead.\n * @param {Vector2} value - The position.\n */\n setLightPosition(value) {\n this.uniforms.lightPosition.value = value;\n }\n /**\n * The density.\n *\n * @type {Number}\n */\n get density() {\n return this.uniforms.density.value;\n }\n set density(value) {\n this.uniforms.density.value = value;\n }\n /**\n * Returns the density.\n *\n * @deprecated Use density instead.\n * @return {Number} The density.\n */\n getDensity() {\n return this.uniforms.density.value;\n }\n /**\n * Sets the density.\n *\n * @deprecated Use density instead.\n * @param {Number} value - The density.\n */\n setDensity(value) {\n this.uniforms.density.value = value;\n }\n /**\n * The decay.\n *\n * @type {Number}\n */\n get decay() {\n return this.uniforms.decay.value;\n }\n set decay(value) {\n this.uniforms.decay.value = value;\n }\n /**\n * Returns the decay.\n *\n * @deprecated Use decay instead.\n * @return {Number} The decay.\n */\n getDecay() {\n return this.uniforms.decay.value;\n }\n /**\n * Sets the decay.\n *\n * @deprecated Use decay instead.\n * @param {Number} value - The decay.\n */\n setDecay(value) {\n this.uniforms.decay.value = value;\n }\n /**\n * The weight.\n *\n * @type {Number}\n */\n get weight() {\n return this.uniforms.weight.value;\n }\n set weight(value) {\n this.uniforms.weight.value = value;\n }\n /**\n * Returns the weight.\n *\n * @deprecated Use weight instead.\n * @return {Number} The weight.\n */\n getWeight() {\n return this.uniforms.weight.value;\n }\n /**\n * Sets the weight.\n *\n * @deprecated Use weight instead.\n * @param {Number} value - The weight.\n */\n setWeight(value) {\n this.uniforms.weight.value = value;\n }\n /**\n * The exposure.\n *\n * @type {Number}\n */\n get exposure() {\n return this.uniforms.exposure.value;\n }\n set exposure(value) {\n this.uniforms.exposure.value = value;\n }\n /**\n * Returns the exposure.\n *\n * @deprecated Use exposure instead.\n * @return {Number} The exposure.\n */\n getExposure() {\n return this.uniforms.exposure.value;\n }\n /**\n * Sets the exposure.\n *\n * @deprecated Use exposure instead.\n * @param {Number} value - The exposure.\n */\n setExposure(value) {\n this.uniforms.exposure.value = value;\n }\n /**\n * The maximum light intensity.\n *\n * @type {Number}\n */\n get maxIntensity() {\n return this.uniforms.clampMax.value;\n }\n set maxIntensity(value) {\n this.uniforms.clampMax.value = value;\n }\n /**\n * Returns the maximum light intensity.\n *\n * @deprecated Use maxIntensity instead.\n * @return {Number} The maximum light intensity.\n */\n getMaxIntensity() {\n return this.uniforms.clampMax.value;\n }\n /**\n * Sets the maximum light intensity.\n *\n * @deprecated Use maxIntensity instead.\n * @param {Number} value - The maximum light intensity.\n */\n setMaxIntensity(value) {\n this.uniforms.clampMax.value = value;\n }\n /**\n * The amount of samples per pixel.\n *\n * @type {Number}\n */\n get samples() {\n return Number(this.defines.SAMPLES_INT);\n }\n set samples(value) {\n const s = Math.floor(value);\n this.defines.SAMPLES_INT = s.toFixed(0);\n this.defines.SAMPLES_FLOAT = s.toFixed(1);\n this.needsUpdate = true;\n }\n /**\n * Returns the amount of samples per pixel.\n *\n * @deprecated Use samples instead.\n * @return {Number} The sample count.\n */\n getSamples() {\n return this.samples;\n }\n /**\n * Sets the amount of samples per pixel.\n *\n * @deprecated Use samples instead.\n * @param {Number} value - The sample count.\n */\n setSamples(value) {\n this.samples = value;\n }\n};\n\n// src/passes/RenderPass.js\nvar RenderPass = class extends Pass {\n /**\n * Constructs a new render pass.\n *\n * @param {Scene} scene - The scene to render.\n * @param {Camera} camera - The camera to use to render the scene.\n * @param {Material} [overrideMaterial=null] - An override material.\n */\n constructor(scene, camera, overrideMaterial = null) {\n super(\"RenderPass\", scene, camera);\n this.needsSwap = false;\n this.clearPass = new ClearPass();\n this.overrideMaterialManager = overrideMaterial === null ? null : new OverrideMaterialManager(overrideMaterial);\n this.ignoreBackground = false;\n this.skipShadowMapUpdate = false;\n this.selection = null;\n }\n set mainScene(value) {\n this.scene = value;\n }\n set mainCamera(value) {\n this.camera = value;\n }\n get renderToScreen() {\n return super.renderToScreen;\n }\n set renderToScreen(value) {\n super.renderToScreen = value;\n this.clearPass.renderToScreen = value;\n }\n /**\n * The current override material.\n *\n * @type {Material}\n */\n get overrideMaterial() {\n const manager = this.overrideMaterialManager;\n return manager !== null ? manager.material : null;\n }\n set overrideMaterial(value) {\n const manager = this.overrideMaterialManager;\n if (value !== null) {\n if (manager !== null) {\n manager.setMaterial(value);\n } else {\n this.overrideMaterialManager = new OverrideMaterialManager(value);\n }\n } else if (manager !== null) {\n manager.dispose();\n this.overrideMaterialManager = null;\n }\n }\n /**\n * Returns the current override material.\n *\n * @deprecated Use overrideMaterial instead.\n * @return {Material} The material.\n */\n getOverrideMaterial() {\n return this.overrideMaterial;\n }\n /**\n * Sets the override material.\n *\n * @deprecated Use overrideMaterial instead.\n * @return {Material} value - The material.\n */\n setOverrideMaterial(value) {\n this.overrideMaterial = value;\n }\n /**\n * Indicates whether the target buffer should be cleared before rendering.\n *\n * @type {Boolean}\n * @deprecated Use clearPass.enabled instead.\n */\n get clear() {\n return this.clearPass.enabled;\n }\n set clear(value) {\n this.clearPass.enabled = value;\n }\n /**\n * Returns the selection. Default is `null` (no restriction).\n *\n * @deprecated Use selection instead.\n * @return {Selection} The selection.\n */\n getSelection() {\n return this.selection;\n }\n /**\n * Sets the selection. Set to `null` to disable.\n *\n * @deprecated Use selection instead.\n * @param {Selection} value - The selection.\n */\n setSelection(value) {\n this.selection = value;\n }\n /**\n * Indicates whether the scene background is disabled.\n *\n * @deprecated Use ignoreBackground instead.\n * @return {Boolean} Whether the scene background is disabled.\n */\n isBackgroundDisabled() {\n return this.ignoreBackground;\n }\n /**\n * Enables or disables the scene background.\n *\n * @deprecated Use ignoreBackground instead.\n * @param {Boolean} value - Whether the scene background should be disabled.\n */\n setBackgroundDisabled(value) {\n this.ignoreBackground = value;\n }\n /**\n * Indicates whether the shadow map auto update is disabled.\n *\n * @deprecated Use skipShadowMapUpdate instead.\n * @return {Boolean} Whether the shadow map update is disabled.\n */\n isShadowMapDisabled() {\n return this.skipShadowMapUpdate;\n }\n /**\n * Enables or disables the shadow map auto update.\n *\n * @deprecated Use skipShadowMapUpdate instead.\n * @param {Boolean} value - Whether the shadow map auto update should be disabled.\n */\n setShadowMapDisabled(value) {\n this.skipShadowMapUpdate = value;\n }\n /**\n * Returns the clear pass.\n *\n * @deprecated Use clearPass.enabled instead.\n * @return {ClearPass} The clear pass.\n */\n getClearPass() {\n return this.clearPass;\n }\n /**\n * Renders the scene.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const scene = this.scene;\n const camera = this.camera;\n const selection = this.selection;\n const mask = camera.layers.mask;\n const background = scene.background;\n const shadowMapAutoUpdate = renderer.shadowMap.autoUpdate;\n const renderTarget = this.renderToScreen ? null : inputBuffer;\n if (selection !== null) {\n camera.layers.set(selection.getLayer());\n }\n if (this.skipShadowMapUpdate) {\n renderer.shadowMap.autoUpdate = false;\n }\n if (this.ignoreBackground || this.clearPass.overrideClearColor !== null) {\n scene.background = null;\n }\n if (this.clearPass.enabled) {\n this.clearPass.render(renderer, inputBuffer);\n }\n renderer.setRenderTarget(renderTarget);\n if (this.overrideMaterialManager !== null) {\n this.overrideMaterialManager.render(renderer, scene, camera);\n } else {\n renderer.render(scene, camera);\n }\n camera.layers.mask = mask;\n scene.background = background;\n renderer.shadowMap.autoUpdate = shadowMapAutoUpdate;\n }\n};\n\n// src/effects/glsl/god-rays.frag\nvar god_rays_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv);}`;\n\n// src/effects/GodRaysEffect.js\nvar v = /* @__PURE__ */ new Vector3();\nvar m = /* @__PURE__ */ new Matrix4();\nvar GodRaysEffect = class extends Effect {\n /**\n * Constructs a new god rays effect.\n *\n * @param {Camera} [camera] - The main camera.\n * @param {Mesh|Points} [lightSource] - The light source. Must not write depth and has to be flagged as transparent.\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function of this effect.\n * @param {Number} [options.samples=60.0] - The number of samples per pixel.\n * @param {Number} [options.density=0.96] - The density of the light rays.\n * @param {Number} [options.decay=0.9] - An illumination decay factor.\n * @param {Number} [options.weight=0.4] - A light ray weight factor.\n * @param {Number} [options.exposure=0.6] - A constant attenuation coefficient.\n * @param {Number} [options.clampMax=1.0] - An upper bound for the saturation of the overall effect.\n * @param {Number} [options.resolutionScale=0.5] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n * @param {KernelSize} [options.kernelSize=KernelSize.SMALL] - The blur kernel size. Has no effect if blur is disabled.\n * @param {Boolean} [options.blur=true] - Whether the god rays should be blurred to reduce artifacts.\n */\n constructor(camera, lightSource, {\n blendFunction = BlendFunction.SCREEN,\n samples = 60,\n density = 0.96,\n decay = 0.9,\n weight = 0.4,\n exposure = 0.6,\n clampMax = 1,\n blur = true,\n kernelSize = KernelSize.SMALL,\n resolutionScale = 0.5,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"GodRaysEffect\", god_rays_default, {\n blendFunction,\n attributes: EffectAttribute.DEPTH,\n uniforms: /* @__PURE__ */ new Map([\n [\"map\", new Uniform22(null)]\n ])\n });\n this.camera = camera;\n this._lightSource = lightSource;\n this.lightSource = lightSource;\n this.lightScene = new Scene2();\n this.screenPosition = new Vector212();\n this.renderTargetA = new WebGLRenderTarget10(1, 1, { depthBuffer: false });\n this.renderTargetA.texture.name = \"GodRays.Target.A\";\n this.renderTargetB = this.renderTargetA.clone();\n this.renderTargetB.texture.name = \"GodRays.Target.B\";\n this.uniforms.get(\"map\").value = this.renderTargetB.texture;\n this.renderTargetLight = new WebGLRenderTarget10(1, 1);\n this.renderTargetLight.texture.name = \"GodRays.Light\";\n this.renderTargetLight.depthTexture = new DepthTexture2();\n this.renderPassLight = new RenderPass(this.lightScene, camera);\n this.renderPassLight.clearPass.overrideClearColor = new Color3(0);\n this.clearPass = new ClearPass(true, false, false);\n this.clearPass.overrideClearColor = new Color3(0);\n this.blurPass = new KawaseBlurPass({ kernelSize });\n this.blurPass.enabled = blur;\n this.depthMaskPass = new ShaderPass(new DepthMaskMaterial());\n const depthMaskMaterial = this.depthMaskMaterial;\n depthMaskMaterial.depthBuffer1 = this.renderTargetLight.depthTexture;\n depthMaskMaterial.copyCameraSettings(camera);\n this.godRaysPass = new ShaderPass(new GodRaysMaterial(this.screenPosition));\n const godRaysMaterial = this.godRaysMaterial;\n godRaysMaterial.density = density;\n godRaysMaterial.decay = decay;\n godRaysMaterial.weight = weight;\n godRaysMaterial.exposure = exposure;\n godRaysMaterial.maxIntensity = clampMax;\n godRaysMaterial.samples = samples;\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n }\n set mainCamera(value) {\n this.camera = value;\n this.renderPassLight.mainCamera = value;\n this.depthMaskMaterial.copyCameraSettings(value);\n }\n /**\n * Sets the light source.\n *\n * @type {Mesh|Points}\n */\n get lightSource() {\n return this._lightSource;\n }\n set lightSource(value) {\n this._lightSource = value;\n if (value !== null) {\n value.material.depthWrite = false;\n value.material.transparent = true;\n }\n }\n /**\n * Returns the blur pass that reduces aliasing artifacts and makes the light softer.\n *\n * @deprecated Use blurPass instead.\n * @return {KawaseBlurPass} The blur pass.\n */\n getBlurPass() {\n return this.blurPass;\n }\n /**\n * A texture that contains the intermediate result of this effect.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTargetB.texture;\n }\n /**\n * Returns the god rays texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.texture;\n }\n /**\n * The depth mask material.\n *\n * @type {DepthMaskMaterial}\n * @private\n */\n get depthMaskMaterial() {\n return this.depthMaskPass.fullscreenMaterial;\n }\n /**\n * The internal god rays material.\n *\n * @type {GodRaysMaterial}\n */\n get godRaysMaterial() {\n return this.godRaysPass.fullscreenMaterial;\n }\n /**\n * Returns the god rays material.\n *\n * @deprecated Use godRaysMaterial instead.\n * @return {GodRaysMaterial} The material.\n */\n getGodRaysMaterial() {\n return this.godRaysMaterial;\n }\n /**\n * Returns the resolution of this effect.\n *\n * @deprecated Use resolution instead.\n * @return {GodRaysMaterial} The material.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * The current width of the internal render targets.\n *\n * @type {Number}\n * @deprecated Use resolution.width instead.\n */\n get width() {\n return this.resolution.width;\n }\n set width(value) {\n this.resolution.preferredWidth = value;\n }\n /**\n * The current height of the internal render targets.\n *\n * @type {Number}\n * @deprecated Use resolution.height instead.\n */\n get height() {\n return this.resolution.height;\n }\n set height(value) {\n this.resolution.preferredHeight = value;\n }\n /**\n * Indicates whether dithering is enabled.\n *\n * @type {Boolean}\n * @deprecated\n */\n get dithering() {\n return this.godRaysMaterial.dithering;\n }\n set dithering(value) {\n const material = this.godRaysMaterial;\n material.dithering = value;\n material.needsUpdate = true;\n }\n /**\n * Indicates whether the god rays should be blurred to reduce artifacts.\n *\n * @type {Boolean}\n * @deprecated Use blurPass.enabled instead.\n */\n get blur() {\n return this.blurPass.enabled;\n }\n set blur(value) {\n this.blurPass.enabled = value;\n }\n /**\n * The blur kernel size.\n *\n * @type {KernelSize}\n * @deprecated Use blurPass.kernelSize instead.\n */\n get kernelSize() {\n return this.blurPass.kernelSize;\n }\n set kernelSize(value) {\n this.blurPass.kernelSize = value;\n }\n /**\n * Returns the current resolution scale.\n *\n * @return {Number} The resolution scale.\n * @deprecated Use resolution instead.\n */\n getResolutionScale() {\n return this.resolution.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * @param {Number} scale - The new resolution scale.\n * @deprecated Use resolution instead.\n */\n setResolutionScale(scale) {\n this.resolution.scale = scale;\n }\n /**\n * The number of samples per pixel.\n *\n * @type {Number}\n * @deprecated Use godRaysMaterial.samples instead.\n */\n get samples() {\n return this.godRaysMaterial.samples;\n }\n /**\n * A higher sample count improves quality at the cost of performance.\n *\n * @type {Number}\n * @deprecated Use godRaysMaterial.samples instead.\n */\n set samples(value) {\n this.godRaysMaterial.samples = value;\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {Number} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking6) {\n this.depthMaskPass.fullscreenMaterial.depthBuffer0 = depthTexture;\n this.depthMaskPass.fullscreenMaterial.depthPacking0 = depthPacking;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const lightSource = this.lightSource;\n const parent = lightSource.parent;\n const matrixAutoUpdate = lightSource.matrixAutoUpdate;\n const renderTargetA = this.renderTargetA;\n const renderTargetLight = this.renderTargetLight;\n lightSource.material.depthWrite = true;\n lightSource.matrixAutoUpdate = false;\n lightSource.updateWorldMatrix(true, false);\n if (parent !== null) {\n if (!matrixAutoUpdate) {\n m.copy(lightSource.matrix);\n }\n lightSource.matrix.copy(lightSource.matrixWorld);\n }\n this.lightScene.add(lightSource);\n this.renderPassLight.render(renderer, renderTargetLight);\n this.clearPass.render(renderer, renderTargetA);\n this.depthMaskPass.render(renderer, renderTargetLight, renderTargetA);\n lightSource.material.depthWrite = false;\n lightSource.matrixAutoUpdate = matrixAutoUpdate;\n if (parent !== null) {\n if (!matrixAutoUpdate) {\n lightSource.matrix.copy(m);\n }\n parent.add(lightSource);\n }\n v.setFromMatrixPosition(lightSource.matrixWorld).project(this.camera);\n this.screenPosition.set(\n Math.min(Math.max((v.x + 1) * 0.5, -1), 2),\n Math.min(Math.max((v.y + 1) * 0.5, -1), 2)\n );\n if (this.blurPass.enabled) {\n this.blurPass.render(renderer, renderTargetA, renderTargetA);\n }\n this.godRaysPass.render(renderer, renderTargetA, this.renderTargetB);\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.renderTargetA.setSize(w, h);\n this.renderTargetB.setSize(w, h);\n this.renderTargetLight.setSize(w, h);\n this.blurPass.resolution.copy(resolution);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.blurPass.initialize(renderer, alpha, frameBufferType);\n this.renderPassLight.initialize(renderer, alpha, frameBufferType);\n this.depthMaskPass.initialize(renderer, alpha, frameBufferType);\n this.godRaysPass.initialize(renderer, alpha, frameBufferType);\n if (frameBufferType !== void 0) {\n this.renderTargetA.texture.type = frameBufferType;\n this.renderTargetB.texture.type = frameBufferType;\n this.renderTargetLight.texture.type = frameBufferType;\n if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace8) {\n this.renderTargetA.texture.colorSpace = SRGBColorSpace8;\n this.renderTargetB.texture.colorSpace = SRGBColorSpace8;\n this.renderTargetLight.texture.colorSpace = SRGBColorSpace8;\n }\n }\n }\n};\n\n// src/effects/GridEffect.js\nimport { Uniform as Uniform23, Vector2 as Vector213 } from \"three\";\n\n// src/effects/glsl/grid.frag\nvar grid_default = `uniform vec2 scale;uniform float lineWidth;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float grid=0.5-max(abs(mod(uv.x*scale.x,1.0)-0.5),abs(mod(uv.y*scale.y,1.0)-0.5));outputColor=vec4(vec3(smoothstep(0.0,lineWidth,grid)),inputColor.a);}`;\n\n// src/effects/GridEffect.js\nvar GridEffect = class extends Effect {\n /**\n * Constructs a new grid effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.OVERLAY] - The blend function of this effect.\n * @param {Number} [options.scale=1.0] - The scale of the grid pattern.\n * @param {Number} [options.lineWidth=0.0] - The line width of the grid pattern.\n */\n constructor({ blendFunction = BlendFunction.OVERLAY, scale = 1, lineWidth = 0 } = {}) {\n super(\"GridEffect\", grid_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"scale\", new Uniform23(new Vector213())],\n [\"lineWidth\", new Uniform23(lineWidth)]\n ])\n });\n this.resolution = new Vector213();\n this.s = 0;\n this.scale = scale;\n this.l = 0;\n this.lineWidth = lineWidth;\n }\n /**\n * The scale.\n *\n * @type {Number}\n */\n get scale() {\n return this.s;\n }\n set scale(value) {\n this.s = Math.max(value, 1e-6);\n this.setSize(this.resolution.width, this.resolution.height);\n }\n /**\n * Returns the current grid scale.\n *\n * @deprecated Use scale instead.\n * @return {Number} The grid scale.\n */\n getScale() {\n return this.scale;\n }\n /**\n * Sets the grid scale.\n *\n * @deprecated Use scale instead.\n * @param {Number} value - The new grid scale.\n */\n setScale(value) {\n this.scale = value;\n }\n /**\n * The line width.\n *\n * @type {Number}\n */\n get lineWidth() {\n return this.l;\n }\n set lineWidth(value) {\n this.l = value;\n this.setSize(this.resolution.width, this.resolution.height);\n }\n /**\n * Returns the current grid line width.\n *\n * @deprecated Use lineWidth instead.\n * @return {Number} The grid line width.\n */\n getLineWidth() {\n return this.lineWidth;\n }\n /**\n * Sets the grid line width.\n *\n * @deprecated Use lineWidth instead.\n * @param {Number} value - The new grid line width.\n */\n setLineWidth(value) {\n this.lineWidth = value;\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.resolution.set(width, height);\n const aspect = width / height;\n const scale = this.scale * (height * 0.125);\n this.uniforms.get(\"scale\").value.set(aspect * scale, scale);\n this.uniforms.get(\"lineWidth\").value = scale / height + this.lineWidth;\n }\n};\n\n// src/effects/HueSaturationEffect.js\nimport { Uniform as Uniform24, Vector3 as Vector32 } from \"three\";\n\n// src/effects/glsl/hue-saturation.frag\nvar hue_saturation_default = `uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}`;\n\n// src/effects/HueSaturationEffect.js\nvar HueSaturationEffect = class extends Effect {\n /**\n * Constructs a new hue/saturation effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n * @param {Number} [options.hue=0.0] - The hue in radians.\n * @param {Number} [options.saturation=0.0] - The saturation factor, ranging from -1 to 1, where 0 means no change.\n */\n constructor({ blendFunction = BlendFunction.SRC, hue = 0, saturation = 0 } = {}) {\n super(\"HueSaturationEffect\", hue_saturation_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"hue\", new Uniform24(new Vector32())],\n [\"saturation\", new Uniform24(saturation)]\n ])\n });\n this.hue = hue;\n }\n /**\n * The saturation.\n *\n * @type {Number}\n */\n get saturation() {\n return this.uniforms.get(\"saturation\").value;\n }\n set saturation(value) {\n this.uniforms.get(\"saturation\").value = value;\n }\n /**\n * Returns the saturation.\n *\n * @deprecated Use saturation instead.\n * @return {Number} The saturation.\n */\n getSaturation() {\n return this.saturation;\n }\n /**\n * Sets the saturation.\n *\n * @deprecated Use saturation instead.\n * @param {Number} value - The saturation.\n */\n setSaturation(value) {\n this.saturation = value;\n }\n /**\n * The hue.\n *\n * @type {Number}\n */\n get hue() {\n const hue = this.uniforms.get(\"hue\").value;\n return Math.acos((hue.x * 3 - 1) / 2);\n }\n set hue(value) {\n const s = Math.sin(value), c2 = Math.cos(value);\n this.uniforms.get(\"hue\").value.set(\n (2 * c2 + 1) / 3,\n (-Math.sqrt(3) * s - c2 + 1) / 3,\n (Math.sqrt(3) * s - c2 + 1) / 3\n );\n }\n /**\n * Returns the hue.\n *\n * @deprecated Use hue instead.\n * @return {Number} The hue in radians.\n */\n getHue() {\n return this.hue;\n }\n /**\n * Sets the hue.\n *\n * @deprecated Use hue instead.\n * @param {Number} value - The hue in radians.\n */\n setHue(value) {\n this.hue = value;\n }\n};\n\n// src/effects/LensDistortionEffect.js\nimport { Uniform as Uniform25, Vector2 as Vector214 } from \"three\";\n\n// src/effects/glsl/lens-distortion.frag\nvar lens_distortion_default = `uniform vec2 distortion;uniform vec2 principalPoint;uniform vec2 focalLength;uniform float skew;float mask(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void mainUv(inout vec2 uv){vec2 xn=2.0*(uv.st-0.5);vec3 xDistorted=vec3((1.0+distortion*dot(xn,xn))*xn,1.0);mat3 kk=mat3(vec3(focalLength.x,0.0,0.0),vec3(skew*focalLength.x,focalLength.y,0.0),vec3(principalPoint.x,principalPoint.y,1.0));uv=(kk*xDistorted).xy*0.5+0.5;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=mask(uv)*inputColor;}`;\n\n// src/effects/LensDistortionEffect.js\nvar LensDistortionEffect = class extends Effect {\n /**\n * Constructs a new lens distortion effect.\n *\n * @param {Object} [options] - The options.\n * @param {Vector2} [options.distortion] - The distortion value.\n * @param {Vector2} [options.principalPoint] - The center point.\n * @param {Vector2} [options.focalLength] - The focal length.\n * @param {Number} [options.skew=0] - The skew value.\n */\n constructor({\n distortion = new Vector214(0, 0),\n principalPoint = new Vector214(0, 0),\n focalLength = new Vector214(1, 1),\n skew = 0\n } = {}) {\n super(\"LensDistortionEffect\", lens_distortion_default, {\n uniforms: /* @__PURE__ */ new Map([\n [\"distortion\", new Uniform25(distortion)],\n [\"principalPoint\", new Uniform25(principalPoint)],\n [\"focalLength\", new Uniform25(focalLength)],\n [\"skew\", new Uniform25(skew)]\n ])\n });\n }\n /**\n * The radial distortion coefficients. Default is (0, 0).\n *\n * @type {Vector2}\n */\n get distortion() {\n return this.uniforms.get(\"distortion\").value;\n }\n set distortion(value) {\n this.uniforms.get(\"distortion\").value = value;\n }\n /**\n * The principal point. Default is (0, 0).\n *\n * @type {Vector2}\n */\n get principalPoint() {\n return this.uniforms.get(\"principalPoint\").value;\n }\n set principalPoint(value) {\n this.uniforms.get(\"principalPoint\").value = value;\n }\n /**\n * The focal length. Default is (1, 1).\n *\n * @type {Vector2}\n */\n get focalLength() {\n return this.uniforms.get(\"focalLength\").value;\n }\n set focalLength(value) {\n this.uniforms.get(\"focalLength\").value = value;\n }\n /**\n * The skew factor in radians.\n *\n * @type {Number}\n */\n get skew() {\n return this.uniforms.get(\"skew\").value;\n }\n set skew(value) {\n this.uniforms.get(\"skew\").value = value;\n }\n};\n\n// src/effects/LUT1DEffect.js\nimport { FloatType, HalfFloatType, Uniform as Uniform26 } from \"three\";\n\n// src/effects/glsl/lut-1d.frag\nvar lut_1d_default = `#ifdef LUT_PRECISION_HIGH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D lut;\n#else\nuniform mediump sampler2D lut;\n#endif\n#else\nuniform lowp sampler2D lut;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(texture2D(lut,vec2(inputColor.r,0.5)).r,texture2D(lut,vec2(inputColor.g,0.5)).r,texture2D(lut,vec2(inputColor.b,0.5)).r,inputColor.a);}`;\n\n// src/effects/LUT1DEffect.js\nvar LUT1DEffect = class extends Effect {\n /**\n * Constructs a new color grading effect.\n *\n * @param {Texture} lut - The lookup texture.\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n */\n constructor(lut, { blendFunction = BlendFunction.SRC } = {}) {\n super(\"LUT1DEffect\", lut_1d_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([[\"lut\", new Uniform26(null)]])\n });\n this.lut = lut;\n }\n /**\n * The LUT.\n *\n * @type {Texture}\n */\n get lut() {\n return this.uniforms.get(\"lut\").value;\n }\n set lut(value) {\n this.uniforms.get(\"lut\").value = value;\n if (value !== null && (value.type === FloatType || value.type === HalfFloatType)) {\n this.defines.set(\"LUT_PRECISION_HIGH\", \"1\");\n }\n }\n};\n\n// src/effects/LUT3DEffect.js\nimport {\n Data3DTexture as Data3DTexture2,\n FloatType as FloatType3,\n HalfFloatType as HalfFloatType2,\n LinearFilter as LinearFilter4,\n NearestFilter as NearestFilter2,\n SRGBColorSpace as SRGBColorSpace10,\n Uniform as Uniform27,\n Vector3 as Vector34\n} from \"three\";\n\n// src/textures/lut/LookupTexture.js\nimport {\n Color as Color4,\n ClampToEdgeWrapping,\n DataTexture as DataTexture2,\n Data3DTexture,\n FloatType as FloatType2,\n LinearFilter as LinearFilter3,\n LinearSRGBColorSpace as LinearSRGBColorSpace3,\n RGBAFormat as RGBAFormat3,\n SRGBColorSpace as SRGBColorSpace9,\n UnsignedByteType as UnsignedByteType10,\n Vector3 as Vector33\n} from \"three\";\n\n// src/enums/LUTOperation.js\nvar LUTOperation = {\n SCALE_UP: \"lut.scaleup\"\n};\n\n// src/textures/RawImageData.js\nfunction createCanvas(width, height, data) {\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n canvas.width = width;\n canvas.height = height;\n if (data instanceof Image) {\n context.drawImage(data, 0, 0);\n } else {\n const imageData = context.createImageData(width, height);\n imageData.data.set(data);\n context.putImageData(imageData, 0, 0);\n }\n return canvas;\n}\nvar RawImageData = class _RawImageData {\n /**\n * Constructs a new image data container.\n *\n * @param {Number} [width=0] - The width of the image.\n * @param {Number} [height=0] - The height of the image.\n * @param {Uint8ClampedArray} [data=null] - The image data.\n */\n constructor(width = 0, height = 0, data = null) {\n this.width = width;\n this.height = height;\n this.data = data;\n }\n /**\n * Creates a canvas from this image data.\n *\n * @return {Canvas} The canvas, or null if it couldn't be created.\n */\n toCanvas() {\n return typeof document === \"undefined\" ? null : createCanvas(this.width, this.height, this.data);\n }\n /**\n * Creates a new image data container.\n *\n * @param {ImageData|Image} image - An image or plain image data.\n * @return {RawImageData} The image data.\n */\n static from(image) {\n const { width, height } = image;\n let data;\n if (image instanceof Image) {\n const canvas = createCanvas(width, height, image);\n if (canvas !== null) {\n const context = canvas.getContext(\"2d\");\n data = context.getImageData(0, 0, width, height).data;\n }\n } else {\n data = image.data;\n }\n return new _RawImageData(width, height, data);\n }\n};\n\n// temp/lut/worker.txt\nvar worker_default = '\"use strict\";(()=>{var O={SCALE_UP:\"lut.scaleup\"};var _=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function d(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function V(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function k(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)V(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=_[0];P[0]=s,P[1]=F,P[2]=f;let o=_[1],L=x-w,S=u-c,U=b-l;o[0]=L*M[0]+w,o[1]=S*M[1]+c,o[2]=U*M[2]+l,V(a,t,o[0],o[1],o[2],n[0]),o[0]=L*g[0]+w,o[1]=S*g[1]+c,o[2]=U*g[2]+l,V(a,t,o[0],o[1],o[2],n[1]),o[0]=L*X[0]+w,o[1]=S*X[1]+c,o[2]=U*X[2]+l,V(a,t,o[0],o[1],o[2],n[2]),o[0]=L*Y[0]+w,o[1]=S*Y[1]+c,o[2]=U*Y[2]+l,V(a,t,o[0],o[1],o[2],n[3]);let T=d(g,X,Y,P)*6,q=d(M,X,Y,P)*6,C=d(M,g,Y,P)*6,E=d(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=q,n[1][1]*=q,n[1][2]*=q,n[2][0]*=C,n[2][1]*=C,n[2][2]*=C,n[3][0]*=E,n[3][1]*=E,n[3][2]*=E,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var v=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(r**3*4),y=t instanceof Uint8Array?255:1,h=r**2,A=1/(r-1);for(let w=0;w{let t=a.data,r=t.data;switch(t.operation){case O.SCALE_UP:r=v.expand(r,t.size);break}postMessage(r,[r.buffer]),close()});})();\\n';\n\n// src/textures/lut/LookupTexture.js\nvar c = /* @__PURE__ */ new Color4();\nvar LookupTexture = class _LookupTexture extends Data3DTexture {\n /**\n * Constructs a cubic 3D lookup texture.\n *\n * @param {TypedArray} data - The pixel data. The default format is RGBA.\n * @param {Number} size - The sidelength.\n */\n constructor(data, size) {\n super(data, size, size, size);\n this.type = FloatType2;\n this.format = RGBAFormat3;\n this.minFilter = LinearFilter3;\n this.magFilter = LinearFilter3;\n this.wrapS = ClampToEdgeWrapping;\n this.wrapT = ClampToEdgeWrapping;\n this.wrapR = ClampToEdgeWrapping;\n this.unpackAlignment = 1;\n this.needsUpdate = true;\n this.colorSpace = LinearSRGBColorSpace3;\n this.domainMin = new Vector33(0, 0, 0);\n this.domainMax = new Vector33(1, 1, 1);\n }\n /**\n * Indicates that this is an instance of LookupTexture3D.\n *\n * @type {Boolean}\n * @deprecated\n */\n get isLookupTexture3D() {\n return true;\n }\n /**\n * Scales this LUT up to a given target size using tetrahedral interpolation.\n *\n * @param {Number} size - The target sidelength.\n * @param {Boolean} [transferData=true] - Extra fast mode. Set to false to keep the original data intact.\n * @return {Promise} A promise that resolves with a new LUT upon completion.\n */\n scaleUp(size, transferData = true) {\n const image = this.image;\n let promise;\n if (size <= image.width) {\n promise = Promise.reject(new Error(\"The target size must be greater than the current size\"));\n } else {\n promise = new Promise((resolve, reject) => {\n const workerURL = URL.createObjectURL(new Blob([worker_default], {\n type: \"text/javascript\"\n }));\n const worker = new Worker(workerURL);\n worker.addEventListener(\"error\", (event) => reject(event.error));\n worker.addEventListener(\"message\", (event) => {\n const lut = new _LookupTexture(event.data, size);\n this.colorSpace = lut.colorSpace;\n lut.type = this.type;\n lut.name = this.name;\n URL.revokeObjectURL(workerURL);\n resolve(lut);\n });\n const transferList = transferData ? [image.data.buffer] : [];\n worker.postMessage({\n operation: LUTOperation.SCALE_UP,\n data: image.data,\n size\n }, transferList);\n });\n }\n return promise;\n }\n /**\n * Applies the given LUT to this one.\n *\n * @param {LookupTexture} lut - A LUT. Must have the same dimensions, type and format as this LUT.\n * @return {LookupTexture} This texture.\n */\n applyLUT(lut) {\n const img0 = this.image;\n const img1 = lut.image;\n const size0 = Math.min(img0.width, img0.height, img0.depth);\n const size1 = Math.min(img1.width, img1.height, img1.depth);\n if (size0 !== size1) {\n console.error(\"Size mismatch\");\n } else if (lut.type !== FloatType2 || this.type !== FloatType2) {\n console.error(\"Both LUTs must be FloatType textures\");\n } else if (lut.format !== RGBAFormat3 || this.format !== RGBAFormat3) {\n console.error(\"Both LUTs must be RGBA textures\");\n } else {\n const data0 = img0.data;\n const data1 = img1.data;\n const size = size0;\n const sizeSq = size ** 2;\n const s = size - 1;\n for (let i = 0, l = size ** 3; i < l; ++i) {\n const i4 = i * 4;\n const r = data0[i4 + 0] * s;\n const g = data0[i4 + 1] * s;\n const b = data0[i4 + 2] * s;\n const iRGB = Math.round(r + g * size + b * sizeSq) * 4;\n data0[i4 + 0] = data1[iRGB + 0];\n data0[i4 + 1] = data1[iRGB + 1];\n data0[i4 + 2] = data1[iRGB + 2];\n }\n this.needsUpdate = true;\n }\n return this;\n }\n /**\n * Converts the LUT data into unsigned byte data.\n *\n * This is a lossy operation which should only be performed after all other transformations have been applied.\n *\n * @return {LookupTexture} This texture.\n */\n convertToUint8() {\n if (this.type === FloatType2) {\n const floatData = this.image.data;\n const uint8Data = new Uint8Array(floatData.length);\n for (let i = 0, l = floatData.length; i < l; ++i) {\n uint8Data[i] = floatData[i] * 255 + 0.5;\n }\n this.image.data = uint8Data;\n this.type = UnsignedByteType10;\n this.needsUpdate = true;\n }\n return this;\n }\n /**\n * Converts the LUT data into float data.\n *\n * @return {LookupTexture} This texture.\n */\n convertToFloat() {\n if (this.type === UnsignedByteType10) {\n const uint8Data = this.image.data;\n const floatData = new Float32Array(uint8Data.length);\n for (let i = 0, l = uint8Data.length; i < l; ++i) {\n floatData[i] = uint8Data[i] / 255;\n }\n this.image.data = floatData;\n this.type = FloatType2;\n this.needsUpdate = true;\n }\n return this;\n }\n /**\n * Converts this LUT into RGBA data.\n *\n * @deprecated LUTs are RGBA by default since three r137.\n * @return {LookupTexture} This texture.\n */\n convertToRGBA() {\n console.warn(\"LookupTexture\", \"convertToRGBA() is deprecated, LUTs are now RGBA by default\");\n return this;\n }\n /**\n * Converts the output of this LUT into sRGB color space.\n *\n * @return {LookupTexture} This texture.\n */\n convertLinearToSRGB() {\n const data = this.image.data;\n if (this.type === FloatType2) {\n for (let i = 0, l = data.length; i < l; i += 4) {\n c.fromArray(data, i).convertLinearToSRGB().toArray(data, i);\n }\n this.colorSpace = SRGBColorSpace9;\n this.needsUpdate = true;\n } else {\n console.error(\"Color space conversion requires FloatType data\");\n }\n return this;\n }\n /**\n * Converts the output of this LUT into linear color space.\n *\n * @return {LookupTexture} This texture.\n */\n convertSRGBToLinear() {\n const data = this.image.data;\n if (this.type === FloatType2) {\n for (let i = 0, l = data.length; i < l; i += 4) {\n c.fromArray(data, i).convertSRGBToLinear().toArray(data, i);\n }\n this.colorSpace = LinearSRGBColorSpace3;\n this.needsUpdate = true;\n } else {\n console.error(\"Color space conversion requires FloatType data\");\n }\n return this;\n }\n /**\n * Converts this LUT into a 2D data texture.\n *\n * Please note that custom input domains are not carried over to 2D textures.\n *\n * @return {DataTexture} The texture.\n */\n toDataTexture() {\n const width = this.image.width;\n const height = this.image.height * this.image.depth;\n const texture = new DataTexture2(this.image.data, width, height);\n texture.name = this.name;\n texture.type = this.type;\n texture.format = this.format;\n texture.minFilter = LinearFilter3;\n texture.magFilter = LinearFilter3;\n texture.wrapS = this.wrapS;\n texture.wrapT = this.wrapT;\n texture.generateMipmaps = false;\n texture.needsUpdate = true;\n this.colorSpace = texture.colorSpace;\n return texture;\n }\n /**\n * Creates a new 3D LUT by copying a given LUT.\n *\n * Common image-based textures will be converted into 3D data textures.\n *\n * @param {Texture} texture - The LUT. Assumed to be cubic.\n * @return {LookupTexture} A new 3D LUT.\n */\n static from(texture) {\n const image = texture.image;\n const { width, height } = image;\n const size = Math.min(width, height);\n let data;\n if (image instanceof Image) {\n const rawImageData = RawImageData.from(image);\n const src = rawImageData.data;\n if (width > height) {\n data = new Uint8Array(src.length);\n for (let z = 0; z < size; ++z) {\n for (let y = 0; y < size; ++y) {\n for (let x = 0; x < size; ++x) {\n const i4 = (x + z * size + y * size * size) * 4;\n const j4 = (x + y * size + z * size * size) * 4;\n data[j4 + 0] = src[i4 + 0];\n data[j4 + 1] = src[i4 + 1];\n data[j4 + 2] = src[i4 + 2];\n data[j4 + 3] = src[i4 + 3];\n }\n }\n }\n } else {\n data = new Uint8Array(src.buffer);\n }\n } else {\n data = image.data.slice();\n }\n const lut = new _LookupTexture(data, size);\n lut.type = texture.type;\n lut.name = texture.name;\n texture.colorSpace = lut.colorSpace;\n return lut;\n }\n /**\n * Creates a neutral 3D LUT.\n *\n * @param {Number} size - The sidelength.\n * @return {LookupTexture} A neutral 3D LUT.\n */\n static createNeutral(size) {\n const data = new Float32Array(size ** 3 * 4);\n const sizeSq = size ** 2;\n const s = 1 / (size - 1);\n for (let r = 0; r < size; ++r) {\n for (let g = 0; g < size; ++g) {\n for (let b = 0; b < size; ++b) {\n const i4 = (r + g * size + b * sizeSq) * 4;\n data[i4 + 0] = r * s;\n data[i4 + 1] = g * s;\n data[i4 + 2] = b * s;\n data[i4 + 3] = 1;\n }\n }\n }\n const lut = new _LookupTexture(data, size);\n lut.name = \"neutral\";\n return lut;\n }\n};\n\n// src/effects/glsl/lut-3d.frag\nvar lut_3d_default = `uniform vec3 scale;uniform vec3 offset;\n#ifdef CUSTOM_INPUT_DOMAIN\nuniform vec3 domainMin;uniform vec3 domainMax;\n#endif\n#ifdef LUT_3D\n#ifdef LUT_PRECISION_HIGH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler3D lut;\n#else\nuniform mediump sampler3D lut;\n#endif\n#else\nuniform lowp sampler3D lut;\n#endif\nvec4 applyLUT(const in vec3 rgb){\n#ifdef TETRAHEDRAL_INTERPOLATION\nvec3 p=floor(rgb);vec3 f=rgb-p;vec3 v1=(p+0.5)*LUT_TEXEL_WIDTH;vec3 v4=(p+1.5)*LUT_TEXEL_WIDTH;vec3 v2,v3;vec3 frac;if(f.r>=f.g){if(f.g>f.b){frac=f.rgb;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else if(f.r>=f.b){frac=f.rbg;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v1.y,v4.z);}else{frac=f.brg;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v4.x,v1.y,v4.z);}}else{if(f.b>f.g){frac=f.bgr;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v1.x,v4.y,v4.z);}else if(f.r>=f.b){frac=f.grb;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else{frac=f.gbr;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v1.x,v4.y,v4.z);}}vec4 n1=texture(lut,v1);vec4 n2=texture(lut,v2);vec4 n3=texture(lut,v3);vec4 n4=texture(lut,v4);vec4 weights=vec4(1.0-frac.x,frac.x-frac.y,frac.y-frac.z,frac.z);vec4 result=weights*mat4(vec4(n1.r,n2.r,n3.r,n4.r),vec4(n1.g,n2.g,n3.g,n4.g),vec4(n1.b,n2.b,n3.b,n4.b),vec4(1.0));return vec4(result.rgb,1.0);\n#else\nreturn texture(lut,rgb);\n#endif\n}\n#else\n#ifdef LUT_PRECISION_HIGH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D lut;\n#else\nuniform mediump sampler2D lut;\n#endif\n#else\nuniform lowp sampler2D lut;\n#endif\nvec4 applyLUT(const in vec3 rgb){float slice=rgb.b*LUT_SIZE;float slice0=floor(slice);float interp=slice-slice0;float centeredInterp=interp-0.5;float slice1=slice0+sign(centeredInterp);\n#ifdef LUT_STRIP_HORIZONTAL\nfloat xOffset=clamp(rgb.r*LUT_TEXEL_HEIGHT,LUT_TEXEL_WIDTH*0.5,LUT_TEXEL_HEIGHT-LUT_TEXEL_WIDTH*0.5);vec2 uv0=vec2(slice0*LUT_TEXEL_HEIGHT+xOffset,rgb.g);vec2 uv1=vec2(slice1*LUT_TEXEL_HEIGHT+xOffset,rgb.g);\n#else\nfloat yOffset=clamp(rgb.g*LUT_TEXEL_WIDTH,LUT_TEXEL_HEIGHT*0.5,LUT_TEXEL_WIDTH-LUT_TEXEL_HEIGHT*0.5);vec2 uv0=vec2(rgb.r,slice0*LUT_TEXEL_WIDTH+yOffset);vec2 uv1=vec2(rgb.r,slice1*LUT_TEXEL_WIDTH+yOffset);\n#endif\nvec4 sample0=texture2D(lut,uv0);vec4 sample1=texture2D(lut,uv1);return mix(sample0,sample1,abs(centeredInterp));}\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 c=inputColor.rgb;\n#ifdef CUSTOM_INPUT_DOMAIN\nif(c.r>=domainMin.r&&c.g>=domainMin.g&&c.b>=domainMin.b&&c.r<=domainMax.r&&c.g<=domainMax.g&&c.b<=domainMax.b){c=applyLUT(scale*c+offset).rgb;}else{c=inputColor.rgb;}\n#else\n#if !defined(LUT_3D) || defined(TETRAHEDRAL_INTERPOLATION)\nc=clamp(c,0.0,1.0);\n#endif\nc=applyLUT(scale*c+offset).rgb;\n#endif\noutputColor=vec4(c,inputColor.a);}`;\n\n// src/effects/LUT3DEffect.js\nvar LUT3DEffect = class extends Effect {\n /**\n * Constructs a new color grading effect.\n *\n * @param {Texture} lut - The lookup texture.\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n * @param {Boolean} [options.tetrahedralInterpolation=false] - Enables or disables tetrahedral interpolation.\n * @param {ColorSpace} [options.inputColorSpace=SRGBColorSpace] - The input color space.\n */\n constructor(lut, {\n blendFunction = BlendFunction.SRC,\n tetrahedralInterpolation = false,\n inputColorSpace = SRGBColorSpace10\n } = {}) {\n super(\"LUT3DEffect\", lut_3d_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"lut\", new Uniform27(null)],\n [\"scale\", new Uniform27(new Vector34())],\n [\"offset\", new Uniform27(new Vector34())],\n [\"domainMin\", new Uniform27(null)],\n [\"domainMax\", new Uniform27(null)]\n ])\n });\n this.tetrahedralInterpolation = tetrahedralInterpolation;\n this.inputColorSpace = inputColorSpace;\n this.lut = lut;\n }\n /**\n * The LUT.\n *\n * @type {Texture}\n */\n get lut() {\n return this.uniforms.get(\"lut\").value;\n }\n set lut(value) {\n const defines = this.defines;\n const uniforms = this.uniforms;\n if (this.lut !== value) {\n uniforms.get(\"lut\").value = value;\n if (value !== null) {\n const image = value.image;\n const tetrahedralInterpolation = this.tetrahedralInterpolation;\n defines.clear();\n defines.set(\"LUT_SIZE\", Math.min(image.width, image.height).toFixed(16));\n defines.set(\"LUT_TEXEL_WIDTH\", (1 / image.width).toFixed(16));\n defines.set(\"LUT_TEXEL_HEIGHT\", (1 / image.height).toFixed(16));\n uniforms.get(\"domainMin\").value = null;\n uniforms.get(\"domainMax\").value = null;\n if (value.type === FloatType3 || value.type === HalfFloatType2) {\n defines.set(\"LUT_PRECISION_HIGH\", \"1\");\n }\n if (image.width > image.height) {\n defines.set(\"LUT_STRIP_HORIZONTAL\", \"1\");\n } else if (value instanceof Data3DTexture2) {\n defines.set(\"LUT_3D\", \"1\");\n }\n if (value instanceof LookupTexture) {\n const min = value.domainMin;\n const max = value.domainMax;\n if (min.x !== 0 || min.y !== 0 || min.z !== 0 || max.x !== 1 || max.y !== 1 || max.z !== 1) {\n defines.set(\"CUSTOM_INPUT_DOMAIN\", \"1\");\n uniforms.get(\"domainMin\").value = min.clone();\n uniforms.get(\"domainMax\").value = max.clone();\n }\n }\n this.tetrahedralInterpolation = tetrahedralInterpolation;\n }\n }\n }\n /**\n * Returns the current LUT.\n *\n * @deprecated Use lut instead.\n * @return {Texture} The LUT.\n */\n getLUT() {\n return this.lut;\n }\n /**\n * Sets the LUT.\n *\n * @deprecated Use lut instead.\n * @param {Texture} value - The LUT.\n */\n setLUT(value) {\n this.lut = value;\n }\n /**\n * Updates the scale and offset for the LUT sampling coordinates.\n *\n * @private\n */\n updateScaleOffset() {\n const lut = this.lut;\n if (lut !== null) {\n const size = Math.min(lut.image.width, lut.image.height);\n const scale = this.uniforms.get(\"scale\").value;\n const offset = this.uniforms.get(\"offset\").value;\n if (this.tetrahedralInterpolation && lut instanceof Data3DTexture2) {\n if (this.defines.has(\"CUSTOM_INPUT_DOMAIN\")) {\n const domainScale = lut.domainMax.clone().sub(lut.domainMin);\n scale.setScalar(size - 1).divide(domainScale);\n offset.copy(lut.domainMin).negate().multiply(scale);\n } else {\n scale.setScalar(size - 1);\n offset.setScalar(0);\n }\n } else {\n if (this.defines.has(\"CUSTOM_INPUT_DOMAIN\")) {\n const domainScale = lut.domainMax.clone().sub(lut.domainMin).multiplyScalar(size);\n scale.setScalar(size - 1).divide(domainScale);\n offset.copy(lut.domainMin).negate().multiply(scale).addScalar(1 / (2 * size));\n } else {\n scale.setScalar((size - 1) / size);\n offset.setScalar(1 / (2 * size));\n }\n }\n }\n }\n /**\n * Configures parameters for tetrahedral interpolation.\n *\n * @private\n */\n configureTetrahedralInterpolation() {\n const lut = this.lut;\n if (lut !== null) {\n lut.minFilter = LinearFilter4;\n lut.magFilter = LinearFilter4;\n if (this.tetrahedralInterpolation) {\n if (lut instanceof Data3DTexture2) {\n lut.minFilter = NearestFilter2;\n lut.magFilter = NearestFilter2;\n } else {\n console.warn(\"Tetrahedral interpolation requires a 3D texture\");\n }\n }\n lut.needsUpdate = true;\n }\n }\n /**\n * Indicates whether tetrahedral interpolation is enabled. Requires a 3D LUT, disabled by default.\n *\n * Tetrahedral interpolation produces highly accurate results but is slower than hardware interpolation.\n *\n * @type {Boolean}\n */\n get tetrahedralInterpolation() {\n return this.defines.has(\"TETRAHEDRAL_INTERPOLATION\");\n }\n set tetrahedralInterpolation(value) {\n if (value) {\n this.defines.set(\"TETRAHEDRAL_INTERPOLATION\", \"1\");\n } else {\n this.defines.delete(\"TETRAHEDRAL_INTERPOLATION\");\n }\n this.configureTetrahedralInterpolation();\n this.updateScaleOffset();\n this.setChanged();\n }\n /**\n * Enables or disables tetrahedral interpolation.\n *\n * @deprecated Use tetrahedralInterpolation instead.\n * @param {Boolean} value - Whether tetrahedral interpolation should be enabled.\n */\n setTetrahedralInterpolationEnabled(value) {\n this.tetrahedralInterpolation = value;\n }\n};\n\n// src/enums/DepthCopyMode.js\nvar DepthCopyMode = {\n FULL: 0,\n SINGLE: 1\n};\n\n// src/enums/EdgeDetectionMode.js\nvar EdgeDetectionMode = {\n DEPTH: 0,\n LUMA: 1,\n COLOR: 2\n};\n\n// src/enums/PredicationMode.js\nvar PredicationMode = {\n DISABLED: 0,\n DEPTH: 1,\n CUSTOM: 2\n};\n\n// src/enums/SMAAPreset.js\nvar SMAAPreset = {\n LOW: 0,\n MEDIUM: 1,\n HIGH: 2,\n ULTRA: 3\n};\n\n// src/enums/ToneMappingMode.js\nvar ToneMappingMode = {\n LINEAR: 0,\n REINHARD: 1,\n REINHARD2: 2,\n REINHARD2_ADAPTIVE: 3,\n UNCHARTED2: 4,\n OPTIMIZED_CINEON: 5,\n CINEON: 5,\n ACES_FILMIC: 6,\n AGX: 7,\n NEUTRAL: 8\n};\n\n// src/enums/VignetteTechnique.js\nvar VignetteTechnique = {\n DEFAULT: 0,\n ESKIL: 1\n};\n\n// src/enums/WebGLExtension.js\nvar WebGLExtension = {\n DERIVATIVES: \"derivatives\",\n FRAG_DEPTH: \"fragDepth\",\n DRAW_BUFFERS: \"drawBuffers\",\n SHADER_TEXTURE_LOD: \"shaderTextureLOD\"\n};\n\n// src/effects/glsl/noise.frag\nvar noise_default = `void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*(1.0+time)));\n#ifdef PREMULTIPLY\noutputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a);\n#else\noutputColor=vec4(noise,inputColor.a);\n#endif\n}`;\n\n// src/effects/NoiseEffect.js\nvar NoiseEffect = class extends Effect {\n /**\n * Constructs a new noise effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function of this effect.\n * @param {Boolean} [options.premultiply=false] - Whether the noise should be multiplied with the input colors prior to blending.\n */\n constructor({ blendFunction = BlendFunction.SCREEN, premultiply = false } = {}) {\n super(\"NoiseEffect\", noise_default, { blendFunction });\n this.premultiply = premultiply;\n }\n /**\n * Indicates whether noise will be multiplied with the input colors prior to blending.\n *\n * @type {Boolean}\n */\n get premultiply() {\n return this.defines.has(\"PREMULTIPLY\");\n }\n set premultiply(value) {\n if (this.premultiply !== value) {\n if (value) {\n this.defines.set(\"PREMULTIPLY\", \"1\");\n } else {\n this.defines.delete(\"PREMULTIPLY\");\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether noise will be multiplied with the input colors prior to blending.\n *\n * @deprecated Use premultiply instead.\n * @return {Boolean} Whether noise is premultiplied.\n */\n isPremultiplied() {\n return this.premultiply;\n }\n /**\n * Controls whether noise should be multiplied with the input colors prior to blending.\n *\n * @deprecated Use premultiply instead.\n * @param {Boolean} value - Whether noise should be premultiplied.\n */\n setPremultiplied(value) {\n this.premultiply = value;\n }\n};\n\n// src/effects/OutlineEffect.js\nimport { Color as Color6, RepeatWrapping as RepeatWrapping3, Uniform as Uniform30, UnsignedByteType as UnsignedByteType11, WebGLRenderTarget as WebGLRenderTarget12 } from \"three\";\n\n// src/materials/DepthComparisonMaterial.js\nimport { NoBlending as NoBlending11, PerspectiveCamera as PerspectiveCamera3, RGBADepthPacking, ShaderMaterial as ShaderMaterial12, Uniform as Uniform28 } from \"three\";\n\n// src/materials/glsl/depth-comparison.frag\nvar depth_comparison_default = `#include \n#include \n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float cameraNear;uniform float cameraFar;centroid varying float vViewZ;centroid varying vec4 vProjTexCoord;void main(){\n#include \nvec2 projTexCoord=(vProjTexCoord.xy/vProjTexCoord.w)*0.5+0.5;projTexCoord=clamp(projTexCoord,0.002,0.998);\n#if DEPTH_PACKING == 3201\nfloat fragCoordZ=unpackRGBAToDepth(texture2D(depthBuffer,projTexCoord));\n#else\nfloat fragCoordZ=texture2D(depthBuffer,projTexCoord).r;\n#endif\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(fragCoordZ,cameraNear,cameraFar);\n#else\nfloat viewZ=orthographicDepthToViewZ(fragCoordZ,cameraNear,cameraFar);\n#endif\nfloat depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}`;\n\n// src/materials/glsl/depth-comparison.vert\nvar depth_comparison_default2 = `#include \n#include \n#include \n#include \nvarying float vViewZ;varying vec4 vProjTexCoord;void main(){\n#include \n#include \n#include \n#include \n#include \nvViewZ=mvPosition.z;vProjTexCoord=gl_Position;\n#include \n}`;\n\n// src/materials/DepthComparisonMaterial.js\nvar DepthComparisonMaterial = class extends ShaderMaterial12 {\n /**\n * Constructs a new depth comparison material.\n *\n * @param {Texture} [depthTexture=null] - A depth texture.\n * @param {PerspectiveCamera} [camera] - A camera.\n */\n constructor(depthTexture = null, camera) {\n super({\n name: \"DepthComparisonMaterial\",\n defines: {\n DEPTH_PACKING: \"0\"\n },\n uniforms: {\n depthBuffer: new Uniform28(null),\n cameraNear: new Uniform28(0.3),\n cameraFar: new Uniform28(1e3)\n },\n blending: NoBlending11,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: depth_comparison_default,\n vertexShader: depth_comparison_default2\n });\n this.depthBuffer = depthTexture;\n this.depthPacking = RGBADepthPacking;\n this.copyCameraSettings(camera);\n }\n /**\n * The depth buffer.\n *\n * @type {Texture}\n */\n set depthBuffer(value) {\n this.uniforms.depthBuffer.value = value;\n }\n /**\n * The depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set depthPacking(value) {\n this.defines.DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the depth buffer.\n *\n * @deprecated Use depthBuffer and depthPacking instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=RGBADepthPacking] - The depth packing strategy.\n */\n setDepthBuffer(buffer, depthPacking = RGBADepthPacking) {\n this.depthBuffer = buffer;\n this.depthPacking = depthPacking;\n }\n /**\n * Copies the settings of the given camera.\n *\n * @deprecated Use copyCameraSettings instead.\n * @param {Camera} camera - A camera.\n */\n adoptCameraSettings(camera) {\n this.copyCameraSettings(camera);\n }\n /**\n * Copies the settings of the given camera.\n *\n * @param {Camera} camera - A camera.\n */\n copyCameraSettings(camera) {\n if (camera) {\n this.uniforms.cameraNear.value = camera.near;\n this.uniforms.cameraFar.value = camera.far;\n if (camera instanceof PerspectiveCamera3) {\n this.defines.PERSPECTIVE_CAMERA = \"1\";\n } else {\n delete this.defines.PERSPECTIVE_CAMERA;\n }\n this.needsUpdate = true;\n }\n }\n};\n\n// src/materials/OutlineMaterial.js\nimport { NoBlending as NoBlending12, ShaderMaterial as ShaderMaterial13, Uniform as Uniform29, Vector2 as Vector215 } from \"three\";\n\n// src/materials/glsl/outline.frag\nvar outline_default = `uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}`;\n\n// src/materials/glsl/outline.vert\nvar outline_default2 = `uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/OutlineMaterial.js\nvar OutlineMaterial = class extends ShaderMaterial13 {\n /**\n * Constructs a new outline material.\n *\n * TODO Remove texelSize param.\n * @param {Vector2} [texelSize] - The screen texel size.\n */\n constructor(texelSize = new Vector215()) {\n super({\n name: \"OutlineMaterial\",\n uniforms: {\n inputBuffer: new Uniform29(null),\n texelSize: new Uniform29(new Vector215())\n },\n blending: NoBlending12,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: outline_default,\n vertexShader: outline_default2\n });\n this.uniforms.texelSize.value.set(texelSize.x, texelSize.y);\n this.uniforms.maskTexture = this.uniforms.inputBuffer;\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the texel size.\n *\n * @deprecated Use setSize() instead.\n * @param {Number} x - The texel width.\n * @param {Number} y - The texel height.\n */\n setTexelSize(x, y) {\n this.uniforms.texelSize.value.set(x, y);\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/passes/DepthPass.js\nimport { Color as Color5, MeshDepthMaterial, NearestFilter as NearestFilter3, RGBADepthPacking as RGBADepthPacking2, WebGLRenderTarget as WebGLRenderTarget11 } from \"three\";\nvar DepthPass = class extends Pass {\n /**\n * Constructs a new depth pass.\n *\n * @param {Scene} scene - The scene to render.\n * @param {Camera} camera - The camera to use to render the scene.\n * @param {Object} [options] - The options.\n * @param {WebGLRenderTarget} [options.renderTarget] - A custom render target.\n * @param {Number} [options.resolutionScale=1.0] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n */\n constructor(scene, camera, {\n renderTarget,\n resolutionScale = 1,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"DepthPass\");\n this.needsSwap = false;\n this.renderPass = new RenderPass(scene, camera, new MeshDepthMaterial({\n depthPacking: RGBADepthPacking2\n }));\n const renderPass = this.renderPass;\n renderPass.skipShadowMapUpdate = true;\n renderPass.ignoreBackground = true;\n const clearPass = renderPass.clearPass;\n clearPass.overrideClearColor = new Color5(16777215);\n clearPass.overrideClearAlpha = 1;\n this.renderTarget = renderTarget;\n if (this.renderTarget === void 0) {\n this.renderTarget = new WebGLRenderTarget11(1, 1, {\n minFilter: NearestFilter3,\n magFilter: NearestFilter3\n });\n this.renderTarget.texture.name = \"DepthPass.Target\";\n }\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n }\n set mainScene(value) {\n this.renderPass.mainScene = value;\n }\n set mainCamera(value) {\n this.renderPass.mainCamera = value;\n }\n /**\n * The depth texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the depth texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * Returns the current resolution scale.\n *\n * @return {Number} The resolution scale.\n * @deprecated Use resolution instead.\n */\n getResolutionScale() {\n return this.resolution.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * @param {Number} scale - The new resolution scale.\n * @deprecated Use resolution instead.\n */\n setResolutionScale(scale) {\n this.resolution.scale = scale;\n }\n /**\n * Renders the scene depth.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const renderTarget = this.renderToScreen ? null : this.renderTarget;\n this.renderPass.render(renderer, renderTarget);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n this.renderTarget.setSize(resolution.width, resolution.height);\n }\n};\n\n// src/effects/glsl/outline.frag\nvar outline_default3 = `uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength;\n#ifdef USE_PATTERN\nuniform lowp sampler2D patternTexture;varying vec2 vUvPattern;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 edge=texture2D(edgeTexture,uv).rg;vec2 mask=texture2D(maskTexture,uv).rg;\n#ifndef X_RAY\nedge.y=0.0;\n#endif\nedge*=(edgeStrength*mask.x*pulse);vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;float visibilityFactor=0.0;\n#ifdef USE_PATTERN\nvec4 patternColor=texture2D(patternTexture,vUvPattern);\n#ifdef X_RAY\nfloat hiddenFactor=0.5;\n#else\nfloat hiddenFactor=0.0;\n#endif\nvisibilityFactor=(1.0-mask.y>0.0)?1.0:hiddenFactor;visibilityFactor*=(1.0-mask.x)*patternColor.a;color+=visibilityFactor*patternColor.rgb;\n#endif\nfloat alpha=max(max(edge.x,edge.y),visibilityFactor);\n#ifdef ALPHA\noutputColor=vec4(color,alpha);\n#else\noutputColor=vec4(color,max(alpha,inputColor.a));\n#endif\n}`;\n\n// src/effects/glsl/outline.vert\nvar outline_default4 = `uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}`;\n\n// src/effects/OutlineEffect.js\nvar OutlineEffect = class extends Effect {\n /**\n * Constructs a new outline effect.\n *\n * @param {Scene} scene - The main scene.\n * @param {Camera} camera - The main camera.\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SCREEN] - The blend function. Use `BlendFunction.ALPHA` for dark outlines.\n * @param {Texture} [options.patternTexture=null] - A pattern texture.\n * @param {Number} [options.patternScale=1.0] - The pattern scale.\n * @param {Number} [options.edgeStrength=1.0] - The edge strength.\n * @param {Number} [options.pulseSpeed=0.0] - The pulse speed. A value of zero disables the pulse effect.\n * @param {Number} [options.visibleEdgeColor=0xffffff] - The color of visible edges.\n * @param {Number} [options.hiddenEdgeColor=0x22090a] - The color of hidden edges.\n * @param {KernelSize} [options.kernelSize=KernelSize.VERY_SMALL] - The blur kernel size.\n * @param {Boolean} [options.blur=false] - Whether the outline should be blurred.\n * @param {Boolean} [options.xRay=true] - Whether occluded parts of selected objects should be visible.\n * @param {Number} [options.multisampling=0] - The number of samples used for multisample antialiasing. Requires WebGL 2.\n * @param {Number} [options.resolutionScale=0.5] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n */\n constructor(scene, camera, {\n blendFunction = BlendFunction.SCREEN,\n patternTexture = null,\n patternScale = 1,\n edgeStrength = 1,\n pulseSpeed = 0,\n visibleEdgeColor = 16777215,\n hiddenEdgeColor = 2230538,\n kernelSize = KernelSize.VERY_SMALL,\n blur = false,\n xRay = true,\n multisampling = 0,\n resolutionScale = 0.5,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"OutlineEffect\", outline_default3, {\n uniforms: /* @__PURE__ */ new Map([\n [\"maskTexture\", new Uniform30(null)],\n [\"edgeTexture\", new Uniform30(null)],\n [\"edgeStrength\", new Uniform30(edgeStrength)],\n [\"visibleEdgeColor\", new Uniform30(new Color6(visibleEdgeColor))],\n [\"hiddenEdgeColor\", new Uniform30(new Color6(hiddenEdgeColor))],\n [\"pulse\", new Uniform30(1)],\n [\"patternScale\", new Uniform30(patternScale)],\n [\"patternTexture\", new Uniform30(null)]\n ])\n });\n this.blendMode.addEventListener(\"change\", (event) => {\n if (this.blendMode.blendFunction === BlendFunction.ALPHA) {\n this.defines.set(\"ALPHA\", \"1\");\n } else {\n this.defines.delete(\"ALPHA\");\n }\n this.setChanged();\n });\n this.blendMode.blendFunction = blendFunction;\n this.patternTexture = patternTexture;\n this.xRay = xRay;\n this.scene = scene;\n this.camera = camera;\n this.renderTargetMask = new WebGLRenderTarget12(1, 1);\n this.renderTargetMask.samples = multisampling;\n this.renderTargetMask.texture.name = \"Outline.Mask\";\n this.uniforms.get(\"maskTexture\").value = this.renderTargetMask.texture;\n this.renderTargetOutline = new WebGLRenderTarget12(1, 1, { depthBuffer: false });\n this.renderTargetOutline.texture.name = \"Outline.Edges\";\n this.uniforms.get(\"edgeTexture\").value = this.renderTargetOutline.texture;\n this.clearPass = new ClearPass();\n this.clearPass.overrideClearColor = new Color6(0);\n this.clearPass.overrideClearAlpha = 1;\n this.depthPass = new DepthPass(scene, camera);\n this.maskPass = new RenderPass(scene, camera, new DepthComparisonMaterial(this.depthPass.texture, camera));\n const clearPass = this.maskPass.clearPass;\n clearPass.overrideClearColor = new Color6(16777215);\n clearPass.overrideClearAlpha = 1;\n this.blurPass = new KawaseBlurPass({ resolutionScale, resolutionX, resolutionY, kernelSize });\n this.blurPass.enabled = blur;\n const resolution = this.blurPass.resolution;\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n this.outlinePass = new ShaderPass(new OutlineMaterial());\n const outlineMaterial = this.outlinePass.fullscreenMaterial;\n outlineMaterial.inputBuffer = this.renderTargetMask.texture;\n this.time = 0;\n this.forceUpdate = true;\n this.selection = new Selection();\n this.pulseSpeed = pulseSpeed;\n }\n set mainScene(value) {\n this.scene = value;\n this.depthPass.mainScene = value;\n this.maskPass.mainScene = value;\n }\n set mainCamera(value) {\n this.camera = value;\n this.depthPass.mainCamera = value;\n this.maskPass.mainCamera = value;\n this.maskPass.overrideMaterial.copyCameraSettings(value);\n }\n /**\n * The resolution of this effect.\n *\n * @type {Resolution}\n */\n get resolution() {\n return this.blurPass.resolution;\n }\n /**\n * Returns the resolution.\n *\n * @return {Resizer} The resolution.\n */\n getResolution() {\n return this.blurPass.getResolution();\n }\n /**\n * The amount of MSAA samples.\n *\n * Requires WebGL 2. Set to zero to disable multisampling.\n *\n * @experimental Requires three >= r138.\n * @type {Number}\n */\n get multisampling() {\n return this.renderTargetMask.samples;\n }\n set multisampling(value) {\n this.renderTargetMask.samples = value;\n this.renderTargetMask.dispose();\n }\n /**\n * The pattern scale.\n *\n * @type {Number}\n */\n get patternScale() {\n return this.uniforms.get(\"patternScale\").value;\n }\n set patternScale(value) {\n this.uniforms.get(\"patternScale\").value = value;\n }\n /**\n * The edge strength.\n *\n * @type {Number}\n */\n get edgeStrength() {\n return this.uniforms.get(\"edgeStrength\").value;\n }\n set edgeStrength(value) {\n this.uniforms.get(\"edgeStrength\").value = value;\n }\n /**\n * The visible edge color.\n *\n * @type {Color}\n */\n get visibleEdgeColor() {\n return this.uniforms.get(\"visibleEdgeColor\").value;\n }\n set visibleEdgeColor(value) {\n this.uniforms.get(\"visibleEdgeColor\").value = value;\n }\n /**\n * The hidden edge color.\n *\n * @type {Color}\n */\n get hiddenEdgeColor() {\n return this.uniforms.get(\"hiddenEdgeColor\").value;\n }\n set hiddenEdgeColor(value) {\n this.uniforms.get(\"hiddenEdgeColor\").value = value;\n }\n /**\n * Returns the blur pass.\n *\n * @deprecated Use blurPass instead.\n * @return {KawaseBlurPass} The blur pass.\n */\n getBlurPass() {\n return this.blurPass;\n }\n /**\n * Returns the selection.\n *\n * @deprecated Use selection instead.\n * @return {Selection} The selection.\n */\n getSelection() {\n return this.selection;\n }\n /**\n * Returns the pulse speed.\n *\n * @deprecated Use pulseSpeed instead.\n * @return {Number} The speed.\n */\n getPulseSpeed() {\n return this.pulseSpeed;\n }\n /**\n * Sets the pulse speed. Set to zero to disable.\n *\n * @deprecated Use pulseSpeed instead.\n * @param {Number} value - The speed.\n */\n setPulseSpeed(value) {\n this.pulseSpeed = value;\n }\n /**\n * The current width of the internal render targets.\n *\n * @type {Number}\n * @deprecated Use resolution.width instead.\n */\n get width() {\n return this.resolution.width;\n }\n set width(value) {\n this.resolution.preferredWidth = value;\n }\n /**\n * The current height of the internal render targets.\n *\n * @type {Number}\n * @deprecated Use resolution.height instead.\n */\n get height() {\n return this.resolution.height;\n }\n set height(value) {\n this.resolution.preferredHeight = value;\n }\n /**\n * The selection layer.\n *\n * @type {Number}\n * @deprecated Use selection.layer instead.\n */\n get selectionLayer() {\n return this.selection.layer;\n }\n set selectionLayer(value) {\n this.selection.layer = value;\n }\n /**\n * Indicates whether dithering is enabled.\n *\n * @type {Boolean}\n * @deprecated\n */\n get dithering() {\n return this.blurPass.dithering;\n }\n set dithering(value) {\n this.blurPass.dithering = value;\n }\n /**\n * The blur kernel size.\n *\n * @type {KernelSize}\n * @deprecated Use blurPass.kernelSize instead.\n */\n get kernelSize() {\n return this.blurPass.kernelSize;\n }\n set kernelSize(value) {\n this.blurPass.kernelSize = value;\n }\n /**\n * Indicates whether the outlines should be blurred.\n *\n * @type {Boolean}\n * @deprecated Use blurPass.enabled instead.\n */\n get blur() {\n return this.blurPass.enabled;\n }\n set blur(value) {\n this.blurPass.enabled = value;\n }\n /**\n * Indicates whether X-ray mode is enabled.\n *\n * @type {Boolean}\n */\n get xRay() {\n return this.defines.has(\"X_RAY\");\n }\n set xRay(value) {\n if (this.xRay !== value) {\n if (value) {\n this.defines.set(\"X_RAY\", \"1\");\n } else {\n this.defines.delete(\"X_RAY\");\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether X-ray mode is enabled.\n *\n * @deprecated Use xRay instead.\n * @return {Boolean} Whether X-ray mode is enabled.\n */\n isXRayEnabled() {\n return this.xRay;\n }\n /**\n * Enables or disables X-ray outlines.\n *\n * @deprecated Use xRay instead.\n * @param {Boolean} value - Whether X-ray should be enabled.\n */\n setXRayEnabled(value) {\n this.xRay = value;\n }\n /**\n * The pattern texture. Set to `null` to disable.\n *\n * @type {Texture}\n */\n get patternTexture() {\n return this.uniforms.get(\"patternTexture\").value;\n }\n set patternTexture(value) {\n if (value !== null) {\n value.wrapS = value.wrapT = RepeatWrapping3;\n this.defines.set(\"USE_PATTERN\", \"1\");\n this.setVertexShader(outline_default4);\n } else {\n this.defines.delete(\"USE_PATTERN\");\n this.setVertexShader(null);\n }\n this.uniforms.get(\"patternTexture\").value = value;\n this.setChanged();\n }\n /**\n * Sets the pattern texture.\n *\n * @deprecated Use patternTexture instead.\n * @param {Texture} value - The new texture.\n */\n setPatternTexture(value) {\n this.patternTexture = value;\n }\n /**\n * Returns the current resolution scale.\n *\n * @return {Number} The resolution scale.\n * @deprecated Use resolution instead.\n */\n getResolutionScale() {\n return this.resolution.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * @param {Number} scale - The new resolution scale.\n * @deprecated Use resolution instead.\n */\n setResolutionScale(scale) {\n this.resolution.scale = scale;\n }\n /**\n * Clears the current selection and selects a list of objects.\n *\n * @param {Object3D[]} objects - The objects that should be outlined. This array will be copied.\n * @return {OutlinePass} This pass.\n * @deprecated Use selection.set() instead.\n */\n setSelection(objects) {\n this.selection.set(objects);\n return this;\n }\n /**\n * Clears the list of selected objects.\n *\n * @return {OutlinePass} This pass.\n * @deprecated Use selection.clear() instead.\n */\n clearSelection() {\n this.selection.clear();\n return this;\n }\n /**\n * Selects an object.\n *\n * @param {Object3D} object - The object that should be outlined.\n * @return {OutlinePass} This pass.\n * @deprecated Use selection.add() instead.\n */\n selectObject(object) {\n this.selection.add(object);\n return this;\n }\n /**\n * Deselects an object.\n *\n * @param {Object3D} object - The object that should no longer be outlined.\n * @return {OutlinePass} This pass.\n * @deprecated Use selection.delete() instead.\n */\n deselectObject(object) {\n this.selection.delete(object);\n return this;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const scene = this.scene;\n const camera = this.camera;\n const selection = this.selection;\n const uniforms = this.uniforms;\n const pulse = uniforms.get(\"pulse\");\n const background = scene.background;\n const mask = camera.layers.mask;\n if (this.forceUpdate || selection.size > 0) {\n scene.background = null;\n pulse.value = 1;\n if (this.pulseSpeed > 0) {\n pulse.value = Math.cos(this.time * this.pulseSpeed * 10) * 0.375 + 0.625;\n }\n this.time += deltaTime;\n selection.setVisible(false);\n this.depthPass.render(renderer);\n selection.setVisible(true);\n camera.layers.set(selection.layer);\n this.maskPass.render(renderer, this.renderTargetMask);\n camera.layers.mask = mask;\n scene.background = background;\n this.outlinePass.render(renderer, null, this.renderTargetOutline);\n if (this.blurPass.enabled) {\n this.blurPass.render(renderer, this.renderTargetOutline, this.renderTargetOutline);\n }\n }\n this.forceUpdate = selection.size > 0;\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.blurPass.setSize(width, height);\n this.renderTargetMask.setSize(width, height);\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.depthPass.setSize(w, h);\n this.renderTargetOutline.setSize(w, h);\n this.outlinePass.fullscreenMaterial.setSize(w, h);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.blurPass.initialize(renderer, alpha, UnsignedByteType11);\n if (frameBufferType !== void 0) {\n this.depthPass.initialize(renderer, alpha, frameBufferType);\n this.maskPass.initialize(renderer, alpha, frameBufferType);\n this.outlinePass.initialize(renderer, alpha, frameBufferType);\n }\n }\n};\n\n// src/effects/PixelationEffect.js\nimport { Uniform as Uniform31, Vector2 as Vector216, Vector4 as Vector43 } from \"three\";\n\n// src/effects/glsl/pixelation.frag\nvar pixelation_default = `uniform bool active;uniform vec4 d;void mainUv(inout vec2 uv){if(active){uv=d.xy*(floor(uv*d.zw)+0.5);}}`;\n\n// src/effects/PixelationEffect.js\nvar PixelationEffect = class extends Effect {\n /**\n * Constructs a new pixelation effect.\n *\n * @param {Object} [granularity=30.0] - The pixel granularity.\n */\n constructor(granularity = 30) {\n super(\"PixelationEffect\", pixelation_default, {\n uniforms: /* @__PURE__ */ new Map([\n [\"active\", new Uniform31(false)],\n [\"d\", new Uniform31(new Vector43())]\n ])\n });\n this.resolution = new Vector216();\n this._granularity = 0;\n this.granularity = granularity;\n }\n /**\n * The pixel granularity.\n *\n * A higher value yields coarser visuals.\n *\n * @type {Number}\n */\n get granularity() {\n return this._granularity;\n }\n set granularity(value) {\n let d = Math.floor(value);\n if (d % 2 > 0) {\n d += 1;\n }\n this._granularity = d;\n this.uniforms.get(\"active\").value = d > 0;\n this.setSize(this.resolution.width, this.resolution.height);\n }\n /**\n * Returns the pixel granularity.\n *\n * @deprecated Use granularity instead.\n * @return {Number} The granularity.\n */\n getGranularity() {\n return this.granularity;\n }\n /**\n * Sets the pixel granularity.\n *\n * @deprecated Use granularity instead.\n * @param {Number} value - The new granularity.\n */\n setGranularity(value) {\n this.granularity = value;\n }\n /**\n * Updates the granularity.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.set(width, height);\n const d = this.granularity;\n const x = d / resolution.x;\n const y = d / resolution.y;\n this.uniforms.get(\"d\").value.set(x, y, 1 / x, 1 / y);\n }\n};\n\n// src/effects/RealisticBokehEffect.js\nimport { Uniform as Uniform32, Vector4 as Vector44 } from \"three\";\n\n// src/effects/glsl/realistic-bokeh.frag\nvar realistic_bokeh_default = `uniform float focus;uniform float focalLength;uniform float fStop;uniform float maxBlur;uniform float luminanceThreshold;uniform float luminanceGain;uniform float bias;uniform float fringe;\n#ifdef MANUAL_DOF\nuniform vec4 dof;\n#endif\n#ifdef PENTAGON\nfloat pentagon(const in vec2 coords){const vec4 HS0=vec4(1.0,0.0,0.0,1.0);const vec4 HS1=vec4(0.309016994,0.951056516,0.0,1.0);const vec4 HS2=vec4(-0.809016994,0.587785252,0.0,1.0);const vec4 HS3=vec4(-0.809016994,-0.587785252,0.0,1.0);const vec4 HS4=vec4(0.309016994,-0.951056516,0.0,1.0);const vec4 HS5=vec4(0.0,0.0,1.0,1.0);const vec4 ONE=vec4(1.0);const float P_FEATHER=0.4;const float N_FEATHER=-P_FEATHER;float inOrOut=-4.0;vec4 P=vec4(coords,vec2(RINGS_FLOAT-1.3));vec4 dist=vec4(dot(P,HS0),dot(P,HS1),dot(P,HS2),dot(P,HS3));dist=smoothstep(N_FEATHER,P_FEATHER,dist);inOrOut+=dot(dist,ONE);dist.x=dot(P,HS4);dist.y=HS5.w-abs(P.z);dist=smoothstep(N_FEATHER,P_FEATHER,dist);inOrOut+=dist.x;return clamp(inOrOut,0.0,1.0);}\n#endif\nvec3 processTexel(const in vec2 coords,const in float blur){vec2 scale=texelSize*fringe*blur;vec3 c=vec3(texture2D(inputBuffer,coords+vec2(0.0,1.0)*scale).r,texture2D(inputBuffer,coords+vec2(-0.866,-0.5)*scale).g,texture2D(inputBuffer,coords+vec2(0.866,-0.5)*scale).b);float luminance=linearToRelativeLuminance(c);float threshold=max((luminance-luminanceThreshold)*luminanceGain,0.0);return c+mix(vec3(0.0),c,threshold*blur);}float gather(const in float i,const in float j,const in float ringSamples,const in vec2 uv,const in vec2 blurFactor,const in float blur,inout vec3 color){float step=PI2/ringSamples;vec2 wh=vec2(cos(j*step)*i,sin(j*step)*i);\n#ifdef PENTAGON\nfloat p=pentagon(wh);\n#else\nfloat p=1.0;\n#endif\ncolor+=processTexel(wh*blurFactor+uv,blur)*mix(1.0,i/RINGS_FLOAT,bias)*p;return mix(1.0,i/RINGS_FLOAT,bias)*p;}void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\n#ifdef MANUAL_DOF\nfloat focalPlane=linearDepth-focus;float farDoF=(focalPlane-dof.z)/dof.w;float nearDoF=(-focalPlane-dof.x)/dof.y;float blur=(focalPlane>0.0)?farDoF:nearDoF;\n#else\nconst float CIRCLE_OF_CONFUSION=0.03;float focalPlaneMM=focus*1000.0;float depthMM=linearDepth*1000.0;float focalPlane=(depthMM*focalLength)/(depthMM-focalLength);float farDoF=(focalPlaneMM*focalLength)/(focalPlaneMM-focalLength);float nearDoF=(focalPlaneMM-focalLength)/(focalPlaneMM*fStop*CIRCLE_OF_CONFUSION);float blur=abs(focalPlane-farDoF)*nearDoF;\n#endif\nconst int MAX_RING_SAMPLES=RINGS_INT*SAMPLES_INT;blur=clamp(blur,0.0,1.0);vec3 color=inputColor.rgb;if(blur>=0.05){vec2 blurFactor=blur*maxBlur*texelSize;float s=1.0;int ringSamples;for(int i=1;i<=RINGS_INT;i++){ringSamples=i*SAMPLES_INT;for(int j=0;j=ringSamples){break;}s+=gather(float(i),float(j),float(ringSamples),uv,blurFactor,blur,color);}}color/=s;}\n#ifdef SHOW_FOCUS\nfloat edge=0.002*linearDepth;float m=clamp(smoothstep(0.0,edge,blur),0.0,1.0);float e=clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);color=mix(color,vec3(1.0,0.5,0.0),(1.0-m)*0.6);color=mix(color,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);\n#endif\noutputColor=vec4(color,inputColor.a);}`;\n\n// src/effects/RealisticBokehEffect.js\nvar RealisticBokehEffect = class extends Effect {\n /**\n * Constructs a new bokeh effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.focus=1.0] - The focus distance in world units.\n * @param {Number} [options.focalLength=24.0] - The focal length of the main camera.\n * @param {Number} [options.fStop=0.9] - The ratio of the lens focal length to the diameter of the entrance pupil (aperture).\n * @param {Number} [options.luminanceThreshold=0.5] - A luminance threshold.\n * @param {Number} [options.luminanceGain=2.0] - A luminance gain factor.\n * @param {Number} [options.bias=0.5] - A blur bias.\n * @param {Number} [options.fringe=0.7] - A blur offset.\n * @param {Number} [options.maxBlur=1.0] - The maximum blur strength.\n * @param {Boolean} [options.rings=3] - The number of blur iterations.\n * @param {Boolean} [options.samples=2] - The amount of samples taken per ring.\n * @param {Boolean} [options.showFocus=false] - Whether the focal point should be highlighted. Useful for debugging.\n * @param {Boolean} [options.manualDoF=false] - Enables manual control over the depth of field.\n * @param {Boolean} [options.pentagon=false] - Enables pentagonal blur shapes. Requires a high number of rings and samples.\n */\n constructor({\n blendFunction,\n focus = 1,\n focalLength = 24,\n fStop = 0.9,\n luminanceThreshold = 0.5,\n luminanceGain = 2,\n bias = 0.5,\n fringe = 0.7,\n maxBlur = 1,\n rings = 3,\n samples = 2,\n showFocus = false,\n manualDoF = false,\n pentagon = false\n } = {}) {\n super(\"RealisticBokehEffect\", realistic_bokeh_default, {\n blendFunction,\n attributes: EffectAttribute.CONVOLUTION | EffectAttribute.DEPTH,\n uniforms: /* @__PURE__ */ new Map([\n [\"focus\", new Uniform32(focus)],\n [\"focalLength\", new Uniform32(focalLength)],\n [\"fStop\", new Uniform32(fStop)],\n [\"luminanceThreshold\", new Uniform32(luminanceThreshold)],\n [\"luminanceGain\", new Uniform32(luminanceGain)],\n [\"bias\", new Uniform32(bias)],\n [\"fringe\", new Uniform32(fringe)],\n [\"maxBlur\", new Uniform32(maxBlur)],\n [\"dof\", new Uniform32(null)]\n ])\n });\n this.rings = rings;\n this.samples = samples;\n this.showFocus = showFocus;\n this.manualDoF = manualDoF;\n this.pentagon = pentagon;\n }\n /**\n * The amount of blur iterations.\n *\n * @type {Number}\n */\n get rings() {\n return Number.parseInt(this.defines.get(\"RINGS_INT\"));\n }\n set rings(value) {\n const r = Math.floor(value);\n this.defines.set(\"RINGS_INT\", r.toFixed(0));\n this.defines.set(\"RINGS_FLOAT\", r.toFixed(1));\n this.setChanged();\n }\n /**\n * The amount of blur samples per ring.\n *\n * @type {Number}\n */\n get samples() {\n return Number.parseInt(this.defines.get(\"SAMPLES_INT\"));\n }\n set samples(value) {\n const s = Math.floor(value);\n this.defines.set(\"SAMPLES_INT\", s.toFixed(0));\n this.defines.set(\"SAMPLES_FLOAT\", s.toFixed(1));\n this.setChanged();\n }\n /**\n * Indicates whether the focal point will be highlighted.\n *\n * @type {Boolean}\n */\n get showFocus() {\n return this.defines.has(\"SHOW_FOCUS\");\n }\n set showFocus(value) {\n if (this.showFocus !== value) {\n if (value) {\n this.defines.set(\"SHOW_FOCUS\", \"1\");\n } else {\n this.defines.delete(\"SHOW_FOCUS\");\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether the Depth of Field should be calculated manually.\n *\n * If enabled, the Depth of Field can be adjusted via the `dof` uniform.\n *\n * @type {Boolean}\n */\n get manualDoF() {\n return this.defines.has(\"MANUAL_DOF\");\n }\n set manualDoF(value) {\n if (this.manualDoF !== value) {\n if (value) {\n this.defines.set(\"MANUAL_DOF\", \"1\");\n this.uniforms.get(\"dof\").value = new Vector44(0.2, 1, 0.2, 2);\n } else {\n this.defines.delete(\"MANUAL_DOF\");\n this.uniforms.get(\"dof\").value = null;\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether the blur shape should be pentagonal.\n *\n * @type {Boolean}\n */\n get pentagon() {\n return this.defines.has(\"PENTAGON\");\n }\n set pentagon(value) {\n if (this.pentagon !== value) {\n if (value) {\n this.defines.set(\"PENTAGON\", \"1\");\n } else {\n this.defines.delete(\"PENTAGON\");\n }\n this.setChanged();\n }\n }\n};\n\n// src/effects/ScanlineEffect.js\nimport { Uniform as Uniform33, Vector2 as Vector217 } from \"three\";\n\n// src/effects/glsl/scanlines.frag\nvar scanlines_default = `uniform float count;\n#ifdef SCROLL\nuniform float scrollSpeed;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float y=uv.y;\n#ifdef SCROLL\ny+=time*scrollSpeed;\n#endif\nvec2 sl=vec2(sin(y*count),cos(y*count));outputColor=vec4(sl.xyx,inputColor.a);}`;\n\n// src/effects/ScanlineEffect.js\nvar ScanlineEffect = class extends Effect {\n /**\n * Constructs a new scanline effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.OVERLAY] - The blend function of this effect.\n * @param {Number} [options.density=1.25] - The scanline density.\n * @param {Number} [options.scrollSpeed=0.0] - The scanline scroll speed.\n */\n constructor({ blendFunction = BlendFunction.OVERLAY, density = 1.25, scrollSpeed = 0 } = {}) {\n super(\"ScanlineEffect\", scanlines_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"count\", new Uniform33(0)],\n [\"scrollSpeed\", new Uniform33(0)]\n ])\n });\n this.resolution = new Vector217();\n this.d = density;\n this.scrollSpeed = scrollSpeed;\n }\n /**\n * The scanline density.\n *\n * @type {Number}\n */\n get density() {\n return this.d;\n }\n set density(value) {\n this.d = value;\n this.setSize(this.resolution.width, this.resolution.height);\n }\n /**\n * Returns the current scanline density.\n *\n * @deprecated Use density instead.\n * @return {Number} The scanline density.\n */\n getDensity() {\n return this.density;\n }\n /**\n * Sets the scanline density.\n *\n * @deprecated Use density instead.\n * @param {Number} value - The new scanline density.\n */\n setDensity(value) {\n this.density = value;\n }\n /**\n * The scanline scroll speed. Default is 0 (disabled).\n *\n * @type {Number}\n */\n get scrollSpeed() {\n return this.uniforms.get(\"scrollSpeed\").value;\n }\n set scrollSpeed(value) {\n this.uniforms.get(\"scrollSpeed\").value = value;\n if (value === 0) {\n if (this.defines.delete(\"SCROLL\")) {\n this.setChanged();\n }\n } else if (!this.defines.has(\"SCROLL\")) {\n this.defines.set(\"SCROLL\", \"1\");\n this.setChanged();\n }\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.resolution.set(width, height);\n this.uniforms.get(\"count\").value = Math.round(height * this.density);\n }\n};\n\n// src/effects/ShockWaveEffect.js\nimport { Uniform as Uniform34, Vector2 as Vector218, Vector3 as Vector35 } from \"three\";\n\n// src/effects/glsl/shock-wave.frag\nvar shock_wave_default = `uniform bool active;uniform vec2 center;uniform float waveSize;uniform float radius;uniform float maxRadius;uniform float amplitude;varying float vSize;void mainUv(inout vec2 uv){if(active){vec2 aspectCorrection=vec2(aspect,1.0);vec2 difference=uv*aspectCorrection-center*aspectCorrection;float distance=sqrt(dot(difference,difference))*vSize;if(distance>radius){if(distance HALF_PI;\n if (uActive.value) {\n uniforms.get(\"cameraDistance\").value = camera.position.distanceTo(position);\n v2.copy(position).project(camera);\n this.screenPosition.set((v2.x + 1) * 0.5, (v2.y + 1) * 0.5);\n }\n this.time += delta * this.speed;\n const radius = this.time - waveSize;\n uniforms.get(\"radius\").value = radius;\n if (radius >= (uniforms.get(\"maxRadius\").value + waveSize) * 2) {\n this.active = false;\n uActive.value = false;\n }\n }\n }\n};\n\n// src/effects/SelectiveBloomEffect.js\nimport {\n BasicDepthPacking as BasicDepthPacking7,\n Color as Color7,\n NotEqualDepth as NotEqualDepth2,\n EqualDepth as EqualDepth2,\n RGBADepthPacking as RGBADepthPacking3,\n SRGBColorSpace as SRGBColorSpace11,\n WebGLRenderTarget as WebGLRenderTarget13\n} from \"three\";\nvar SelectiveBloomEffect = class extends BloomEffect {\n /**\n * Constructs a new selective bloom effect.\n *\n * @param {Scene} scene - The main scene.\n * @param {Camera} camera - The main camera.\n * @param {Object} [options] - The options. See {@link BloomEffect} for details.\n */\n constructor(scene, camera, options) {\n super(options);\n this.setAttributes(this.getAttributes() | EffectAttribute.DEPTH);\n this.camera = camera;\n this.depthPass = new DepthPass(scene, camera);\n this.clearPass = new ClearPass(true, false, false);\n this.clearPass.overrideClearColor = new Color7(0);\n this.depthMaskPass = new ShaderPass(new DepthMaskMaterial());\n const depthMaskMaterial = this.depthMaskMaterial;\n depthMaskMaterial.copyCameraSettings(camera);\n depthMaskMaterial.depthBuffer1 = this.depthPass.texture;\n depthMaskMaterial.depthPacking1 = RGBADepthPacking3;\n depthMaskMaterial.depthMode = EqualDepth2;\n this.renderTargetMasked = new WebGLRenderTarget13(1, 1, { depthBuffer: false });\n this.renderTargetMasked.texture.name = \"Bloom.Masked\";\n this.selection = new Selection();\n this._inverted = false;\n this._ignoreBackground = false;\n }\n set mainScene(value) {\n this.depthPass.mainScene = value;\n }\n set mainCamera(value) {\n this.camera = value;\n this.depthPass.mainCamera = value;\n this.depthMaskMaterial.copyCameraSettings(value);\n }\n /**\n * Returns the selection.\n *\n * @deprecated Use selection instead.\n * @return {Selection} The selection.\n */\n getSelection() {\n return this.selection;\n }\n /**\n * The depth mask material.\n *\n * @type {DepthMaskMaterial}\n * @private\n */\n get depthMaskMaterial() {\n return this.depthMaskPass.fullscreenMaterial;\n }\n /**\n * Indicates whether the selection should be considered inverted.\n *\n * @type {Boolean}\n */\n get inverted() {\n return this._inverted;\n }\n set inverted(value) {\n this._inverted = value;\n this.depthMaskMaterial.depthMode = value ? NotEqualDepth2 : EqualDepth2;\n }\n /**\n * Indicates whether the mask is inverted.\n *\n * @deprecated Use inverted instead.\n * @return {Boolean} Whether the mask is inverted.\n */\n isInverted() {\n return this.inverted;\n }\n /**\n * Enables or disable mask inversion.\n *\n * @deprecated Use inverted instead.\n * @param {Boolean} value - Whether the mask should be inverted.\n */\n setInverted(value) {\n this.inverted = value;\n }\n /**\n * Indicates whether the background colors will be ignored.\n *\n * @type {Boolean}\n */\n get ignoreBackground() {\n return this._ignoreBackground;\n }\n set ignoreBackground(value) {\n this._ignoreBackground = value;\n this.depthMaskMaterial.maxDepthStrategy = value ? DepthTestStrategy.DISCARD_MAX_DEPTH : DepthTestStrategy.KEEP_MAX_DEPTH;\n }\n /**\n * Indicates whether the background is disabled.\n *\n * @deprecated Use ignoreBackground instead.\n * @return {Boolean} Whether the background is disabled.\n */\n isBackgroundDisabled() {\n return this.ignoreBackground;\n }\n /**\n * Enables or disables the background.\n *\n * @deprecated Use ignoreBackground instead.\n * @param {Boolean} value - Whether the background should be disabled.\n */\n setBackgroundDisabled(value) {\n this.ignoreBackground = value;\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking7) {\n this.depthMaskMaterial.depthBuffer0 = depthTexture;\n this.depthMaskMaterial.depthPacking0 = depthPacking;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const camera = this.camera;\n const selection = this.selection;\n const inverted = this.inverted;\n let renderTarget = inputBuffer;\n if (this.ignoreBackground || !inverted || selection.size > 0) {\n const mask = camera.layers.mask;\n camera.layers.set(selection.layer);\n this.depthPass.render(renderer);\n camera.layers.mask = mask;\n renderTarget = this.renderTargetMasked;\n this.clearPass.render(renderer, renderTarget);\n this.depthMaskPass.render(renderer, inputBuffer, renderTarget);\n }\n super.update(renderer, renderTarget, deltaTime);\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n super.setSize(width, height);\n this.renderTargetMasked.setSize(width, height);\n this.depthPass.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n super.initialize(renderer, alpha, frameBufferType);\n this.clearPass.initialize(renderer, alpha, frameBufferType);\n this.depthPass.initialize(renderer, alpha, frameBufferType);\n this.depthMaskPass.initialize(renderer, alpha, frameBufferType);\n if (renderer !== null && renderer.capabilities.logarithmicDepthBuffer) {\n this.depthMaskPass.fullscreenMaterial.defines.LOG_DEPTH = \"1\";\n }\n if (frameBufferType !== void 0) {\n this.renderTargetMasked.texture.type = frameBufferType;\n if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace11) {\n this.renderTargetMasked.texture.colorSpace = SRGBColorSpace11;\n }\n }\n }\n};\n\n// src/effects/SepiaEffect.js\nimport { Uniform as Uniform35, Vector3 as Vector36 } from \"three\";\n\n// src/effects/glsl/sepia.frag\nvar sepia_default = `uniform vec3 weightsR;uniform vec3 weightsG;uniform vec3 weightsB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,weightsR),dot(inputColor.rgb,weightsG),dot(inputColor.rgb,weightsB));outputColor=vec4(color,inputColor.a);}`;\n\n// src/effects/SepiaEffect.js\nvar SepiaEffect = class extends Effect {\n /**\n * Constructs a new sepia effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.intensity=1.0] - The intensity of the effect.\n */\n constructor({ blendFunction, intensity = 1 } = {}) {\n super(\"SepiaEffect\", sepia_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"weightsR\", new Uniform35(new Vector36(0.393, 0.769, 0.189))],\n [\"weightsG\", new Uniform35(new Vector36(0.349, 0.686, 0.168))],\n [\"weightsB\", new Uniform35(new Vector36(0.272, 0.534, 0.131))]\n ])\n });\n }\n /**\n * The intensity.\n *\n * @deprecated Use blendMode.opacity instead.\n * @type {Number}\n */\n get intensity() {\n return this.blendMode.opacity.value;\n }\n set intensity(value) {\n this.blendMode.opacity.value = value;\n }\n /**\n * Returns the current sepia intensity.\n *\n * @deprecated Use blendMode.opacity instead.\n * @return {Number} The intensity.\n */\n getIntensity() {\n return this.intensity;\n }\n /**\n * Sets the sepia intensity.\n *\n * @deprecated Use blendMode.opacity instead.\n * @param {Number} value - The intensity.\n */\n setIntensity(value) {\n this.intensity = value;\n }\n /**\n * The weights for the red channel. Default is `(0.393, 0.769, 0.189)`.\n *\n * @type {Vector3}\n */\n get weightsR() {\n return this.uniforms.get(\"weightsR\").value;\n }\n /**\n * The weights for the green channel. Default is `(0.349, 0.686, 0.168)`.\n *\n * @type {Vector3}\n */\n get weightsG() {\n return this.uniforms.get(\"weightsG\").value;\n }\n /**\n * The weights for the blue channel. Default is `(0.272, 0.534, 0.131)`.\n *\n * @type {Vector3}\n */\n get weightsB() {\n return this.uniforms.get(\"weightsB\").value;\n }\n};\n\n// src/effects/SMAAEffect.js\nimport {\n BasicDepthPacking as BasicDepthPacking9,\n Color as Color8,\n LinearFilter as LinearFilter5,\n LoadingManager,\n NearestFilter as NearestFilter4,\n Texture as Texture3,\n Uniform as Uniform38,\n WebGLRenderTarget as WebGLRenderTarget14\n} from \"three\";\n\n// src/materials/EdgeDetectionMaterial.js\nimport { BasicDepthPacking as BasicDepthPacking8, NoBlending as NoBlending13, REVISION as REVISION2, ShaderMaterial as ShaderMaterial14, Uniform as Uniform36, Vector2 as Vector219 } from \"three\";\n\n// src/materials/glsl/edge-detection.frag\nvar edge_detection_default = `varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\n#if EDGE_DETECTION_MODE == 1\n#include \n#endif\n#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);}\n#elif PREDICATION_MODE == 2\nuniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);}\n#endif\n#if PREDICATION_MODE != 0\nvec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);}\n#endif\n#if EDGE_DETECTION_MODE != 0\nuniform sampler2D inputBuffer;\n#endif\nvoid main(){\n#if EDGE_DETECTION_MODE == 0\nconst vec2 threshold=vec2(DEPTH_THRESHOLD);\n#elif PREDICATION_MODE != 0\nvec2 threshold=calculatePredicatedThreshold();\n#else\nconst vec2 threshold=vec2(EDGE_THRESHOLD);\n#endif\n#if EDGE_DETECTION_MODE == 0\nvec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 1\nfloat l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 2\nvec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#endif\n}`;\n\n// src/materials/glsl/edge-detection.vert\nvar edge_detection_default2 = `uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\nvoid main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0);\n#if EDGE_DETECTION_MODE != 0\nvUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/EdgeDetectionMaterial.js\nvar EdgeDetectionMaterial = class extends ShaderMaterial14 {\n /**\n * Constructs a new edge detection material.\n *\n * TODO Remove parameters.\n * @param {Vector2} [texelSize] - The screen texel size.\n * @param {EdgeDetectionMode} [mode=EdgeDetectionMode.COLOR] - The edge detection mode.\n */\n constructor(texelSize = new Vector219(), mode = EdgeDetectionMode.COLOR) {\n super({\n name: \"EdgeDetectionMaterial\",\n defines: {\n THREE_REVISION: REVISION2.replace(/\\D+/g, \"\"),\n LOCAL_CONTRAST_ADAPTATION_FACTOR: \"2.0\",\n EDGE_THRESHOLD: \"0.1\",\n DEPTH_THRESHOLD: \"0.01\",\n PREDICATION_MODE: \"0\",\n PREDICATION_THRESHOLD: \"0.01\",\n PREDICATION_SCALE: \"2.0\",\n PREDICATION_STRENGTH: \"1.0\",\n DEPTH_PACKING: \"0\"\n },\n uniforms: {\n inputBuffer: new Uniform36(null),\n depthBuffer: new Uniform36(null),\n predicationBuffer: new Uniform36(null),\n texelSize: new Uniform36(texelSize)\n },\n blending: NoBlending13,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: edge_detection_default,\n vertexShader: edge_detection_default2\n });\n this.edgeDetectionMode = mode;\n }\n /**\n * The depth buffer.\n *\n * @type {Texture}\n */\n set depthBuffer(value) {\n this.uniforms.depthBuffer.value = value;\n }\n /**\n * The depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set depthPacking(value) {\n this.defines.DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the depth buffer.\n *\n * @deprecated Use depthBuffer and depthPacking instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthBuffer(buffer, depthPacking = BasicDepthPacking8) {\n this.depthBuffer = buffer;\n this.depthPacking = depthPacking;\n }\n /**\n * The edge detection mode.\n *\n * @type {EdgeDetectionMode}\n */\n get edgeDetectionMode() {\n return Number(this.defines.EDGE_DETECTION_MODE);\n }\n set edgeDetectionMode(value) {\n this.defines.EDGE_DETECTION_MODE = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Returns the edge detection mode.\n *\n * @deprecated Use edgeDetectionMode instead.\n * @return {EdgeDetectionMode} The mode.\n */\n getEdgeDetectionMode() {\n return this.edgeDetectionMode;\n }\n /**\n * Sets the edge detection mode.\n *\n * @deprecated Use edgeDetectionMode instead.\n * @param {EdgeDetectionMode} value - The edge detection mode.\n */\n setEdgeDetectionMode(value) {\n this.edgeDetectionMode = value;\n }\n /**\n * The local contrast adaptation factor. Has no effect if the edge detection mode is set to DEPTH. Default is 2.0.\n *\n * If a neighbor edge has _factor_ times bigger contrast than the current edge, the edge will be discarded.\n *\n * This allows to eliminate spurious crossing edges and is based on the fact that if there is too much contrast in a\n * direction, the perceptual contrast in the other neighbors will be hidden.\n *\n * @type {Number}\n */\n get localContrastAdaptationFactor() {\n return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR);\n }\n set localContrastAdaptationFactor(value) {\n this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR = value.toFixed(\"6\");\n this.needsUpdate = true;\n }\n /**\n * Returns the local contrast adaptation factor.\n *\n * @deprecated Use localContrastAdaptationFactor instead.\n * @return {Number} The factor.\n */\n getLocalContrastAdaptationFactor() {\n return this.localContrastAdaptationFactor;\n }\n /**\n * Sets the local contrast adaptation factor. Has no effect if the edge detection mode is set to DEPTH.\n *\n * @deprecated Use localContrastAdaptationFactor instead.\n * @param {Number} value - The local contrast adaptation factor. Default is 2.0.\n */\n setLocalContrastAdaptationFactor(value) {\n this.localContrastAdaptationFactor = value;\n }\n /**\n * The edge detection threshold. Range: [0.0, 0.5].\n *\n * A lower value results in more edges being detected at the expense of performance.\n *\n * For luma- and chroma-based edge detection, 0.1 is a reasonable value and allows to catch most visible edges. 0.05\n * is a rather overkill value that allows to catch 'em all. Darker scenes may require an even lower threshold.\n *\n * If depth-based edge detection is used, the threshold will depend on the scene depth.\n *\n * @type {Number}\n */\n get edgeDetectionThreshold() {\n return Number(this.defines.EDGE_THRESHOLD);\n }\n set edgeDetectionThreshold(value) {\n this.defines.EDGE_THRESHOLD = value.toFixed(\"6\");\n this.defines.DEPTH_THRESHOLD = (value * 0.1).toFixed(\"6\");\n this.needsUpdate = true;\n }\n /**\n * Returns the edge detection threshold.\n *\n * @deprecated Use edgeDetectionThreshold instead.\n * @return {Number} The threshold.\n */\n getEdgeDetectionThreshold() {\n return this.edgeDetectionThreshold;\n }\n /**\n * Sets the edge detection threshold.\n *\n * @deprecated Use edgeDetectionThreshold instead.\n * @param {Number} value - The edge detection threshold. Range: [0.0, 0.5].\n */\n setEdgeDetectionThreshold(value) {\n this.edgeDetectionThreshold = value;\n }\n /**\n * The predication mode.\n *\n * Predicated thresholding allows to better preserve texture details and to improve edge detection using an additional\n * buffer such as a light accumulation or depth buffer.\n *\n * @type {PredicationMode}\n */\n get predicationMode() {\n return Number(this.defines.PREDICATION_MODE);\n }\n set predicationMode(value) {\n this.defines.PREDICATION_MODE = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Returns the predication mode.\n *\n * @deprecated Use predicationMode instead.\n * @return {PredicationMode} The mode.\n */\n getPredicationMode() {\n return this.predicationMode;\n }\n /**\n * Sets the predication mode.\n *\n * @deprecated Use predicationMode instead.\n * @param {PredicationMode} value - The predication mode.\n */\n setPredicationMode(value) {\n this.predicationMode = value;\n }\n /**\n * The predication buffer.\n *\n * @type {Texture}\n */\n set predicationBuffer(value) {\n this.uniforms.predicationBuffer.value = value;\n }\n /**\n * Sets a custom predication buffer.\n *\n * @deprecated Use predicationBuffer instead.\n * @param {Texture} value - The predication buffer.\n */\n setPredicationBuffer(value) {\n this.uniforms.predicationBuffer.value = value;\n }\n /**\n * The predication threshold.\n *\n * @type {Number}\n */\n get predicationThreshold() {\n return Number(this.defines.PREDICATION_THRESHOLD);\n }\n set predicationThreshold(value) {\n this.defines.PREDICATION_THRESHOLD = value.toFixed(\"6\");\n this.needsUpdate = true;\n }\n /**\n * Returns the predication threshold.\n *\n * @deprecated Use predicationThreshold instead.\n * @return {Number} The threshold.\n */\n getPredicationThreshold() {\n return this.predicationThreshold;\n }\n /**\n * Sets the predication threshold.\n *\n * @deprecated Use predicationThreshold instead.\n * @param {Number} value - The threshold.\n */\n setPredicationThreshold(value) {\n this.predicationThreshold = value;\n }\n /**\n * The predication scale. Range: [1.0, 5.0].\n *\n * Determines how much the edge detection threshold should be scaled when using predication.\n *\n * @type {Boolean|Texture|Number}\n */\n get predicationScale() {\n return Number(this.defines.PREDICATION_SCALE);\n }\n set predicationScale(value) {\n this.defines.PREDICATION_SCALE = value.toFixed(\"6\");\n this.needsUpdate = true;\n }\n /**\n * Returns the predication scale.\n *\n * @deprecated Use predicationScale instead.\n * @return {Number} The scale.\n */\n getPredicationScale() {\n return this.predicationScale;\n }\n /**\n * Sets the predication scale.\n *\n * @deprecated Use predicationScale instead.\n * @param {Number} value - The scale. Range: [1.0, 5.0].\n */\n setPredicationScale(value) {\n this.predicationScale = value;\n }\n /**\n * The predication strength. Range: [0.0, 1.0].\n *\n * Determines how much the edge detection threshold should be decreased locally when using predication.\n *\n * @type {Number}\n */\n get predicationStrength() {\n return Number(this.defines.PREDICATION_STRENGTH);\n }\n set predicationStrength(value) {\n this.defines.PREDICATION_STRENGTH = value.toFixed(\"6\");\n this.needsUpdate = true;\n }\n /**\n * Returns the predication strength.\n *\n * @deprecated Use predicationStrength instead.\n * @return {Number} The strength.\n */\n getPredicationStrength() {\n return this.predicationStrength;\n }\n /**\n * Sets the predication strength.\n *\n * @deprecated Use predicationStrength instead.\n * @param {Number} value - The strength. Range: [0.0, 1.0].\n */\n setPredicationStrength(value) {\n this.predicationStrength = value;\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/materials/SMAAWeightsMaterial.js\nimport { NoBlending as NoBlending14, ShaderMaterial as ShaderMaterial15, Uniform as Uniform37, Vector2 as Vector220 } from \"three\";\n\n// src/materials/glsl/smaa-weights.frag\nvar smaa_weights_default = `#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)\n#if __VERSION__ < 300\n#define round(v) floor(v + 0.5)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0);\n#endif\n}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0);\n#endif\n}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){\n#if !defined(DISABLE_DIAG_DETECTION)\nweights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){\n#endif\nvec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d);\n#if !defined(DISABLE_DIAG_DETECTION)\n}else{e.r=0.0;}\n#endif\n}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`;\n\n// src/materials/glsl/smaa-weights.vert\nvar smaa_weights_default2 = `uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/SMAAWeightsMaterial.js\nvar SMAAWeightsMaterial = class extends ShaderMaterial15 {\n /**\n * Constructs a new SMAA weights material.\n *\n * @param {Vector2} [texelSize] - The absolute screen texel size.\n * @param {Vector2} [resolution] - The resolution.\n */\n constructor(texelSize = new Vector220(), resolution = new Vector220()) {\n super({\n name: \"SMAAWeightsMaterial\",\n defines: {\n // Configurable settings:\n MAX_SEARCH_STEPS_INT: \"16\",\n MAX_SEARCH_STEPS_FLOAT: \"16.0\",\n MAX_SEARCH_STEPS_DIAG_INT: \"8\",\n MAX_SEARCH_STEPS_DIAG_FLOAT: \"8.0\",\n CORNER_ROUNDING: \"25\",\n CORNER_ROUNDING_NORM: \"0.25\",\n // Non-configurable settings:\n AREATEX_MAX_DISTANCE: \"16.0\",\n AREATEX_MAX_DISTANCE_DIAG: \"20.0\",\n AREATEX_PIXEL_SIZE: \"(1.0 / vec2(160.0, 560.0))\",\n AREATEX_SUBTEX_SIZE: \"(1.0 / 7.0)\",\n SEARCHTEX_SIZE: \"vec2(66.0, 33.0)\",\n SEARCHTEX_PACKED_SIZE: \"vec2(64.0, 16.0)\"\n },\n uniforms: {\n inputBuffer: new Uniform37(null),\n searchTexture: new Uniform37(null),\n areaTexture: new Uniform37(null),\n resolution: new Uniform37(resolution),\n texelSize: new Uniform37(texelSize)\n },\n blending: NoBlending14,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: smaa_weights_default,\n vertexShader: smaa_weights_default2\n });\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The search lookup texture.\n *\n * @type {Texture}\n */\n get searchTexture() {\n return this.uniforms.searchTexture.value;\n }\n set searchTexture(value) {\n this.uniforms.searchTexture.value = value;\n }\n /**\n * The area lookup texture.\n *\n * @type {Texture}\n */\n get areaTexture() {\n return this.uniforms.areaTexture.value;\n }\n set areaTexture(value) {\n this.uniforms.areaTexture.value = value;\n }\n /**\n * Sets the search and area lookup textures.\n *\n * @deprecated Use searchTexture and areaTexture instead.\n * @param {Texture} search - The search lookup texture.\n * @param {Texture} area - The area lookup texture.\n */\n setLookupTextures(search, area2) {\n this.searchTexture = search;\n this.areaTexture = area2;\n }\n /**\n * The maximum amount of steps performed in the horizontal/vertical pattern searches, at each side of the pixel.\n * Range: [0, 112].\n *\n * In number of pixels, it's actually the double. So the maximum line length perfectly handled by, for example 16, is\n * 64 (perfectly means that longer lines won't look as good, but are still antialiased).\n *\n * @type {Number}\n */\n get orthogonalSearchSteps() {\n return Number(this.defines.MAX_SEARCH_STEPS_INT);\n }\n set orthogonalSearchSteps(value) {\n const s = Math.min(Math.max(value, 0), 112);\n this.defines.MAX_SEARCH_STEPS_INT = s.toFixed(\"0\");\n this.defines.MAX_SEARCH_STEPS_FLOAT = s.toFixed(\"1\");\n this.needsUpdate = true;\n }\n /**\n * Sets the maximum amount of steps performed in the horizontal/vertical pattern searches, at each side of the pixel.\n *\n * @deprecated Use orthogonalSearchSteps instead.\n * @param {Number} value - The search steps. Range: [0, 112].\n */\n setOrthogonalSearchSteps(value) {\n this.orthogonalSearchSteps = value;\n }\n /**\n * The maximum steps performed in the diagonal pattern searches, at each side of the pixel. This search\n * jumps one pixel at a time. Range: [0, 20].\n *\n * On high-end machines this search is cheap (between 0.8x and 0.9x slower for 16 steps), but it can have a\n * significant impact on older machines.\n *\n * @type {Number}\n */\n get diagonalSearchSteps() {\n return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT);\n }\n set diagonalSearchSteps(value) {\n const s = Math.min(Math.max(value, 0), 20);\n this.defines.MAX_SEARCH_STEPS_DIAG_INT = s.toFixed(\"0\");\n this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT = s.toFixed(\"1\");\n this.needsUpdate = true;\n }\n /**\n * Specifies the maximum steps performed in the diagonal pattern searches, at each side of the pixel.\n *\n * @deprecated Use diagonalSearchSteps instead.\n * @param {Number} value - The search steps. Range: [0, 20].\n */\n setDiagonalSearchSteps(value) {\n this.diagonalSearchSteps = value;\n }\n /**\n * Indicates whether diagonal pattern detection is enabled.\n *\n * @type {Boolean}\n */\n get diagonalDetection() {\n return this.defines.DISABLE_DIAG_DETECTION === void 0;\n }\n set diagonalDetection(value) {\n if (value) {\n delete this.defines.DISABLE_DIAG_DETECTION;\n } else {\n this.defines.DISABLE_DIAG_DETECTION = \"1\";\n }\n this.needsUpdate = true;\n }\n /**\n * Indicates whether diagonal pattern detection is enabled.\n *\n * @deprecated Use diagonalDetection instead.\n * @return {Boolean} Whether diagonal pattern detection is enabled.\n */\n isDiagonalDetectionEnabled() {\n return this.diagonalDetection;\n }\n /**\n * Enables or disables diagonal pattern detection.\n *\n * @deprecated Use diagonalDetection instead.\n * @param {Boolean} value - Whether diagonal pattern detection should be enabled.\n */\n setDiagonalDetectionEnabled(value) {\n this.diagonalDetection = value;\n }\n /**\n * Specifies how much sharp corners will be rounded. Range: [0, 100].\n *\n * @type {Number}\n */\n get cornerRounding() {\n return Number(this.defines.CORNER_ROUNDING);\n }\n set cornerRounding(value) {\n const r = Math.min(Math.max(value, 0), 100);\n this.defines.CORNER_ROUNDING = r.toFixed(\"4\");\n this.defines.CORNER_ROUNDING_NORM = (r / 100).toFixed(\"4\");\n this.needsUpdate = true;\n }\n /**\n * Specifies how much sharp corners will be rounded.\n *\n * @deprecated Use cornerRounding instead.\n * @param {Number} value - The corner rounding amount. Range: [0, 100].\n */\n setCornerRounding(value) {\n this.cornerRounding = value;\n }\n /**\n * Indicates whether corner detection is enabled.\n *\n * @type {Number}\n */\n get cornerDetection() {\n return this.defines.DISABLE_CORNER_DETECTION === void 0;\n }\n set cornerDetection(value) {\n if (value) {\n delete this.defines.DISABLE_CORNER_DETECTION;\n } else {\n this.defines.DISABLE_CORNER_DETECTION = \"1\";\n }\n this.needsUpdate = true;\n }\n /**\n * Indicates whether corner rounding is enabled.\n *\n * @deprecated Use cornerDetection instead.\n * @return {Boolean} Whether corner rounding is enabled.\n */\n isCornerRoundingEnabled() {\n return this.cornerDetection;\n }\n /**\n * Enables or disables corner rounding.\n *\n * @deprecated Use cornerDetection instead.\n * @param {Boolean} value - Whether corner rounding should be enabled.\n */\n setCornerRoundingEnabled(value) {\n this.cornerDetection = value;\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const uniforms = this.uniforms;\n uniforms.texelSize.value.set(1 / width, 1 / height);\n uniforms.resolution.value.set(width, height);\n }\n};\n\n// src/textures/smaa/searchImageDataURL.js\nvar searchImageDataURL_default = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC\";\n\n// src/textures/smaa/areaImageDataURL.js\nvar areaImageDataURL_default = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw7cqimr+zFM/ZLnZF64cgL8BYD+AWwB8x/dlWuWagHiYL984AJ/0RWBy1AE4AizyM1yxYAcTigW55xMbAkxEiwEdkJ/ZCQxPAiOHgBECcKEC4TBZcKkSv+mTieNcNPNC26mLNsj45QD8LQDTAO4GcJt/7iw2bfoG4WG+vAGwm9ExiEg69zpg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pqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC\";\n\n// src/effects/glsl/smaa.frag\nvar smaa_default = `uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}`;\n\n// src/effects/glsl/smaa.vert\nvar smaa_default2 = `varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}`;\n\n// src/effects/SMAAEffect.js\nvar SMAAEffect = class extends Effect {\n /**\n * Constructs a new SMAA effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n * @param {SMAAPreset} [options.preset=SMAAPreset.MEDIUM] - The quality preset.\n * @param {EdgeDetectionMode} [options.edgeDetectionMode=EdgeDetectionMode.COLOR] - The edge detection mode.\n * @param {PredicationMode} [options.predicationMode=PredicationMode.DISABLED] - The predication mode.\n */\n constructor({\n blendFunction = BlendFunction.SRC,\n preset = SMAAPreset.MEDIUM,\n edgeDetectionMode = EdgeDetectionMode.COLOR,\n predicationMode = PredicationMode.DISABLED\n } = {}) {\n super(\"SMAAEffect\", smaa_default, {\n vertexShader: smaa_default2,\n blendFunction,\n attributes: EffectAttribute.CONVOLUTION | EffectAttribute.DEPTH,\n uniforms: /* @__PURE__ */ new Map([\n [\"weightMap\", new Uniform38(null)]\n ])\n });\n let searchImage, areaImage;\n if (arguments.length > 1) {\n searchImage = arguments[0];\n areaImage = arguments[1];\n if (arguments.length > 2) {\n preset = arguments[2];\n }\n if (arguments.length > 3) {\n edgeDetectionMode = arguments[3];\n }\n }\n this.renderTargetEdges = new WebGLRenderTarget14(1, 1, { depthBuffer: false });\n this.renderTargetEdges.texture.name = \"SMAA.Edges\";\n this.renderTargetWeights = this.renderTargetEdges.clone();\n this.renderTargetWeights.texture.name = \"SMAA.Weights\";\n this.uniforms.get(\"weightMap\").value = this.renderTargetWeights.texture;\n this.clearPass = new ClearPass(true, false, false);\n this.clearPass.overrideClearColor = new Color8(0);\n this.clearPass.overrideClearAlpha = 1;\n this.edgeDetectionPass = new ShaderPass(new EdgeDetectionMaterial());\n this.edgeDetectionMaterial.edgeDetectionMode = edgeDetectionMode;\n this.edgeDetectionMaterial.predicationMode = predicationMode;\n this.weightsPass = new ShaderPass(new SMAAWeightsMaterial());\n const loadingManager = new LoadingManager();\n loadingManager.onLoad = () => {\n const searchTexture = new Texture3(searchImage);\n searchTexture.name = \"SMAA.Search\";\n searchTexture.magFilter = NearestFilter4;\n searchTexture.minFilter = NearestFilter4;\n searchTexture.generateMipmaps = false;\n searchTexture.needsUpdate = true;\n searchTexture.flipY = true;\n this.weightsMaterial.searchTexture = searchTexture;\n const areaTexture = new Texture3(areaImage);\n areaTexture.name = \"SMAA.Area\";\n areaTexture.magFilter = LinearFilter5;\n areaTexture.minFilter = LinearFilter5;\n areaTexture.generateMipmaps = false;\n areaTexture.needsUpdate = true;\n areaTexture.flipY = false;\n this.weightsMaterial.areaTexture = areaTexture;\n this.dispatchEvent({ type: \"load\" });\n };\n loadingManager.itemStart(\"search\");\n loadingManager.itemStart(\"area\");\n if (searchImage !== void 0 && areaImage !== void 0) {\n loadingManager.itemEnd(\"search\");\n loadingManager.itemEnd(\"area\");\n } else if (typeof Image !== \"undefined\") {\n searchImage = new Image();\n areaImage = new Image();\n searchImage.addEventListener(\"load\", () => loadingManager.itemEnd(\"search\"));\n areaImage.addEventListener(\"load\", () => loadingManager.itemEnd(\"area\"));\n searchImage.src = searchImageDataURL_default;\n areaImage.src = areaImageDataURL_default;\n }\n this.applyPreset(preset);\n }\n /**\n * The edges texture.\n *\n * @type {Texture}\n */\n get edgesTexture() {\n return this.renderTargetEdges.texture;\n }\n /**\n * Returns the edges texture.\n *\n * @deprecated Use edgesTexture instead.\n * @return {Texture} The texture.\n */\n getEdgesTexture() {\n return this.edgesTexture;\n }\n /**\n * The edge weights texture.\n *\n * @type {Texture}\n */\n get weightsTexture() {\n return this.renderTargetWeights.texture;\n }\n /**\n * Returns the edge weights texture.\n *\n * @deprecated Use weightsTexture instead.\n * @return {Texture} The texture.\n */\n getWeightsTexture() {\n return this.weightsTexture;\n }\n /**\n * The edge detection material.\n *\n * @type {EdgeDetectionMaterial}\n */\n get edgeDetectionMaterial() {\n return this.edgeDetectionPass.fullscreenMaterial;\n }\n /**\n * The edge detection material.\n *\n * @type {EdgeDetectionMaterial}\n * @deprecated Use edgeDetectionMaterial instead.\n */\n get colorEdgesMaterial() {\n return this.edgeDetectionMaterial;\n }\n /**\n * Returns the edge detection material.\n *\n * @deprecated Use edgeDetectionMaterial instead.\n * @return {EdgeDetectionMaterial} The material.\n */\n getEdgeDetectionMaterial() {\n return this.edgeDetectionMaterial;\n }\n /**\n * The edge weights material.\n *\n * @type {SMAAWeightsMaterial}\n */\n get weightsMaterial() {\n return this.weightsPass.fullscreenMaterial;\n }\n /**\n * Returns the edge weights material.\n *\n * @deprecated Use weightsMaterial instead.\n * @return {SMAAWeightsMaterial} The material.\n */\n getWeightsMaterial() {\n return this.weightsMaterial;\n }\n /**\n * Sets the edge detection sensitivity.\n *\n * See {@link EdgeDetectionMaterial#setEdgeDetectionThreshold} for more details.\n *\n * @deprecated Use edgeDetectionMaterial instead.\n * @param {Number} threshold - The edge detection sensitivity. Range: [0.05, 0.5].\n */\n setEdgeDetectionThreshold(threshold) {\n this.edgeDetectionMaterial.edgeDetectionThreshold = threshold;\n }\n /**\n * Sets the maximum amount of horizontal/vertical search steps.\n *\n * See {@link SMAAWeightsMaterial#setOrthogonalSearchSteps} for more details.\n *\n * @deprecated Use weightsMaterial instead.\n * @param {Number} steps - The search steps. Range: [0, 112].\n */\n setOrthogonalSearchSteps(steps) {\n this.weightsMaterial.orthogonalSearchSteps = steps;\n }\n /**\n * Applies the given quality preset.\n *\n * @param {SMAAPreset} preset - The preset.\n */\n applyPreset(preset) {\n const edgeDetectionMaterial = this.edgeDetectionMaterial;\n const weightsMaterial = this.weightsMaterial;\n switch (preset) {\n case SMAAPreset.LOW:\n edgeDetectionMaterial.edgeDetectionThreshold = 0.15;\n weightsMaterial.orthogonalSearchSteps = 4;\n weightsMaterial.diagonalDetection = false;\n weightsMaterial.cornerDetection = false;\n break;\n case SMAAPreset.MEDIUM:\n edgeDetectionMaterial.edgeDetectionThreshold = 0.1;\n weightsMaterial.orthogonalSearchSteps = 8;\n weightsMaterial.diagonalDetection = false;\n weightsMaterial.cornerDetection = false;\n break;\n case SMAAPreset.HIGH:\n edgeDetectionMaterial.edgeDetectionThreshold = 0.1;\n weightsMaterial.orthogonalSearchSteps = 16;\n weightsMaterial.diagonalSearchSteps = 8;\n weightsMaterial.cornerRounding = 25;\n weightsMaterial.diagonalDetection = true;\n weightsMaterial.cornerDetection = true;\n break;\n case SMAAPreset.ULTRA:\n edgeDetectionMaterial.edgeDetectionThreshold = 0.05;\n weightsMaterial.orthogonalSearchSteps = 32;\n weightsMaterial.diagonalSearchSteps = 16;\n weightsMaterial.cornerRounding = 25;\n weightsMaterial.diagonalDetection = true;\n weightsMaterial.cornerDetection = true;\n break;\n }\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking9) {\n this.edgeDetectionMaterial.depthBuffer = depthTexture;\n this.edgeDetectionMaterial.depthPacking = depthPacking;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n this.clearPass.render(renderer, this.renderTargetEdges);\n this.edgeDetectionPass.render(renderer, inputBuffer, this.renderTargetEdges);\n this.weightsPass.render(renderer, this.renderTargetEdges, this.renderTargetWeights);\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.edgeDetectionMaterial.setSize(width, height);\n this.weightsMaterial.setSize(width, height);\n this.renderTargetEdges.setSize(width, height);\n this.renderTargetWeights.setSize(width, height);\n }\n /**\n * Deletes internal render targets and textures.\n */\n dispose() {\n const { searchTexture, areaTexture } = this.weightsMaterial;\n if (searchTexture !== null && areaTexture !== null) {\n searchTexture.dispose();\n areaTexture.dispose();\n }\n super.dispose();\n }\n /**\n * The SMAA search image, encoded as a base64 data URL.\n *\n * @type {String}\n * @deprecated\n */\n static get searchImageDataURL() {\n return searchImageDataURL_default;\n }\n /**\n * The SMAA area image, encoded as a base64 data URL.\n *\n * @type {String}\n * @deprecated\n */\n static get areaImageDataURL() {\n return areaImageDataURL_default;\n }\n};\n\n// src/effects/SSAOEffect.js\nimport { BasicDepthPacking as BasicDepthPacking13, Color as Color9, RepeatWrapping as RepeatWrapping4, RGBAFormat as RGBAFormat4, Uniform as Uniform41, WebGLRenderTarget as WebGLRenderTarget16 } from \"three\";\n\n// src/materials/SSAOMaterial.js\nimport { BasicDepthPacking as BasicDepthPacking10, Matrix4 as Matrix42, NoBlending as NoBlending15, PerspectiveCamera as PerspectiveCamera4, ShaderMaterial as ShaderMaterial16, Uniform as Uniform39, Vector2 as Vector221 } from \"three\";\n\n// src/materials/glsl/ssao.frag\nvar ssao_default = `#include \n#include \n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}\n#else\nuniform lowp sampler2D normalBuffer;\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nuniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform vec2 cameraNearFar;uniform float intensity;uniform float minRadiusScale;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){float radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;float noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i1.0||coords.t<0.0||coords.t>1.0){continue;}float sampleDepth=readDepth(coords);float viewZ=getViewZ(sampleDepth);\n#ifdef PERSPECTIVE_CAMERA\nfloat linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y);\n#else\nfloat linearSampleDepth=sampleDepth;\n#endif\nfloat proximity=abs(depth-linearSampleDepth);if(proximity\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\n#ifdef DOWNSAMPLE_NORMALS\nuniform lowp sampler2D normalBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i] this.setSize(resolution.baseWidth, resolution.baseHeight));\n }\n /**\n * The normal(RGB) + depth(A) texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the normal(RGB) + depth(A) texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking12) {\n this.fullscreenMaterial.depthBuffer = depthTexture;\n this.fullscreenMaterial.depthPacking = depthPacking;\n }\n /**\n * Downsamples depth and scene normals.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget);\n renderer.render(this.scene, this.camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n this.renderTarget.setSize(resolution.width, resolution.height);\n this.fullscreenMaterial.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n const gl = renderer.getContext();\n const renderable = gl.getExtension(\"EXT_color_buffer_float\") || gl.getExtension(\"EXT_color_buffer_half_float\");\n if (!renderable) {\n throw new Error(\"Rendering to float texture is not supported.\");\n }\n }\n};\n\n// src/effects/glsl/ssao.frag\nvar ssao_default3 = `uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH)\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\n#endif\n#ifdef COLORIZE\nuniform vec3 color;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300\nvec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distance this.setSize(resolution.baseWidth, resolution.baseHeight));\n this.camera = camera;\n this.depthDownsamplingPass = new DepthDownsamplingPass({ normalBuffer, resolutionScale });\n this.depthDownsamplingPass.enabled = normalDepthBuffer === null;\n this.ssaoPass = new ShaderPass(new SSAOMaterial(camera));\n const noiseTexture = new NoiseTexture(NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, RGBAFormat4);\n noiseTexture.wrapS = noiseTexture.wrapT = RepeatWrapping4;\n const ssaoMaterial = this.ssaoMaterial;\n ssaoMaterial.normalBuffer = normalBuffer;\n ssaoMaterial.noiseTexture = noiseTexture;\n ssaoMaterial.minRadiusScale = minRadiusScale;\n ssaoMaterial.samples = samples;\n ssaoMaterial.radius = radius;\n ssaoMaterial.rings = rings;\n ssaoMaterial.fade = fade;\n ssaoMaterial.bias = bias;\n ssaoMaterial.distanceThreshold = distanceThreshold;\n ssaoMaterial.distanceFalloff = distanceFalloff;\n ssaoMaterial.proximityThreshold = rangeThreshold;\n ssaoMaterial.proximityFalloff = rangeFalloff;\n if (worldDistanceThreshold !== void 0) {\n ssaoMaterial.worldDistanceThreshold = worldDistanceThreshold;\n }\n if (worldDistanceFalloff !== void 0) {\n ssaoMaterial.worldDistanceFalloff = worldDistanceFalloff;\n }\n if (worldProximityThreshold !== void 0) {\n ssaoMaterial.worldProximityThreshold = worldProximityThreshold;\n }\n if (worldProximityFalloff !== void 0) {\n ssaoMaterial.worldProximityFalloff = worldProximityFalloff;\n }\n if (normalDepthBuffer !== null) {\n this.ssaoMaterial.normalDepthBuffer = normalDepthBuffer;\n this.defines.set(\"NORMAL_DEPTH\", \"1\");\n }\n this.depthAwareUpsampling = depthAwareUpsampling;\n this.color = color2;\n }\n set mainCamera(value) {\n this.camera = value;\n this.ssaoMaterial.copyCameraSettings(value);\n }\n /**\n * Sets the normal buffer.\n *\n * @type {Texture}\n */\n get normalBuffer() {\n return this.ssaoMaterial.normalBuffer;\n }\n set normalBuffer(value) {\n this.ssaoMaterial.normalBuffer = value;\n this.depthDownsamplingPass.fullscreenMaterial.normalBuffer = value;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * The SSAO material.\n *\n * @type {SSAOMaterial}\n */\n get ssaoMaterial() {\n return this.ssaoPass.fullscreenMaterial;\n }\n /**\n * Returns the SSAO material.\n *\n * @deprecated Use ssaoMaterial instead.\n * @return {SSAOMaterial} The material.\n */\n getSSAOMaterial() {\n return this.ssaoMaterial;\n }\n /**\n * The amount of occlusion samples per pixel.\n *\n * @type {Number}\n * @deprecated Use ssaoMaterial.samples instead.\n */\n get samples() {\n return this.ssaoMaterial.samples;\n }\n set samples(value) {\n this.ssaoMaterial.samples = value;\n }\n /**\n * The amount of spiral turns in the occlusion sampling pattern.\n *\n * @type {Number}\n * @deprecated Use ssaoMaterial.rings instead.\n */\n get rings() {\n return this.ssaoMaterial.rings;\n }\n set rings(value) {\n this.ssaoMaterial.rings = value;\n }\n /**\n * The occlusion sampling radius.\n *\n * @type {Number}\n * @deprecated Use ssaoMaterial.radius instead.\n */\n get radius() {\n return this.ssaoMaterial.radius;\n }\n set radius(value) {\n this.ssaoMaterial.radius = value;\n }\n /**\n * Indicates whether depth-aware upsampling is enabled.\n *\n * @type {Boolean}\n */\n get depthAwareUpsampling() {\n return this.defines.has(\"DEPTH_AWARE_UPSAMPLING\");\n }\n set depthAwareUpsampling(value) {\n if (this.depthAwareUpsampling !== value) {\n if (value) {\n this.defines.set(\"DEPTH_AWARE_UPSAMPLING\", \"1\");\n } else {\n this.defines.delete(\"DEPTH_AWARE_UPSAMPLING\");\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether depth-aware upsampling is enabled.\n *\n * @deprecated Use depthAwareUpsampling instead.\n * @return {Boolean} Whether depth-aware upsampling is enabled.\n */\n isDepthAwareUpsamplingEnabled() {\n return this.depthAwareUpsampling;\n }\n /**\n * Enables or disables depth-aware upsampling.\n *\n * @deprecated Use depthAwareUpsampling instead.\n * @param {Boolean} value - Whether depth-aware upsampling should be enabled.\n */\n setDepthAwareUpsamplingEnabled(value) {\n this.depthAwareUpsampling = value;\n }\n /**\n * Indicates whether distance-based radius scaling is enabled.\n *\n * @type {Boolean}\n * @deprecated\n */\n get distanceScaling() {\n return true;\n }\n set distanceScaling(value) {\n }\n /**\n * The color of the ambient occlusion. Set to `null` to disable.\n *\n * @type {Color}\n */\n get color() {\n return this.uniforms.get(\"color\").value;\n }\n set color(value) {\n const uniforms = this.uniforms;\n const defines = this.defines;\n if (value !== null) {\n if (defines.has(\"COLORIZE\")) {\n uniforms.get(\"color\").value.set(value);\n } else {\n defines.set(\"COLORIZE\", \"1\");\n uniforms.get(\"color\").value = new Color9(value);\n this.setChanged();\n }\n } else if (defines.has(\"COLORIZE\")) {\n defines.delete(\"COLORIZE\");\n uniforms.get(\"color\").value = null;\n this.setChanged();\n }\n }\n /**\n * The luminance influence factor. Range: [0.0, 1.0].\n *\n * @type {Boolean}\n */\n get luminanceInfluence() {\n return this.uniforms.get(\"luminanceInfluence\").value;\n }\n set luminanceInfluence(value) {\n this.uniforms.get(\"luminanceInfluence\").value = value;\n }\n /**\n * The intensity.\n *\n * @type {Number}\n */\n get intensity() {\n return this.uniforms.get(\"intensity\").value;\n }\n set intensity(value) {\n this.uniforms.get(\"intensity\").value = value;\n }\n /**\n * Returns the color of the ambient occlusion.\n *\n * @deprecated Use color instead.\n * @return {Color} The color.\n */\n getColor() {\n return this.color;\n }\n /**\n * Sets the color of the ambient occlusion. Set to `null` to disable colorization.\n *\n * @deprecated Use color instead.\n * @param {Color} value - The color.\n */\n setColor(value) {\n this.color = value;\n }\n /**\n * Sets the occlusion distance cutoff.\n *\n * @deprecated Use ssaoMaterial instead.\n * @param {Number} threshold - The distance threshold. Range [0.0, 1.0].\n * @param {Number} falloff - The falloff. Range [0.0, 1.0].\n */\n setDistanceCutoff(threshold, falloff) {\n this.ssaoMaterial.distanceThreshold = threshold;\n this.ssaoMaterial.distanceFalloff = falloff;\n }\n /**\n * Sets the occlusion proximity cutoff.\n *\n * @deprecated Use ssaoMaterial instead.\n * @param {Number} threshold - The proximity threshold. Range [0.0, 1.0].\n * @param {Number} falloff - The falloff. Range [0.0, 1.0].\n */\n setProximityCutoff(threshold, falloff) {\n this.ssaoMaterial.proximityThreshold = threshold;\n this.ssaoMaterial.proximityFalloff = falloff;\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking13) {\n this.depthDownsamplingPass.setDepthTexture(depthTexture, depthPacking);\n this.ssaoMaterial.depthBuffer = depthTexture;\n this.ssaoMaterial.depthPacking = depthPacking;\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n const renderTarget = this.renderTarget;\n if (this.depthDownsamplingPass.enabled) {\n this.depthDownsamplingPass.render(renderer);\n }\n this.ssaoPass.render(renderer, null, renderTarget);\n }\n /**\n * Sets the size.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.ssaoMaterial.copyCameraSettings(this.camera);\n this.ssaoMaterial.setSize(w, h);\n this.renderTarget.setSize(w, h);\n this.depthDownsamplingPass.resolution.scale = resolution.scale;\n this.depthDownsamplingPass.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n try {\n let normalDepthBuffer = this.uniforms.get(\"normalDepthBuffer\").value;\n if (normalDepthBuffer === null) {\n this.depthDownsamplingPass.initialize(renderer, alpha, frameBufferType);\n normalDepthBuffer = this.depthDownsamplingPass.texture;\n this.uniforms.get(\"normalDepthBuffer\").value = normalDepthBuffer;\n this.ssaoMaterial.normalDepthBuffer = normalDepthBuffer;\n this.defines.set(\"NORMAL_DEPTH\", \"1\");\n }\n } catch (e) {\n this.depthDownsamplingPass.enabled = false;\n }\n }\n};\n\n// src/effects/TextureEffect.js\nimport { Uniform as Uniform42, UnsignedByteType as UnsignedByteType12 } from \"three\";\n\n// src/effects/glsl/texture.frag\nvar texture_default = `#ifdef TEXTURE_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nvarying vec2 vUv2;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){\n#ifdef UV_TRANSFORM\nvec4 texel=texture2D(map,vUv2);\n#else\nvec4 texel=texture2D(map,uv);\n#endif\noutputColor=TEXEL;outputColor.a=max(inputColor.a,outputColor.a);}`;\n\n// src/effects/glsl/texture.vert\nvar texture_default2 = `#ifdef ASPECT_CORRECTION\nuniform float scale;\n#else\nuniform mat3 uvTransform;\n#endif\nvarying vec2 vUv2;void mainSupport(const in vec2 uv){\n#ifdef ASPECT_CORRECTION\nvUv2=uv*vec2(aspect,1.0)*scale;\n#else\nvUv2=(uvTransform*vec3(uv,1.0)).xy;\n#endif\n}`;\n\n// src/effects/TextureEffect.js\nvar TextureEffect = class extends Effect {\n /**\n * Constructs a new texture effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Texture} [options.texture] - A texture.\n * @param {Boolean} [options.aspectCorrection=false] - Deprecated. Adjust the texture's offset, repeat and center instead.\n */\n constructor({ blendFunction, texture = null, aspectCorrection = false } = {}) {\n super(\"TextureEffect\", texture_default, {\n blendFunction,\n defines: /* @__PURE__ */ new Map([\n [\"TEXEL\", \"texel\"]\n ]),\n uniforms: /* @__PURE__ */ new Map([\n [\"map\", new Uniform42(null)],\n [\"scale\", new Uniform42(1)],\n [\"uvTransform\", new Uniform42(null)]\n ])\n });\n this.texture = texture;\n this.aspectCorrection = aspectCorrection;\n }\n /**\n * The texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.uniforms.get(\"map\").value;\n }\n set texture(value) {\n const prevTexture = this.texture;\n const uniforms = this.uniforms;\n const defines = this.defines;\n if (prevTexture !== value) {\n uniforms.get(\"map\").value = value;\n uniforms.get(\"uvTransform\").value = value.matrix;\n defines.delete(\"TEXTURE_PRECISION_HIGH\");\n if (value !== null) {\n if (value.matrixAutoUpdate) {\n defines.set(\"UV_TRANSFORM\", \"1\");\n this.setVertexShader(texture_default2);\n } else {\n defines.delete(\"UV_TRANSFORM\");\n this.setVertexShader(null);\n }\n if (value.type !== UnsignedByteType12) {\n defines.set(\"TEXTURE_PRECISION_HIGH\", \"1\");\n }\n if (prevTexture === null || prevTexture.type !== value.type || prevTexture.encoding !== value.encoding) {\n this.setChanged();\n }\n }\n }\n }\n /**\n * Returns the texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.texture;\n }\n /**\n * Sets the texture.\n *\n * @deprecated Use texture instead.\n * @param {Texture} value - The texture.\n */\n setTexture(value) {\n this.texture = value;\n }\n /**\n * Indicates whether aspect correction is enabled.\n *\n * @type {Number}\n * @deprecated Adjust the texture's offset, repeat, rotation and center instead.\n */\n get aspectCorrection() {\n return this.defines.has(\"ASPECT_CORRECTION\");\n }\n set aspectCorrection(value) {\n if (this.aspectCorrection !== value) {\n if (value) {\n this.defines.set(\"ASPECT_CORRECTION\", \"1\");\n } else {\n this.defines.delete(\"ASPECT_CORRECTION\");\n }\n this.setChanged();\n }\n }\n /**\n * Indicates whether the texture UV coordinates will be transformed using the transformation matrix of the texture.\n *\n * @type {Boolean}\n * @deprecated Use texture.matrixAutoUpdate instead.\n */\n get uvTransform() {\n const texture = this.texture;\n return texture !== null && texture.matrixAutoUpdate;\n }\n set uvTransform(value) {\n const texture = this.texture;\n if (texture !== null) {\n texture.matrixAutoUpdate = value;\n }\n }\n /**\n * Sets the swizzles that will be applied to the components of a texel before it is written to the output color.\n *\n * @param {ColorChannel} r - The swizzle for the `r` component.\n * @param {ColorChannel} [g=r] - The swizzle for the `g` component.\n * @param {ColorChannel} [b=r] - The swizzle for the `b` component.\n * @param {ColorChannel} [a=r] - The swizzle for the `a` component.\n */\n setTextureSwizzleRGBA(r, g = r, b = r, a = r) {\n const rgba = \"rgba\";\n let swizzle = \"\";\n if (r !== ColorChannel.RED || g !== ColorChannel.GREEN || b !== ColorChannel.BLUE || a !== ColorChannel.ALPHA) {\n swizzle = [\".\", rgba[r], rgba[g], rgba[b], rgba[a]].join(\"\");\n }\n this.defines.set(\"TEXEL\", \"texel\" + swizzle);\n this.setChanged();\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n if (this.texture.matrixAutoUpdate) {\n this.texture.updateMatrix();\n }\n }\n};\n\n// src/effects/TiltShiftEffect.js\nimport { SRGBColorSpace as SRGBColorSpace12, Uniform as Uniform44, Vector2 as Vector224, WebGLRenderTarget as WebGLRenderTarget17 } from \"three\";\n\n// src/materials/TiltShiftBlurMaterial.js\nimport { Uniform as Uniform43, Vector2 as Vector223, Vector4 as Vector45 } from \"three\";\n\n// src/materials/glsl/convolution.tilt-shift.frag\nvar convolution_tilt_shift_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform vec4 maskParams;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;float linearGradientMask(const in float x){return smoothstep(maskParams.x,maskParams.y,x)-smoothstep(maskParams.w,maskParams.z,x);}void main(){vec2 dUv=vOffset*(1.0-linearGradientMask(vUv2.y));vec4 sum=texture2D(inputBuffer,vec2(vUv.x-dUv.x,vUv.y+dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x+dUv.x,vUv.y+dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x+dUv.x,vUv.y-dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x-dUv.x,vUv.y-dUv.y));gl_FragColor=sum*0.25;\n#include \n}`;\n\n// src/materials/glsl/convolution.tilt-shift.vert\nvar convolution_tilt_shift_default2 = `uniform vec4 texelSize;uniform float kernel;uniform float scale;uniform float aspect;uniform vec2 rotation;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;void main(){vec2 uv=position.xy*0.5+0.5;vUv=uv;vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));vOffset=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/TiltShiftBlurMaterial.js\nvar TiltShiftBlurMaterial = class extends KawaseBlurMaterial {\n /**\n * Constructs a new tilt shift blur material.\n *\n * @param {Object} [options] - The options.\n * @param {Number} [options.offset=0.0] - The relative offset of the focus area.\n * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians.\n * @param {Number} [options.focusArea=0.4] - The relative size of the focus area.\n * @param {Number} [options.feather=0.3] - The softness of the focus area edges.\n */\n constructor({\n kernelSize = KernelSize.MEDIUM,\n offset = 0,\n rotation = 0,\n focusArea = 0.4,\n feather = 0.3\n } = {}) {\n super();\n this.fragmentShader = convolution_tilt_shift_default;\n this.vertexShader = convolution_tilt_shift_default2;\n this.kernelSize = kernelSize;\n this.uniforms.aspect = new Uniform43(1);\n this.uniforms.rotation = new Uniform43(new Vector223());\n this.uniforms.maskParams = new Uniform43(new Vector45());\n this._offset = offset;\n this._focusArea = focusArea;\n this._feather = feather;\n this.rotation = rotation;\n this.updateParams();\n }\n /**\n * The relative offset of the focus area.\n *\n * @private\n */\n updateParams() {\n const params = this.uniforms.maskParams.value;\n const a = Math.max(this.focusArea, 0);\n const b = Math.max(a - this.feather, 0);\n params.set(\n this.offset - a,\n this.offset - b,\n this.offset + a,\n this.offset + b\n );\n }\n /**\n * The rotation of the focus area in radians.\n *\n * @type {Number}\n */\n get rotation() {\n return Math.acos(this.uniforms.rotation.value.x);\n }\n set rotation(value) {\n this.uniforms.rotation.value.set(Math.cos(value), Math.sin(value));\n }\n /**\n * The relative offset of the focus area.\n *\n * @type {Number}\n */\n get offset() {\n return this._offset;\n }\n set offset(value) {\n this._offset = value;\n this.updateParams();\n }\n /**\n * The relative size of the focus area.\n *\n * @type {Number}\n */\n get focusArea() {\n return this._focusArea;\n }\n set focusArea(value) {\n this._focusArea = value;\n this.updateParams();\n }\n /**\n * The softness of the focus area edges.\n *\n * @type {Number}\n */\n get feather() {\n return this._feather;\n }\n set feather(value) {\n this._feather = value;\n this.updateParams();\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n super.setSize(width, height);\n this.uniforms.aspect.value = width / height;\n }\n};\n\n// src/passes/TiltShiftBlurPass.js\nvar TiltShiftBlurPass = class extends KawaseBlurPass {\n /**\n * Constructs a new Kawase blur pass.\n *\n * @param {Object} [options] - The options.\n * @param {Number} [options.offset=0.0] - The relative offset of the focus area.\n * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians.\n * @param {Number} [options.focusArea=0.4] - The relative size of the focus area.\n * @param {Number} [options.feather=0.3] - The softness of the focus area edges.\n * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size.\n * @param {Number} [options.resolutionScale=0.5] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n */\n constructor({\n offset = 0,\n rotation = 0,\n focusArea = 0.4,\n feather = 0.3,\n kernelSize = KernelSize.MEDIUM,\n resolutionScale = 0.5,\n resolutionX = Resolution.AUTO_SIZE,\n resolutionY = Resolution.AUTO_SIZE\n } = {}) {\n super({ kernelSize, resolutionScale, resolutionX, resolutionY });\n this.blurMaterial = new TiltShiftBlurMaterial({ kernelSize, offset, rotation, focusArea, feather });\n }\n};\n\n// src/effects/glsl/tilt-shift.frag\nvar tilt_shift_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform vec2 maskParams;varying vec2 vUv2;float linearGradientMask(const in float x){return step(maskParams.x,x)-step(maskParams.y,x);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float mask=linearGradientMask(vUv2.y);vec4 texel=texture2D(map,uv);outputColor=mix(texel,inputColor,mask);}`;\n\n// src/effects/glsl/tilt-shift.vert\nvar tilt_shift_default2 = `uniform vec2 rotation;varying vec2 vUv2;void mainSupport(const in vec2 uv){vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));}`;\n\n// src/effects/TiltShiftEffect.js\nvar TiltShiftEffect = class extends Effect {\n /**\n * Constructs a new tilt shift Effect\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {Number} [options.offset=0.0] - The relative offset of the focus area.\n * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians.\n * @param {Number} [options.focusArea=0.4] - The relative size of the focus area.\n * @param {Number} [options.feather=0.3] - The softness of the focus area edges.\n * @param {Number} [options.bias=0.06] - Deprecated.\n * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size.\n * @param {Number} [options.resolutionScale=0.5] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n */\n constructor({\n blendFunction,\n offset = 0,\n rotation = 0,\n focusArea = 0.4,\n feather = 0.3,\n kernelSize = KernelSize.MEDIUM,\n resolutionScale = 0.5,\n resolutionX = Resolution.AUTO_SIZE,\n resolutionY = Resolution.AUTO_SIZE\n } = {}) {\n super(\"TiltShiftEffect\", tilt_shift_default, {\n vertexShader: tilt_shift_default2,\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"rotation\", new Uniform44(new Vector224())],\n [\"maskParams\", new Uniform44(new Vector224())],\n [\"map\", new Uniform44(null)]\n ])\n });\n this._offset = offset;\n this._focusArea = focusArea;\n this._feather = feather;\n this.renderTarget = new WebGLRenderTarget17(1, 1, { depthBuffer: false });\n this.renderTarget.texture.name = \"TiltShift.Target\";\n this.uniforms.get(\"map\").value = this.renderTarget.texture;\n this.blurPass = new TiltShiftBlurPass({\n kernelSize,\n resolutionScale,\n resolutionX,\n resolutionY,\n offset,\n rotation,\n focusArea,\n feather\n });\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n this.rotation = rotation;\n this.updateParams();\n }\n /**\n * Updates the mask params.\n *\n * @private\n */\n updateParams() {\n const params = this.uniforms.get(\"maskParams\").value;\n const x = Math.max(this.focusArea - this.feather, 0);\n params.set(this.offset - x, this.offset + x);\n }\n /**\n * The rotation of the focus area in radians.\n *\n * @type {Number}\n */\n get rotation() {\n return Math.acos(this.uniforms.get(\"rotation\").value.x);\n }\n set rotation(value) {\n this.uniforms.get(\"rotation\").value.set(Math.cos(value), Math.sin(value));\n this.blurPass.blurMaterial.rotation = value;\n }\n /**\n * The relative offset of the focus area.\n *\n * @type {Number}\n */\n get offset() {\n return this._offset;\n }\n set offset(value) {\n this._offset = value;\n this.blurPass.blurMaterial.offset = value;\n this.updateParams();\n }\n /**\n * The relative size of the focus area.\n *\n * @type {Number}\n */\n get focusArea() {\n return this._focusArea;\n }\n set focusArea(value) {\n this._focusArea = value;\n this.blurPass.blurMaterial.focusArea = value;\n this.updateParams();\n }\n /**\n * The softness of the focus area edges.\n *\n * @type {Number}\n */\n get feather() {\n return this._feather;\n }\n set feather(value) {\n this._feather = value;\n this.blurPass.blurMaterial.feather = value;\n this.updateParams();\n }\n /**\n * A blend bias.\n *\n * @type {Number}\n * @deprecated\n */\n get bias() {\n return 0;\n }\n set bias(value) {\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n this.blurPass.render(renderer, inputBuffer, this.renderTarget);\n }\n /**\n * Updates the size of internal render targets.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n this.renderTarget.setSize(resolution.width, resolution.height);\n this.blurPass.resolution.copy(resolution);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.blurPass.initialize(renderer, alpha, frameBufferType);\n if (frameBufferType !== void 0) {\n this.renderTarget.texture.type = frameBufferType;\n if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace12) {\n this.renderTarget.texture.colorSpace = SRGBColorSpace12;\n }\n }\n }\n};\n\n// src/effects/ToneMappingEffect.js\nimport { LinearMipmapLinearFilter, REVISION as REVISION3, Uniform as Uniform46, WebGLRenderTarget as WebGLRenderTarget19 } from \"three\";\n\n// src/passes/AdaptiveLuminancePass.js\nimport { NearestFilter as NearestFilter6, WebGLRenderTarget as WebGLRenderTarget18 } from \"three\";\n\n// src/materials/AdaptiveLuminanceMaterial.js\nimport { NoBlending as NoBlending17, ShaderMaterial as ShaderMaterial18, Uniform as Uniform45 } from \"three\";\n\n// src/materials/glsl/adaptive-luminance.frag\nvar adaptive_luminance_default = `#include \n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\nuniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv));\n#if __VERSION__ < 300\nfloat l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;\n#else\nfloat l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;\n#endif\nl0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`;\n\n// src/materials/AdaptiveLuminanceMaterial.js\nvar AdaptiveLuminanceMaterial = class extends ShaderMaterial18 {\n /**\n * Constructs a new adaptive luminance material.\n */\n constructor() {\n super({\n name: \"AdaptiveLuminanceMaterial\",\n defines: {\n MIP_LEVEL_1X1: \"0.0\"\n },\n uniforms: {\n luminanceBuffer0: new Uniform45(null),\n luminanceBuffer1: new Uniform45(null),\n minLuminance: new Uniform45(0.01),\n deltaTime: new Uniform45(0),\n tau: new Uniform45(1)\n },\n extensions: {\n shaderTextureLOD: true\n },\n blending: NoBlending17,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: adaptive_luminance_default,\n vertexShader: common_default\n });\n }\n /**\n * The primary luminance buffer that contains the downsampled average luminance.\n *\n * @type {Texture}\n */\n set luminanceBuffer0(value) {\n this.uniforms.luminanceBuffer0.value = value;\n }\n /**\n * Sets the primary luminance buffer that contains the downsampled average luminance.\n *\n * @deprecated Use luminanceBuffer0 instead.\n * @param {Texture} value - The buffer.\n */\n setLuminanceBuffer0(value) {\n this.uniforms.luminanceBuffer0.value = value;\n }\n /**\n * The secondary luminance buffer.\n *\n * @type {Texture}\n */\n set luminanceBuffer1(value) {\n this.uniforms.luminanceBuffer1.value = value;\n }\n /**\n * Sets the secondary luminance buffer.\n *\n * @deprecated Use luminanceBuffer1 instead.\n * @param {Texture} value - The buffer.\n */\n setLuminanceBuffer1(value) {\n this.uniforms.luminanceBuffer1.value = value;\n }\n /**\n * The 1x1 mipmap level.\n *\n * This level is used to identify the smallest mipmap of the primary luminance buffer.\n *\n * @type {Number}\n */\n set mipLevel1x1(value) {\n this.defines.MIP_LEVEL_1X1 = value.toFixed(1);\n this.needsUpdate = true;\n }\n /**\n * Sets the 1x1 mipmap level.\n *\n * @deprecated Use mipLevel1x1 instead.\n * @param {Number} value - The level.\n */\n setMipLevel1x1(value) {\n this.mipLevel1x1 = value;\n }\n /**\n * The delta time.\n *\n * @type {Number}\n */\n set deltaTime(value) {\n this.uniforms.deltaTime.value = value;\n }\n /**\n * Sets the delta time.\n *\n * @deprecated Use deltaTime instead.\n * @param {Number} value - The delta time.\n */\n setDeltaTime(value) {\n this.uniforms.deltaTime.value = value;\n }\n /**\n * The lowest possible luminance value.\n *\n * @type {Number}\n */\n get minLuminance() {\n return this.uniforms.minLuminance.value;\n }\n set minLuminance(value) {\n this.uniforms.minLuminance.value = value;\n }\n /**\n * Returns the lowest possible luminance value.\n *\n * @deprecated Use minLuminance instead.\n * @return {Number} The minimum luminance.\n */\n getMinLuminance() {\n return this.uniforms.minLuminance.value;\n }\n /**\n * Sets the minimum luminance.\n *\n * @deprecated Use minLuminance instead.\n * @param {Number} value - The minimum luminance.\n */\n setMinLuminance(value) {\n this.uniforms.minLuminance.value = value;\n }\n /**\n * The luminance adaptation rate.\n *\n * @type {Number}\n */\n get adaptationRate() {\n return this.uniforms.tau.value;\n }\n set adaptationRate(value) {\n this.uniforms.tau.value = value;\n }\n /**\n * Returns the luminance adaptation rate.\n *\n * @deprecated Use adaptationRate instead.\n * @return {Number} The adaptation rate.\n */\n getAdaptationRate() {\n return this.uniforms.tau.value;\n }\n /**\n * Sets the luminance adaptation rate.\n *\n * @deprecated Use adaptationRate instead.\n * @param {Number} value - The adaptation rate.\n */\n setAdaptationRate(value) {\n this.uniforms.tau.value = value;\n }\n};\n\n// src/passes/AdaptiveLuminancePass.js\nvar AdaptiveLuminancePass = class extends Pass {\n /**\n * Constructs a new adaptive luminance pass.\n *\n * @param {Texture} luminanceBuffer - A buffer that contains the current scene luminance.\n * @param {Object} [options] - The options.\n * @param {Number} [options.minLuminance=0.01] - The minimum luminance.\n * @param {Number} [options.adaptationRate=1.0] - The luminance adaptation rate.\n */\n constructor(luminanceBuffer, { minLuminance = 0.01, adaptationRate = 1 } = {}) {\n super(\"AdaptiveLuminancePass\");\n this.fullscreenMaterial = new AdaptiveLuminanceMaterial();\n this.needsSwap = false;\n this.renderTargetPrevious = new WebGLRenderTarget18(1, 1, {\n minFilter: NearestFilter6,\n magFilter: NearestFilter6,\n depthBuffer: false\n });\n this.renderTargetPrevious.texture.name = \"Luminance.Previous\";\n const material = this.fullscreenMaterial;\n material.luminanceBuffer0 = this.renderTargetPrevious.texture;\n material.luminanceBuffer1 = luminanceBuffer;\n material.minLuminance = minLuminance;\n material.adaptationRate = adaptationRate;\n this.renderTargetAdapted = this.renderTargetPrevious.clone();\n this.renderTargetAdapted.texture.name = \"Luminance.Adapted\";\n this.copyPass = new CopyPass(this.renderTargetPrevious, false);\n }\n /**\n * The adaptive luminance texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTargetAdapted.texture;\n }\n /**\n * Returns the adaptive 1x1 luminance texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTargetAdapted.texture;\n }\n /**\n * Sets the 1x1 mipmap level.\n *\n * This level is used to identify the smallest mipmap of the main luminance texture which contains the downsampled\n * average scene luminance.\n *\n * @type {Number}\n * @deprecated Use fullscreenMaterial.mipLevel1x1 instead.\n */\n set mipLevel1x1(value) {\n this.fullscreenMaterial.mipLevel1x1 = value;\n }\n /**\n * The luminance adaptation rate.\n *\n * @type {Number}\n * @deprecated Use fullscreenMaterial.adaptationRate instead.\n */\n get adaptationRate() {\n return this.fullscreenMaterial.adaptationRate;\n }\n /**\n * @type {Number}\n * @deprecated Use fullscreenMaterial.adaptationRate instead.\n */\n set adaptationRate(value) {\n this.fullscreenMaterial.adaptationRate = value;\n }\n /**\n * Renders the scene normals.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n this.fullscreenMaterial.deltaTime = deltaTime;\n renderer.setRenderTarget(this.renderToScreen ? null : this.renderTargetAdapted);\n renderer.render(this.scene, this.camera);\n this.copyPass.render(renderer, this.renderTargetAdapted);\n }\n};\n\n// src/effects/glsl/tone-mapping.frag\nvar tone_mapping_default = `#include \nuniform float whitePoint;\n#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3\nuniform float middleGrey;\n#if TONE_MAPPING_MODE == 3\nuniform lowp sampler2D luminanceBuffer;\n#else\nuniform float averageLuminance;\n#endif\nvec3 Reinhard2ToneMapping(vec3 color){color*=toneMappingExposure;float l=luminance(color);\n#if TONE_MAPPING_MODE == 3\nfloat lumAvg=unpackRGBAToFloat(texture2D(luminanceBuffer,vec2(0.5)));\n#else\nfloat lumAvg=averageLuminance;\n#endif\nfloat lumScaled=(l*middleGrey)/max(lumAvg,1e-6);float lumCompressed=lumScaled*(1.0+lumScaled/(whitePoint*whitePoint));lumCompressed/=(1.0+lumScaled);return clamp(lumCompressed*color,0.0,1.0);}\n#elif TONE_MAPPING_MODE == 4\n#define A 0.15\n#define B 0.50\n#define C 0.10\n#define D 0.20\n#define E 0.02\n#define F 0.30\nvec3 Uncharted2Helper(const in vec3 x){return((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}vec3 Uncharted2ToneMapping(vec3 color){color*=toneMappingExposure;return clamp(Uncharted2Helper(color)/Uncharted2Helper(vec3(whitePoint)),0.0,1.0);}\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){\n#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3\noutputColor=vec4(Reinhard2ToneMapping(inputColor.rgb),inputColor.a);\n#elif TONE_MAPPING_MODE == 4\noutputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a);\n#else\noutputColor=vec4(toneMapping(inputColor.rgb),inputColor.a);\n#endif\n}`;\n\n// src/effects/ToneMappingEffect.js\nvar ToneMappingEffect = class extends Effect {\n /**\n * Constructs a new tone mapping effect.\n *\n * The additional parameters only affect the Reinhard2 operator.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction=BlendFunction.SRC] - The blend function of this effect.\n * @param {Boolean} [options.adaptive=false] - Deprecated. Use mode instead.\n * @param {ToneMappingMode} [options.mode=ToneMappingMode.AGX] - The tone mapping mode.\n * @param {Number} [options.resolution=256] - The resolution of the luminance texture. Must be a power of two.\n * @param {Number} [options.maxLuminance=4.0] - Deprecated. Same as whitePoint.\n * @param {Number} [options.whitePoint=4.0] - The white point.\n * @param {Number} [options.middleGrey=0.6] - The middle grey factor.\n * @param {Number} [options.minLuminance=0.01] - The minimum luminance. Prevents very high exposure in dark scenes.\n * @param {Number} [options.averageLuminance=1.0] - The average luminance. Used for the non-adaptive Reinhard operator.\n * @param {Number} [options.adaptationRate=1.0] - The luminance adaptation rate.\n */\n constructor({\n blendFunction = BlendFunction.SRC,\n adaptive = false,\n mode = adaptive ? ToneMappingMode.REINHARD2_ADAPTIVE : ToneMappingMode.AGX,\n resolution = 256,\n maxLuminance = 4,\n whitePoint = maxLuminance,\n middleGrey = 0.6,\n minLuminance = 0.01,\n averageLuminance = 1,\n adaptationRate = 1\n } = {}) {\n super(\"ToneMappingEffect\", tone_mapping_default, {\n blendFunction,\n uniforms: /* @__PURE__ */ new Map([\n [\"luminanceBuffer\", new Uniform46(null)],\n [\"maxLuminance\", new Uniform46(maxLuminance)],\n // Unused\n [\"whitePoint\", new Uniform46(whitePoint)],\n [\"middleGrey\", new Uniform46(middleGrey)],\n [\"averageLuminance\", new Uniform46(averageLuminance)]\n ])\n });\n this.renderTargetLuminance = new WebGLRenderTarget19(1, 1, {\n minFilter: LinearMipmapLinearFilter,\n depthBuffer: false\n });\n this.renderTargetLuminance.texture.generateMipmaps = true;\n this.renderTargetLuminance.texture.name = \"Luminance\";\n this.luminancePass = new LuminancePass({\n renderTarget: this.renderTargetLuminance\n });\n this.adaptiveLuminancePass = new AdaptiveLuminancePass(this.luminancePass.texture, {\n minLuminance,\n adaptationRate\n });\n this.uniforms.get(\"luminanceBuffer\").value = this.adaptiveLuminancePass.texture;\n this.resolution = resolution;\n this.mode = mode;\n }\n /**\n * The tone mapping mode.\n *\n * @type {ToneMappingMode}\n */\n get mode() {\n return Number(this.defines.get(\"TONE_MAPPING_MODE\"));\n }\n set mode(value) {\n if (this.mode === value) {\n return;\n }\n const revision = REVISION3.replace(/\\D+/g, \"\");\n const cineonToneMapping = revision >= 168 ? \"CineonToneMapping(texel)\" : \"OptimizedCineonToneMapping(texel)\";\n this.defines.clear();\n this.defines.set(\"TONE_MAPPING_MODE\", value.toFixed(0));\n switch (value) {\n case ToneMappingMode.LINEAR:\n this.defines.set(\"toneMapping(texel)\", \"LinearToneMapping(texel)\");\n break;\n case ToneMappingMode.REINHARD:\n this.defines.set(\"toneMapping(texel)\", \"ReinhardToneMapping(texel)\");\n break;\n case ToneMappingMode.CINEON:\n case ToneMappingMode.OPTIMIZED_CINEON:\n this.defines.set(\"toneMapping(texel)\", cineonToneMapping);\n break;\n case ToneMappingMode.ACES_FILMIC:\n this.defines.set(\"toneMapping(texel)\", \"ACESFilmicToneMapping(texel)\");\n break;\n case ToneMappingMode.AGX:\n this.defines.set(\"toneMapping(texel)\", \"AgXToneMapping(texel)\");\n break;\n case ToneMappingMode.NEUTRAL:\n this.defines.set(\"toneMapping(texel)\", \"NeutralToneMapping(texel)\");\n break;\n default:\n this.defines.set(\"toneMapping(texel)\", \"texel\");\n break;\n }\n this.adaptiveLuminancePass.enabled = value === ToneMappingMode.REINHARD2_ADAPTIVE;\n this.setChanged();\n }\n /**\n * Returns the current tone mapping mode.\n *\n * @deprecated Use mode instead.\n * @return {ToneMappingMode} The tone mapping mode.\n */\n getMode() {\n return this.mode;\n }\n /**\n * Sets the tone mapping mode.\n *\n * @deprecated Use mode instead.\n * @param {ToneMappingMode} value - The tone mapping mode.\n */\n setMode(value) {\n this.mode = value;\n }\n /**\n * The white point. Default is `4.0`.\n *\n * Only applies to Reinhard2 (Modified & Adaptive).\n *\n * @type {Number}\n */\n get whitePoint() {\n return this.uniforms.get(\"whitePoint\").value;\n }\n set whitePoint(value) {\n this.uniforms.get(\"whitePoint\").value = value;\n }\n /**\n * The middle grey factor. Default is `0.6`.\n *\n * Only applies to Reinhard2 (Modified & Adaptive).\n *\n * @type {Number}\n */\n get middleGrey() {\n return this.uniforms.get(\"middleGrey\").value;\n }\n set middleGrey(value) {\n this.uniforms.get(\"middleGrey\").value = value;\n }\n /**\n * The average luminance.\n *\n * Only applies to Reinhard2 (Modified).\n *\n * @type {Number}\n */\n get averageLuminance() {\n return this.uniforms.get(\"averageLuminance\").value;\n }\n set averageLuminance(value) {\n this.uniforms.get(\"averageLuminance\").value = value;\n }\n /**\n * The adaptive luminance material.\n *\n * @type {AdaptiveLuminanceMaterial}\n */\n get adaptiveLuminanceMaterial() {\n return this.adaptiveLuminancePass.fullscreenMaterial;\n }\n /**\n * Returns the adaptive luminance material.\n *\n * @deprecated Use adaptiveLuminanceMaterial instead.\n * @return {AdaptiveLuminanceMaterial} The material.\n */\n getAdaptiveLuminanceMaterial() {\n return this.adaptiveLuminanceMaterial;\n }\n /**\n * The resolution of the luminance texture. Must be a power of two.\n *\n * @type {Number}\n */\n get resolution() {\n return this.luminancePass.resolution.width;\n }\n set resolution(value) {\n const exponent = Math.max(0, Math.ceil(Math.log2(value)));\n const size = Math.pow(2, exponent);\n this.luminancePass.resolution.setPreferredSize(size, size);\n this.adaptiveLuminanceMaterial.mipLevel1x1 = exponent;\n }\n /**\n * Returns the resolution of the luminance texture.\n *\n * @deprecated Use resolution instead.\n * @return {Number} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * Sets the resolution of the luminance texture. Must be a power of two.\n *\n * @deprecated Use resolution instead.\n * @param {Number} value - The resolution.\n */\n setResolution(value) {\n this.resolution = value;\n }\n /**\n * Indicates whether this pass uses adaptive luminance.\n *\n * @type {Boolean}\n * @deprecated Use mode instead.\n */\n get adaptive() {\n return this.mode === ToneMappingMode.REINHARD2_ADAPTIVE;\n }\n set adaptive(value) {\n this.mode = value ? ToneMappingMode.REINHARD2_ADAPTIVE : ToneMappingMode.REINHARD2;\n }\n /**\n * The luminance adaptation rate.\n *\n * @type {Number}\n * @deprecated Use adaptiveLuminanceMaterial.adaptationRate instead.\n */\n get adaptationRate() {\n return this.adaptiveLuminanceMaterial.adaptationRate;\n }\n set adaptationRate(value) {\n this.adaptiveLuminanceMaterial.adaptationRate = value;\n }\n /**\n * @type {Number}\n * @deprecated\n */\n get distinction() {\n console.warn(this.name, \"distinction was removed.\");\n return 1;\n }\n set distinction(value) {\n console.warn(this.name, \"distinction was removed.\");\n }\n /**\n * Updates this effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n */\n update(renderer, inputBuffer, deltaTime) {\n if (this.adaptiveLuminancePass.enabled) {\n this.luminancePass.render(renderer, inputBuffer);\n this.adaptiveLuminancePass.render(renderer, null, null, deltaTime);\n }\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.adaptiveLuminancePass.initialize(renderer, alpha, frameBufferType);\n }\n};\n\n// src/effects/VignetteEffect.js\nimport { Uniform as Uniform47 } from \"three\";\n\n// src/effects/glsl/vignette.frag\nvar vignette_default = `uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;\n#if VIGNETTE_TECHNIQUE == 0\nfloat d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));\n#else\nvec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));\n#endif\noutputColor=vec4(color,inputColor.a);}`;\n\n// src/effects/VignetteEffect.js\nvar VignetteEffect = class extends Effect {\n /**\n * Constructs a new Vignette effect.\n *\n * @param {Object} [options] - The options.\n * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.\n * @param {VignetteTechnique} [options.technique=VignetteTechnique.DEFAULT] - The Vignette technique.\n * @param {Boolean} [options.eskil=false] - Deprecated. Use technique instead.\n * @param {Number} [options.offset=0.5] - The Vignette offset.\n * @param {Number} [options.darkness=0.5] - The Vignette darkness.\n */\n constructor({\n blendFunction,\n eskil = false,\n technique = eskil ? VignetteTechnique.ESKIL : VignetteTechnique.DEFAULT,\n offset = 0.5,\n darkness = 0.5\n } = {}) {\n super(\"VignetteEffect\", vignette_default, {\n blendFunction,\n defines: /* @__PURE__ */ new Map([\n [\"VIGNETTE_TECHNIQUE\", technique.toFixed(0)]\n ]),\n uniforms: /* @__PURE__ */ new Map([\n [\"offset\", new Uniform47(offset)],\n [\"darkness\", new Uniform47(darkness)]\n ])\n });\n }\n /**\n * The Vignette technique.\n *\n * @type {VignetteTechnique}\n */\n get technique() {\n return Number(this.defines.get(\"VIGNETTE_TECHNIQUE\"));\n }\n set technique(value) {\n if (this.technique !== value) {\n this.defines.set(\"VIGNETTE_TECHNIQUE\", value.toFixed(0));\n this.setChanged();\n }\n }\n /**\n * Indicates whether Eskil's Vignette technique is enabled.\n *\n * @type {Boolean}\n * @deprecated Use technique instead.\n */\n get eskil() {\n return this.technique === VignetteTechnique.ESKIL;\n }\n /**\n * Indicates whether Eskil's Vignette technique is enabled.\n *\n * @type {Boolean}\n * @deprecated Use technique instead.\n */\n set eskil(value) {\n this.technique = value ? VignetteTechnique.ESKIL : VignetteTechnique.DEFAULT;\n }\n /**\n * Returns the Vignette technique.\n *\n * @deprecated Use technique instead.\n * @return {VignetteTechnique} The technique.\n */\n getTechnique() {\n return this.technique;\n }\n /**\n * Sets the Vignette technique.\n *\n * @deprecated Use technique instead.\n * @param {VignetteTechnique} value - The technique.\n */\n setTechnique(value) {\n this.technique = value;\n }\n /**\n * The Vignette offset.\n *\n * @type {Number}\n */\n get offset() {\n return this.uniforms.get(\"offset\").value;\n }\n set offset(value) {\n this.uniforms.get(\"offset\").value = value;\n }\n /**\n * Returns the Vignette offset.\n *\n * @deprecated Use offset instead.\n * @return {Number} The offset.\n */\n getOffset() {\n return this.offset;\n }\n /**\n * Sets the Vignette offset.\n *\n * @deprecated Use offset instead.\n * @param {Number} value - The offset.\n */\n setOffset(value) {\n this.offset = value;\n }\n /**\n * The Vignette darkness.\n *\n * @type {Number}\n */\n get darkness() {\n return this.uniforms.get(\"darkness\").value;\n }\n set darkness(value) {\n this.uniforms.get(\"darkness\").value = value;\n }\n /**\n * Returns the Vignette darkness.\n *\n * @deprecated Use darkness instead.\n * @return {Number} The darkness.\n */\n getDarkness() {\n return this.darkness;\n }\n /**\n * Sets the Vignette darkness.\n *\n * @deprecated Use darkness instead.\n * @param {Number} value - The darkness.\n */\n setDarkness(value) {\n this.darkness = value;\n }\n};\n\n// src/loaders/LUT3dlLoader.js\nimport { FileLoader, Loader, LoadingManager as LoadingManager2 } from \"three\";\nvar LUT3dlLoader = class extends Loader {\n /**\n * Loads a LUT.\n *\n * @param {String} url - The URL of the 3dl-file.\n * @param {Function} [onLoad] - A callback that receives the loaded lookup texture.\n * @param {Function} [onProgress] - A progress callback that receives the XMLHttpRequest instance.\n * @param {Function} [onError] - An error callback that receives the URL of the file that failed to load.\n * @return {Promise} A promise that returns the lookup texture.\n */\n load(url, onLoad = () => {\n }, onProgress = () => {\n }, onError = null) {\n const externalManager = this.manager;\n const internalManager = new LoadingManager2();\n const loader = new FileLoader(internalManager);\n loader.setPath(this.path);\n loader.setResponseType(\"text\");\n return new Promise((resolve, reject) => {\n internalManager.onError = (url2) => {\n externalManager.itemError(url2);\n if (onError !== null) {\n onError(`Failed to load ${url2}`);\n resolve();\n } else {\n reject(`Failed to load ${url2}`);\n }\n };\n externalManager.itemStart(url);\n loader.load(url, (data) => {\n try {\n const result = this.parse(data);\n externalManager.itemEnd(url);\n onLoad(result);\n resolve(result);\n } catch (e) {\n console.error(e);\n internalManager.onError(url);\n }\n }, onProgress);\n });\n }\n /**\n * Parses the given data.\n *\n * @param {String} input - The LUT data.\n * @return {LookupTexture} The lookup texture.\n * @throws {Error} Fails if the data is invalid.\n */\n parse(input) {\n const regExpGridInfo = /^[\\d ]+$/m;\n const regExpDataPoints = /^([\\d.e+-]+) +([\\d.e+-]+) +([\\d.e+-]+) *$/gm;\n let result = regExpGridInfo.exec(input);\n if (result === null) {\n throw new Error(\"Missing grid information\");\n }\n const gridLines = result[0].trim().split(/\\s+/g).map((n) => Number(n));\n const gridStep = gridLines[1] - gridLines[0];\n const size = gridLines.length;\n const sizeSq = size ** 2;\n for (let i = 1, l = gridLines.length; i < l; ++i) {\n if (gridStep !== gridLines[i] - gridLines[i - 1]) {\n throw new Error(\"Inconsistent grid size\");\n }\n }\n const data = new Float32Array(size ** 3 * 4);\n let maxValue = 0;\n let index = 0;\n while ((result = regExpDataPoints.exec(input)) !== null) {\n const r = Number(result[1]);\n const g = Number(result[2]);\n const b = Number(result[3]);\n maxValue = Math.max(maxValue, r, g, b);\n const bLayer = index % size;\n const gLayer = Math.floor(index / size) % size;\n const rLayer = Math.floor(index / sizeSq) % size;\n const d4 = (bLayer * sizeSq + gLayer * size + rLayer) * 4;\n data[d4 + 0] = r;\n data[d4 + 1] = g;\n data[d4 + 2] = b;\n data[d4 + 3] = 1;\n ++index;\n }\n const bits = Math.ceil(Math.log2(maxValue));\n const maxBitValue = Math.pow(2, bits);\n for (let i = 0, l = data.length; i < l; i += 4) {\n data[i + 0] /= maxBitValue;\n data[i + 1] /= maxBitValue;\n data[i + 2] /= maxBitValue;\n }\n return new LookupTexture(data, size);\n }\n};\n\n// src/loaders/LUTCubeLoader.js\nimport { FileLoader as FileLoader2, Loader as Loader2, LoadingManager as LoadingManager3, Vector3 as Vector37 } from \"three\";\nvar LUTCubeLoader = class extends Loader2 {\n /**\n * Loads a LUT.\n *\n * @param {String} url - The URL of the CUBE-file.\n * @param {Function} [onLoad] - A callback that receives the loaded lookup texture.\n * @param {Function} [onProgress] - A progress callback that receives the XMLHttpRequest instance.\n * @param {Function} [onError] - An error callback that receives the URL of the file that failed to load.\n * @return {Promise} A promise that returns the lookup texture.\n */\n load(url, onLoad = () => {\n }, onProgress = () => {\n }, onError = null) {\n const externalManager = this.manager;\n const internalManager = new LoadingManager3();\n const loader = new FileLoader2(internalManager);\n loader.setPath(this.path);\n loader.setResponseType(\"text\");\n return new Promise((resolve, reject) => {\n internalManager.onError = (url2) => {\n externalManager.itemError(url2);\n if (onError !== null) {\n onError(`Failed to load ${url2}`);\n resolve();\n } else {\n reject(`Failed to load ${url2}`);\n }\n };\n externalManager.itemStart(url);\n loader.load(url, (data) => {\n try {\n const result = this.parse(data);\n externalManager.itemEnd(url);\n onLoad(result);\n resolve(result);\n } catch (e) {\n console.error(e);\n internalManager.onError(url);\n }\n }, onProgress);\n });\n }\n /**\n * Parses the given data.\n *\n * @param {String} input - The LUT data.\n * @return {LookupTexture} The lookup texture.\n * @throws {Error} Fails if the data is invalid.\n */\n parse(input) {\n const regExpTitle = /TITLE +\"([^\"]*)\"/;\n const regExpSize = /LUT_3D_SIZE +(\\d+)/;\n const regExpDomainMin = /DOMAIN_MIN +([\\d.]+) +([\\d.]+) +([\\d.]+)/;\n const regExpDomainMax = /DOMAIN_MAX +([\\d.]+) +([\\d.]+) +([\\d.]+)/;\n const regExpDataPoints = /^([\\d.e+-]+) +([\\d.e+-]+) +([\\d.e+-]+) *$/gm;\n let result = regExpTitle.exec(input);\n const title = result !== null ? result[1] : null;\n result = regExpSize.exec(input);\n if (result === null) {\n throw new Error(\"Missing LUT_3D_SIZE information\");\n }\n const size = Number(result[1]);\n const data = new Float32Array(size ** 3 * 4);\n const domainMin = new Vector37(0, 0, 0);\n const domainMax = new Vector37(1, 1, 1);\n result = regExpDomainMin.exec(input);\n if (result !== null) {\n domainMin.set(Number(result[1]), Number(result[2]), Number(result[3]));\n }\n result = regExpDomainMax.exec(input);\n if (result !== null) {\n domainMax.set(Number(result[1]), Number(result[2]), Number(result[3]));\n }\n if (domainMin.x > domainMax.x || domainMin.y > domainMax.y || domainMin.z > domainMax.z) {\n domainMin.set(0, 0, 0);\n domainMax.set(1, 1, 1);\n throw new Error(\"Invalid input domain\");\n }\n let i = 0;\n while ((result = regExpDataPoints.exec(input)) !== null) {\n data[i++] = Number(result[1]);\n data[i++] = Number(result[2]);\n data[i++] = Number(result[3]);\n data[i++] = 1;\n }\n const lut = new LookupTexture(data, size);\n lut.domainMin.copy(domainMin);\n lut.domainMax.copy(domainMax);\n if (title !== null) {\n lut.name = title;\n }\n return lut;\n }\n};\n\n// src/loaders/SMAAImageLoader.js\nimport { Loader as Loader3, LoadingManager as LoadingManager4 } from \"three\";\nvar SMAAImageLoader = class extends Loader3 {\n /**\n * Loads the SMAA data images.\n *\n * @param {Function} [onLoad] - A callback that receives the search image and area image as a pair.\n * @param {Function} [onError] - An error callback that receives the URL of the image that failed to load.\n * @return {Promise} A promise that returns the search image and area image as a pair.\n */\n load(onLoad = () => {\n }, onError = null) {\n if (arguments.length === 4) {\n onLoad = arguments[1];\n onError = arguments[3];\n } else if (arguments.length === 3 || typeof arguments[0] !== \"function\") {\n onLoad = arguments[1];\n onError = null;\n }\n const externalManager = this.manager;\n const internalManager = new LoadingManager4();\n return new Promise((resolve, reject) => {\n const searchImage = new Image();\n const areaImage = new Image();\n internalManager.onError = (url) => {\n externalManager.itemError(url);\n if (onError !== null) {\n onError(`Failed to load ${url}`);\n resolve();\n } else {\n reject(`Failed to load ${url}`);\n }\n };\n internalManager.onLoad = () => {\n const result = [searchImage, areaImage];\n onLoad(result);\n resolve(result);\n };\n searchImage.addEventListener(\"error\", (e) => {\n internalManager.itemError(\"smaa-search\");\n });\n areaImage.addEventListener(\"error\", (e) => {\n internalManager.itemError(\"smaa-area\");\n });\n searchImage.addEventListener(\"load\", () => {\n externalManager.itemEnd(\"smaa-search\");\n internalManager.itemEnd(\"smaa-search\");\n });\n areaImage.addEventListener(\"load\", () => {\n externalManager.itemEnd(\"smaa-area\");\n internalManager.itemEnd(\"smaa-area\");\n });\n externalManager.itemStart(\"smaa-search\");\n externalManager.itemStart(\"smaa-area\");\n internalManager.itemStart(\"smaa-search\");\n internalManager.itemStart(\"smaa-area\");\n searchImage.src = searchImageDataURL_default;\n areaImage.src = areaImageDataURL_default;\n });\n }\n};\n\n// src/materials/BoxBlurMaterial.js\nimport { NoBlending as NoBlending18, PerspectiveCamera as PerspectiveCamera5, ShaderMaterial as ShaderMaterial19, Uniform as Uniform48, Vector2 as Vector225 } from \"three\";\n\n// src/materials/glsl/convolution.box.frag\nvar convolution_box_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef BILATERAL\n#include \nuniform vec2 cameraNearFar;\n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}\n#else\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nfloat getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}\n#ifdef PERSPECTIVE_CAMERA\n#define linearDepth(v) viewZToOrthographicDepth(getViewZ(readDepth(v)), cameraNearFar.x, cameraNearFar.y)\n#else\n#define linearDepth(v) readDepth(v)\n#endif\n#endif\n#define getTexel(v) texture2D(inputBuffer, v)\n#if KERNEL_SIZE == 3\nvarying vec2 vUv00,vUv01,vUv02;varying vec2 vUv03,vUv04,vUv05;varying vec2 vUv06,vUv07,vUv08;\n#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13\nvarying vec2 vUv00,vUv01,vUv02,vUv03,vUv04;varying vec2 vUv05,vUv06,vUv07,vUv08,vUv09;varying vec2 vUv10,vUv11,vUv12,vUv13,vUv14;varying vec2 vUv15,vUv16,vUv17,vUv18,vUv19;varying vec2 vUv20,vUv21,vUv22,vUv23,vUv24;\n#else\nuniform vec2 texelSize;uniform float scale;varying vec2 vUv;\n#endif\nvoid main(){\n#if KERNEL_SIZE == 3\nvec4 c[]=vec4[KERNEL_SIZE_SQ](getTexel(vUv00),getTexel(vUv01),getTexel(vUv02),getTexel(vUv03),getTexel(vUv04),getTexel(vUv05),getTexel(vUv06),getTexel(vUv07),getTexel(vUv08));\n#ifdef BILATERAL\nfloat z[]=float[KERNEL_SIZE_SQ](linearDepth(vUv00),linearDepth(vUv01),linearDepth(vUv02),linearDepth(vUv03),linearDepth(vUv04),linearDepth(vUv05),linearDepth(vUv06),linearDepth(vUv07),linearDepth(vUv08));\n#endif\n#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13\nvec4 c[]=vec4[KERNEL_SIZE_SQ](getTexel(vUv00),getTexel(vUv01),getTexel(vUv02),getTexel(vUv03),getTexel(vUv04),getTexel(vUv05),getTexel(vUv06),getTexel(vUv07),getTexel(vUv08),getTexel(vUv09),getTexel(vUv10),getTexel(vUv11),getTexel(vUv12),getTexel(vUv13),getTexel(vUv14),getTexel(vUv15),getTexel(vUv16),getTexel(vUv17),getTexel(vUv18),getTexel(vUv19),getTexel(vUv20),getTexel(vUv21),getTexel(vUv22),getTexel(vUv23),getTexel(vUv24));\n#ifdef BILATERAL\nfloat z[]=float[KERNEL_SIZE_SQ](linearDepth(vUv00),linearDepth(vUv01),linearDepth(vUv02),linearDepth(vUv03),linearDepth(vUv04),linearDepth(vUv05),linearDepth(vUv06),linearDepth(vUv07),linearDepth(vUv08),linearDepth(vUv09),linearDepth(vUv10),linearDepth(vUv11),linearDepth(vUv12),linearDepth(vUv13),linearDepth(vUv14),linearDepth(vUv15),linearDepth(vUv16),linearDepth(vUv17),linearDepth(vUv18),linearDepth(vUv19),linearDepth(vUv20),linearDepth(vUv21),linearDepth(vUv22),linearDepth(vUv23),linearDepth(vUv24));\n#endif\n#endif\nvec4 result=vec4(0.0);\n#ifdef BILATERAL\nfloat w=0.0;\n#if KERNEL_SIZE == 3 || (KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13)\nfloat centerDepth=z[KERNEL_SIZE_SQ_HALF];for(int i=0;i= 13)\nfor(int i=0;i= 13\nvarying vec2 vUv00,vUv01,vUv02,vUv03,vUv04;varying vec2 vUv05,vUv06,vUv07,vUv08,vUv09;varying vec2 vUv10,vUv11,vUv12,vUv13,vUv14;varying vec2 vUv15,vUv16,vUv17,vUv18,vUv19;varying vec2 vUv20,vUv21,vUv22,vUv23,vUv24;\n#else\nvarying vec2 vUv;\n#endif\nvoid main(){vec2 uv=position.xy*0.5+0.5;\n#if KERNEL_SIZE == 3\nvec2 s=texelSize*scale;vUv00=uv+s*vec2(-1.0,-1.0);vUv01=uv+s*vec2(0.0,-1.0);vUv02=uv+s*vec2(1.0,-1.0);vUv03=uv+s*vec2(-1.0,0.0);vUv04=uv;vUv05=uv+s*vec2(1.0,0.0);vUv06=uv+s*vec2(-1.0,1.0);vUv07=uv+s*vec2(0.0,1.0);vUv08=uv+s*vec2(1.0,1.0);\n#elif KERNEL_SIZE == 5\nvec2 s=texelSize*scale;vUv00=uv+s*vec2(-2.0,-2.0);vUv01=uv+s*vec2(-1.0,-2.0);vUv02=uv+s*vec2(0.0,-2.0);vUv03=uv+s*vec2(1.0,-2.0);vUv04=uv+s*vec2(2.0,-2.0);vUv05=uv+s*vec2(-2.0,-1.0);vUv06=uv+s*vec2(-1.0,-1.0);vUv07=uv+s*vec2(0.0,-1.0);vUv08=uv+s*vec2(1.0,-1.0);vUv09=uv+s*vec2(2.0,-1.0);vUv10=uv+s*vec2(-2.0,0.0);vUv11=uv+s*vec2(-1.0,0.0);vUv12=uv;vUv13=uv+s*vec2(1.0,0.0);vUv14=uv+s*vec2(2.0,0.0);vUv15=uv+s*vec2(-2.0,1.0);vUv16=uv+s*vec2(-1.0,1.0);vUv17=uv+s*vec2(0.0,1.0);vUv18=uv+s*vec2(1.0,1.0);vUv19=uv+s*vec2(2.0,1.0);vUv20=uv+s*vec2(-2.0,2.0);vUv21=uv+s*vec2(-1.0,2.0);vUv22=uv+s*vec2(0.0,2.0);vUv23=uv+s*vec2(1.0,2.0);vUv24=uv+s*vec2(2.0,2.0);\n#else\nvUv=uv;\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/BoxBlurMaterial.js\nvar BoxBlurMaterial = class extends ShaderMaterial19 {\n /**\n * Constructs a new box blur material.\n *\n * @param {Object} [options] - The options.\n * @param {Number} [options.bilateral=false] - Enables or disables bilateral blurring.\n * @param {Number} [options.kernelSize=5] - The kernel size.\n */\n constructor({ bilateral = false, kernelSize = 5 } = {}) {\n super({\n name: \"BoxBlurMaterial\",\n defines: {\n DEPTH_PACKING: \"0\",\n DISTANCE_THRESHOLD: \"0.1\"\n },\n uniforms: {\n inputBuffer: new Uniform48(null),\n depthBuffer: new Uniform48(null),\n normalDepthBuffer: new Uniform48(null),\n texelSize: new Uniform48(new Vector225()),\n cameraNearFar: new Uniform48(new Vector225()),\n scale: new Uniform48(1)\n },\n blending: NoBlending18,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_box_default,\n vertexShader: convolution_box_default2\n });\n this.bilateral = bilateral;\n this.kernelSize = kernelSize;\n this.maxVaryingVectors = 8;\n }\n /**\n * The maximum amount of varying vectors.\n *\n * Should be synced with `renderer.capabilities.maxVaryings`. Default is 8.\n *\n * @type {Number}\n */\n set maxVaryingVectors(value) {\n this.defines.MAX_VARYING_VECTORS = value.toFixed(0);\n }\n /**\n * The kernel size.\n *\n * - Must be an odd number\n * - Kernel size 3 and 5 use optimized code paths\n * - Default is 5\n *\n * @type {Number}\n */\n get kernelSize() {\n return Number(this.defines.KERNEL_SIZE);\n }\n set kernelSize(value) {\n if (value % 2 === 0) {\n throw new Error(\"The kernel size must be an odd number\");\n }\n this.defines.KERNEL_SIZE = value.toFixed(0);\n this.defines.KERNEL_SIZE_HALF = Math.floor(value / 2).toFixed(0);\n this.defines.KERNEL_SIZE_SQ = (value ** 2).toFixed(0);\n this.defines.KERNEL_SIZE_SQ_HALF = Math.floor(value ** 2 / 2).toFixed(0);\n this.defines.INV_KERNEL_SIZE_SQ = (1 / value ** 2).toFixed(6);\n this.needsUpdate = true;\n }\n /**\n * The blur scale.\n *\n * @type {Number}\n */\n get scale() {\n return this.uniforms.scale.value;\n }\n set scale(value) {\n this.uniforms.scale.value = value;\n }\n /**\n * The current near plane setting.\n *\n * @type {Number}\n * @private\n */\n get near() {\n return this.uniforms.cameraNearFar.value.x;\n }\n /**\n * The current far plane setting.\n *\n * @type {Number}\n * @private\n */\n get far() {\n return this.uniforms.cameraNearFar.value.y;\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The depth buffer.\n *\n * @type {Texture}\n */\n set depthBuffer(value) {\n this.uniforms.depthBuffer.value = value;\n }\n /**\n * A combined normal-depth buffer. Overrides {@link depthBuffer} if set.\n *\n * @type {Texture}\n */\n set normalDepthBuffer(value) {\n this.uniforms.normalDepthBuffer.value = value;\n if (value !== null) {\n this.defines.NORMAL_DEPTH = \"1\";\n } else {\n delete this.defines.NORMAL_DEPTH;\n }\n this.needsUpdate = true;\n }\n /**\n * The depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set depthPacking(value) {\n this.defines.DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Indicates whether bilateral filtering is enabled.\n *\n * @type {Boolean}\n */\n get bilateral() {\n return this.defines.BILATERAL !== void 0;\n }\n set bilateral(value) {\n if (value !== null) {\n this.defines.BILATERAL = \"1\";\n } else {\n delete this.defines.BILATERAL;\n }\n this.needsUpdate = true;\n }\n /**\n * The bilateral filter distance threshold in world units.\n *\n * @type {Number}\n */\n get worldDistanceThreshold() {\n return -orthographicDepthToViewZ(Number(this.defines.DISTANCE_THRESHOLD), this.near, this.far);\n }\n set worldDistanceThreshold(value) {\n const threshold = viewZToOrthographicDepth(-value, this.near, this.far);\n this.defines.DISTANCE_THRESHOLD = threshold.toFixed(12);\n this.needsUpdate = true;\n }\n /**\n * Copies the settings of the given camera.\n *\n * @param {Camera} camera - A camera.\n */\n copyCameraSettings(camera) {\n if (camera) {\n this.uniforms.cameraNearFar.value.set(camera.near, camera.far);\n if (camera instanceof PerspectiveCamera5) {\n this.defines.PERSPECTIVE_CAMERA = \"1\";\n } else {\n delete this.defines.PERSPECTIVE_CAMERA;\n }\n this.needsUpdate = true;\n }\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/materials/DepthCopyMaterial.js\nimport { BasicDepthPacking as BasicDepthPacking14, NoBlending as NoBlending19, ShaderMaterial as ShaderMaterial20, Uniform as Uniform49, Vector2 as Vector226 } from \"three\";\n\n// src/materials/glsl/depth-copy.frag\nvar depth_copy_default = `#include \nvarying vec2 vUv;\n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}\n#else\n#if INPUT_DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if INPUT_DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nvoid main(){\n#if INPUT_DEPTH_PACKING == OUTPUT_DEPTH_PACKING\ngl_FragColor=texture2D(depthBuffer,vUv);\n#else\nfloat depth=readDepth(vUv);\n#if OUTPUT_DEPTH_PACKING == 3201\ngl_FragColor=(depth==1.0)?vec4(1.0):packDepthToRGBA(depth);\n#else\ngl_FragColor=vec4(vec3(depth),1.0);\n#endif\n#endif\n}`;\n\n// src/materials/glsl/depth-copy.vert\nvar depth_copy_default2 = `varying vec2 vUv;\n#if DEPTH_COPY_MODE == 1\nuniform vec2 texelPosition;\n#endif\nvoid main(){\n#if DEPTH_COPY_MODE == 1\nvUv=texelPosition;\n#else\nvUv=position.xy*0.5+0.5;\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/DepthCopyMaterial.js\nvar DepthCopyMaterial = class extends ShaderMaterial20 {\n /**\n * Constructs a new depth copy material.\n */\n constructor() {\n super({\n name: \"DepthCopyMaterial\",\n defines: {\n INPUT_DEPTH_PACKING: \"0\",\n OUTPUT_DEPTH_PACKING: \"0\",\n DEPTH_COPY_MODE: \"0\"\n },\n uniforms: {\n depthBuffer: new Uniform49(null),\n texelPosition: new Uniform49(new Vector226())\n },\n blending: NoBlending19,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: depth_copy_default,\n vertexShader: depth_copy_default2\n });\n this.depthCopyMode = DepthCopyMode.FULL;\n }\n /**\n * The input depth buffer.\n *\n * @type {Texture}\n */\n get depthBuffer() {\n return this.uniforms.depthBuffer.value;\n }\n set depthBuffer(value) {\n this.uniforms.depthBuffer.value = value;\n }\n /**\n * The input depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n set inputDepthPacking(value) {\n this.defines.INPUT_DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * The output depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n get outputDepthPacking() {\n return Number(this.defines.OUTPUT_DEPTH_PACKING);\n }\n set outputDepthPacking(value) {\n this.defines.OUTPUT_DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the input depth buffer.\n *\n * @deprecated Use depthBuffer and inputDepthPacking instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthBuffer(buffer, depthPacking = BasicDepthPacking14) {\n this.depthBuffer = buffer;\n this.inputDepthPacking = depthPacking;\n }\n /**\n * Returns the current input depth packing strategy.\n *\n * @deprecated\n * @return {DepthPackingStrategies} The input depth packing strategy.\n */\n getInputDepthPacking() {\n return Number(this.defines.INPUT_DEPTH_PACKING);\n }\n /**\n * Sets the input depth packing strategy.\n *\n * @deprecated Use inputDepthPacking instead.\n * @param {DepthPackingStrategies} value - The new input depth packing strategy.\n */\n setInputDepthPacking(value) {\n this.defines.INPUT_DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Returns the current output depth packing strategy.\n *\n * @deprecated Use outputDepthPacking instead.\n * @return {DepthPackingStrategies} The output depth packing strategy.\n */\n getOutputDepthPacking() {\n return Number(this.defines.OUTPUT_DEPTH_PACKING);\n }\n /**\n * Sets the output depth packing strategy.\n *\n * @deprecated Use outputDepthPacking instead.\n * @param {DepthPackingStrategies} value - The new output depth packing strategy.\n */\n setOutputDepthPacking(value) {\n this.defines.OUTPUT_DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * The screen space position used for single-texel copy operations.\n *\n * @type {Vector2}\n */\n get texelPosition() {\n return this.uniforms.texelPosition.value;\n }\n /**\n * Returns the screen space position used for single-texel copy operations.\n *\n * @deprecated Use texelPosition instead.\n * @return {Vector2} The position.\n */\n getTexelPosition() {\n return this.uniforms.texelPosition.value;\n }\n /**\n * Sets the screen space position used for single-texel copy operations.\n *\n * @deprecated\n * @param {Vector2} value - The position.\n */\n setTexelPosition(value) {\n this.uniforms.texelPosition.value = value;\n }\n /**\n * The depth copy mode.\n *\n * @type {DepthCopyMode}\n */\n get mode() {\n return this.depthCopyMode;\n }\n set mode(value) {\n this.depthCopyMode = value;\n this.defines.DEPTH_COPY_MODE = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Returns the depth copy mode.\n *\n * @deprecated Use mode instead.\n * @return {DepthCopyMode} The depth copy mode.\n */\n getMode() {\n return this.mode;\n }\n /**\n * Sets the depth copy mode.\n *\n * @deprecated Use mode instead.\n * @param {DepthCopyMode} value - The new mode.\n */\n setMode(value) {\n this.mode = value;\n }\n};\n\n// src/materials/EffectMaterial.js\nimport { BasicDepthPacking as BasicDepthPacking15, NoBlending as NoBlending20, PerspectiveCamera as PerspectiveCamera6, REVISION as REVISION4, ShaderMaterial as ShaderMaterial21, Uniform as Uniform50, Vector2 as Vector227 } from \"three\";\n\n// src/materials/glsl/effect.frag\nvar effect_default = `#include \n#include \n#include \n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#if DEPTH_PACKING == 3201\nuniform lowp sampler2D depthBuffer;\n#elif defined(GL_FRAGMENT_PRECISION_HIGH)\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0;\n#ifdef ENCODE_OUTPUT\n#include \n#endif\n#include \n}`;\n\n// src/materials/glsl/effect.vert\nvar effect_default2 = `uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/EffectMaterial.js\nvar EffectMaterial = class extends ShaderMaterial21 {\n /**\n * Constructs a new effect material.\n *\n * @param {Map} [shaderParts] - Deprecated. Use setShaderData instead.\n * @param {Map} [defines] - Deprecated. Use setShaderData instead.\n * @param {Map} [uniforms] - Deprecated. Use setShaderData instead.\n * @param {Camera} [camera] - A camera.\n * @param {Boolean} [dithering=false] - Deprecated.\n */\n constructor(shaderParts, defines, uniforms, camera, dithering = false) {\n super({\n name: \"EffectMaterial\",\n defines: {\n THREE_REVISION: REVISION4.replace(/\\D+/g, \"\"),\n DEPTH_PACKING: \"0\",\n ENCODE_OUTPUT: \"1\"\n },\n uniforms: {\n inputBuffer: new Uniform50(null),\n depthBuffer: new Uniform50(null),\n resolution: new Uniform50(new Vector227()),\n texelSize: new Uniform50(new Vector227()),\n cameraNear: new Uniform50(0.3),\n cameraFar: new Uniform50(1e3),\n aspect: new Uniform50(1),\n time: new Uniform50(0)\n },\n blending: NoBlending20,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n dithering\n });\n if (shaderParts) {\n this.setShaderParts(shaderParts);\n }\n if (defines) {\n this.setDefines(defines);\n }\n if (uniforms) {\n this.setUniforms(uniforms);\n }\n this.copyCameraSettings(camera);\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * Sets the input buffer.\n *\n * @deprecated Use inputBuffer instead.\n * @param {Texture} value - The input buffer.\n */\n setInputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The depth buffer.\n *\n * @type {Texture}\n */\n get depthBuffer() {\n return this.uniforms.depthBuffer.value;\n }\n set depthBuffer(value) {\n this.uniforms.depthBuffer.value = value;\n }\n /**\n * The depth packing strategy.\n *\n * @type {DepthPackingStrategies}\n */\n get depthPacking() {\n return Number(this.defines.DEPTH_PACKING);\n }\n set depthPacking(value) {\n this.defines.DEPTH_PACKING = value.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the depth buffer.\n *\n * @deprecated Use depthBuffer and depthPacking instead.\n * @param {Texture} buffer - The depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthBuffer(buffer, depthPacking = BasicDepthPacking15) {\n this.depthBuffer = buffer;\n this.depthPacking = depthPacking;\n }\n /**\n * Sets the shader data.\n *\n * @param {EffectShaderData} data - The shader data.\n * @return {EffectMaterial} This material.\n */\n setShaderData(data) {\n this.setShaderParts(data.shaderParts);\n this.setDefines(data.defines);\n this.setUniforms(data.uniforms);\n this.setExtensions(data.extensions);\n }\n /**\n * Sets the shader parts.\n *\n * @deprecated Use setShaderData instead.\n * @param {Map} shaderParts - A collection of shader snippets. See {@link EffectShaderSection}.\n * @return {EffectMaterial} This material.\n */\n setShaderParts(shaderParts) {\n this.fragmentShader = effect_default.replace(EffectShaderSection.FRAGMENT_HEAD, shaderParts.get(EffectShaderSection.FRAGMENT_HEAD) || \"\").replace(EffectShaderSection.FRAGMENT_MAIN_UV, shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV) || \"\").replace(EffectShaderSection.FRAGMENT_MAIN_IMAGE, shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE) || \"\");\n this.vertexShader = effect_default2.replace(EffectShaderSection.VERTEX_HEAD, shaderParts.get(EffectShaderSection.VERTEX_HEAD) || \"\").replace(EffectShaderSection.VERTEX_MAIN_SUPPORT, shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT) || \"\");\n this.needsUpdate = true;\n return this;\n }\n /**\n * Sets the shader macros.\n *\n * @deprecated Use setShaderData instead.\n * @param {Map} defines - A collection of preprocessor macro definitions.\n * @return {EffectMaterial} This material.\n */\n setDefines(defines) {\n for (const entry of defines.entries()) {\n this.defines[entry[0]] = entry[1];\n }\n this.needsUpdate = true;\n return this;\n }\n /**\n * Sets the shader uniforms.\n *\n * @deprecated Use setShaderData instead.\n * @param {Map} uniforms - A collection of uniforms.\n * @return {EffectMaterial} This material.\n */\n setUniforms(uniforms) {\n for (const entry of uniforms.entries()) {\n this.uniforms[entry[0]] = entry[1];\n }\n return this;\n }\n /**\n * Sets the required shader extensions.\n *\n * @deprecated Use setShaderData instead.\n * @param {Set} extensions - A collection of extensions.\n * @return {EffectMaterial} This material.\n */\n setExtensions(extensions) {\n this.extensions = {};\n for (const extension of extensions) {\n this.extensions[extension] = true;\n }\n return this;\n }\n /**\n * Indicates whether output encoding is enabled.\n *\n * @type {Boolean}\n */\n get encodeOutput() {\n return this.defines.ENCODE_OUTPUT !== void 0;\n }\n set encodeOutput(value) {\n if (this.encodeOutput !== value) {\n if (value) {\n this.defines.ENCODE_OUTPUT = \"1\";\n } else {\n delete this.defines.ENCODE_OUTPUT;\n }\n this.needsUpdate = true;\n }\n }\n /**\n * Indicates whether output encoding is enabled.\n *\n * @deprecated Use encodeOutput instead.\n * @return {Boolean} Whether output encoding is enabled.\n */\n isOutputEncodingEnabled(value) {\n return this.encodeOutput;\n }\n /**\n * Enables or disables output encoding.\n *\n * @deprecated Use encodeOutput instead.\n * @param {Boolean} value - Whether output encoding should be enabled.\n */\n setOutputEncodingEnabled(value) {\n this.encodeOutput = value;\n }\n /**\n * The time in seconds.\n *\n * @type {Number}\n */\n get time() {\n return this.uniforms.time.value;\n }\n set time(value) {\n this.uniforms.time.value = value;\n }\n /**\n * Sets the delta time.\n *\n * @deprecated Use time instead.\n * @param {Number} value - The delta time in seconds.\n */\n setDeltaTime(value) {\n this.uniforms.time.value += value;\n }\n /**\n * Copies the settings of the given camera.\n *\n * @deprecated Use copyCameraSettings instead.\n * @param {Camera} camera - A camera.\n */\n adoptCameraSettings(camera) {\n this.copyCameraSettings(camera);\n }\n /**\n * Copies the settings of the given camera.\n *\n * @param {Camera} camera - A camera.\n */\n copyCameraSettings(camera) {\n if (camera) {\n this.uniforms.cameraNear.value = camera.near;\n this.uniforms.cameraFar.value = camera.far;\n if (camera instanceof PerspectiveCamera6) {\n this.defines.PERSPECTIVE_CAMERA = \"1\";\n } else {\n delete this.defines.PERSPECTIVE_CAMERA;\n }\n this.needsUpdate = true;\n }\n }\n /**\n * Sets the resolution.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const uniforms = this.uniforms;\n uniforms.resolution.value.set(width, height);\n uniforms.texelSize.value.set(1 / width, 1 / height);\n uniforms.aspect.value = width / height;\n }\n /**\n * An enumeration of shader code placeholders.\n *\n * @deprecated Use EffectShaderSection instead.\n * @type {Object}\n */\n static get Section() {\n return EffectShaderSection;\n }\n};\n\n// src/materials/GaussianBlurMaterial.js\nimport { NoBlending as NoBlending21, ShaderMaterial as ShaderMaterial22, Uniform as Uniform51, Vector2 as Vector228 } from \"three\";\n\n// src/materials/glsl/convolution.gaussian.frag\nvar convolution_gaussian_default = `#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform vec2 kernel[STEPS];varying vec2 vOffset;varying vec2 vUv;void main(){vec4 result=texture2D(inputBuffer,vUv)*kernel[0].y;for(int i=1;i\n}`;\n\n// src/materials/glsl/convolution.gaussian.vert\nvar convolution_gaussian_default2 = `uniform vec2 texelSize;uniform vec2 direction;uniform float scale;varying vec2 vOffset;varying vec2 vUv;void main(){vOffset=direction*texelSize*scale;vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`;\n\n// src/materials/GaussianBlurMaterial.js\nvar GaussianBlurMaterial = class extends ShaderMaterial22 {\n /**\n * Constructs a new convolution material.\n *\n * @param {Object} [options] - The options.\n * @param {Number} [options.kernelSize=35] - The kernel size.\n */\n constructor({ kernelSize = 35 } = {}) {\n super({\n name: \"GaussianBlurMaterial\",\n uniforms: {\n inputBuffer: new Uniform51(null),\n texelSize: new Uniform51(new Vector228()),\n direction: new Uniform51(new Vector228()),\n kernel: new Uniform51(null),\n scale: new Uniform51(1)\n },\n blending: NoBlending21,\n toneMapped: false,\n depthWrite: false,\n depthTest: false,\n fragmentShader: convolution_gaussian_default,\n vertexShader: convolution_gaussian_default2\n });\n this._kernelSize = 0;\n this.kernelSize = kernelSize;\n }\n /**\n * The input buffer.\n *\n * @type {Texture}\n */\n set inputBuffer(value) {\n this.uniforms.inputBuffer.value = value;\n }\n /**\n * The kernel size.\n *\n * @type {Number}\n */\n get kernelSize() {\n return this._kernelSize;\n }\n set kernelSize(value) {\n this._kernelSize = value;\n this.generateKernel(value);\n }\n /**\n * The blur direction.\n *\n * @type {Vector2}\n */\n get direction() {\n return this.uniforms.direction.value;\n }\n /**\n * The blur kernel scale. Values greater than 1.0 may introduce artifacts.\n *\n * @type {Number}\n */\n get scale() {\n return this.uniforms.scale.value;\n }\n set scale(value) {\n this.uniforms.scale.value = value;\n }\n /**\n * Generates the Gauss kernel.\n *\n * @param {KernelSize} kernelSize - The kernel size. Should be an odd number.\n * @private\n */\n generateKernel(kernelSize) {\n const kernel = new GaussKernel(kernelSize);\n const steps = kernel.linearSteps;\n const kernelData = new Float64Array(steps * 2);\n for (let i = 0, j = 0; i < steps; ++i) {\n kernelData[j++] = kernel.linearOffsets[i];\n kernelData[j++] = kernel.linearWeights[i];\n }\n this.uniforms.kernel.value = kernelData;\n this.defines.STEPS = steps.toFixed(0);\n this.needsUpdate = true;\n }\n /**\n * Sets the size of this object.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.uniforms.texelSize.value.set(1 / width, 1 / height);\n }\n};\n\n// src/passes/BoxBlurPass.js\nimport { BasicDepthPacking as BasicDepthPacking16, SRGBColorSpace as SRGBColorSpace13, UnsignedByteType as UnsignedByteType13, WebGLRenderTarget as WebGLRenderTarget20 } from \"three\";\nvar BoxBlurPass = class extends Pass {\n /**\n * Constructs a new box blur pass.\n *\n * @param {Object} [options] - The options.\n * @param {Number} [options.kernelSize=5] - Must be an odd number. The sizes 3 and 5 use optimized code paths.\n * @param {Number} [options.iterations=1] - The amount of times the blur should be applied.\n * @param {Number} [options.bilateral=false] - Enables or disables bilateral blurring.\n * @param {Number} [options.resolutionScale=1.0] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n */\n constructor({\n kernelSize = 5,\n iterations = 1,\n bilateral = false,\n resolutionScale = 1,\n resolutionX = Resolution.AUTO_SIZE,\n resolutionY = Resolution.AUTO_SIZE\n } = {}) {\n super(\"BoxBlurPass\");\n this.needsDepthTexture = bilateral;\n this.renderTargetA = new WebGLRenderTarget20(1, 1, { depthBuffer: false });\n this.renderTargetA.texture.name = \"Blur.Target.A\";\n this.renderTargetB = new WebGLRenderTarget20(1, 1, { depthBuffer: false });\n this.renderTargetB.texture.name = \"Blur.Target.B\";\n this.blurMaterial = new BoxBlurMaterial({ bilateral, kernelSize });\n this.copyMaterial = new CopyMaterial();\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n this.iterations = iterations;\n }\n set mainCamera(value) {\n this.blurMaterial.copyCameraSettings(value);\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing strategy.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking16) {\n this.blurMaterial.depthBuffer = depthTexture;\n this.blurMaterial.depthPacking = depthPacking;\n }\n /**\n * Renders the blur.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const scene = this.scene;\n const camera = this.camera;\n const renderTargetA = this.renderTargetA;\n const renderTargetB = this.renderTargetB;\n const blurMaterial = this.blurMaterial;\n this.fullscreenMaterial = blurMaterial;\n let previousBuffer = inputBuffer;\n for (let i = 0, l = Math.max(this.iterations, 1); i < l; ++i) {\n const buffer = (i & 1) === 0 ? renderTargetA : renderTargetB;\n blurMaterial.inputBuffer = previousBuffer.texture;\n renderer.setRenderTarget(buffer);\n renderer.render(scene, camera);\n previousBuffer = buffer;\n }\n this.copyMaterial.inputBuffer = previousBuffer.texture;\n this.fullscreenMaterial = this.copyMaterial;\n renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);\n renderer.render(scene, camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.renderTargetA.setSize(w, h);\n this.renderTargetB.setSize(w, h);\n this.blurMaterial.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (renderer !== null) {\n this.blurMaterial.maxVaryingVectors = renderer.capabilities.maxVaryings;\n }\n if (frameBufferType !== void 0) {\n this.renderTargetA.texture.type = frameBufferType;\n this.renderTargetB.texture.type = frameBufferType;\n if (frameBufferType !== UnsignedByteType13) {\n this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace13) {\n this.renderTargetA.texture.colorSpace = SRGBColorSpace13;\n this.renderTargetB.texture.colorSpace = SRGBColorSpace13;\n }\n }\n }\n};\n\n// src/passes/DepthPickingPass.js\nimport { BasicDepthPacking as BasicDepthPacking18, FloatType as FloatType6, REVISION as REVISION5, RGBADepthPacking as RGBADepthPacking5 } from \"three\";\n\n// src/passes/DepthCopyPass.js\nimport {\n BasicDepthPacking as BasicDepthPacking17,\n FloatType as FloatType5,\n NearestFilter as NearestFilter7,\n RGBADepthPacking as RGBADepthPacking4,\n UnsignedByteType as UnsignedByteType14,\n WebGLRenderTarget as WebGLRenderTarget21\n} from \"three\";\nvar DepthCopyPass = class extends Pass {\n /**\n * Constructs a new depth save pass.\n *\n * @param {Object} [options] - The options.\n * @param {DepthPackingStrategies} [options.depthPacking=RGBADepthPacking] - The output depth packing.\n */\n constructor({ depthPacking = RGBADepthPacking4 } = {}) {\n super(\"DepthCopyPass\");\n const material = new DepthCopyMaterial();\n material.outputDepthPacking = depthPacking;\n this.fullscreenMaterial = material;\n this.needsDepthTexture = true;\n this.needsSwap = false;\n this.renderTarget = new WebGLRenderTarget21(1, 1, {\n type: depthPacking === RGBADepthPacking4 ? UnsignedByteType14 : FloatType5,\n minFilter: NearestFilter7,\n magFilter: NearestFilter7,\n depthBuffer: false\n });\n this.renderTarget.texture.name = \"DepthCopyPass.Target\";\n }\n /**\n * The output depth texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the output depth texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTarget.texture;\n }\n /**\n * The output depth packing.\n *\n * @type {DepthPackingStrategies}\n */\n get depthPacking() {\n return this.fullscreenMaterial.outputDepthPacking;\n }\n /**\n * Returns the output depth packing.\n *\n * @deprecated Use depthPacking instead.\n * @return {DepthPackingStrategies} The depth packing.\n */\n getDepthPacking() {\n return this.fullscreenMaterial.outputDepthPacking;\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking17) {\n this.fullscreenMaterial.depthBuffer = depthTexture;\n this.fullscreenMaterial.inputDepthPacking = depthPacking;\n }\n /**\n * Copies depth from a depth texture.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n renderer.setRenderTarget(this.renderToScreen ? null : this.renderTarget);\n renderer.render(this.scene, this.camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.renderTarget.setSize(width, height);\n }\n};\n\n// src/passes/DepthPickingPass.js\nvar threeRevision = Number(REVISION5.replace(/\\D+/g, \"\"));\nvar unpackDownscale = 255 / 256;\nvar unpackFactorsLegacy = new Float32Array([\n unpackDownscale / 256 ** 3,\n unpackDownscale / 256 ** 2,\n unpackDownscale / 256,\n unpackDownscale\n]);\nvar unpackFactors = new Float32Array([\n unpackDownscale,\n unpackDownscale / 256,\n unpackDownscale / 256 ** 2,\n 1 / 256 ** 3\n]);\nfunction unpackRGBAToDepth(packedDepth) {\n const f = threeRevision >= 167 ? unpackFactors : unpackFactorsLegacy;\n return (packedDepth[0] * f[0] + packedDepth[1] * f[1] + packedDepth[2] * f[2] + packedDepth[3] * f[3]) / 255;\n}\nvar DepthPickingPass = class extends DepthCopyPass {\n /**\n * Constructs a new depth picking pass.\n *\n * @param {Object} [options] - The options.\n * @param {DepthPackingStrategies} [options.depthPacking=RGBADepthPacking] - The depth packing.\n * @param {Number} [options.mode=DepthCopyMode.SINGLE] - The depth copy mode.\n */\n constructor({ depthPacking = RGBADepthPacking5, mode = DepthCopyMode.SINGLE } = {}) {\n if (depthPacking !== RGBADepthPacking5 && depthPacking !== BasicDepthPacking18) {\n throw new Error(`Unsupported depth packing: ${depthPacking}`);\n }\n super({ depthPacking });\n this.name = \"DepthPickingPass\";\n this.fullscreenMaterial.mode = mode;\n this.pixelBuffer = depthPacking === RGBADepthPacking5 ? new Uint8Array(4) : new Float32Array(4);\n this.callback = null;\n }\n /**\n * Reads depth at a specific screen position.\n *\n * Only one depth value can be picked per frame. Calling this method multiple times per frame will overwrite the\n * picking coordinates. Unresolved promises will be abandoned.\n *\n * @example\n * const ndc = new Vector3();\n * const clientRect = myViewport.getBoundingClientRect();\n * const clientX = pointerEvent.clientX - clientRect.left;\n * const clientY = pointerEvent.clientY - clientRect.top;\n * ndc.x = (clientX / myViewport.clientWidth) * 2.0 - 1.0;\n * ndc.y = -(clientY / myViewport.clientHeight) * 2.0 + 1.0;\n * const depth = await depthPickingPass.readDepth(ndc);\n * ndc.z = depth * 2.0 - 1.0;\n *\n * const worldPosition = ndc.unproject(camera);\n *\n * @param {Vector2|Vector3} ndc - Normalized device coordinates. Only X and Y are relevant.\n * @return {Promise} A promise that returns the depth on the next frame.\n */\n readDepth(ndc) {\n this.fullscreenMaterial.texelPosition.set(ndc.x * 0.5 + 0.5, ndc.y * 0.5 + 0.5);\n return new Promise((resolve) => {\n this.callback = resolve;\n });\n }\n /**\n * Copies depth and resolves depth picking promises.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const material = this.fullscreenMaterial;\n const mode = material.mode;\n if (mode === DepthCopyMode.FULL) {\n super.render(renderer);\n }\n if (this.callback !== null) {\n const renderTarget = this.renderTarget;\n const pixelBuffer = this.pixelBuffer;\n const packed = renderTarget.texture.type !== FloatType6;\n let x = 0, y = 0;\n if (mode === DepthCopyMode.SINGLE) {\n super.render(renderer);\n } else {\n const texelPosition = material.texelPosition;\n x = Math.round(texelPosition.x * renderTarget.width);\n y = Math.round(texelPosition.y * renderTarget.height);\n }\n renderer.readRenderTargetPixels(renderTarget, x, y, 1, 1, pixelBuffer);\n this.callback(packed ? unpackRGBAToDepth(pixelBuffer) : pixelBuffer[0]);\n this.callback = null;\n }\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n if (this.fullscreenMaterial.mode === DepthCopyMode.FULL) {\n super.setSize(width, height);\n }\n }\n};\n\n// src/passes/EffectPass.js\nimport { BasicDepthPacking as BasicDepthPacking19, NoColorSpace as NoColorSpace2, SRGBColorSpace as SRGBColorSpace14, UnsignedByteType as UnsignedByteType15 } from \"three\";\nfunction prefixSubstrings(prefix, substrings, strings) {\n for (const substring of substrings) {\n const prefixed = \"$1\" + prefix + substring.charAt(0).toUpperCase() + substring.slice(1);\n const regExp = new RegExp(\"([^\\\\.])(\\\\b\" + substring + \"\\\\b)\", \"g\");\n for (const entry of strings.entries()) {\n if (entry[1] !== null) {\n strings.set(entry[0], entry[1].replace(regExp, prefixed));\n }\n }\n }\n}\nfunction integrateEffect(prefix, effect, data) {\n let fragmentShader = effect.getFragmentShader();\n let vertexShader = effect.getVertexShader();\n const mainImageExists = fragmentShader !== void 0 && /mainImage/.test(fragmentShader);\n const mainUvExists = fragmentShader !== void 0 && /mainUv/.test(fragmentShader);\n data.attributes |= effect.getAttributes();\n if (fragmentShader === void 0) {\n throw new Error(`Missing fragment shader (${effect.name})`);\n } else if (mainUvExists && (data.attributes & EffectAttribute.CONVOLUTION) !== 0) {\n throw new Error(`Effects that transform UVs are incompatible with convolution effects (${effect.name})`);\n } else if (!mainImageExists && !mainUvExists) {\n throw new Error(`Could not find mainImage or mainUv function (${effect.name})`);\n } else {\n const functionRegExp = /\\w+\\s+(\\w+)\\([\\w\\s,]*\\)\\s*{/g;\n const shaderParts = data.shaderParts;\n let fragmentHead = shaderParts.get(EffectShaderSection.FRAGMENT_HEAD) || \"\";\n let fragmentMainUv = shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV) || \"\";\n let fragmentMainImage = shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE) || \"\";\n let vertexHead = shaderParts.get(EffectShaderSection.VERTEX_HEAD) || \"\";\n let vertexMainSupport = shaderParts.get(EffectShaderSection.VERTEX_MAIN_SUPPORT) || \"\";\n const varyings = /* @__PURE__ */ new Set();\n const names = /* @__PURE__ */ new Set();\n if (mainUvExists) {\n fragmentMainUv += `\t${prefix}MainUv(UV);\n`;\n data.uvTransformation = true;\n }\n if (vertexShader !== null && /mainSupport/.test(vertexShader)) {\n const needsUv = /mainSupport *\\([\\w\\s]*?uv\\s*?\\)/.test(vertexShader);\n vertexMainSupport += `\t${prefix}MainSupport(`;\n vertexMainSupport += needsUv ? \"vUv);\\n\" : \");\\n\";\n for (const m2 of vertexShader.matchAll(/(?:varying\\s+\\w+\\s+([\\S\\s]*?);)/g)) {\n for (const n of m2[1].split(/\\s*,\\s*/)) {\n data.varyings.add(n);\n varyings.add(n);\n names.add(n);\n }\n }\n for (const m2 of vertexShader.matchAll(functionRegExp)) {\n names.add(m2[1]);\n }\n }\n for (const m2 of fragmentShader.matchAll(functionRegExp)) {\n names.add(m2[1]);\n }\n for (const d of effect.defines.keys()) {\n names.add(d.replace(/\\([\\w\\s,]*\\)/g, \"\"));\n }\n for (const u of effect.uniforms.keys()) {\n names.add(u);\n }\n names.delete(\"while\");\n names.delete(\"for\");\n names.delete(\"if\");\n effect.uniforms.forEach((val, key) => data.uniforms.set(prefix + key.charAt(0).toUpperCase() + key.slice(1), val));\n effect.defines.forEach((val, key) => data.defines.set(prefix + key.charAt(0).toUpperCase() + key.slice(1), val));\n const shaders = /* @__PURE__ */ new Map([[\"fragment\", fragmentShader], [\"vertex\", vertexShader]]);\n prefixSubstrings(prefix, names, data.defines);\n prefixSubstrings(prefix, names, shaders);\n fragmentShader = shaders.get(\"fragment\");\n vertexShader = shaders.get(\"vertex\");\n const blendMode = effect.blendMode;\n data.blendModes.set(blendMode.blendFunction, blendMode);\n if (mainImageExists) {\n if (effect.inputColorSpace !== null && effect.inputColorSpace !== data.colorSpace) {\n fragmentMainImage += effect.inputColorSpace === SRGBColorSpace14 ? \"color0 = sRGBTransferOETF(color0);\\n\t\" : \"color0 = sRGBToLinear(color0);\\n\t\";\n }\n if (effect.outputColorSpace !== NoColorSpace2) {\n data.colorSpace = effect.outputColorSpace;\n } else if (effect.inputColorSpace !== null) {\n data.colorSpace = effect.inputColorSpace;\n }\n const depthParamRegExp = /MainImage *\\([\\w\\s,]*?depth[\\w\\s,]*?\\)/;\n fragmentMainImage += `${prefix}MainImage(color0, UV, `;\n if ((data.attributes & EffectAttribute.DEPTH) !== 0 && depthParamRegExp.test(fragmentShader)) {\n fragmentMainImage += \"depth, \";\n data.readDepth = true;\n }\n fragmentMainImage += \"color1);\\n\t\";\n const blendOpacity = prefix + \"BlendOpacity\";\n data.uniforms.set(blendOpacity, blendMode.opacity);\n fragmentMainImage += `color0 = blend${blendMode.blendFunction}(color0, color1, ${blendOpacity});\n\n\t`;\n fragmentHead += `uniform float ${blendOpacity};\n\n`;\n }\n fragmentHead += fragmentShader + \"\\n\";\n if (vertexShader !== null) {\n vertexHead += vertexShader + \"\\n\";\n }\n shaderParts.set(EffectShaderSection.FRAGMENT_HEAD, fragmentHead);\n shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV, fragmentMainUv);\n shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE, fragmentMainImage);\n shaderParts.set(EffectShaderSection.VERTEX_HEAD, vertexHead);\n shaderParts.set(EffectShaderSection.VERTEX_MAIN_SUPPORT, vertexMainSupport);\n if (effect.extensions !== null) {\n for (const extension of effect.extensions) {\n data.extensions.add(extension);\n }\n }\n }\n}\nvar EffectPass = class extends Pass {\n /**\n * Constructs a new effect pass.\n *\n * @param {Camera} camera - The main camera.\n * @param {...Effect} effects - The effects that will be rendered by this pass.\n */\n constructor(camera, ...effects) {\n super(\"EffectPass\");\n this.fullscreenMaterial = new EffectMaterial(null, null, null, camera);\n this.listener = (event) => this.handleEvent(event);\n this.effects = [];\n this.setEffects(effects);\n this.skipRendering = false;\n this.minTime = 1;\n this.maxTime = Number.POSITIVE_INFINITY;\n this.timeScale = 1;\n }\n set mainScene(value) {\n for (const effect of this.effects) {\n effect.mainScene = value;\n }\n }\n set mainCamera(value) {\n this.fullscreenMaterial.copyCameraSettings(value);\n for (const effect of this.effects) {\n effect.mainCamera = value;\n }\n }\n /**\n * Indicates whether this pass encodes its output when rendering to screen.\n *\n * @type {Boolean}\n * @deprecated Use fullscreenMaterial.encodeOutput instead.\n */\n get encodeOutput() {\n return this.fullscreenMaterial.encodeOutput;\n }\n set encodeOutput(value) {\n this.fullscreenMaterial.encodeOutput = value;\n }\n /**\n * Indicates whether dithering is enabled.\n *\n * @type {Boolean}\n */\n get dithering() {\n return this.fullscreenMaterial.dithering;\n }\n set dithering(value) {\n const material = this.fullscreenMaterial;\n material.dithering = value;\n material.needsUpdate = true;\n }\n /**\n * Sets the effects.\n *\n * @param {Effect[]} effects - The effects.\n * @protected\n */\n setEffects(effects) {\n for (const effect of this.effects) {\n effect.removeEventListener(\"change\", this.listener);\n }\n this.effects = effects.sort((a, b) => b.attributes - a.attributes);\n for (const effect of this.effects) {\n effect.addEventListener(\"change\", this.listener);\n }\n }\n /**\n * Updates the compound shader material.\n *\n * @protected\n */\n updateMaterial() {\n const data = new EffectShaderData();\n let id = 0;\n for (const effect of this.effects) {\n if (effect.blendMode.blendFunction === BlendFunction.DST) {\n data.attributes |= effect.getAttributes() & EffectAttribute.DEPTH;\n } else if ((data.attributes & effect.getAttributes() & EffectAttribute.CONVOLUTION) !== 0) {\n throw new Error(`Convolution effects cannot be merged (${effect.name})`);\n } else {\n integrateEffect(\"e\" + id++, effect, data);\n }\n }\n let fragmentHead = data.shaderParts.get(EffectShaderSection.FRAGMENT_HEAD);\n let fragmentMainImage = data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_IMAGE);\n let fragmentMainUv = data.shaderParts.get(EffectShaderSection.FRAGMENT_MAIN_UV);\n const blendRegExp = /\\bblend\\b/g;\n for (const blendMode of data.blendModes.values()) {\n fragmentHead += blendMode.getShaderCode().replace(blendRegExp, `blend${blendMode.blendFunction}`) + \"\\n\";\n }\n if ((data.attributes & EffectAttribute.DEPTH) !== 0) {\n if (data.readDepth) {\n fragmentMainImage = \"float depth = readDepth(UV);\\n\\n\t\" + fragmentMainImage;\n }\n this.needsDepthTexture = this.getDepthTexture() === null;\n } else {\n this.needsDepthTexture = false;\n }\n if (data.colorSpace === SRGBColorSpace14) {\n fragmentMainImage += \"color0 = sRGBToLinear(color0);\\n\t\";\n }\n if (data.uvTransformation) {\n fragmentMainUv = \"vec2 transformedUv = vUv;\\n\" + fragmentMainUv;\n data.defines.set(\"UV\", \"transformedUv\");\n } else {\n data.defines.set(\"UV\", \"vUv\");\n }\n data.shaderParts.set(EffectShaderSection.FRAGMENT_HEAD, fragmentHead);\n data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE, fragmentMainImage);\n data.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV, fragmentMainUv);\n for (const [key, value] of data.shaderParts) {\n if (value !== null) {\n data.shaderParts.set(key, value.trim().replace(/^#/, \"\\n#\"));\n }\n }\n this.skipRendering = id === 0;\n this.needsSwap = !this.skipRendering;\n this.fullscreenMaterial.setShaderData(data);\n }\n /**\n * Rebuilds the shader material.\n */\n recompile() {\n this.updateMaterial();\n }\n /**\n * Returns the current depth texture.\n *\n * @return {Texture} The current depth texture, or null if there is none.\n */\n getDepthTexture() {\n return this.fullscreenMaterial.depthBuffer;\n }\n /**\n * Sets the depth texture.\n *\n * @param {Texture} depthTexture - A depth texture.\n * @param {DepthPackingStrategies} [depthPacking=BasicDepthPacking] - The depth packing.\n */\n setDepthTexture(depthTexture, depthPacking = BasicDepthPacking19) {\n this.fullscreenMaterial.depthBuffer = depthTexture;\n this.fullscreenMaterial.depthPacking = depthPacking;\n for (const effect of this.effects) {\n effect.setDepthTexture(depthTexture, depthPacking);\n }\n }\n /**\n * Renders the effect.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n for (const effect of this.effects) {\n effect.update(renderer, inputBuffer, deltaTime);\n }\n if (!this.skipRendering || this.renderToScreen) {\n const material = this.fullscreenMaterial;\n material.inputBuffer = inputBuffer.texture;\n material.time += deltaTime * this.timeScale;\n renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);\n renderer.render(this.scene, this.camera);\n }\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n this.fullscreenMaterial.setSize(width, height);\n for (const effect of this.effects) {\n effect.setSize(width, height);\n }\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n this.renderer = renderer;\n for (const effect of this.effects) {\n effect.initialize(renderer, alpha, frameBufferType);\n }\n this.updateMaterial();\n if (frameBufferType !== void 0 && frameBufferType !== UnsignedByteType15) {\n this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n }\n }\n /**\n * Deletes disposable objects.\n */\n dispose() {\n super.dispose();\n for (const effect of this.effects) {\n effect.removeEventListener(\"change\", this.listener);\n effect.dispose();\n }\n }\n /**\n * Handles events.\n *\n * @param {Event} event - An event.\n */\n handleEvent(event) {\n switch (event.type) {\n case \"change\":\n this.recompile();\n break;\n }\n }\n};\n\n// src/passes/GaussianBlurPass.js\nimport { SRGBColorSpace as SRGBColorSpace15, UnsignedByteType as UnsignedByteType16, WebGLRenderTarget as WebGLRenderTarget22 } from \"three\";\nvar GaussianBlurPass = class extends Pass {\n /**\n * Constructs a new Gaussian blur pass.\n *\n * @param {Object} [options] - The options.\n * @param {Number} [options.kernelSize=35] - The kernel size. Should be an odd number in the range [3, 1020].\n * @param {Number} [options.iterations=1] - The amount of times the blur should be applied.\n * @param {Number} [options.resolutionScale=1.0] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n */\n constructor({\n kernelSize = 35,\n iterations = 1,\n resolutionScale = 1,\n resolutionX = Resolution.AUTO_SIZE,\n resolutionY = Resolution.AUTO_SIZE\n } = {}) {\n super(\"GaussianBlurPass\");\n this.renderTargetA = new WebGLRenderTarget22(1, 1, { depthBuffer: false });\n this.renderTargetA.texture.name = \"Blur.Target.A\";\n this.renderTargetB = this.renderTargetA.clone();\n this.renderTargetB.texture.name = \"Blur.Target.B\";\n this.blurMaterial = new GaussianBlurMaterial({ kernelSize });\n this.copyMaterial = new CopyMaterial();\n this.copyMaterial.inputBuffer = this.renderTargetB.texture;\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n this.iterations = iterations;\n }\n /**\n * Renders the blur.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const scene = this.scene;\n const camera = this.camera;\n const renderTargetA = this.renderTargetA;\n const renderTargetB = this.renderTargetB;\n const blurMaterial = this.blurMaterial;\n this.fullscreenMaterial = blurMaterial;\n let previousBuffer = inputBuffer;\n for (let i = 0, l = Math.max(this.iterations, 1); i < l; ++i) {\n blurMaterial.direction.set(1, 0);\n blurMaterial.inputBuffer = previousBuffer.texture;\n renderer.setRenderTarget(renderTargetA);\n renderer.render(scene, camera);\n blurMaterial.direction.set(0, 1);\n blurMaterial.inputBuffer = renderTargetA.texture;\n renderer.setRenderTarget(renderTargetB);\n renderer.render(scene, camera);\n if (i === 0 && l > 1) {\n previousBuffer = renderTargetB;\n }\n }\n this.fullscreenMaterial = this.copyMaterial;\n renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);\n renderer.render(scene, camera);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n const w = resolution.width, h = resolution.height;\n this.renderTargetA.setSize(w, h);\n this.renderTargetB.setSize(w, h);\n this.blurMaterial.setSize(width, height);\n }\n /**\n * Performs initialization tasks.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not.\n * @param {Number} frameBufferType - The type of the main frame buffers.\n */\n initialize(renderer, alpha, frameBufferType) {\n if (frameBufferType !== void 0) {\n this.renderTargetA.texture.type = frameBufferType;\n this.renderTargetB.texture.type = frameBufferType;\n if (frameBufferType !== UnsignedByteType16) {\n this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = \"1\";\n } else if (renderer !== null && renderer.outputColorSpace === SRGBColorSpace15) {\n this.renderTargetA.texture.colorSpace = SRGBColorSpace15;\n this.renderTargetB.texture.colorSpace = SRGBColorSpace15;\n }\n }\n }\n};\n\n// src/passes/LambdaPass.js\nvar LambdaPass = class extends Pass {\n /**\n * Constructs a new lambda pass.\n *\n * @param {Function} f - A function.\n */\n constructor(f) {\n super(\"LambdaPass\", null, null);\n this.needsSwap = false;\n this.f = f;\n }\n /**\n * Executes the function.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n this.f();\n }\n};\n\n// src/passes/NormalPass.js\nimport { Color as Color10, MeshNormalMaterial, NearestFilter as NearestFilter8, WebGLRenderTarget as WebGLRenderTarget23 } from \"three\";\nvar NormalPass = class extends Pass {\n /**\n * Constructs a new normal pass.\n *\n * @param {Scene} scene - The scene to render.\n * @param {Camera} camera - The camera to use to render the scene.\n * @param {Object} [options] - The options.\n * @param {WebGLRenderTarget} [options.renderTarget] - A custom render target.\n * @param {Number} [options.resolutionScale=1.0] - The resolution scale.\n * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.\n * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.\n * @param {Number} [options.width=Resolution.AUTO_SIZE] - Deprecated. Use resolutionX instead.\n * @param {Number} [options.height=Resolution.AUTO_SIZE] - Deprecated. Use resolutionY instead.\n */\n constructor(scene, camera, {\n renderTarget,\n resolutionScale = 1,\n width = Resolution.AUTO_SIZE,\n height = Resolution.AUTO_SIZE,\n resolutionX = width,\n resolutionY = height\n } = {}) {\n super(\"NormalPass\");\n this.needsSwap = false;\n this.renderPass = new RenderPass(scene, camera, new MeshNormalMaterial());\n const renderPass = this.renderPass;\n renderPass.ignoreBackground = true;\n renderPass.skipShadowMapUpdate = true;\n const clearPass = renderPass.getClearPass();\n clearPass.overrideClearColor = new Color10(7829503);\n clearPass.overrideClearAlpha = 1;\n this.renderTarget = renderTarget;\n if (this.renderTarget === void 0) {\n this.renderTarget = new WebGLRenderTarget23(1, 1, {\n minFilter: NearestFilter8,\n magFilter: NearestFilter8\n });\n this.renderTarget.texture.name = \"NormalPass.Target\";\n }\n const resolution = this.resolution = new Resolution(this, resolutionX, resolutionY, resolutionScale);\n resolution.addEventListener(\"change\", (e) => this.setSize(resolution.baseWidth, resolution.baseHeight));\n }\n set mainScene(value) {\n this.renderPass.mainScene = value;\n }\n set mainCamera(value) {\n this.renderPass.mainCamera = value;\n }\n /**\n * The normal texture.\n *\n * @type {Texture}\n */\n get texture() {\n return this.renderTarget.texture;\n }\n /**\n * The normal texture.\n *\n * @deprecated Use texture instead.\n * @return {Texture} The texture.\n */\n getTexture() {\n return this.renderTarget.texture;\n }\n /**\n * Returns the resolution settings.\n *\n * @deprecated Use resolution instead.\n * @return {Resolution} The resolution.\n */\n getResolution() {\n return this.resolution;\n }\n /**\n * Returns the current resolution scale.\n *\n * @return {Number} The resolution scale.\n * @deprecated Use resolution.preferredWidth or resolution.preferredHeight instead.\n */\n getResolutionScale() {\n return this.resolution.scale;\n }\n /**\n * Sets the resolution scale.\n *\n * @param {Number} scale - The new resolution scale.\n * @deprecated Use resolution.preferredWidth or resolution.preferredHeight instead.\n */\n setResolutionScale(scale) {\n this.resolution.scale = scale;\n }\n /**\n * Renders the scene normals.\n *\n * @param {WebGLRenderer} renderer - The renderer.\n * @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.\n * @param {WebGLRenderTarget} outputBuffer - A frame buffer that serves as the output render target unless this pass renders to screen.\n * @param {Number} [deltaTime] - The time between the last frame and the current one in seconds.\n * @param {Boolean} [stencilTest] - Indicates whether a stencil mask is active.\n */\n render(renderer, inputBuffer, outputBuffer, deltaTime, stencilTest) {\n const renderTarget = this.renderToScreen ? null : this.renderTarget;\n this.renderPass.render(renderer, renderTarget, renderTarget);\n }\n /**\n * Updates the size of this pass.\n *\n * @param {Number} width - The width.\n * @param {Number} height - The height.\n */\n setSize(width, height) {\n const resolution = this.resolution;\n resolution.setBaseSize(width, height);\n this.renderTarget.setSize(resolution.width, resolution.height);\n }\n};\n\n// src/textures/lut/TetrahedralUpscaler.js\nvar P = [\n new Float32Array(3),\n new Float32Array(3)\n];\nvar C = [\n new Float32Array(3),\n new Float32Array(3),\n new Float32Array(3),\n new Float32Array(3)\n];\nvar T = [\n [\n new Float32Array([0, 0, 0]),\n new Float32Array([1, 0, 0]),\n new Float32Array([1, 1, 0]),\n new Float32Array([1, 1, 1])\n ],\n [\n new Float32Array([0, 0, 0]),\n new Float32Array([1, 0, 0]),\n new Float32Array([1, 0, 1]),\n new Float32Array([1, 1, 1])\n ],\n [\n new Float32Array([0, 0, 0]),\n new Float32Array([0, 0, 1]),\n new Float32Array([1, 0, 1]),\n new Float32Array([1, 1, 1])\n ],\n [\n new Float32Array([0, 0, 0]),\n new Float32Array([0, 1, 0]),\n new Float32Array([1, 1, 0]),\n new Float32Array([1, 1, 1])\n ],\n [\n new Float32Array([0, 0, 0]),\n new Float32Array([0, 1, 0]),\n new Float32Array([0, 1, 1]),\n new Float32Array([1, 1, 1])\n ],\n [\n new Float32Array([0, 0, 0]),\n new Float32Array([0, 0, 1]),\n new Float32Array([0, 1, 1]),\n new Float32Array([1, 1, 1])\n ]\n];\nfunction calculateTetrahedronVolume(a, b, c2, d) {\n const bcX = c2[0] - b[0];\n const bcY = c2[1] - b[1];\n const bcZ = c2[2] - b[2];\n const baX = a[0] - b[0];\n const baY = a[1] - b[1];\n const baZ = a[2] - b[2];\n const crossX = bcY * baZ - bcZ * baY;\n const crossY = bcZ * baX - bcX * baZ;\n const crossZ = bcX * baY - bcY * baX;\n const length = Math.sqrt(crossX * crossX + crossY * crossY + crossZ * crossZ);\n const triangleArea = length * 0.5;\n const normalX = crossX / length;\n const normalY = crossY / length;\n const normalZ = crossZ / length;\n const constant = -(a[0] * normalX + a[1] * normalY + a[2] * normalZ);\n const dot = d[0] * normalX + d[1] * normalY + d[2] * normalZ;\n const height = Math.abs(dot + constant);\n return height * triangleArea / 3;\n}\nfunction sample(data, size, x, y, z, color2) {\n const i4 = (x + y * size + z * size * size) * 4;\n color2[0] = data[i4 + 0];\n color2[1] = data[i4 + 1];\n color2[2] = data[i4 + 2];\n}\nfunction tetrahedralSample(data, size, u, v3, w, color2) {\n const px = u * (size - 1);\n const py = v3 * (size - 1);\n const pz = w * (size - 1);\n const minX = Math.floor(px);\n const minY = Math.floor(py);\n const minZ = Math.floor(pz);\n const maxX = Math.ceil(px);\n const maxY = Math.ceil(py);\n const maxZ = Math.ceil(pz);\n const su = px - minX;\n const sv = py - minY;\n const sw = pz - minZ;\n if (minX === px && minY === py && minZ === pz) {\n sample(data, size, px, py, pz, color2);\n } else {\n let vertices;\n if (su >= sv && sv >= sw) {\n vertices = T[0];\n } else if (su >= sw && sw >= sv) {\n vertices = T[1];\n } else if (sw >= su && su >= sv) {\n vertices = T[2];\n } else if (sv >= su && su >= sw) {\n vertices = T[3];\n } else if (sv >= sw && sw >= su) {\n vertices = T[4];\n } else if (sw >= sv && sv >= su) {\n vertices = T[5];\n }\n const [P0, P1, P2, P3] = vertices;\n const coords = P[0];\n coords[0] = su;\n coords[1] = sv;\n coords[2] = sw;\n const tmp = P[1];\n const diffX = maxX - minX;\n const diffY = maxY - minY;\n const diffZ = maxZ - minZ;\n tmp[0] = diffX * P0[0] + minX;\n tmp[1] = diffY * P0[1] + minY;\n tmp[2] = diffZ * P0[2] + minZ;\n sample(data, size, tmp[0], tmp[1], tmp[2], C[0]);\n tmp[0] = diffX * P1[0] + minX;\n tmp[1] = diffY * P1[1] + minY;\n tmp[2] = diffZ * P1[2] + minZ;\n sample(data, size, tmp[0], tmp[1], tmp[2], C[1]);\n tmp[0] = diffX * P2[0] + minX;\n tmp[1] = diffY * P2[1] + minY;\n tmp[2] = diffZ * P2[2] + minZ;\n sample(data, size, tmp[0], tmp[1], tmp[2], C[2]);\n tmp[0] = diffX * P3[0] + minX;\n tmp[1] = diffY * P3[1] + minY;\n tmp[2] = diffZ * P3[2] + minZ;\n sample(data, size, tmp[0], tmp[1], tmp[2], C[3]);\n const V0 = calculateTetrahedronVolume(P1, P2, P3, coords) * 6;\n const V1 = calculateTetrahedronVolume(P0, P2, P3, coords) * 6;\n const V2 = calculateTetrahedronVolume(P0, P1, P3, coords) * 6;\n const V3 = calculateTetrahedronVolume(P0, P1, P2, coords) * 6;\n C[0][0] *= V0;\n C[0][1] *= V0;\n C[0][2] *= V0;\n C[1][0] *= V1;\n C[1][1] *= V1;\n C[1][2] *= V1;\n C[2][0] *= V2;\n C[2][1] *= V2;\n C[2][2] *= V2;\n C[3][0] *= V3;\n C[3][1] *= V3;\n C[3][2] *= V3;\n color2[0] = C[0][0] + C[1][0] + C[2][0] + C[3][0];\n color2[1] = C[0][1] + C[1][1] + C[2][1] + C[3][1];\n color2[2] = C[0][2] + C[1][2] + C[2][2] + C[3][2];\n }\n}\nvar TetrahedralUpscaler = class {\n /**\n * Expands the given data to the target size.\n *\n * @param {TypedArray} data - The input RGBA data. Assumed to be cubic.\n * @param {Number} size - The target size.\n * @return {TypedArray} The new data.\n */\n static expand(data, size) {\n const originalSize = Math.cbrt(data.length / 4);\n const rgb = new Float32Array(3);\n const array = new data.constructor(size ** 3 * 4);\n const maxValue = data instanceof Uint8Array ? 255 : 1;\n const sizeSq = size ** 2;\n const s = 1 / (size - 1);\n for (let z = 0; z < size; ++z) {\n for (let y = 0; y < size; ++y) {\n for (let x = 0; x < size; ++x) {\n const u = x * s;\n const v3 = y * s;\n const w = z * s;\n const i4 = Math.round(x + y * size + z * sizeSq) * 4;\n tetrahedralSample(data, originalSize, u, v3, w, rgb);\n array[i4 + 0] = rgb[0];\n array[i4 + 1] = rgb[1];\n array[i4 + 2] = rgb[2];\n array[i4 + 3] = maxValue;\n }\n }\n }\n return array;\n }\n};\n\n// src/textures/smaa/SMAAAreaImageData.js\nvar area = [\n new Float32Array(2),\n new Float32Array(2)\n];\nvar ORTHOGONAL_SIZE = 16;\nvar DIAGONAL_SIZE = 20;\nvar DIAGONAL_SAMPLES = 30;\nvar SMOOTH_MAX_DISTANCE = 32;\nvar orthogonalSubsamplingOffsets = new Float32Array([\n 0,\n -0.25,\n 0.25,\n -0.125,\n 0.125,\n -0.375,\n 0.375\n]);\nvar diagonalSubsamplingOffsets = [\n new Float32Array([0, 0]),\n new Float32Array([0.25, -0.25]),\n new Float32Array([-0.25, 0.25]),\n new Float32Array([0.125, -0.125]),\n new Float32Array([-0.125, 0.125])\n];\nvar orthogonalEdges = [\n new Uint8Array([0, 0]),\n new Uint8Array([3, 0]),\n new Uint8Array([0, 3]),\n new Uint8Array([3, 3]),\n new Uint8Array([1, 0]),\n new Uint8Array([4, 0]),\n new Uint8Array([1, 3]),\n new Uint8Array([4, 3]),\n new Uint8Array([0, 1]),\n new Uint8Array([3, 1]),\n new Uint8Array([0, 4]),\n new Uint8Array([3, 4]),\n new Uint8Array([1, 1]),\n new Uint8Array([4, 1]),\n new Uint8Array([1, 4]),\n new Uint8Array([4, 4])\n];\nvar diagonalEdges = [\n new Uint8Array([0, 0]),\n new Uint8Array([1, 0]),\n new Uint8Array([0, 2]),\n new Uint8Array([1, 2]),\n new Uint8Array([2, 0]),\n new Uint8Array([3, 0]),\n new Uint8Array([2, 2]),\n new Uint8Array([3, 2]),\n new Uint8Array([0, 1]),\n new Uint8Array([1, 1]),\n new Uint8Array([0, 3]),\n new Uint8Array([1, 3]),\n new Uint8Array([2, 1]),\n new Uint8Array([3, 1]),\n new Uint8Array([2, 3]),\n new Uint8Array([3, 3])\n];\nfunction lerp(a, b, p) {\n return a + (b - a) * p;\n}\nfunction saturate(a) {\n return Math.min(Math.max(a, 0), 1);\n}\nfunction smoothArea(d) {\n const a1 = area[0];\n const a2 = area[1];\n const b1X = Math.sqrt(a1[0] * 2) * 0.5;\n const b1Y = Math.sqrt(a1[1] * 2) * 0.5;\n const b2X = Math.sqrt(a2[0] * 2) * 0.5;\n const b2Y = Math.sqrt(a2[1] * 2) * 0.5;\n const p = saturate(d / SMOOTH_MAX_DISTANCE);\n a1[0] = lerp(b1X, a1[0], p);\n a1[1] = lerp(b1Y, a1[1], p);\n a2[0] = lerp(b2X, a2[0], p);\n a2[1] = lerp(b2Y, a2[1], p);\n}\nfunction getOrthArea(p1X, p1Y, p2X, p2Y, x, result) {\n const dX = p2X - p1X;\n const dY = p2Y - p1Y;\n const x1 = x;\n const x2 = x + 1;\n const y1 = p1Y + dY * (x1 - p1X) / dX;\n const y2 = p1Y + dY * (x2 - p1X) / dX;\n if (x1 >= p1X && x1 < p2X || x2 > p1X && x2 <= p2X) {\n if (Math.sign(y1) === Math.sign(y2) || Math.abs(y1) < 1e-4 || Math.abs(y2) < 1e-4) {\n const a = (y1 + y2) / 2;\n if (a < 0) {\n result[0] = Math.abs(a);\n result[1] = 0;\n } else {\n result[0] = 0;\n result[1] = Math.abs(a);\n }\n } else {\n const t = -p1Y * dX / dY + p1X;\n const tInt = Math.trunc(t);\n const a1 = t > p1X ? y1 * (t - tInt) / 2 : 0;\n const a2 = t < p2X ? y2 * (1 - (t - tInt)) / 2 : 0;\n const a = Math.abs(a1) > Math.abs(a2) ? a1 : -a2;\n if (a < 0) {\n result[0] = Math.abs(a1);\n result[1] = Math.abs(a2);\n } else {\n result[0] = Math.abs(a2);\n result[1] = Math.abs(a1);\n }\n }\n } else {\n result[0] = 0;\n result[1] = 0;\n }\n return result;\n}\nfunction getOrthAreaForPattern(pattern, left, right, offset, result) {\n const a1 = area[0];\n const a2 = area[1];\n const o1 = 0.5 + offset;\n const o2 = 0.5 + offset - 1;\n const d = left + right + 1;\n switch (pattern) {\n case 0: {\n result[0] = 0;\n result[1] = 0;\n break;\n }\n case 1: {\n if (left <= right) {\n getOrthArea(0, o2, d / 2, 0, left, result);\n } else {\n result[0] = 0;\n result[1] = 0;\n }\n break;\n }\n case 2: {\n if (left >= right) {\n getOrthArea(d / 2, 0, d, o2, left, result);\n } else {\n result[0] = 0;\n result[1] = 0;\n }\n break;\n }\n case 3: {\n getOrthArea(0, o2, d / 2, 0, left, a1);\n getOrthArea(d / 2, 0, d, o2, left, a2);\n smoothArea(d, area);\n result[0] = a1[0] + a2[0];\n result[1] = a1[1] + a2[1];\n break;\n }\n case 4: {\n if (left <= right) {\n getOrthArea(0, o1, d / 2, 0, left, result);\n } else {\n result[0] = 0;\n result[1] = 0;\n }\n break;\n }\n case 5: {\n result[0] = 0;\n result[1] = 0;\n break;\n }\n case 6: {\n if (Math.abs(offset) > 0) {\n getOrthArea(0, o1, d, o2, left, a1);\n getOrthArea(0, o1, d / 2, 0, left, a2);\n getOrthArea(d / 2, 0, d, o2, left, result);\n a2[0] = a2[0] + result[0];\n a2[1] = a2[1] + result[1];\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n } else {\n getOrthArea(0, o1, d, o2, left, result);\n }\n break;\n }\n case 7: {\n getOrthArea(0, o1, d, o2, left, result);\n break;\n }\n case 8: {\n if (left >= right) {\n getOrthArea(d / 2, 0, d, o1, left, result);\n } else {\n result[0] = 0;\n result[1] = 0;\n }\n break;\n }\n case 9: {\n if (Math.abs(offset) > 0) {\n getOrthArea(0, o2, d, o1, left, a1);\n getOrthArea(0, o2, d / 2, 0, left, a2);\n getOrthArea(d / 2, 0, d, o1, left, result);\n a2[0] = a2[0] + result[0];\n a2[1] = a2[1] + result[1];\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n } else {\n getOrthArea(0, o2, d, o1, left, result);\n }\n break;\n }\n case 10: {\n result[0] = 0;\n result[1] = 0;\n break;\n }\n case 11: {\n getOrthArea(0, o2, d, o1, left, result);\n break;\n }\n case 12: {\n getOrthArea(0, o1, d / 2, 0, left, a1);\n getOrthArea(d / 2, 0, d, o1, left, a2);\n smoothArea(d, area);\n result[0] = a1[0] + a2[0];\n result[1] = a1[1] + a2[1];\n break;\n }\n case 13: {\n getOrthArea(0, o2, d, o1, left, result);\n break;\n }\n case 14: {\n getOrthArea(0, o1, d, o2, left, result);\n break;\n }\n case 15: {\n result[0] = 0;\n result[1] = 0;\n break;\n }\n }\n return result;\n}\nfunction isInsideArea(a1X, a1Y, a2X, a2Y, x, y) {\n let result = a1X === a2X && a1Y === a2Y;\n if (!result) {\n const xm = (a1X + a2X) / 2;\n const ym = (a1Y + a2Y) / 2;\n const a = a2Y - a1Y;\n const b = a1X - a2X;\n const c2 = a * (x - xm) + b * (y - ym);\n result = c2 > 0;\n }\n return result;\n}\nfunction getDiagAreaForPixel(a1X, a1Y, a2X, a2Y, pX, pY) {\n let n = 0;\n for (let y = 0; y < DIAGONAL_SAMPLES; ++y) {\n for (let x = 0; x < DIAGONAL_SAMPLES; ++x) {\n const offsetX = x / (DIAGONAL_SAMPLES - 1);\n const offsetY = y / (DIAGONAL_SAMPLES - 1);\n if (isInsideArea(a1X, a1Y, a2X, a2Y, pX + offsetX, pY + offsetY)) {\n ++n;\n }\n }\n }\n return n / (DIAGONAL_SAMPLES * DIAGONAL_SAMPLES);\n}\nfunction getDiagArea(pattern, a1X, a1Y, a2X, a2Y, left, offset, result) {\n const e = diagonalEdges[pattern];\n const e1 = e[0];\n const e2 = e[1];\n if (e1 > 0) {\n a1X += offset[0];\n a1Y += offset[1];\n }\n if (e2 > 0) {\n a2X += offset[0];\n a2Y += offset[1];\n }\n result[0] = 1 - getDiagAreaForPixel(a1X, a1Y, a2X, a2Y, 1 + left, 0 + left);\n result[1] = getDiagAreaForPixel(a1X, a1Y, a2X, a2Y, 1 + left, 1 + left);\n return result;\n}\nfunction getDiagAreaForPattern(pattern, left, right, offset, result) {\n const a1 = area[0];\n const a2 = area[1];\n const d = left + right + 1;\n switch (pattern) {\n case 0: {\n getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 1: {\n getDiagArea(pattern, 1, 0, 0 + d, 0 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 2: {\n getDiagArea(pattern, 0, 0, 1 + d, 0 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 3: {\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, result);\n break;\n }\n case 4: {\n getDiagArea(pattern, 1, 1, 0 + d, 0 + d, left, offset, a1);\n getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 5: {\n getDiagArea(pattern, 1, 1, 0 + d, 0 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 6: {\n getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, result);\n break;\n }\n case 7: {\n getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 8: {\n getDiagArea(pattern, 0, 0, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 9: {\n getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, result);\n getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, result);\n break;\n }\n case 10: {\n getDiagArea(pattern, 0, 0, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 11: {\n getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 12: {\n getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, result);\n break;\n }\n case 13: {\n getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 1 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 14: {\n getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 1, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n case 15: {\n getDiagArea(pattern, 1, 1, 1 + d, 1 + d, left, offset, a1);\n getDiagArea(pattern, 1, 0, 1 + d, 0 + d, left, offset, a2);\n result[0] = (a1[0] + a2[0]) / 2;\n result[1] = (a1[1] + a2[1]) / 2;\n break;\n }\n }\n return result;\n}\nfunction generatePatterns(patterns, offset, orthogonal) {\n const result = new Float32Array(2);\n for (let i = 0, l = patterns.length; i < l; ++i) {\n const pattern = patterns[i];\n const data = pattern.data;\n const size = pattern.width;\n for (let y = 0; y < size; ++y) {\n for (let x = 0; x < size; ++x) {\n if (orthogonal) {\n getOrthAreaForPattern(i, x, y, offset, result);\n } else {\n getDiagAreaForPattern(i, x, y, offset, result);\n }\n const c2 = (y * size + x) * 2;\n data[c2] = result[0] * 255;\n data[c2 + 1] = result[1] * 255;\n }\n }\n }\n}\nfunction assemble(baseX, baseY, patterns, edges2, size, orthogonal, target) {\n const dstData = target.data;\n const dstWidth = target.width;\n for (let i = 0, l = patterns.length; i < l; ++i) {\n const edge = edges2[i];\n const pattern = patterns[i];\n const srcData = pattern.data;\n const srcWidth = pattern.width;\n for (let y = 0; y < size; ++y) {\n for (let x = 0; x < size; ++x) {\n const pX = edge[0] * size + baseX + x;\n const pY = edge[1] * size + baseY + y;\n const c2 = (pY * dstWidth + pX) * 4;\n const d = orthogonal ? (y * y * srcWidth + x * x) * 2 : (y * srcWidth + x) * 2;\n dstData[c2] = srcData[d];\n dstData[c2 + 1] = srcData[d + 1];\n dstData[c2 + 2] = 0;\n dstData[c2 + 3] = 255;\n }\n }\n }\n}\nvar SMAAAreaImageData = class {\n /**\n * Creates a new area image.\n *\n * @return {RawImageData} The generated image data.\n */\n static generate() {\n const width = 2 * 5 * ORTHOGONAL_SIZE;\n const height = orthogonalSubsamplingOffsets.length * 5 * ORTHOGONAL_SIZE;\n const data = new Uint8ClampedArray(width * height * 4);\n const result = new RawImageData(width, height, data);\n const orthPatternSize = Math.pow(ORTHOGONAL_SIZE - 1, 2) + 1;\n const diagPatternSize = DIAGONAL_SIZE;\n const orthogonalPatterns = [];\n const diagonalPatterns = [];\n for (let i = 3, l = data.length; i < l; i += 4) {\n data[i] = 255;\n }\n for (let i = 0; i < 16; ++i) {\n orthogonalPatterns.push(new RawImageData(\n orthPatternSize,\n orthPatternSize,\n new Uint8ClampedArray(orthPatternSize * orthPatternSize * 2),\n 2\n ));\n diagonalPatterns.push(new RawImageData(\n diagPatternSize,\n diagPatternSize,\n new Uint8ClampedArray(diagPatternSize * diagPatternSize * 2),\n 2\n ));\n }\n for (let i = 0, l = orthogonalSubsamplingOffsets.length; i < l; ++i) {\n generatePatterns(orthogonalPatterns, orthogonalSubsamplingOffsets[i], true);\n assemble(\n 0,\n 5 * ORTHOGONAL_SIZE * i,\n orthogonalPatterns,\n orthogonalEdges,\n ORTHOGONAL_SIZE,\n true,\n result\n );\n }\n for (let i = 0, l = diagonalSubsamplingOffsets.length; i < l; ++i) {\n generatePatterns(diagonalPatterns, diagonalSubsamplingOffsets[i], false);\n assemble(\n 5 * ORTHOGONAL_SIZE,\n 4 * DIAGONAL_SIZE * i,\n diagonalPatterns,\n diagonalEdges,\n DIAGONAL_SIZE,\n false,\n result\n );\n }\n return result;\n }\n};\n\n// src/textures/smaa/SMAAImageGenerator.js\nimport { LoadingManager as LoadingManager5 } from \"three\";\n\n// temp/smaa/worker.txt\nvar worker_default2 = '\"use strict\";(()=>{function q(t,a,s){let e=document.createElement(\"canvas\"),n=e.getContext(\"2d\");if(e.width=t,e.height=a,s instanceof Image)n.drawImage(s,0,0);else{let r=n.createImageData(t,a);r.data.set(s),n.putImageData(r,0,0)}return e}var F=class t{constructor(a=0,s=0,e=null){this.width=a,this.height=s,this.data=e}toCanvas(){return typeof document==\"undefined\"?null:q(this.width,this.height,this.data)}static from(a){let{width:s,height:e}=a,n;if(a instanceof Image){let r=q(s,e,a);r!==null&&(n=r.getContext(\"2d\").getImageData(0,0,s,e).data)}else n=a.data;return new t(s,e,n)}};var M=[new Float32Array(2),new Float32Array(2)],D=16,W=20,I=30,j=32,v=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),N=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],z=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],p=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];function C(t,a,s){return t+(a-t)*s}function B(t){return Math.min(Math.max(t,0),1)}function _(t){let a=M[0],s=M[1],e=Math.sqrt(a[0]*2)*.5,n=Math.sqrt(a[1]*2)*.5,r=Math.sqrt(s[0]*2)*.5,o=Math.sqrt(s[1]*2)*.5,c=B(t/j);a[0]=C(e,a[0],c),a[1]=C(n,a[1],c),s[0]=C(r,s[0],c),s[1]=C(o,s[1],c)}function d(t,a,s,e,n,r){let o=s-t,c=e-a,h=n,i=n+1,w=a+c*(h-t)/o,b=a+c*(i-t)/o;if(h>=t&&ht&&i<=s)if(Math.sign(w)===Math.sign(b)||Math.abs(w)<1e-4||Math.abs(b)<1e-4){let g=(w+b)/2;g<0?(r[0]=Math.abs(g),r[1]=0):(r[0]=0,r[1]=Math.abs(g))}else{let g=-a*o/c+t,k=Math.trunc(g),m=g>t?w*(g-k)/2:0,U=gMath.abs(U)?m:-U)<0?(r[0]=Math.abs(m),r[1]=Math.abs(U)):(r[0]=Math.abs(U),r[1]=Math.abs(m))}else r[0]=0,r[1]=0;return r}function J(t,a,s,e,n){let r=M[0],o=M[1],c=.5+e,h=.5+e-1,i=a+s+1;switch(t){case 0:{n[0]=0,n[1]=0;break}case 1:{a<=s?d(0,h,i/2,0,a,n):(n[0]=0,n[1]=0);break}case 2:{a>=s?d(i/2,0,i,h,a,n):(n[0]=0,n[1]=0);break}case 3:{d(0,h,i/2,0,a,r),d(i/2,0,i,h,a,o),_(i,M),n[0]=r[0]+o[0],n[1]=r[1]+o[1];break}case 4:{a<=s?d(0,c,i/2,0,a,n):(n[0]=0,n[1]=0);break}case 5:{n[0]=0,n[1]=0;break}case 6:{Math.abs(e)>0?(d(0,c,i,h,a,r),d(0,c,i/2,0,a,o),d(i/2,0,i,h,a,n),o[0]=o[0]+n[0],o[1]=o[1]+n[1],n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2):d(0,c,i,h,a,n);break}case 7:{d(0,c,i,h,a,n);break}case 8:{a>=s?d(i/2,0,i,c,a,n):(n[0]=0,n[1]=0);break}case 9:{Math.abs(e)>0?(d(0,h,i,c,a,r),d(0,h,i/2,0,a,o),d(i/2,0,i,c,a,n),o[0]=o[0]+n[0],o[1]=o[1]+n[1],n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2):d(0,h,i,c,a,n);break}case 10:{n[0]=0,n[1]=0;break}case 11:{d(0,h,i,c,a,n);break}case 12:{d(0,c,i/2,0,a,r),d(i/2,0,i,c,a,o),_(i,M),n[0]=r[0]+o[0],n[1]=r[1]+o[1];break}case 13:{d(0,h,i,c,a,n);break}case 14:{d(0,c,i,h,a,n);break}case 15:{n[0]=0,n[1]=0;break}}return n}function K(t,a,s,e,n,r){let o=t===s&&a===e;if(!o){let c=(t+s)/2,h=(a+e)/2,i=e-a,w=t-s;o=i*(n-c)+w*(r-h)>0}return o}function G(t,a,s,e,n,r){let o=0;for(let c=0;c0&&(a+=o[0],s+=o[1]),w>0&&(e+=o[0],n+=o[1]),c[0]=1-G(a,s,e,n,1+r,0+r),c[1]=G(a,s,e,n,1+r,1+r),c}function Q(t,a,s,e,n){let r=M[0],o=M[1],c=a+s+1;switch(t){case 0:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 1:{A(t,1,0,0+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 2:{A(t,0,0,1+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 3:{A(t,1,0,1+c,0+c,a,e,n);break}case 4:{A(t,1,1,0+c,0+c,a,e,r),A(t,1,1,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 5:{A(t,1,1,0+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 6:{A(t,1,1,1+c,0+c,a,e,n);break}case 7:{A(t,1,1,1+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 8:{A(t,0,0,1+c,1+c,a,e,r),A(t,1,0,1+c,1+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 9:{A(t,1,0,1+c,1+c,a,e,n),A(t,1,0,1+c,1+c,a,e,n);break}case 10:{A(t,0,0,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 11:{A(t,1,0,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 12:{A(t,1,1,1+c,1+c,a,e,n);break}case 13:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,1+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 14:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,1,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 15:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}}return n}function R(t,a,s){let e=new Float32Array(2);for(let n=0,r=t.length;n{let a=S.generate(),s=E.generate();postMessage({areaImageData:a,searchImageData:s},[a.data.buffer,s.data.buffer]),close()});})();\\n';\n\n// src/textures/smaa/SMAAImageGenerator.js\nfunction generate(useCache = true) {\n const workerURL = URL.createObjectURL(new Blob([worker_default2], {\n type: \"text/javascript\"\n }));\n const worker = new Worker(workerURL);\n URL.revokeObjectURL(workerURL);\n return new Promise((resolve, reject) => {\n worker.addEventListener(\"error\", (event) => reject(event.error));\n worker.addEventListener(\"message\", (event) => {\n const searchImageData = RawImageData.from(event.data.searchImageData);\n const areaImageData = RawImageData.from(event.data.areaImageData);\n const urls = [\n searchImageData.toCanvas().toDataURL(\"image/png\", 1),\n areaImageData.toCanvas().toDataURL(\"image/png\", 1)\n ];\n if (useCache) {\n localStorage.setItem(\"smaa-search\", urls[0]);\n localStorage.setItem(\"smaa-area\", urls[1]);\n }\n resolve(urls);\n });\n worker.postMessage(null);\n });\n}\nvar SMAAImageGenerator = class {\n /**\n * Constructs a new SMAA image generator.\n */\n constructor() {\n this.disableCache = false;\n }\n /**\n * Enables or disables caching via localStorage.\n *\n * @param {Boolean} value - Whether the cache should be enabled.\n */\n setCacheEnabled(value) {\n this.disableCache = !value;\n }\n /**\n * Generates the SMAA data images.\n *\n * @example\n * SMAAImageGenerator.generate().then(([search, area]) => {\n * const smaaEffect = new SMAAEffect(search, area);\n * });\n * @return {Promise} A promise that returns the search image and area image as a pair.\n */\n generate() {\n const useCache = !this.disableCache && window.localStorage !== void 0;\n const cachedURLs = useCache ? [\n localStorage.getItem(\"smaa-search\"),\n localStorage.getItem(\"smaa-area\")\n ] : [null, null];\n const promise = cachedURLs[0] !== null && cachedURLs[1] !== null ? Promise.resolve(cachedURLs) : generate(useCache);\n return promise.then((urls) => {\n return new Promise((resolve, reject) => {\n const searchImage = new Image();\n const areaImage = new Image();\n const manager = new LoadingManager5();\n manager.onLoad = () => resolve([searchImage, areaImage]);\n manager.onError = reject;\n searchImage.addEventListener(\"error\", (e) => manager.itemError(\"smaa-search\"));\n areaImage.addEventListener(\"error\", (e) => manager.itemError(\"smaa-area\"));\n searchImage.addEventListener(\"load\", () => manager.itemEnd(\"smaa-search\"));\n areaImage.addEventListener(\"load\", () => manager.itemEnd(\"smaa-area\"));\n manager.itemStart(\"smaa-search\");\n manager.itemStart(\"smaa-area\");\n searchImage.src = urls[0];\n areaImage.src = urls[1];\n });\n });\n }\n};\n\n// src/textures/smaa/SMAASearchImageData.js\nvar edges = /* @__PURE__ */ new Map([\n [bilinear(0, 0, 0, 0), new Float32Array([0, 0, 0, 0])],\n [bilinear(0, 0, 0, 1), new Float32Array([0, 0, 0, 1])],\n [bilinear(0, 0, 1, 0), new Float32Array([0, 0, 1, 0])],\n [bilinear(0, 0, 1, 1), new Float32Array([0, 0, 1, 1])],\n [bilinear(0, 1, 0, 0), new Float32Array([0, 1, 0, 0])],\n [bilinear(0, 1, 0, 1), new Float32Array([0, 1, 0, 1])],\n [bilinear(0, 1, 1, 0), new Float32Array([0, 1, 1, 0])],\n [bilinear(0, 1, 1, 1), new Float32Array([0, 1, 1, 1])],\n [bilinear(1, 0, 0, 0), new Float32Array([1, 0, 0, 0])],\n [bilinear(1, 0, 0, 1), new Float32Array([1, 0, 0, 1])],\n [bilinear(1, 0, 1, 0), new Float32Array([1, 0, 1, 0])],\n [bilinear(1, 0, 1, 1), new Float32Array([1, 0, 1, 1])],\n [bilinear(1, 1, 0, 0), new Float32Array([1, 1, 0, 0])],\n [bilinear(1, 1, 0, 1), new Float32Array([1, 1, 0, 1])],\n [bilinear(1, 1, 1, 0), new Float32Array([1, 1, 1, 0])],\n [bilinear(1, 1, 1, 1), new Float32Array([1, 1, 1, 1])]\n]);\nfunction lerp2(a, b, p) {\n return a + (b - a) * p;\n}\nfunction bilinear(e0, e1, e2, e3) {\n const a = lerp2(e0, e1, 1 - 0.25);\n const b = lerp2(e2, e3, 1 - 0.25);\n return lerp2(a, b, 1 - 0.125);\n}\nfunction deltaLeft(left, top) {\n let d = 0;\n if (top[3] === 1) {\n d += 1;\n }\n if (d === 1 && top[2] === 1 && left[1] !== 1 && left[3] !== 1) {\n d += 1;\n }\n return d;\n}\nfunction deltaRight(left, top) {\n let d = 0;\n if (top[3] === 1 && left[1] !== 1 && left[3] !== 1) {\n d += 1;\n }\n if (d === 1 && top[2] === 1 && left[0] !== 1 && left[2] !== 1) {\n d += 1;\n }\n return d;\n}\nvar SMAASearchImageData = class {\n /**\n * Creates a new search image.\n *\n * @return {RawImageData} The generated image data.\n */\n static generate() {\n const width = 66;\n const height = 33;\n const halfWidth = width / 2;\n const croppedWidth = 64;\n const croppedHeight = 16;\n const data = new Uint8ClampedArray(width * height);\n const croppedData = new Uint8ClampedArray(croppedWidth * croppedHeight * 4);\n for (let y = 0; y < height; ++y) {\n for (let x = 0; x < width; ++x) {\n const s = 0.03125 * x;\n const t = 0.03125 * y;\n if (edges.has(s) && edges.has(t)) {\n const e1 = edges.get(s);\n const e2 = edges.get(t);\n const i = y * width + x;\n data[i] = 127 * deltaLeft(e1, e2);\n data[i + halfWidth] = 127 * deltaRight(e1, e2);\n }\n }\n }\n for (let i = 0, y = height - croppedHeight; y < height; ++y) {\n for (let x = 0; x < croppedWidth; ++x, i += 4) {\n croppedData[i] = data[y * width + x];\n croppedData[i + 3] = 255;\n }\n }\n return new RawImageData(croppedWidth, croppedHeight, croppedData);\n }\n};\nexport {\n ASCIIEffect,\n ASCIITexture,\n AdaptiveLuminanceMaterial,\n AdaptiveLuminancePass,\n BlendFunction,\n BlendMode,\n BloomEffect,\n KawaseBlurPass as BlurPass,\n BokehEffect,\n BokehMaterial,\n BoxBlurMaterial,\n BoxBlurPass,\n BrightnessContrastEffect,\n ChromaticAberrationEffect,\n CircleOfConfusionMaterial,\n ClearMaskPass,\n ClearPass,\n ColorAverageEffect,\n ColorChannel,\n ColorDepthEffect,\n EdgeDetectionMaterial as ColorEdgesMaterial,\n KawaseBlurMaterial as ConvolutionMaterial,\n CopyMaterial,\n CopyPass,\n DepthComparisonMaterial,\n DepthCopyMaterial,\n DepthCopyMode,\n DepthCopyPass,\n DepthDownsamplingMaterial,\n DepthDownsamplingPass,\n DepthEffect,\n DepthMaskMaterial,\n DepthOfFieldEffect,\n DepthPass,\n DepthPickingPass,\n DepthCopyPass as DepthSavePass,\n DepthTestStrategy,\n Disposable,\n DotScreenEffect,\n DownsamplingMaterial,\n EdgeDetectionMaterial,\n EdgeDetectionMode,\n Effect,\n EffectAttribute,\n EffectComposer,\n EffectMaterial,\n EffectPass,\n EffectShaderData,\n EffectShaderSection,\n FXAAEffect,\n GammaCorrectionEffect,\n GaussKernel,\n GaussianBlurMaterial,\n GaussianBlurPass,\n GlitchEffect,\n GlitchMode,\n GodRaysEffect,\n GodRaysMaterial,\n GridEffect,\n HueSaturationEffect,\n ImmutableTimer,\n Initializable,\n KawaseBlurMaterial,\n KawaseBlurPass,\n KernelSize,\n LUT1DEffect,\n LUT3DEffect,\n LUT3dlLoader,\n LUTCubeLoader,\n LUT3DEffect as LUTEffect,\n LUTOperation,\n LambdaPass,\n LensDistortionEffect,\n LookupTexture,\n LookupTexture as LookupTexture3D,\n LuminanceMaterial,\n LuminancePass,\n MaskFunction,\n MaskMaterial,\n MaskPass,\n MipmapBlurPass,\n NoiseEffect,\n NoiseTexture,\n NormalPass,\n OutlineMaterial as OutlineEdgesMaterial,\n OutlineEffect,\n OutlineMaterial,\n OverrideMaterialManager,\n Pass,\n PixelationEffect,\n PredicationMode,\n RawImageData,\n RealisticBokehEffect,\n RenderPass,\n Resizable,\n Resolution as Resizer,\n Resolution,\n SMAAAreaImageData,\n SMAAEffect,\n SMAAImageGenerator,\n SMAAImageLoader,\n SMAAPreset,\n SMAASearchImageData,\n SMAAWeightsMaterial,\n SSAOEffect,\n SSAOMaterial,\n CopyPass as SavePass,\n ScanlineEffect,\n EffectShaderSection as Section,\n Selection,\n SelectiveBloomEffect,\n SepiaEffect,\n ShaderPass,\n ShockWaveEffect,\n TetrahedralUpscaler,\n TextureEffect,\n TiltShiftBlurMaterial,\n TiltShiftBlurPass,\n TiltShiftEffect,\n Timer,\n ToneMappingEffect,\n ToneMappingMode,\n UpsamplingMaterial,\n VignetteEffect,\n VignetteTechnique,\n WebGLExtension,\n version\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAI,UAAU;AAGd,IAAI,aAAa,MAAM;AAAA;AAAA;AAAA;AAAA,EAIrB,UAAU;AAAA,EACV;AACF;AAgBA,IAAI,0BAA0B,IAAI;AAClC,IAAI,0BAA0B;AAC9B,IAAI,QAAQ,MAAM;AAAA;AAAA;AAAA;AAAA,EAIhB,cAAc;AACZ,SAAK,YAAY,YAAY,IAAI;AACjC,SAAK,eAAe;AACpB,SAAK,cAAc;AACnB,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,cAAc,MAAM;AACzB,SAAK,YAAY;AACjB,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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vB;AAAA,IACF;AACA,WAAO,IAAI,aAAa,cAAc,eAAe,WAAW;AAAA,EAClE;AACF;", + "names": [] +} diff --git a/app/src/main.ts b/app/src/main.ts index 4991c06..6820af3 100644 --- a/app/src/main.ts +++ b/app/src/main.ts @@ -6,6 +6,7 @@ import { LightingManager } from './lighting' import { ModelLoader } from './model-loader' import { PhysicsManager } from './physics' import { EventManager } from './event-manager' +import { PostProcessingManager } from './post-processing' class AAFHomepage { private scene: THREE.Scene @@ -20,6 +21,8 @@ class AAFHomepage { private lastTime: number = 0 private modelLoader: ModelLoader private eventManager: EventManager + private postProcessing!: PostProcessingManager + private usePostProcessing: boolean = true constructor() { this.scene = new THREE.Scene() @@ -85,6 +88,21 @@ class AAFHomepage { // Setup lighting LightingManager.setupLighting(this.scene) + // Initialize post-processing + this.postProcessing = new PostProcessingManager(this.renderer, this.scene, this.camera) + + // Setup window resize handler + window.addEventListener('resize', () => { + const width = window.innerWidth + const height = window.innerHeight + + this.camera.aspect = width / height + this.camera.updateProjectionMatrix() + + this.renderer.setSize(width, height) + this.postProcessing.resize(width, height) + }) + // Load and create objects from the main model this.loadAndCreateObjects() @@ -117,7 +135,14 @@ class AAFHomepage { clampedDeltaTime ) - this.renderer.render(this.scene, this.camera) + // Use post-processing rendering + if (this.usePostProcessing) { + this.postProcessing.update(clampedDeltaTime) + this.postProcessing.render(clampedDeltaTime) + } else { + // Fallback to direct rendering + this.renderer.render(this.scene, this.camera) + } } } diff --git a/app/src/motion-blur.ts b/app/src/motion-blur.ts new file mode 100644 index 0000000..9fb800f --- /dev/null +++ b/app/src/motion-blur.ts @@ -0,0 +1,121 @@ +import * as THREE from 'three' + +export class MotionBlurEffect { + private scene: THREE.Scene + private camera: THREE.PerspectiveCamera + private renderer: THREE.WebGLRenderer + private renderTarget1: THREE.WebGLRenderTarget + private renderTarget2: THREE.WebGLRenderTarget + private blurMaterial: THREE.ShaderMaterial + private quad: THREE.Mesh + private intensity: number = 0.5 + private accumulation: number = 0.8 + + constructor( + scene: THREE.Scene, + camera: THREE.PerspectiveCamera, + renderer: THREE.WebGLRenderer + ) { + this.scene = scene + this.camera = camera + this.renderer = renderer + + const size = renderer.getSize(new THREE.Vector2()) + + // Create render targets for accumulation + this.renderTarget1 = new THREE.WebGLRenderTarget(size.x, size.y, { + minFilter: THREE.LinearFilter, + magFilter: THREE.LinearFilter, + format: THREE.RGBAFormat, + type: THREE.FloatType + }) + + this.renderTarget2 = new THREE.WebGLRenderTarget(size.x, size.y, { + minFilter: THREE.LinearFilter, + magFilter: THREE.LinearFilter, + format: THREE.RGBAFormat, + type: THREE.FloatType + }) + + // Motion blur shader material + this.blurMaterial = new THREE.ShaderMaterial({ + uniforms: { + tCurrent: { value: null }, + tPrevious: { value: null }, + intensity: { value: this.intensity }, + accumulation: { value: this.accumulation } + }, + vertexShader: ` + varying vec2 vUv; + void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `, + fragmentShader: ` + uniform sampler2D tCurrent; + uniform sampler2D tPrevious; + uniform float intensity; + uniform float accumulation; + varying vec2 vUv; + + void main() { + vec4 current = texture2D(tCurrent, vUv); + vec4 previous = texture2D(tPrevious, vUv); + + // Blend current frame with accumulated previous frames + vec4 result = mix(current, previous, accumulation * intensity); + + gl_FragColor = result; + } + ` + }) + + // Create fullscreen quad + const geometry = new THREE.PlaneGeometry(2, 2) + this.quad = new THREE.Mesh(geometry, this.blurMaterial) + } + + public render(deltaTime: number): THREE.WebGLRenderTarget { + // Render current frame to renderTarget1 + this.renderer.setRenderTarget(this.renderTarget1) + this.renderer.render(this.scene, this.camera) + + // Apply motion blur by blending with previous frame + this.blurMaterial.uniforms.tCurrent.value = this.renderTarget1.texture + this.blurMaterial.uniforms.tPrevious.value = this.renderTarget2.texture + + // Render blurred result to renderTarget2 + this.renderer.setRenderTarget(this.renderTarget2) + this.renderer.render(this.quad, new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1)) + + // Swap render targets for next frame + const temp = this.renderTarget1 + this.renderTarget1 = this.renderTarget2 + this.renderTarget2 = temp + + return this.renderTarget1 + } + + public setIntensity(intensity: number): void { + this.intensity = intensity + this.blurMaterial.uniforms.intensity.value = intensity + } + + public setAccumulation(accumulation: number): void { + this.accumulation = accumulation + this.blurMaterial.uniforms.accumulation.value = accumulation + } + + public resize(width: number, height: number): void { + this.renderTarget1.setSize(width, height) + this.renderTarget2.setSize(width, height) + } + + public dispose(): void { + this.renderTarget1.dispose() + this.renderTarget2.dispose() + this.blurMaterial.dispose() + this.quad.geometry.dispose() + } +} diff --git a/app/src/post-processing.ts b/app/src/post-processing.ts new file mode 100644 index 0000000..91ea0bd --- /dev/null +++ b/app/src/post-processing.ts @@ -0,0 +1,122 @@ +import * as THREE from 'three' +import { + EffectComposer, + EffectPass, + RenderPass, + BloomEffect, + SSAOEffect, + DepthOfFieldEffect, + NormalPass, + SMAAEffect +} from 'postprocessing' + +export class PostProcessingManager { + private composer: EffectComposer + private bloomEffect: BloomEffect + private ssaoEffect: SSAOEffect + private depthOfFieldEffect: DepthOfFieldEffect + private normalPass: NormalPass + + constructor( + renderer: THREE.WebGLRenderer, + scene: THREE.Scene, + camera: THREE.PerspectiveCamera + ) { + // Create effect composer + this.composer = new EffectComposer(renderer) + + // Add render pass (renders the scene) + const renderPass = new RenderPass(scene, camera) + this.composer.addPass(renderPass) + + // Create normal pass for SSAO + this.normalPass = new NormalPass(scene, camera) + this.composer.addPass(this.normalPass) + + // Create bloom effect - enhanced for more dramatic glow + this.bloomEffect = new BloomEffect({ + intensity: 1.2, + luminanceThreshold: 0.1, + luminanceSmoothing: 0.15, + radius: 0.9, + mipmapBlur: true + }) + + // Create SSAO effect - enhanced for better ambient occlusion + this.ssaoEffect = new SSAOEffect(camera, this.normalPass.texture, { + intensity: 0.8, + fade: 0.01, + radius: 0.15, + samples: 32, + rings: 4, + worldDistanceThreshold: 20, + worldDistanceFalloff: 5, + worldProximityThreshold: 0.0005, + worldProximityFalloff: 0.001, + luminanceInfluence: 0.7, + bias: 0.02 + }) + + // Create depth of field effect - tighter focus for more dramatic effect + this.depthOfFieldEffect = new DepthOfFieldEffect(camera, { + focusDistance: 0.015, // Closer focus point + focalLength: 0.12, // Shorter focal length for stronger blur + bokehScale: 4.0, // Larger bokeh for more pronounced blur + height: 480 + }) + + // Create SMAA effect for better antialiasing + const smaaEffect = new SMAAEffect() + + // Combine effects in a single pass for better performance + const effectPass = new EffectPass( + camera, + this.bloomEffect, + this.ssaoEffect, + this.depthOfFieldEffect, + smaaEffect + ) + + this.composer.addPass(effectPass) + } + + public render(deltaTime?: number): void { + this.composer.render(deltaTime) + } + + public resize(width: number, height: number): void { + this.composer.setSize(width, height) + } + + // Control methods for real-time adjustments + public setBloomIntensity(intensity: number): void { + this.bloomEffect.intensity = intensity + } + + public setSSAOIntensity(intensity: number): void { + this.ssaoEffect.intensity = intensity + } + + public setDepthOfFieldFocus(focusDistance: number): void { + this.depthOfFieldEffect.circleOfConfusionMaterial.uniforms.focusDistance.value = focusDistance + } + + // Get the composer for advanced usage + public getComposer(): EffectComposer { + return this.composer + } + + // Update method for any per-frame updates + public update(_deltaTime: number): void { + // Add any custom update logic here if needed + } + + // Dispose method for cleanup + public dispose(): void { + this.composer.dispose() + this.bloomEffect.dispose() + this.ssaoEffect.dispose() + this.depthOfFieldEffect.dispose() + this.normalPass.dispose() + } +}