@needle-tools/engine 4.12.0-beta.1 → 4.12.0-next.c6c0281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.needle.json +1 -1
- package/dist/{generateMeshBVH.worker-mO20N_b8.js → generateMeshBVH.worker-BvGEI0r7.js} +4 -4
- package/dist/{gltf-progressive-DZrY8VT6.min.js → gltf-progressive-BmSygnAC.min.js} +2 -2
- package/dist/{gltf-progressive-DgYz5BYa.js → gltf-progressive-DnLBuGK5.js} +24 -24
- package/dist/{gltf-progressive-DWcmTMCh.umd.cjs → gltf-progressive-Rs-ojtXy.umd.cjs} +1 -1
- package/dist/{loader.worker-Dip-PthR.js → loader.worker-DWzfDpAl.js} +4 -4
- package/dist/{needle-engine.bundle-BxG30KEV.js → needle-engine.bundle-BVdPECIB.js} +1106 -1167
- package/dist/{needle-engine.bundle-C08Ag6_H.umd.cjs → needle-engine.bundle-Dk2U2sIu.umd.cjs} +76 -77
- package/dist/{needle-engine.bundle-BeTUOBiO.min.js → needle-engine.bundle-ThW_g39D.min.js} +80 -81
- package/dist/needle-engine.d.ts +96 -40
- package/dist/needle-engine.js +4 -4
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-DYDtB188.min.js → postprocessing-B5ksn9-G.min.js} +54 -54
- package/dist/{postprocessing-CMgoN5t5.umd.cjs → postprocessing-DZtb9Nnn.umd.cjs} +81 -81
- package/dist/{postprocessing-BTW9pD_s.js → postprocessing-__7s9wON.js} +450 -441
- package/dist/{three-DfMvBzXi.js → three-BCCkyCA5.js} +1 -7
- package/dist/{three-qj71I7J3.umd.cjs → three-Bf2NBxAw.umd.cjs} +2 -2
- package/dist/{three-B7CT31Bt.min.js → three-W7zWTcfP.min.js} +1 -1
- package/dist/{three-examples-CsW4_6LI.umd.cjs → three-examples-Dho7cuu4.umd.cjs} +4 -4
- package/dist/{three-examples-D1P7eEhn.min.js → three-examples-MsJjauyk.min.js} +10 -10
- package/dist/{three-examples-D1SK93ek.js → three-examples-y2GeYlze.js} +2 -20
- package/dist/{three-mesh-ui-C_uSB5dD.js → three-mesh-ui-3nSSizT4.js} +1 -1
- package/dist/{three-mesh-ui-LQ44s0AL.min.js → three-mesh-ui-CIez6qJQ.min.js} +1 -1
- package/dist/{three-mesh-ui-DpATDXwU.umd.cjs → three-mesh-ui-zsOOA5Pq.umd.cjs} +1 -1
- package/dist/vendor-BiJQtqow.min.js +1116 -0
- package/dist/{vendor-D0zoswDa.js → vendor-C_oHRUjX.js} +2686 -2663
- package/dist/{vendor-UCpFAwt1.umd.cjs → vendor-DN-NsXVB.umd.cjs} +30 -30
- package/lib/engine/codegen/register_types.js +0 -2
- package/lib/engine/codegen/register_types.js.map +1 -1
- package/lib/engine/engine_license.js +3 -9
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_physics_rapier.js +1 -1
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/extensions/extensions.d.ts +29 -7
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js +4 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js +1 -1
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +1 -1
- package/lib/engine-components/AlignmentConstraint.js +1 -1
- package/lib/engine-components/Animation.d.ts +1 -1
- package/lib/engine-components/Animation.js +1 -1
- package/lib/engine-components/Animator.d.ts +1 -1
- package/lib/engine-components/Animator.js +1 -1
- package/lib/engine-components/AudioListener.d.ts +1 -1
- package/lib/engine-components/AudioListener.js +1 -1
- package/lib/engine-components/AudioSource.d.ts +1 -1
- package/lib/engine-components/AudioSource.js +1 -1
- package/lib/engine-components/Camera.d.ts +1 -1
- package/lib/engine-components/Camera.js +1 -1
- package/lib/engine-components/CharacterController.d.ts +6 -2
- package/lib/engine-components/CharacterController.js +6 -2
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +1 -1
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +14 -0
- package/lib/engine-components/Joints.js +14 -0
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +1 -1
- package/lib/engine-components/LookAtConstraint.js +1 -1
- package/lib/engine-components/OrbitControls.d.ts +1 -1
- package/lib/engine-components/OrbitControls.js +1 -1
- package/lib/engine-components/Renderer.d.ts +6 -0
- package/lib/engine-components/Renderer.js +6 -0
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererInstancing.js +5 -3
- package/lib/engine-components/RendererInstancing.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +18 -14
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.d.ts +2 -1
- package/lib/engine-components/SpriteRenderer.js +2 -1
- package/lib/engine-components/SpriteRenderer.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js +1 -0
- package/lib/engine-components/api.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +0 -1
- package/lib/engine-components/codegen/components.js +0 -1
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/timeline/SignalAsset.d.ts +1 -1
- package/lib/engine-components/timeline/SignalAsset.js +1 -1
- package/lib/engine-components/ui/Raycaster.d.ts +3 -2
- package/lib/engine-components/ui/Raycaster.js +3 -2
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/RectTransform.d.ts +6 -0
- package/lib/engine-components/ui/RectTransform.js +6 -0
- package/lib/engine-components/ui/RectTransform.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +2 -1
- package/lib/engine-components/utils/LookAt.js +2 -1
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +1 -1
- package/lib/engine-components/web/CursorFollow.js +1 -1
- package/lib/engine-components/web/HoverAnimation.d.ts +1 -1
- package/lib/engine-components/web/HoverAnimation.js +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +1 -1
- package/lib/engine-components/web/ViewBox.js +1 -1
- package/package.json +2 -2
- package/src/engine/codegen/register_types.ts +0 -2
- package/src/engine/engine_license.ts +3 -8
- package/src/engine/engine_physics_rapier.ts +1 -1
- package/src/engine/extensions/extensions.ts +30 -6
- package/src/engine/webcomponents/needle menu/needle-menu.ts +4 -5
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine-components/AlignmentConstraint.ts +1 -1
- package/src/engine-components/Animation.ts +1 -1
- package/src/engine-components/Animator.ts +1 -1
- package/src/engine-components/AudioListener.ts +1 -1
- package/src/engine-components/AudioSource.ts +1 -1
- package/src/engine-components/Camera.ts +1 -1
- package/src/engine-components/CharacterController.ts +6 -2
- package/src/engine-components/Collider.ts +1 -1
- package/src/engine-components/Joints.ts +14 -0
- package/src/engine-components/LookAtConstraint.ts +1 -1
- package/src/engine-components/OrbitControls.ts +1 -1
- package/src/engine-components/Renderer.ts +6 -0
- package/src/engine-components/RendererInstancing.ts +6 -3
- package/src/engine-components/SceneSwitcher.ts +17 -17
- package/src/engine-components/SpriteRenderer.ts +2 -1
- package/src/engine-components/api.ts +2 -1
- package/src/engine-components/codegen/components.ts +0 -1
- package/src/engine-components/timeline/SignalAsset.ts +1 -1
- package/src/engine-components/ui/Raycaster.ts +3 -2
- package/src/engine-components/ui/RectTransform.ts +6 -0
- package/src/engine-components/utils/LookAt.ts +2 -1
- package/src/engine-components/web/CursorFollow.ts +1 -1
- package/src/engine-components/web/HoverAnimation.ts +1 -1
- package/src/engine-components/web/ViewBox.ts +1 -1
- package/dist/vendor-BKGa4GE0.min.js +0 -1116
|
@@ -10802,13 +10802,7 @@ function DC(s) {
|
|
|
10802
10802
|
}
|
|
10803
10803
|
function UC(s) {
|
|
10804
10804
|
let e = "ENVMAP_MODE_REFLECTION";
|
|
10805
|
-
|
|
10806
|
-
switch (s.envMapMode) {
|
|
10807
|
-
case Li:
|
|
10808
|
-
e = "ENVMAP_MODE_REFRACTION";
|
|
10809
|
-
break;
|
|
10810
|
-
}
|
|
10811
|
-
return e;
|
|
10805
|
+
return s.envMap && s.envMapMode === Li && (e = "ENVMAP_MODE_REFRACTION"), e;
|
|
10812
10806
|
}
|
|
10813
10807
|
function FC(s) {
|
|
10814
10808
|
let e = "ENVMAP_BLENDING_NONE";
|
|
@@ -3767,7 +3767,7 @@ void main() {
|
|
|
3767
3767
|
`;return s.precision==="highp"?e+=`
|
|
3768
3768
|
#define HIGH_PRECISION`:s.precision==="mediump"?e+=`
|
|
3769
3769
|
#define MEDIUM_PRECISION`:s.precision==="lowp"&&(e+=`
|
|
3770
|
-
#define LOW_PRECISION`),e}function lR(s){let e="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===Lf?e="SHADOWMAP_TYPE_PCF":s.shadowMapType===Df?e="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===oi&&(e="SHADOWMAP_TYPE_VSM"),e}function uR(s){let e="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case wi:case Vi:e="ENVMAP_TYPE_CUBE";break;case hr:e="ENVMAP_TYPE_CUBE_UV";break}return e}function hR(s){let e="ENVMAP_MODE_REFLECTION";
|
|
3770
|
+
#define LOW_PRECISION`),e}function lR(s){let e="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===Lf?e="SHADOWMAP_TYPE_PCF":s.shadowMapType===Df?e="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===oi&&(e="SHADOWMAP_TYPE_VSM"),e}function uR(s){let e="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case wi:case Vi:e="ENVMAP_TYPE_CUBE";break;case hr:e="ENVMAP_TYPE_CUBE_UV";break}return e}function hR(s){let e="ENVMAP_MODE_REFLECTION";return s.envMap&&s.envMapMode===Vi&&(e="ENVMAP_MODE_REFRACTION"),e}function dR(s){let e="ENVMAP_BLENDING_NONE";if(s.envMap)switch(s.combine){case fa:e="ENVMAP_BLENDING_MULTIPLY";break;case Of:e="ENVMAP_BLENDING_MIX";break;case Vf:e="ENVMAP_BLENDING_ADD";break}return e}function pR(s){const e=s.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function fR(s,e,t,n){const i=s.getContext(),r=t.defines;let o=t.vertexShader,a=t.fragmentShader;const c=lR(t),l=uR(t),u=hR(t),h=dR(t),d=pR(t),p=tR(t),f=nR(r),x=i.createProgram();let m,g,y=t.glslVersion?"#version "+t.glslVersion+`
|
|
3771
3771
|
`:"";t.isRawShaderMaterial?(m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f].filter(Ja).join(`
|
|
3772
3772
|
`),m.length>0&&(m+=`
|
|
3773
3773
|
`),g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f].filter(Ja).join(`
|
|
@@ -3867,4 +3867,4 @@ ${e.tab}if ( ${u} ) {
|
|
|
3867
3867
|
`}}class Nb{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.startTime=null,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let n=e.get(t);return n===void 0&&(n={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,n)),n}updateBeforeNode(e){const t=e.getUpdateBeforeType(),n=e.updateReference(this);if(t===We.FRAME){const{frameMap:i}=this._getMaps(this.updateBeforeMap,n);i.get(n)!==this.frameId&&e.updateBefore(this)!==!1&&i.set(n,this.frameId)}else if(t===We.RENDER){const{renderMap:i}=this._getMaps(this.updateBeforeMap,n);i.get(n)!==this.renderId&&e.updateBefore(this)!==!1&&i.set(n,this.renderId)}else t===We.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),n=e.updateReference(this);if(t===We.FRAME){const{frameMap:i}=this._getMaps(this.updateAfterMap,n);i.get(n)!==this.frameId&&e.updateAfter(this)!==!1&&i.set(n,this.frameId)}else if(t===We.RENDER){const{renderMap:i}=this._getMaps(this.updateAfterMap,n);i.get(n)!==this.renderId&&e.updateAfter(this)!==!1&&i.set(n,this.renderId)}else t===We.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),n=e.updateReference(this);if(t===We.FRAME){const{frameMap:i}=this._getMaps(this.updateMap,n);i.get(n)!==this.frameId&&e.update(this)!==!1&&i.set(n,this.frameId)}else if(t===We.RENDER){const{renderMap:i}=this._getMaps(this.updateMap,n);i.get(n)!==this.renderId&&e.update(this)!==!1&&i.set(n,this.renderId)}else t===We.OBJECT&&e.update(this)}update(){this.frameId++,this.lastTime===void 0&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class Kg{constructor(e,t,n=null,i="",r=!1){this.type=e,this.name=t,this.count=n,this.qualifier=i,this.isConst=r}}Kg.isNodeFunctionInput=!0;class I3 extends Ye{static get type(){return"StructTypeNode"}constructor(e){super(),this.types=e,this.isStructTypeNode=!0}getMemberTypes(){return this.types}}class jg extends Ye{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}setup(e){super.setup(e);const t=this.members,n=[];for(let i=0;i<t.length;i++)n.push(t[i].getNodeType(e));this.nodeType=e.getStructTypeFromNode(new I3(n)).name}generate(e,t){const n=e.getOutputStructName(),i=this.members,r=n!==""?n+".":"";for(let o=0;o<i.length;o++){const a=i[o].build(e,t);e.addLineFlowCode(`${r}m${o} = ${a}`,this)}return n}}const P3=K(jg);function Qg(s,e){for(let t=0;t<s.length;t++)if(s[t].name===e)return t;return-1}class Eb extends jg{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.isMRTNode=!0}has(e){return this.outputNodes[e]!==void 0}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes};return Vd(t)}setup(e){const t=this.outputNodes,n=e.renderer.getRenderTarget(),i=[],r=n.textures;for(const o in t){const a=Qg(r,o);i[a]=oe(t[o])}return this.members=i,super.setup(e)}}const Vd=K(Eb);class Cb extends Ye{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let n=this._candidateFnCall;if(n===null){let i=null,r=-1;for(const o of this.functionNodes){const c=o.shaderNode.layout;if(c===null)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const l=c.inputs;if(t.length===l.length){let u=0;for(let h=0;h<t.length;h++){const d=t[h],p=l[h];d.getNodeType(e)===p.type?u++:u=0}u>r&&(i=o,r=u)}}this._candidateFnCall=n=i(...t)}return n}}const L3=K(Cb),On=s=>(...e)=>L3(s,...e);class Sn extends uo{static get type(){return"TimerNode"}constructor(e=Sn.LOCAL,t=1,n=0){super(n),this.scope=e,this.scale=t,this.updateType=We.FRAME}update(e){const t=this.scope,n=this.scale;t===Sn.LOCAL?this.value+=e.deltaTime*n:t===Sn.DELTA?this.value=e.deltaTime*n:t===Sn.FRAME?this.value=e.frameId:this.value=e.time*n}serialize(e){super.serialize(e),e.scope=this.scope,e.scale=this.scale}deserialize(e){super.deserialize(e),this.scope=e.scope,this.scale=e.scale}}Sn.LOCAL="local";Sn.GLOBAL="global";Sn.DELTA="delta";Sn.FRAME="frame";const e0=(s,e=0)=>H(new Sn(Sn.LOCAL,s,e)),D3=(s,e=0)=>H(new Sn(Sn.GLOBAL,s,e)),U3=(s,e=0)=>H(new Sn(Sn.DELTA,s,e)),F3=fe(Sn,Sn.FRAME).toUint();class pn extends Ye{static get type(){return"OscNode"}constructor(e=pn.SINE,t=e0()){super(),this.method=e,this.timeNode=t}getNodeType(e){return this.timeNode.getNodeType(e)}setup(){const e=this.method,t=H(this.timeNode);let n=null;return e===pn.SINE?n=t.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5):e===pn.SQUARE?n=t.fract().round():e===pn.TRIANGLE?n=t.add(.5).fract().mul(2).sub(1).abs():e===pn.SAWTOOTH&&(n=t.fract()),n}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}pn.SINE="sine";pn.SQUARE="square";pn.TRIANGLE="triangle";pn.SAWTOOTH="sawtooth";const O3=K(pn,pn.SINE),V3=K(pn,pn.SQUARE),B3=K(pn,pn.TRIANGLE),z3=K(pn,pn.SAWTOOTH);class Rb extends Ye{static get type(){return"SpriteSheetUVNode"}constructor(e,t=rt(),n=A(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=n}setup(){const{frameNode:e,uvNode:t,countNode:n}=this,{width:i,height:r}=n,o=e.mod(i.mul(r)).floor(),a=o.mod(i),c=r.sub(o.add(1).div(i).ceil()),l=n.reciprocal(),u=z(a,c);return t.add(u).mul(l)}}const k3=K(Rb);class Ib extends mr{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}setup(e){return e.isAvailable("storageBuffer")===!1&&this.node.bufferObject===!0&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let n;const i=e.context.assign;if(e.isAvailable("storageBuffer")===!1?this.node.bufferObject===!0&&i!==!0?n=e.generatePBO(this):n=this.node.build(e):n=super.generate(e),i!==!0){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}const G3=K(Ib);class Pb extends Ye{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,n=null,i=A(1),r=en,o=hi){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=n,this.scaleNode=i,this.positionNode=r,this.normalNode=o}setup(){const{textureXNode:e,textureYNode:t,textureZNode:n,scaleNode:i,positionNode:r,normalNode:o}=this;let a=o.abs().normalize();a=a.div(a.dot(D(1)));const c=r.yz.mul(i),l=r.zx.mul(i),u=r.xy.mul(i),h=e.value,d=t!==null?t.value:h,p=n!==null?n.value:h,f=xt(h,c).mul(a.x),x=xt(d,l).mul(a.y),m=xt(p,u).mul(a.z);return Wt(f,x,m)}}const Lb=K(Pb),H3=(...s)=>Lb(...s),Uo=new cs,Pr=new E,Fo=new E,Jp=new E,Xa=new Fe,Su=new E(0,0,-1),Ns=new st,qa=new E,Tu=new E,$a=new st,bu=new J,E_=new fn,W3=_r.flipX();let Kp=!1;class Db extends gs{static get type(){return"ReflectorNode"}constructor(e={}){super(E_.texture,W3);const{target:t=new yt,resolution:n=1,generateMipmaps:i=!1,bounces:r=!0}=e;this.target=t,this.resolution=n,this.generateMipmaps=i,this.bounces=r,this.updateBeforeType=r?We.RENDER:We.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new WeakMap}_updateResolution(e,t){const n=this.resolution;t.getDrawingBufferSize(bu),e.setSize(Math.round(bu.width*n),Math.round(bu.height*n))}setup(e){return this._updateResolution(E_,e.renderer),super.setup(e)}getTextureNode(){return this.textureNode}getVirtualCamera(e){let t=this.virtualCameras.get(e);return t===void 0&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return t===void 0&&(t=new fn(0,0,{type:Ln}),this.generateMipmaps===!0&&(t.texture.minFilter=uy,t.texture.generateMipmaps=!0),this.renderTargets.set(e,t)),t}updateBefore(e){if(this.bounces===!1&&Kp)return!1;Kp=!0;const{scene:t,camera:n,renderer:i,material:r}=e,{target:o}=this,a=this.getVirtualCamera(n),c=this.getRenderTarget(a);if(i.getDrawingBufferSize(bu),this._updateResolution(c,i),Fo.setFromMatrixPosition(o.matrixWorld),Jp.setFromMatrixPosition(n.matrixWorld),Xa.extractRotation(o.matrixWorld),Pr.set(0,0,1),Pr.applyMatrix4(Xa),qa.subVectors(Fo,Jp),qa.dot(Pr)>0)return;qa.reflect(Pr).negate(),qa.add(Fo),Xa.extractRotation(n.matrixWorld),Su.set(0,0,-1),Su.applyMatrix4(Xa),Su.add(Jp),Tu.subVectors(Fo,Su),Tu.reflect(Pr).negate(),Tu.add(Fo),a.coordinateSystem=n.coordinateSystem,a.position.copy(qa),a.up.set(0,1,0),a.up.applyMatrix4(Xa),a.up.reflect(Pr),a.lookAt(Tu),a.near=n.near,a.far=n.far,a.updateMatrixWorld(),a.projectionMatrix.copy(n.projectionMatrix),Uo.setFromNormalAndCoplanarPoint(Pr,Fo),Uo.applyMatrix4(a.matrixWorldInverse),Ns.set(Uo.normal.x,Uo.normal.y,Uo.normal.z,Uo.constant);const l=a.projectionMatrix;$a.x=(Math.sign(Ns.x)+l.elements[8])/l.elements[0],$a.y=(Math.sign(Ns.y)+l.elements[9])/l.elements[5],$a.z=-1,$a.w=(1+l.elements[10])/l.elements[14],Ns.multiplyScalar(1/Ns.dot($a));const u=0;l.elements[2]=Ns.x,l.elements[6]=Ns.y,l.elements[10]=Ns.z-u,l.elements[14]=Ns.w,this.value=c.texture,r.visible=!1;const h=i.getRenderTarget(),d=i.getMRT();i.setMRT(null),i.setRenderTarget(c),i.render(t,a),i.setMRT(d),i.setRenderTarget(h),r.visible=!0,Kp=!1}}const X3=s=>H(new Db(s)),jp=new oo(-1,1,1,-1,0,1);class q3 extends at{constructor(e=!1){super();const t=e===!1?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Ve([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Ve(t,2))}}const $3=new q3;class ys extends kt{constructor(e=null){super($3,e),this.camera=jp,this.isQuadMesh=!0}renderAsync(e){return e.renderAsync(this,jp)}render(e){e.render(this,jp)}}const Y3=new J;class Ub extends gs{static get type(){return"RTTNode"}constructor(e,t=null,n=null,i={type:Ln}){const r=new fn(t,n,i);super(r.texture,rt()),this.node=e,this.width=t,this.height=n,this.renderTarget=r,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this.updateMap=new WeakMap,this._rttNode=null,this._quadMesh=new ys(new Tt),this.updateBeforeType=We.RENDER}get autoSize(){return this.width===null}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const n=e*this.pixelRatio,i=t*this.pixelRatio;this.renderTarget.setSize(n,i),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(this.textureNeedsUpdate===!1&&this.autoUpdate===!1)return;if(this.textureNeedsUpdate=!1,this.autoSize===!0){this.pixelRatio=e.getPixelRatio();const n=e.getSize(Y3);this.setSize(n.width,n.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new gs(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const Fb=(s,...e)=>H(new Ub(H(s),...e)),ei=(s,...e)=>s.isTextureNode?s:Fb(s,...e);class Ob extends Ag{static get type(){return"VertexColorNode"}constructor(e=0){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e),n=e.hasGeometryAttribute(t);let i;return n===!0?i=super.generate(e):i=e.generateConst(this.nodeType,new st(1,1,1,1)),i}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const Z3=(...s)=>H(new Ob(...s));class Vb extends Ye{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const J3=fe(Vb);class Qi extends Ye{static get type(){return"SceneNode"}constructor(e=Qi.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,n=this.scene!==null?this.scene:e.scene;let i;return t===Qi.BACKGROUND_BLURRINESS?i=dn("backgroundBlurriness","float",n):t===Qi.BACKGROUND_INTENSITY?i=dn("backgroundIntensity","float",n):console.error("THREE.SceneNode: Unknown scope:",t),i}}Qi.BACKGROUND_BLURRINESS="backgroundBlurriness";Qi.BACKGROUND_INTENSITY="backgroundIntensity";const K3=fe(Qi,Qi.BACKGROUND_BLURRINESS),j3=fe(Qi,Qi.BACKGROUND_INTENSITY),C_={Storage:"storage",ReadOnlyStorage:"read-only-storage"},Qp={WriteOnly:"write-only",ReadOnly:"read-only"};class t0 extends Rd{static get type(){return"StorageBufferNode"}constructor(e,t,n=0){super(e,t,n),this.isStorageBufferNode=!0,this.access=C_.Storage,this.isAtomic=!1,this.bufferObject=!1,this.bufferCount=n,this._attribute=null,this._varying=null,this.global=!0,e.isStorageBufferAttribute!==!0&&e.isStorageInstancedBufferAttribute!==!0&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(this.bufferCount===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return"storageBuffer"}element(e){return G3(this,e)}setBufferObject(e){return this.bufferObject=e,this}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(C_.ReadOnlyStorage)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}generate(e){if(e.isAvailable("storageBuffer"))return super.generate(e);const t=this.getNodeType(e);this._attribute===null&&(this._attribute=dl(this.value),this._varying=Un(this._attribute));const n=this._varying.build(e,t);return e.registerTransform(n,this._attribute),n}}const Q3=(s,e,t)=>H(new t0(s,e,t)),eD=(s,e,t)=>H(new t0(s,e,t).setBufferObject(!0));class Bb extends gs{static get type(){return"StorageTextureNode"}constructor(e,t,n=null){super(e,t),this.storeNode=n,this.isStorageTextureNode=!0,this.access=Qp.WriteOnly}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);t.storeNode=this.storeNode}setAccess(e){return this.access=e,this}generate(e,t){let n;return this.storeNode!==null?n=this.generateStore(e):n=super.generate(e,t),n}toReadOnly(){return this.setAccess(Qp.ReadOnly)}toWriteOnly(){return this.setAccess(Qp.WriteOnly)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:n,storeNode:i}=t,r=super.generate(e,"property"),o=n.build(e,"uvec2"),a=i.build(e,"vec4"),c=e.generateTextureStore(e,r,o,a);e.addLineFlowCode(c,this)}}const zb=K(Bb),tD=(s,e,t)=>{const n=zb(s,e,t);return t!==null&&n.append(),n};class kb extends ml{static get type(){return"UserDataNode"}constructor(e,t,n=null){super(e,t,n),this.userData=n}updateReference(e){return this.reference=this.userData!==null?this.userData:e.object.userData,this.reference}}const nD=(s,e,t)=>H(new kb(s,e,t));class Gb extends pt{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const iD=K(Gb);let ef=null;class Hb extends vl{static get type(){return"ViewportSharedTextureNode"}constructor(e=_r,t=null){ef===null&&(ef=new fm),super(e,t,ef)}updateReference(){return this}}const sD=K(Hb),rD=new J;class Wb extends gs{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class R_ extends Wb{static get type(){return"PassMultipleTextureNode"}constructor(e,t,n=!1){super(e,null),this.textureName=t,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class bn extends pt{static get type(){return"PassNode"}constructor(e,t,n,i={}){super("vec4"),this.scope=e,this.scene=t,this.camera=n,this.options=i,this._pixelRatio=1,this._width=1,this._height=1;const r=new ao;r.isRenderTargetTexture=!0,r.name="depth";const o=new fn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Ln,...i});o.texture.name="output",o.depthTexture=r,this.renderTarget=o,this.updateBeforeType=We.FRAME,this._textures={output:o.texture,depth:r},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=pe(0),this._cameraFar=pe(0),this._mrt=null,this.isPassNode=!0}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.isRenderTargetTexture=!0,t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),t.isRenderTargetTexture=!0,this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const n=this._textures[e],i=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[i]=t,this._textures[e]=t,this._previousTextures[e]=n,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(this._textureNodes[e]=t=H(new R_(this,e)),this._textureNodes[e].updateTexture()),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),this._previousTextureNodes[e]=t=H(new R_(this,e,!0)),this._previousTextureNodes[e].updateTexture()),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const n=this._cameraNear,i=this._cameraFar;this._viewZNodes[e]=t=Vg(this.getTextureNode(e),n,i)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const n=this._cameraNear,i=this._cameraFar,r=this.getViewZNode(e);this._linearDepthNodes[e]=t=rc(r,n,i)}return t}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,e.backend.isWebGLBackend===!0&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===bn.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:n,camera:i}=this;this._pixelRatio=t.getPixelRatio();const r=t.getSize(rD);this.setSize(r.width,r.height);const o=t.getRenderTarget(),a=t.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const c in this._previousTextures)this.toggleTexture(c);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(n,i),t.setRenderTarget(o),t.setMRT(a)}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget.setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}bn.COLOR="color";bn.DEPTH="depth";const oD=(s,e,t)=>H(new bn(bn.COLOR,s,e,t)),Na=(s,e)=>H(new Wb(s,e)),aD=(s,e)=>H(new bn(bn.DEPTH,s,e)),I_=new ys,P_=new ys;class Xb extends pt{static get type(){return"GaussianBlurNode"}constructor(e,t=null,n=2){super("vec4"),this.textureNode=e,this.directionNode=t,this.sigma=n,this._invSize=pe(new J),this._passDirection=pe(new J),this._horizontalRT=new fn,this._horizontalRT.texture.name="GaussianBlurNode.horizontal",this._verticalRT=new fn,this._verticalRT.texture.name="GaussianBlurNode.vertical",this._textureNode=Na(this,this._verticalRT.texture),this.updateBeforeType=We.RENDER,this.resolution=new J(1,1)}setSize(e,t){e=Math.max(Math.round(e*this.resolution.x),1),t=Math.max(Math.round(t*this.resolution.y),1),this._invSize.value.set(1/e,1/t),this._horizontalRT.setSize(e,t),this._verticalRT.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=this.textureNode,i=n.value,r=t.getRenderTarget(),o=t.getMRT(),a=n.value;I_.material=this._material,P_.material=this._material,this.setSize(i.image.width,i.image.height);const c=i.type;this._horizontalRT.texture.type=c,this._verticalRT.texture.type=c,t.setMRT(null),t.setRenderTarget(this._horizontalRT),this._passDirection.value.set(1,0),I_.render(t),n.value=this._horizontalRT.texture,t.setRenderTarget(this._verticalRT),this._passDirection.value.set(0,1),P_.render(t),t.setRenderTarget(r),t.setMRT(o),n.value=a}getTextureNode(){return this._textureNode}setup(e){const t=this.textureNode;if(t.isTextureNode!==!0)return console.error("GaussianBlurNode requires a TextureNode."),oe();const n=t.uvNode||rt(),i=z(this.directionNode||1),r=l=>t.uv(l),o=U(()=>{const l=3+2*this.sigma,u=this._getCoefficients(l),h=this._invSize,d=i.mul(this._passDirection),p=A(u[0]).toVar(),f=oe(r(n).mul(p)).toVar();for(let x=1;x<l;x++){const m=A(x),g=A(u[x]),y=z(d.mul(h.mul(m))).toVar(),_=oe(r(n.add(y))),v=oe(r(n.sub(y)));f.addAssign(_.add(v).mul(g)),p.addAssign(ot(2,g))}return f.div(p)}),a=this._material||(this._material=new Tt);a.fragmentNode=o().context(e.getSharedContext()),a.name="Gaussian_blur",a.needsUpdate=!0;const c=e.getNodeProperties(this);return c.textureNode=t,this._textureNode}dispose(){this._horizontalRT.dispose(),this._verticalRT.dispose()}_getCoefficients(e){const t=[];for(let n=0;n<e;n++)t.push(.39894*Math.exp(-.5*n*n/(e*e))/e);return t}}const cD=(s,e,t)=>H(new Xb(ei(s),e,t)),tf=new J,L_=new ys;class qb extends pt{static get type(){return"AfterImageNode"}constructor(e,t=.96){super(e),this.textureNode=e,this.textureNodeOld=xt(),this.damp=pe(t),this._compRT=new fn,this._compRT.texture.name="AfterImageNode.comp",this._oldRT=new fn,this._oldRT.texture.name="AfterImageNode.old",this._textureNode=Na(this,this._compRT.texture),this.updateBeforeType=We.RENDER}getTextureNode(){return this._textureNode}setSize(e,t){this._compRT.setSize(e,t),this._oldRT.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=this.textureNode,r=n.value.type;this._compRT.texture.type=r,this._oldRT.texture.type=r,t.getDrawingBufferSize(tf),this.setSize(tf.x,tf.y);const o=t.getRenderTarget(),a=n.value;this.textureNodeOld.value=this._oldRT.texture,t.setRenderTarget(this._compRT),L_.render(t);const c=this._oldRT;this._oldRT=this._compRT,this._compRT=c,t.setRenderTarget(o),n.value=a}setup(e){const t=this.textureNode,n=this.textureNodeOld,i=t.uvNode||rt();n.uvNode=i;const r=u=>t.uv(u),o=U(([u,h])=>{const d=A(h).toVar(),p=oe(u).toVar();return ft(cl(p.sub(d)),0)}),a=U(()=>{const u=oe(n),h=oe(r(i));return u.mulAssign(this.damp.mul(o(u,.1))),ft(h,u)}),c=this._materialComposed||(this._materialComposed=new Tt);c.name="AfterImage",c.fragmentNode=a(),L_.material=c;const l=e.getNodeProperties(this);return l.textureNode=t,this._textureNode}dispose(){this._compRT.dispose(),this._oldRT.dispose()}}const lD=(s,e)=>H(new qb(ei(s),e)),uD=U(([s])=>En(s.rgb)),hD=U(([s,e=A(1)])=>e.mix(En(s.rgb),s.rgb)),dD=U(([s,e=A(1)])=>{const t=Wt(s.r,s.g,s.b).div(3),n=s.r.max(s.g.max(s.b)),i=n.sub(t).mul(e).mul(-3);return it(s.rgb,n,i)}),pD=U(([s,e=A(1)])=>{const t=D(.57735,.57735,.57735),n=e.cos();return D(s.rgb.mul(n).add(t.cross(s.rgb).mul(e.sin()).add(t.mul($t(t,s.rgb).mul(n.oneMinus())))))}),fD=new E,En=(s,e=D(...gt.getLuminanceCoefficients(fD)))=>$t(s,e),$b=(s,e)=>it(D(0),s,En(s).sub(e).max(0)),D_=new ys;class Yb extends pt{static get type(){return"AnamorphicNode"}constructor(e,t,n,i){super("vec4"),this.textureNode=e,this.tresholdNode=t,this.scaleNode=n,this.colorNode=D(.1,0,1),this.samples=i,this.resolution=new J(1,1),this._renderTarget=new fn,this._renderTarget.texture.name="anamorphic",this._invSize=pe(new J),this._textureNode=Na(this,this._renderTarget.texture),this.updateBeforeType=We.RENDER}getTextureNode(){return this._textureNode}setSize(e,t){this._invSize.value.set(1/e,1/t),e=Math.max(Math.round(e*this.resolution.x),1),t=Math.max(Math.round(t*this.resolution.y),1),this._renderTarget.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=this.textureNode,i=n.value;this._renderTarget.texture.type=i.type;const r=t.getRenderTarget(),o=n.value;D_.material=this._material,this.setSize(i.image.width,i.image.height),t.setRenderTarget(this._renderTarget),D_.render(t),t.setRenderTarget(r),n.value=o}setup(e){const t=this.textureNode,n=t.uvNode||rt(),i=c=>t.uv(c),r=U(()=>{const c=this.samples,l=Math.floor(c/2),u=D(0).toVar();return mt({start:-l,end:l},({i:h})=>{const d=A(h).abs().div(l).oneMinus(),p=z(n.x.add(this._invSize.x.mul(h).mul(this.scaleNode)),n.y),f=i(p),x=$b(f,this.tresholdNode).mul(d);u.addAssign(x)}),u.mul(this.colorNode)}),o=this._material||(this._material=new Tt);o.name="Anamorphic",o.fragmentNode=r();const a=e.getNodeProperties(this);return a.textureNode=t,this._textureNode}dispose(){this._renderTarget.dispose()}}const mD=(s,e=.9,t=3,n=32)=>H(new Yb(ei(s),H(e),H(t),n));class Zb extends pt{static get type(){return"SobelOperatorNode"}constructor(e){super(),this.textureNode=e,this.updateBeforeType=We.RENDER,this._invSize=pe(new J)}updateBefore(){const e=this.textureNode.value;this._invSize.value.set(1/e.image.width,1/e.image.height)}setup(){const{textureNode:e}=this,t=e.uvNode||rt(),n=o=>e.uv(o);return U(()=>{const o=this._invSize,a=Tn(-1,-2,-1,0,0,0,1,2,1),c=Tn(-1,0,1,-2,0,2,-1,0,1),l=En(n(t.add(o.mul(z(-1,-1)))).xyz),u=En(n(t.add(o.mul(z(-1,0)))).xyz),h=En(n(t.add(o.mul(z(-1,1)))).xyz),d=En(n(t.add(o.mul(z(0,-1)))).xyz),p=En(n(t.add(o.mul(z(0,0)))).xyz),f=En(n(t.add(o.mul(z(0,1)))).xyz),x=En(n(t.add(o.mul(z(1,-1)))).xyz),m=En(n(t.add(o.mul(z(1,0)))).xyz),g=En(n(t.add(o.mul(z(1,1)))).xyz),y=Wt(a[0][0].mul(l),a[1][0].mul(d),a[2][0].mul(x),a[0][1].mul(u),a[1][1].mul(p),a[2][1].mul(m),a[0][2].mul(h),a[1][2].mul(f),a[2][2].mul(g)),_=Wt(c[0][0].mul(l),c[1][0].mul(d),c[2][0].mul(x),c[0][1].mul(u),c[1][1].mul(p),c[2][1].mul(m),c[0][2].mul(h),c[1][2].mul(f),c[2][2].mul(g)),v=y.mul(y).add(_.mul(_)).sqrt();return oe(D(v),1)})()}}const gD=s=>H(new Zb(ei(s)));class Jb extends pt{static get type(){return"DepthOfFieldNode"}constructor(e,t,n,i,r){super(),this.textureNode=e,this.viewZNode=t,this.focusNode=n,this.apertureNode=i,this.maxblurNode=r,this._aspect=pe(0),this.updateBeforeType=We.RENDER}updateBefore(){const e=this.textureNode.value;this._aspect.value=e.image.width/e.image.height}setup(){const e=this.textureNode,t=e.uvNode||rt(),n=o=>e.uv(o);return U(()=>{const o=z(1,this._aspect),a=this.focusNode.add(this.viewZNode),c=z(cn(a.mul(this.apertureNode),this.maxblurNode.negate(),this.maxblurNode)),l=c.mul(.9),u=c.mul(.7),h=c.mul(.4);let d=oe(0);return d=d.add(n(t)),d=d.add(n(t.add(z(0,.4).mul(o).mul(c)))),d=d.add(n(t.add(z(.15,.37).mul(o).mul(c)))),d=d.add(n(t.add(z(.29,.29).mul(o).mul(c)))),d=d.add(n(t.add(z(-.37,.15).mul(o).mul(c)))),d=d.add(n(t.add(z(.4,0).mul(o).mul(c)))),d=d.add(n(t.add(z(.37,-.15).mul(o).mul(c)))),d=d.add(n(t.add(z(.29,-.29).mul(o).mul(c)))),d=d.add(n(t.add(z(-.15,-.37).mul(o).mul(c)))),d=d.add(n(t.add(z(0,-.4).mul(o).mul(c)))),d=d.add(n(t.add(z(-.15,.37).mul(o).mul(c)))),d=d.add(n(t.add(z(-.29,.29).mul(o).mul(c)))),d=d.add(n(t.add(z(.37,.15).mul(o).mul(c)))),d=d.add(n(t.add(z(-.4,0).mul(o).mul(c)))),d=d.add(n(t.add(z(-.37,-.15).mul(o).mul(c)))),d=d.add(n(t.add(z(-.29,-.29).mul(o).mul(c)))),d=d.add(n(t.add(z(.15,-.37).mul(o).mul(c)))),d=d.add(n(t.add(z(.15,.37).mul(o).mul(l)))),d=d.add(n(t.add(z(-.37,.15).mul(o).mul(l)))),d=d.add(n(t.add(z(.37,-.15).mul(o).mul(l)))),d=d.add(n(t.add(z(-.15,-.37).mul(o).mul(l)))),d=d.add(n(t.add(z(-.15,.37).mul(o).mul(l)))),d=d.add(n(t.add(z(.37,.15).mul(o).mul(l)))),d=d.add(n(t.add(z(-.37,-.15).mul(o).mul(l)))),d=d.add(n(t.add(z(.15,-.37).mul(o).mul(l)))),d=d.add(n(t.add(z(.29,.29).mul(o).mul(u)))),d=d.add(n(t.add(z(.4,0).mul(o).mul(u)))),d=d.add(n(t.add(z(.29,-.29).mul(o).mul(u)))),d=d.add(n(t.add(z(0,-.4).mul(o).mul(u)))),d=d.add(n(t.add(z(-.29,.29).mul(o).mul(u)))),d=d.add(n(t.add(z(-.4,0).mul(o).mul(u)))),d=d.add(n(t.add(z(-.29,-.29).mul(o).mul(u)))),d=d.add(n(t.add(z(0,.4).mul(o).mul(u)))),d=d.add(n(t.add(z(.29,.29).mul(o).mul(h)))),d=d.add(n(t.add(z(.4,0).mul(o).mul(h)))),d=d.add(n(t.add(z(.29,-.29).mul(o).mul(h)))),d=d.add(n(t.add(z(0,-.4).mul(o).mul(h)))),d=d.add(n(t.add(z(-.29,.29).mul(o).mul(h)))),d=d.add(n(t.add(z(-.4,0).mul(o).mul(h)))),d=d.add(n(t.add(z(-.29,-.29).mul(o).mul(h)))),d=d.add(n(t.add(z(0,.4).mul(o).mul(h)))),d=d.div(41),d.a=1,oe(d)})()}}const xD=(s,e,t=1,n=.025,i=1)=>H(new Jb(ei(s),H(e),H(t),H(n),H(i)));class Kb extends pt{static get type(){return"DotScreenNode"}constructor(e,t=new J(.5,.5),n=1.57,i=1){super("vec4"),this.inputNode=e,this.center=pe(t),this.angle=pe(n),this.scale=pe(i)}setup(){const e=this.inputNode,t=U(()=>{const r=Cn(this.angle),o=Mi(this.angle),a=rt().mul(da).sub(this.center),c=z(o.mul(a.x).sub(r.mul(a.y)),r.mul(a.x).add(o.mul(a.y))).mul(this.scale);return Cn(c.x).mul(Cn(c.y)).mul(4)});return U(()=>{const r=e,o=Wt(r.r,r.g,r.b).div(3);return oe(D(o.mul(10).sub(5).add(t())),r.a)})()}}const _D=(s,e,t,n)=>H(new Kb(H(s),e,t,n));class jb extends pt{static get type(){return"RGBShiftNode"}constructor(e,t=.005,n=0){super("vec4"),this.textureNode=e,this.amount=pe(t),this.angle=pe(n)}setup(){const{textureNode:e}=this,t=e.uvNode||rt(),n=r=>e.uv(r);return U(()=>{const r=z(Mi(this.angle),Cn(this.angle)).mul(this.amount),o=n(t.add(r)),a=n(t),c=n(t.sub(r));return oe(o.r,a.g,c.b,a.a)})()}}const yD=(s,e,t)=>H(new jb(ei(s),e,t));class Qb extends pt{static get type(){return"FilmNode"}constructor(e,t=null,n=null){super(),this.inputNode=e,this.intensityNode=t,this.uvNode=n}setup(){const e=this.uvNode||rt();return U(()=>{const i=this.inputNode.rgb,r=yg(xr(e.add(e0())));let o=i.add(i.mul(cn(r.add(.1),0,1)));return this.intensityNode!==null&&(o=it(i,o,this.intensityNode)),oe(o,this.inputNode.a)})()}}const vD=K(Qb);class ew extends pt{static get type(){return"Lut3DNode"}constructor(e,t,n,i){super(),this.inputNode=e,this.lutNode=t,this.size=pe(n),this.intensityNode=i}setup(){const{inputNode:e,lutNode:t}=this,n=o=>t.uv(o);return U(()=>{const o=e,a=A(1).div(this.size),c=A(.5).div(this.size),l=D(c).add(o.rgb.mul(A(1).sub(a))),u=oe(n(l).rgb,o.a);return oe(it(o,u,this.intensityNode))})()}}const MD=(s,e,t,n)=>H(new ew(H(s),H(e),t,H(n))),U_=new ys,F_=new _e,SD=new J;class tw extends pt{static get type(){return"GTAONode"}constructor(e,t,n){super(),this.depthNode=e,this.normalNode=t,this.radius=pe(.25),this.resolution=pe(new J),this.thickness=pe(1),this.distanceExponent=pe(1),this.distanceFallOff=pe(1),this.scale=pe(1),this.noiseNode=xt(TD()),this.cameraProjectionMatrix=pe(n.projectionMatrix),this.cameraProjectionMatrixInverse=pe(n.projectionMatrixInverse),this.SAMPLES=pe(16),this._aoRenderTarget=new fn,this._aoRenderTarget.texture.name="GTAONode.AO",this._material=null,this._textureNode=Na(this,this._aoRenderTarget.texture),this.updateBeforeType=We.FRAME}getTextureNode(){return this._textureNode}setSize(e,t){this.resolution.value.set(e,t),this._aoRenderTarget.setSize(e,t)}updateBefore(e){const{renderer:t}=e,n=t.getDrawingBufferSize(SD),i=t.getRenderTarget(),r=t.getMRT();t.getClearColor(F_);const o=t.getClearAlpha();U_.material=this._material,this.setSize(n.width,n.height),t.setMRT(null),t.setClearColor(16777215,1),t.setRenderTarget(this._aoRenderTarget),U_.render(t),t.setRenderTarget(i),t.setMRT(r),t.setClearColor(F_,o)}setup(e){const t=rt(),n=l=>this.depthNode.uv(l).x,i=l=>this.noiseNode.uv(l),r=U(([l])=>{const u=this.cameraProjectionMatrix.mul(oe(l,1));let h=u.xy.div(u.w).mul(.5).add(.5).toVar();h=z(h.x,h.y.oneMinus());const d=n(h);return D(h,d)}),o=U(([l,u])=>{l=z(l.x,l.y.oneMinus()).mul(2).sub(1);const h=oe(D(l,u),1),d=oe(this.cameraProjectionMatrixInverse.mul(h));return d.xyz.div(d.w)}),a=U(()=>{const l=n(t);l.greaterThanEqual(1).discard();const u=o(t,l),h=this.normalNode.rgb.normalize(),d=this.radius,p=tr(this.noiseNode,0);let f=z(t.x,t.y.oneMinus());f=f.mul(this.resolution.div(p));const x=i(f),m=x.xyz.mul(2).sub(1),g=D(m.xy,0).normalize(),y=D(g.y.mul(-1),g.x,0),_=Tn(g,y,D(0,0,1)),v=this.SAMPLES.lessThan(30).select(3,5),I=Wt(this.SAMPLES,v.sub(1)).div(v),T=A(0).toVar();return mt({start:L(0),end:v,type:"int",condition:"<"},({i:w})=>{const C=A(w).div(A(v)).mul(to),F=oe(Mi(C),Cn(C),0,Wt(.5,ot(.5,x.w)));F.xyz=vi(_.mul(F.xyz));const M=vi(u.xyz.negate()),b=vi(Qo(F.xyz,M)),G=Qo(b,M),W=vi(h.sub(b.mul($t(h,b)))),$=Qo(W,b),ie=z($t(M,$),$t(M,$.negate())).toVar();mt({end:I,type:"int",name:"j",condition:"<"},({j:Qe})=>{const ht=F.xyz.mul(d).mul(F.w).mul(Kn(ns(A(Qe).add(1),A(I)),this.distanceExponent)),ne=r(u.add(ht)),Ae=o(ne.xy,ne.z).sub(u);Oe(Dt(Ae.z).lessThan(this.thickness),()=>{const Je=$t(M,vi(Ae));ie.x.addAssign(ft(0,ot(Je.sub(ie.x),it(1,A(2).div(A(Qe).add(2)),this.distanceFallOff))))});const ge=r(u.sub(ht)),Xe=o(ge.xy,ge.z).sub(u);Oe(Dt(Xe.z).lessThan(this.thickness),()=>{const Je=$t(M,vi(Xe));ie.y.addAssign(ft(0,ot(Je.sub(ie.y),it(1,A(2).div(A(Qe).add(2)),this.distanceFallOff))))})});const q=os(Ft(1,ie.mul(ie))),he=$t(W,G),Q=$t(W,M),we=ot(.5,gh(ie.y).sub(gh(ie.x)).add(q.x.mul(ie.x).sub(q.y.mul(ie.y)))),Ne=ot(.5,Ft(2,ie.x.mul(ie.x)).sub(ie.y.mul(ie.y))),Ee=he.mul(we).add(Q.mul(Ne));T.addAssign(Ee)}),T.assign(cn(T.div(v),0,1)),T.assign(Kn(T,this.scale)),oe(D(T),1)}),c=this._material||(this._material=new Tt);return c.fragmentNode=a().context(e.getSharedContext()),c.name="GTAO",c.needsUpdate=!0,this._textureNode}dispose(){this._aoRenderTarget.dispose()}}function TD(s=5){const e=Math.floor(s)%2===0?Math.floor(s)+1:Math.floor(s),t=bD(e),n=t.length,i=new Uint8Array(n*4);for(let o=0;o<n;++o){const a=t[o],c=2*Math.PI*a/n,l=new E(Math.cos(c),Math.sin(c),0).normalize();i[o*4]=(l.x*.5+.5)*255,i[o*4+1]=(l.y*.5+.5)*255,i[o*4+2]=127,i[o*4+3]=255}const r=new Oi(i,e,e);return r.wrapS=rr,r.wrapT=rr,r.needsUpdate=!0,r}function bD(s){const e=Math.floor(s)%2===0?Math.floor(s)+1:Math.floor(s),t=e*e,n=Array(t).fill(0);let i=Math.floor(e/2),r=e-1;for(let o=1;o<=t;){if(i===-1&&r===e?(r=e-2,i=0):(r===e&&(r=0),i<0&&(i=e-1)),n[i*e+r]!==0){r-=2,i++;continue}else n[i*e+r]=o++;r++,i--}return n}const wD=(s,e,t)=>H(new tw(H(s),H(e),t));class nw extends pt{static get type(){return"DenoiseNode"}constructor(e,t,n,i,r){super(),this.textureNode=e,this.depthNode=t,this.normalNode=n,this.noiseNode=i,this.cameraProjectionMatrixInverse=pe(r.projectionMatrixInverse),this.lumaPhi=pe(5),this.depthPhi=pe(5),this.normalPhi=pe(5),this.radius=pe(5),this.index=pe(0),this._resolution=pe(new J),this._sampleVectors=ds(AD(16,2,1)),this.updateBeforeType=We.RENDER}updateBefore(){const e=this.textureNode.value;this._resolution.value.set(e.image.width,e.image.height)}setup(){const e=rt(),t=h=>this.textureNode.uv(h),n=h=>this.depthNode.uv(h).x,i=h=>this.normalNode.uv(h),r=h=>this.noiseNode.uv(h),o=U(([h,d])=>{h=z(h.x,h.y.oneMinus()).mul(2).sub(1);const p=oe(D(h,d),1),f=oe(this.cameraProjectionMatrixInverse.mul(p));return f.xyz.div(f.w)}),a=U(([h,d,p,f])=>{const x=t(f),m=n(f),g=i(f).rgb.normalize(),y=x.rgb,_=o(f,m),v=$t(d,g).toVar(),I=Kn(ft(v,0),this.normalPhi).toVar(),T=Dt(En(y).sub(En(h))).toVar(),w=ft(A(1).sub(T.div(this.lumaPhi)),0).toVar(),C=Dt($t(p.sub(_),d)).toVar(),F=ft(A(1).sub(C.div(this.depthPhi)),0),M=w.mul(F).mul(I);return oe(y.mul(M),M)}),c=U(([h])=>{const d=n(h),p=i(h).rgb.normalize(),f=t(h);Oe(d.greaterThanEqual(1).or($t(p,p).equal(0)),()=>f);const x=D(f.rgb),m=o(h,d),g=tr(this.noiseNode,0);let y=z(h.x,h.y.oneMinus());y=y.mul(this._resolution.div(g));const _=r(y),v=Cn(_.element(this.index.mod(4).mul(2).mul(to))),I=Mi(_.element(this.index.mod(4).mul(2).mul(to))),T=z(v,I),w=ol(T.x,T.y.negate(),T.x,T.y),C=A(1).toVar(),F=D(f.rgb).toVar();return mt({start:L(0),end:L(16),type:"int",condition:"<"},({i:M})=>{const b=this._sampleVectors.element(M).toVar(),G=w.mul(b.xy.mul(A(1).add(b.z.mul(this.radius.sub(1))))).div(this._resolution).toVar(),W=h.add(G).toVar(),$=a(x,p,m,W);F.addAssign($.xyz),C.addAssign($.w)}),Oe(C.greaterThan(A(0)),()=>{F.divAssign(C)}),oe(F,f.a)}).setLayout({name:"denoise",type:"vec4",inputs:[{name:"uv",type:"vec2"}]});return U(()=>c(e))()}}function AD(s,e,t){const n=ND(s,e,t),i=[];for(let r=0;r<s;r++){const o=n[r];i.push(o)}return i}function ND(s,e,t){const n=[];for(let i=0;i<s;i++){const r=2*Math.PI*e*i/s,o=Math.pow(i/(s-1),t);n.push(new E(Math.cos(r),Math.sin(r),o))}return n}const ED=(s,e,t,n,i)=>H(new nw(ei(s),H(e),H(t),H(n),i));class iw extends pt{static get type(){return"FXAANode"}constructor(e){super(),this.textureNode=e,this.updateBeforeType=We.RENDER,this._invSize=pe(new J)}updateBefore(){const e=this.textureNode.value;this._invSize.value.set(1/e.image.width,1/e.image.height)}setup(){const e=this.textureNode.bias(-100),t=e.uvNode||rt(),n=u=>e.uv(u),i=(u,h,d)=>e.uv(u.add(h.mul(d))),r=L(5),o=U(([u,h])=>{const d=oe(h).toVar(),p=oe(u).toVar(),f=oe(Dt(p.sub(d))).toVar();return ft(ft(ft(f.r,f.g),f.b),f.a)}),a=U(([u,h,d,p])=>{const f=n(u).toVar(),x=i(u,z(0,-1),h.xy).toVar(),m=i(u,z(1,0),h.xy).toVar(),g=i(u,z(0,1),h.xy).toVar(),y=i(u,z(-1,0),h.xy).toVar(),_=o(f,g).toVar(),v=o(f,x).toVar(),I=o(f,m).toVar(),T=o(f,y).toVar(),w=ft(_,ft(v,ft(I,T))).toVar();Oe(w.lessThan(d),()=>f);const C=Ft(_.add(v),I.add(T)).toVar();C.mulAssign(p),Oe(Dt(C).lessThan(.3),()=>{const ht=I.greaterThan(T).select(1,-1).toVar(),ne=v.greaterThan(_).select(1,-1).toVar(),ue=z(ht,ne).toVar(),Ae=i(u,z(ue.x,ue.y),h.xy),ge=o(f,Ae).toVar(),Ze=i(u,z(ue.x.negate(),ue.y.negate()),h.xy),Xe=o(f,Ze).toVar();C.assign(Xe.sub(ge)),C.mulAssign(p),Oe(Dt(C).lessThan(.3),()=>{const Je=g.add(x).add(m).add(y);return it(f,Je.mul(.25),.4)})});const F=z().toVar();Oe(C.lessThanEqual(0),()=>{g.assign(y),x.assign(m),F.x.assign(0),F.y.assign(h.y)}).Else(()=>{F.x.assign(h.x),F.y.assign(0)});const M=o(f,g).toVar(),b=o(f,x).toVar();Oe(M.lessThanEqual(b),()=>{g.assign(x)});const G=L(0).toVar(),W=L(0).toVar(),$=A(0).toVar(),ie=A(0).toVar(),q=z(u).toVar(),he=z(u).toVar(),Q=L(0).toVar(),we=L(0).toVar();mt(r,({i:ht})=>{const ne=ht.add(1).toVar();Oe(G.equal(0),()=>{$.addAssign(ne),q.assign(u.add(F.mul($)));const ue=n(q.xy),Ae=o(ue,f).toVar(),ge=o(ue,g).toVar();Oe(Ae.greaterThan(ge),()=>{G.assign(1)}),Q.assign(ht)}),Oe(W.equal(0),()=>{ie.addAssign(ne),he.assign(u.sub(F.mul(ie)));const ue=n(he.xy),Ae=o(ue,f).toVar(),ge=o(ue,g).toVar();Oe(Ae.greaterThan(ge),()=>{W.assign(1)}),we.assign(ht)}),Oe(G.equal(1).or(W.equal(1)),()=>{Ld()})}),Oe(G.equal(0).and(W.equal(0)),()=>f);const Ne=A(1).toVar(),Ee=A(1).toVar();Oe(G.equal(1),()=>{Ne.assign(A(Q).div(A(r.sub(1))))}),Oe(W.equal(1),()=>{Ee.assign(A(we).div(A(r.sub(1))))});const Qe=Mn(Ne,Ee);return Qe.assign(Kn(Qe,.5)),Qe.assign(A(1).sub(Qe)),it(f,g,Qe.mul(.5))}).setLayout({name:"FxaaPixelShader",type:"vec4",inputs:[{name:"uv",type:"vec2"},{name:"fxaaQualityRcpFrame",type:"vec2"},{name:"fxaaQualityEdgeThreshold",type:"float"},{name:"fxaaQualityinvEdgeThreshold",type:"float"}]});return U(()=>{const u=A(.2),h=A(1).div(u);return a(t,this._invSize,u,h)})()}}const CD=s=>H(new iw(ei(s))),Lr=new ys,RD=new _e(0,0,0),O_=new _e,ID=new J,PD=new J(1,0),LD=new J(0,1);class sw extends pt{static get type(){return"BloomNode"}constructor(e,t=1,n=0,i=0){super(),this.inputNode=e,this.strength=pe(t),this.radius=pe(n),this.threshold=pe(i),this.smoothWidth=pe(.01),this._renderTargetsHorizontal=[],this._renderTargetsVertical=[],this._nMips=5,this._renderTargetBright=new fn(1,1,{type:Ln}),this._renderTargetBright.texture.name="UnrealBloomPass.bright",this._renderTargetBright.texture.generateMipmaps=!1;for(let r=0;r<this._nMips;r++){const o=new fn(1,1,{type:Ln});o.texture.name="UnrealBloomPass.h"+r,o.texture.generateMipmaps=!1,this._renderTargetsHorizontal.push(o);const a=new fn(1,1,{type:Ln});a.texture.name="UnrealBloomPass.v"+r,a.texture.generateMipmaps=!1,this._renderTargetsVertical.push(a)}this._compositeMaterial=null,this._highPassFilterMaterial=null,this._separableBlurMaterials=[],this._textureNodeBright=xt(this._renderTargetBright.texture),this._textureNodeBlur0=xt(this._renderTargetsVertical[0].texture),this._textureNodeBlur1=xt(this._renderTargetsVertical[1].texture),this._textureNodeBlur2=xt(this._renderTargetsVertical[2].texture),this._textureNodeBlur3=xt(this._renderTargetsVertical[3].texture),this._textureNodeBlur4=xt(this._renderTargetsVertical[4].texture),this._textureOutput=Na(this,this._renderTargetsHorizontal[0].texture),this.updateBeforeType=We.FRAME}getTextureNode(){return this._textureOutput}setSize(e,t){let n=Math.round(e/2),i=Math.round(t/2);this._renderTargetBright.setSize(n,i);for(let r=0;r<this._nMips;r++)this._renderTargetsHorizontal[r].setSize(n,i),this._renderTargetsVertical[r].setSize(n,i),this._separableBlurMaterials[r].invSize.value.set(1/n,1/i),n=Math.round(n/2),i=Math.round(i/2)}updateBefore(e){const{renderer:t}=e,n=t.getDrawingBufferSize(ID);this.setSize(n.width,n.height);const i=t.getRenderTarget(),r=t.getMRT();t.getClearColor(O_);const o=t.getClearAlpha();this.setSize(n.width,n.height),t.setMRT(null),t.setClearColor(RD,0),t.setRenderTarget(this._renderTargetBright),Lr.material=this._highPassFilterMaterial,Lr.render(t);let a=this._renderTargetBright;for(let c=0;c<this._nMips;c++)Lr.material=this._separableBlurMaterials[c],this._separableBlurMaterials[c].colorTexture.value=a.texture,this._separableBlurMaterials[c].direction.value=PD,t.setRenderTarget(this._renderTargetsHorizontal[c]),t.clear(),Lr.render(t),this._separableBlurMaterials[c].colorTexture.value=this._renderTargetsHorizontal[c].texture,this._separableBlurMaterials[c].direction.value=LD,t.setRenderTarget(this._renderTargetsVertical[c]),t.clear(),Lr.render(t),a=this._renderTargetsVertical[c];t.setRenderTarget(this._renderTargetsHorizontal[0]),t.clear(),Lr.material=this._compositeMaterial,Lr.render(t),t.setRenderTarget(i),t.setMRT(r),t.setClearColor(O_,o)}setup(e){const t=U(()=>{const c=this.inputNode,l=En(c.rgb),u=ti(this.threshold,this.threshold.add(this.smoothWidth),l);return it(oe(0),c,u)});this._highPassFilterMaterial=this._highPassFilterMaterial||new Tt,this._highPassFilterMaterial.fragmentNode=t().context(e.getSharedContext()),this._highPassFilterMaterial.name="Bloom_highPass",this._highPassFilterMaterial.needsUpdate=!0;const n=[3,5,7,9,11];for(let c=0;c<this._nMips;c++)this._separableBlurMaterials.push(this._getSeperableBlurMaterial(e,n[c]));const i=ds([1,.8,.6,.4,.2]),r=ds([new E(1,1,1),new E(1,1,1),new E(1,1,1),new E(1,1,1),new E(1,1,1)]),o=U(([c,l])=>{const u=A(1.2).sub(c);return it(c,u,l)}).setLayout({name:"lerpBloomFactor",type:"float",inputs:[{name:"factor",type:"float"},{name:"radius",type:"float"}]}),a=U(()=>{const c=o(i.element(0),this.radius).mul(oe(r.element(0),1)).mul(this._textureNodeBlur0),l=o(i.element(1),this.radius).mul(oe(r.element(1),1)).mul(this._textureNodeBlur1),u=o(i.element(2),this.radius).mul(oe(r.element(2),1)).mul(this._textureNodeBlur2),h=o(i.element(3),this.radius).mul(oe(r.element(3),1)).mul(this._textureNodeBlur3),d=o(i.element(4),this.radius).mul(oe(r.element(4),1)).mul(this._textureNodeBlur4);return c.add(l).add(u).add(h).add(d).mul(this.strength)});return this._compositeMaterial=this._compositeMaterial||new Tt,this._compositeMaterial.fragmentNode=a().context(e.getSharedContext()),this._compositeMaterial.name="Bloom_comp",this._compositeMaterial.needsUpdate=!0,this._textureOutput}dispose(){for(let e=0;e<this._renderTargetsHorizontal.length;e++)this._renderTargetsHorizontal[e].dispose();for(let e=0;e<this._renderTargetsVertical.length;e++)this._renderTargetsVertical[e].dispose();this._renderTargetBright.dispose()}_getSeperableBlurMaterial(e,t){const n=[];for(let d=0;d<t;d++)n.push(.39894*Math.exp(-.5*d*d/(t*t))/t);const i=xt(),r=ds(n),o=pe(new J),a=pe(new J(.5,.5)),c=rt(),l=d=>i.uv(d),u=U(()=>{const d=r.element(0).toVar(),p=l(c).rgb.mul(d).toVar();return mt({start:L(1),end:L(t),type:"int",condition:"<"},({i:f})=>{const x=A(f),m=r.element(f),g=a.mul(o).mul(x),y=l(c.add(g)).rgb,_=l(c.sub(g)).rgb;p.addAssign(Wt(y,_).mul(m)),d.addAssign(A(2).mul(m))}),oe(p.div(d),1)}),h=new Tt;return h.fragmentNode=u().context(e.getSharedContext()),h.name="Bloom_seperable",h.needsUpdate=!0,h.colorTexture=i,h.direction=a,h.invSize=o,h}}const DD=(s,e,t,n)=>H(new sw(H(s),e,t,n));class rw extends pt{static get type(){return"TransitionNode"}constructor(e,t,n,i,r,o){super(),this.textureNodeA=e,this.textureNodeB=t,this.mixTextureNode=n,this.mixRatioNode=i,this.thresholdNode=r,this.useTextureNode=o}setup(){const{textureNodeA:e,textureNodeB:t,mixTextureNode:n,mixRatioNode:i,thresholdNode:r,useTextureNode:o}=this,a=u=>{const h=u.uvNode||rt();return u.uv(h)};return U(()=>{const u=a(e),h=a(t),d=oe().toVar();return Oe(o.equal(L(1)),()=>{const p=a(n),f=i.mul(r.mul(2).add(1)).sub(r),x=cn(Ft(p.r,f).mul(A(1).div(r)),0,1);d.assign(it(u,h,x))}).Else(()=>{d.assign(it(h,u,i))}),d})()}}const UD=(s,e,t,n=0,i=.1,r=0)=>H(new rw(ei(s),ei(e),ei(t),H(n),H(i),H(r)));class FD extends pt{static get type(){return"PixelationNode"}constructor(e,t,n,i,r,o){super(),this.textureNode=e,this.depthNode=t,this.normalNode=n,this.pixelSize=i,this.normalEdgeStrength=r,this.depthEdgeStrength=o,this._resolution=pe(new st),this.updateBeforeType=We.RENDER}updateBefore(){const e=this.textureNode.value,t=e.image.width,n=e.image.height;this._resolution.value.set(t,n,1/t,1/n)}setup(){const{textureNode:e,depthNode:t,normalNode:n}=this,i=e.uvNode||rt(),r=t.uvNode||rt(),o=n.uvNode||rt(),a=()=>e.uv(i),c=(x,m)=>t.uv(r.add(z(x,m).mul(this._resolution.zw))).r,l=(x,m)=>n.uv(o.add(z(x,m).mul(this._resolution.zw))).rgb.normalize(),u=x=>{const m=ai("float","diff");return m.addAssign(cn(c(1,0).sub(x))),m.addAssign(cn(c(-1,0).sub(x))),m.addAssign(cn(c(0,1).sub(x))),m.addAssign(cn(c(0,-1).sub(x))),gr(ti(.01,.02,m).mul(2)).div(2)},h=(x,m,g,y)=>{const _=c(x,m).sub(g),v=l(x,m),I=D(1,1,1),T=$t(y.sub(v),I),w=cn(ti(-.01,.01,T),0,1),C=cn(cl(_.mul(.25).add(.0025)),0,1);return A(1).sub($t(y,v)).mul(C).mul(w)},d=(x,m)=>{const g=ai("float","indicator");return g.addAssign(h(0,-1,x,m)),g.addAssign(h(0,1,x,m)),g.addAssign(h(-1,0,x,m)),g.addAssign(h(1,0,x,m)),ll(.1,g)};return U(()=>{const x=a(),m=ai("float","depth"),g=ai("vec3","normal");Oe(this.depthEdgeStrength.greaterThan(0).or(this.normalEdgeStrength.greaterThan(0)),()=>{m.assign(c(0,0)),g.assign(l(0,0))});const y=ai("float","dei");Oe(this.depthEdgeStrength.greaterThan(0),()=>{y.assign(u(m))});const _=ai("float","nei");Oe(this.normalEdgeStrength.greaterThan(0),()=>{_.assign(d(m,g))});const v=y.greaterThan(0).select(A(1).sub(y.mul(this.depthEdgeStrength)),_.mul(this.normalEdgeStrength).add(1));return x.mul(v)})()}}const OD=(s,e,t,n=6,i=.3,r=.4)=>H(new FD(ei(s),ei(e),ei(t),H(n),H(i),H(r)));class ow extends bn{static get type(){return"PixelationPassNode"}constructor(e,t,n=6,i=.3,r=.4){super("color",e,t,{minFilter:Qt,magFilter:Qt}),this.pixelSize=n,this.normalEdgeStrength=i,this.depthEdgeStrength=r,this.isPixelationPassNode=!0,this._mrt=Vd({output:sg,normal:di})}setSize(e,t){const n=this.pixelSize.value?this.pixelSize.value:this.pixelSize,i=Math.floor(e/n),r=Math.floor(t/n);super.setSize(i,r)}setup(){const e=super.getTextureNode("output"),t=super.getTextureNode("depth"),n=super.getTextureNode("normal");return OD(e,t,n,this.pixelSize,this.normalEdgeStrength,this.depthEdgeStrength)}}const VD=(s,e,t,n,i)=>H(new ow(s,e,t,n,i)),BD=new J;class aw extends bn{static get type(){return"SSAAPassNode"}constructor(e,t){super(bn.COLOR,e,t),this.isSSAAPassNode=!0,this.sampleLevel=4,this.unbiased=!0,this.clearColor=new _e(0),this.clearAlpha=0,this._currentClearColor=new _e,this.sampleWeight=pe(1),this.sampleRenderTarget=null,this._quadMesh=new ys}updateBefore(e){const{renderer:t}=e,{scene:n,camera:i}=this;this._pixelRatio=t.getPixelRatio();const r=t.getSize(BD);this.setSize(r.width,r.height),this.sampleRenderTarget.setSize(this.renderTarget.width,this.renderTarget.height),t.getClearColor(this._currentClearColor);const o=t.getClearAlpha(),a=t.getRenderTarget(),c=t.getMRT(),l=t.autoClear;this._cameraNear.value=i.near,this._cameraFar.value=i.far,t.setMRT(this.getMRT()),t.autoClear=!1;const u=zD[Math.max(0,Math.min(this.sampleLevel,5))],h=1/u.length,d=1/32,p={fullWidth:this.renderTarget.width,fullHeight:this.renderTarget.height,offsetX:0,offsetY:0,width:this.renderTarget.width,height:this.renderTarget.height},f=Object.assign({},i.view);f.enabled&&Object.assign(p,f);for(let x=0;x<u.length;x++){const m=u[x];if(i.setViewOffset&&i.setViewOffset(p.fullWidth,p.fullHeight,p.offsetX+m[0]*.0625,p.offsetY+m[1]*.0625,p.width,p.height),this.sampleWeight.value=h,this.unbiased){const g=-.5+(x+.5)/u.length;this.sampleWeight.value+=d*g}t.setClearColor(this.clearColor,this.clearAlpha),t.setRenderTarget(this.sampleRenderTarget),t.clear(),t.render(n,i),t.setRenderTarget(this.renderTarget),x===0&&(t.setClearColor(0,0),t.clear()),this._quadMesh.render(t)}t.copyTextureToTexture(this.sampleRenderTarget.depthTexture,this.renderTarget.depthTexture),i.setViewOffset&&f.enabled?i.setViewOffset(f.fullWidth,f.fullHeight,f.offsetX,f.offsetY,f.width,f.height):i.clearViewOffset&&i.clearViewOffset(),t.setRenderTarget(a),t.setMRT(c),t.autoClear=l,t.setClearColor(this._currentClearColor,o)}setup(e){this.sampleRenderTarget===null&&(this.sampleRenderTarget=this.renderTarget.clone());let t;const n=this.getMRT();if(n!==null){const i={};for(const r in n.outputNodes){const o=Qg(this.sampleRenderTarget.textures,r);o>=0&&(i[r]=xt(this.sampleRenderTarget.textures[o]).mul(this.sampleWeight))}t=Vd(i)}else t=xt(this.sampleRenderTarget.texture).mul(this.sampleWeight);return this._quadMesh.material=new Tt,this._quadMesh.material.fragmentNode=t,this._quadMesh.material.transparent=!0,this._quadMesh.material.depthTest=!1,this._quadMesh.material.depthWrite=!1,this._quadMesh.material.premultipliedAlpha=!0,this._quadMesh.material.blending=cc,this._quadMesh.material.normals=!1,this._quadMesh.material.name="SSAA",super.setup(e)}dispose(){super.dispose(),this.sampleRenderTarget!==null&&this.sampleRenderTarget.dispose()}}const zD=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]],kD=(s,e)=>H(new aw(s,e)),GD=new J;class cw extends bn{static get type(){return"StereoPassNode"}constructor(e,t){super(bn.COLOR,e,t),this.isStereoPassNode=!0,this.stereo=new Dm,this.stereo.aspect=.5}updateBefore(e){const{renderer:t}=e,{scene:n,camera:i,stereo:r,renderTarget:o}=this;this._pixelRatio=t.getPixelRatio(),r.cameraL.coordinateSystem=t.coordinateSystem,r.cameraR.coordinateSystem=t.coordinateSystem,r.update(i);const a=t.getSize(GD);this.setSize(a.width,a.height);const c=t.autoClear;t.autoClear=!1;const l=t.getRenderTarget(),u=t.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const h in this._previousTextures)this.toggleTexture(h);t.setRenderTarget(o),t.setMRT(this._mrt),t.clear(),o.scissorTest=!0,o.scissor.set(0,0,o.width/2,o.height),o.viewport.set(0,0,o.width/2,o.height),t.render(n,r.cameraL),o.scissor.set(o.width/2,0,o.width/2,o.height),o.viewport.set(o.width/2,0,o.width/2,o.height),t.render(n,r.cameraR),o.scissorTest=!1,t.setRenderTarget(l),t.setMRT(u),t.autoClear=c}}const HD=(s,e)=>H(new cw(s,e)),WD=new J,V_=new ys;class lw extends bn{static get type(){return"StereoCompositePassNode"}constructor(e,t){super(bn.COLOR,e,t),this.isStereoCompositePassNode=!0,this.stereo=new Dm;const n={minFilter:Ut,magFilter:Qt,type:Ln};this._renderTargetL=new fn(1,1,n),this._renderTargetR=new fn(1,1,n),this._mapLeft=xt(this._renderTargetL.texture),this._mapRight=xt(this._renderTargetR.texture),this._material=null}updateStereoCamera(e){this.stereo.cameraL.coordinateSystem=e,this.stereo.cameraR.coordinateSystem=e,this.stereo.update(this.camera)}setSize(e,t){super.setSize(e,t),this._renderTargetL.setSize(this.renderTarget.width,this.renderTarget.height),this._renderTargetR.setSize(this.renderTarget.width,this.renderTarget.height)}updateBefore(e){const{renderer:t}=e,{scene:n,stereo:i,renderTarget:r}=this;this._pixelRatio=t.getPixelRatio(),this.updateStereoCamera(t.coordinateSystem);const o=t.getSize(WD);this.setSize(o.width,o.height);const a=t.getRenderTarget();t.setRenderTarget(this._renderTargetL),t.render(n,i.cameraL),t.setRenderTarget(this._renderTargetR),t.render(n,i.cameraR),t.setRenderTarget(r),V_.material=this._material,V_.render(t),t.setRenderTarget(a)}dispose(){super.dispose(),this._renderTargetL.dispose(),this._renderTargetR.dispose(),this._material!==null&&this._material.dispose()}}class uw extends lw{static get type(){return"AnaglyphPassNode"}constructor(e,t){super(e,t),this.isAnaglyphPassNode=!0,this._colorMatrixLeft=pe(new Ke().fromArray([.4561,-.0400822,-.0152161,.500484,-.0378246,-.0205971,.176381,-.0157589,-.00546856])),this._colorMatrixRight=pe(new Ke().fromArray([-.0434706,.378476,-.0721527,-.0879388,.73364,-.112961,-.00155529,-.0184503,1.2264]))}setup(e){const t=rt(),n=U(()=>{const r=this._mapLeft.uv(t),o=this._mapRight.uv(t),a=cn(this._colorMatrixLeft.mul(r.rgb).add(this._colorMatrixRight.mul(o.rgb)));return oe(a.rgb,ft(r.a,o.a))}),i=this._material||(this._material=new Tt);return i.fragmentNode=n().context(e.getSharedContext()),i.name="Anaglyph",i.needsUpdate=!0,super.setup(e)}}const XD=(s,e)=>H(new uw(s,e));class hw extends lw{static get type(){return"ParallaxBarrierPassNode"}constructor(e,t){super(e,t),this.isParallaxBarrierPassNode=!0}setup(e){const t=rt(),n=U(()=>{const r=oe().toVar();return Oe(Ad(Aa.y,2).greaterThan(1),()=>{r.assign(this._mapLeft.uv(t))}).Else(()=>{r.assign(this._mapRight.uv(t))}),r}),i=this._material||(this._material=new Tt);return i.fragmentNode=n().context(e.getSharedContext()),i.needsUpdate=!0,super.setup(e)}}const qD=(s,e)=>H(new hw(s,e));class dw extends bn{static get type(){return"ToonOutlinePassNode"}constructor(e,t,n,i,r){super(bn.COLOR,e,t),this.colorNode=n,this.thicknessNode=i,this.alphaNode=r,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,n=t.getRenderObjectFunction();t.setRenderObjectFunction((i,r,o,a,c,l,u)=>{if((c.isMeshToonMaterial||c.isMeshToonNodeMaterial)&&c.wireframe===!1){const h=this._getOutlineMaterial(c);t.renderObject(i,r,o,a,h,l,u)}t.renderObject(i,r,o,a,c,l,u)}),super.updateBefore(e),t.setRenderObjectFunction(n)}_createMaterial(){const e=new Tt;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=ln;const t=hi.negate(),n=ci.mul(xs),i=A(1),r=n.mul(oe(en,1)),o=n.mul(oe(en.add(t),1)),a=vi(r.sub(o));return e.vertexNode=r.add(a.mul(this.thicknessNode).mul(r.w).mul(i)),e.colorNode=oe(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return t===void 0&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const $D=(s,e,t=new _e(0,0,0),n=.003,i=1)=>H(new dw(s,e,H(t),H(n),H(i)));class pw extends Ye{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outpuType=null,this.events=new Ai,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return this.outputType!==null}set value(e){this._value!==e&&(this._cache&&this.inputType==="URL"&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&this._cache===null&&this.inputType==="URL"&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&e.value!==null&&e.value!==void 0&&((this.inputType==="URL"||this.inputType==="String")&&typeof e.value=="string"||this.inputType==="Number"&&typeof e.value=="number"||this.inputType==="Vector2"&&e.value.isVector2||this.inputType==="Vector3"&&e.value.isVector3||this.inputType==="Vector4"&&e.value.isVector4||this.inputType==="Color"&&e.value.isColor||this.inputType==="Matrix3"&&e.value.isMatrix3||this.inputType==="Matrix4"&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:A()}serialize(e){super.serialize(e),this.value!==null?this.inputType==="ArrayBuffer"?e.value=Wm(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;e.value!==null&&(e.inputType==="ArrayBuffer"?t=Xm(e.value):e.inputType==="Texture"?t=e.meta.textures[e.value]:t=e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Uu=K(pw);class fw extends Map{get(e,t=null,...n){if(this.has(e))return super.get(e);if(t!==null){const i=t(...n);return this.set(e,i),i}}}class YD{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Fu=new fw;class mw extends Ye{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new fw,this._output=Uu(),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const n=this._outputs;return n[e]===void 0?n[e]=Uu(t):n[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const n=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),n[e]=t,n[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),n[e]=t,n[e].events.addEventListener("refresh",this.onRefresh)):n[e]===void 0?(n[e]=Uu(t),n[e].events.addEventListener("refresh",this.onRefresh)):n[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const i=this.getObject()[e];if(typeof i=="function")return i(...t)}async callAsync(e,...t){const i=this.getObject()[e];if(typeof i=="function")return i.constructor.name==="AsyncFunction"?await i(...t):i(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){e!==null?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),this._object!==null)return this._object;const e=()=>this.refresh(),t=(l,u)=>this.setOutput(l,u),n=new YD(this),i=Fu.get("THREE"),r=Fu.get("TSL"),o=this.getMethod(this.codeNode),a=[n,this._local,Fu,e,t,i,r];this._object=o(...a);const c=this._object.layout;if(c&&(c.cache===!1&&this._local.clear(),this._output.outputType=c.outputType||null,Array.isArray(c.elements)))for(const l of c.elements){const u=l.id||l.name;l.inputType&&(this.getParameter(u)===void 0&&this.setParameter(u,null),this.getParameter(u).inputType=l.inputType),l.outputType&&(this.getOutput(u)===void 0&&this.setOutput(u,null),this.getOutput(u).outputType=l.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const t in this.parameters){let n=this.parameters[t];n.isScriptableNode&&(n=n.getDefaultOutput()),n.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:A()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),this._method!==null)return this._method;const e=["parameters","local","global","refresh","setOutput","THREE","TSL"],n=["layout","init","main","dispose"].join(", "),i="var "+n+`; var output = {};
|
|
3868
3868
|
`,r=`
|
|
3869
3869
|
return { ...output, `+n+" };",o=i+this.codeNode.code+r;return this._method=new Function(...e,o),this._method}dispose(){this._method!==null&&(this._object&&typeof this._object.dispose=="function"&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[zv(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const n in this.parameters)t.push(this.parameters[n].getCacheKey(e));return kv(t)}set needsUpdate(e){e===!0&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return this.codeNode===null?this:(this._needsOutputUpdate===!0&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value,this)}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const ZD=K(mw);class Bd extends Ye{static get type(){return"FogNode"}constructor(e,t){super("float"),this.isFogNode=!0,this.colorNode=e,this.factorNode=t}getViewZNode(e){let t;const n=e.context.getViewZ;return n!==void 0&&(t=n(this)),(t||Pn.z).negate()}setup(){return this.factorNode}}const JD=K(Bd);class gw extends Bd{static get type(){return"FogRangeNode"}constructor(e,t,n){super(e),this.isFogRangeNode=!0,this.nearNode=t,this.farNode=n}setup(e){const t=this.getViewZNode(e);return ti(this.nearNode,this.farNode,t)}}const KD=K(gw);class xw extends Bd{static get type(){return"FogExp2Node"}constructor(e,t){super(e),this.isFogExp2Node=!0,this.densityNode=t}setup(e){const t=this.getViewZNode(e),n=this.densityNode;return n.mul(n,t,t).negate().exp().oneMinus()}}const jD=K(xw);let Dr=null,Ur=null;class _w extends Ye{static get type(){return"RangeNode"}constructor(e=A(),t=A()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Is(this.minNode.value)),n=e.getTypeLength(Is(this.maxNode.value));return t>n?t:n}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let n=null;if(t.count>1){const i=this.minNode.value,r=this.maxNode.value,o=e.getTypeLength(Is(i)),a=e.getTypeLength(Is(r));Dr=Dr||new st,Ur=Ur||new st,Dr.setScalar(0),Ur.setScalar(0),o===1?Dr.setScalar(i):i.isColor?Dr.set(i.r,i.g,i.b):Dr.set(i.x,i.y,i.z||0,i.w||0),a===1?Ur.setScalar(r):r.isColor?Ur.set(r.r,r.g,r.b):Ur.set(r.x,r.y,r.z||0,r.w||0);const c=4,l=c*t.count,u=new Float32Array(l);for(let d=0;d<l;d++){const p=d%c,f=Dr.getComponent(p),x=Ur.getComponent(p);u[d]=Gh.lerp(f,x,Math.random())}const h=this.getNodeType(e);if(t.count<=4096)n=fl(u,"vec4",t.count).element(yl).convert(h);else{const d=new Us(u,4);e.geometry.setAttribute("__range"+this.id,d),n=_h(d).convert(h)}}else n=A(0);return n}}const QD=K(_w),eU=U(({depthTexture:s,shadowCoord:e})=>xt(s,e.xy).compare(e.z)),tU=U(({depthTexture:s,shadowCoord:e,shadow:t})=>{const n=(x,m)=>xt(s,x).compare(m),i=dn("mapSize","vec2",t).setGroup(_t),r=dn("radius","float",t).setGroup(_t),o=z(1).div(i),a=o.x.negate().mul(r),c=o.y.negate().mul(r),l=o.x.mul(r),u=o.y.mul(r),h=a.div(2),d=c.div(2),p=l.div(2),f=u.div(2);return Wt(n(e.xy.add(z(a,c)),e.z),n(e.xy.add(z(0,c)),e.z),n(e.xy.add(z(l,c)),e.z),n(e.xy.add(z(h,d)),e.z),n(e.xy.add(z(0,d)),e.z),n(e.xy.add(z(p,d)),e.z),n(e.xy.add(z(a,0)),e.z),n(e.xy.add(z(h,0)),e.z),n(e.xy,e.z),n(e.xy.add(z(p,0)),e.z),n(e.xy.add(z(l,0)),e.z),n(e.xy.add(z(h,f)),e.z),n(e.xy.add(z(0,f)),e.z),n(e.xy.add(z(p,f)),e.z),n(e.xy.add(z(a,u)),e.z),n(e.xy.add(z(0,u)),e.z),n(e.xy.add(z(l,u)),e.z)).mul(1/17)}),nU=U(({depthTexture:s,shadowCoord:e,shadow:t})=>{const n=(u,h)=>xt(s,u).compare(h),i=dn("mapSize","vec2",t).setGroup(_t),r=z(1).div(i),o=r.x,a=r.y,c=e.xy,l=xr(c.mul(i).add(.5));return c.subAssign(l.mul(r)),Wt(n(c,e.z),n(c.add(z(o,0)),e.z),n(c.add(z(0,a)),e.z),n(c.add(r),e.z),it(n(c.add(z(o.negate(),0)),e.z),n(c.add(z(o.mul(2),0)),e.z),l.x),it(n(c.add(z(o.negate(),a)),e.z),n(c.add(z(o.mul(2),a)),e.z),l.x),it(n(c.add(z(0,a.negate())),e.z),n(c.add(z(0,a.mul(2))),e.z),l.y),it(n(c.add(z(o,a.negate())),e.z),n(c.add(z(o,a.mul(2))),e.z),l.y),it(it(n(c.add(z(o.negate(),a.negate())),e.z),n(c.add(z(o.mul(2),a.negate())),e.z),l.x),it(n(c.add(z(o.negate(),a.mul(2))),e.z),n(c.add(z(o.mul(2),a.mul(2))),e.z),l.x),l.y)).mul(1/9)}),iU=U(({depthTexture:s,shadowCoord:e})=>{const t=A(1).toVar(),n=xt(s).uv(e.xy).rg,i=ll(e.z,n.x);return Oe(i.notEqual(A(1)),()=>{const r=e.z.sub(n.x),o=ft(0,n.y.mul(n.y));let a=o.div(o.add(r.mul(r)));a=cn(Ft(a,.3).div(.95-.3)),t.assign(cn(ft(i,a)))}),t}),sU=U(({samples:s,radius:e,size:t,shadowPass:n})=>{const i=A(0).toVar(),r=A(0).toVar(),o=s.lessThanEqual(A(1)).select(A(0),A(2).div(s.sub(1))),a=s.lessThanEqual(A(1)).select(A(0),A(-1));mt({start:L(0),end:L(s),type:"int",condition:"<"},({i:l})=>{const u=a.add(A(l).mul(o)),h=n.uv(Wt(Aa.xy,z(0,u).mul(e)).div(t)).x;i.addAssign(h),r.addAssign(h.mul(h))}),i.divAssign(s),r.divAssign(s);const c=os(r.sub(i.mul(i)));return z(i,c)}),rU=U(({samples:s,radius:e,size:t,shadowPass:n})=>{const i=A(0).toVar(),r=A(0).toVar(),o=s.lessThanEqual(A(1)).select(A(0),A(2).div(s.sub(1))),a=s.lessThanEqual(A(1)).select(A(0),A(-1));mt({start:L(0),end:L(s),type:"int",condition:"<"},({i:l})=>{const u=a.add(A(l).mul(o)),h=n.uv(Wt(Aa.xy,z(u,0).mul(e)).div(t));i.addAssign(h.x),r.addAssign(Wt(h.y.mul(h.y),h.x.mul(h.x)))}),i.divAssign(s),r.divAssign(s);const c=os(r.sub(i.mul(i)));return z(i,c)}),oU=[eU,tU,nU,iU];let Oo=null;const wu=new ys;class yr extends ho{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.updateType=We.FRAME,this.light=e,this.color=new _e,this.colorNode=pe(this.color).setGroup(_t),this.baseColorNode=null,this.shadowMap=null,this.shadowNode=null,this.shadowColorNode=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this.isAnalyticLightNode=!0}getCacheKey(){return km(super.getCacheKey(),this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}setupShadow(e){const{object:t,renderer:n}=e;if(n.shadowMap.enabled===!1)return;let i=this.shadowColorNode;if(i===null){Oo===null&&(Oo=new Tt,Oo.fragmentNode=oe(0,0,0,1),Oo.isShadowNodeMaterial=!0,Oo.name="ShadowMaterial");const r=n.shadowMap.type,o=this.light.shadow,a=new ao;a.compareFunction=jf;const c=e.createRenderTarget(o.mapSize.width,o.mapSize.height);if(c.depthTexture=a,o.camera.updateProjectionMatrix(),r===oi){a.compareFunction=null,this.vsmShadowMapVertical=e.createRenderTarget(o.mapSize.width,o.mapSize.height,{format:na,type:Ln}),this.vsmShadowMapHorizontal=e.createRenderTarget(o.mapSize.width,o.mapSize.height,{format:na,type:Ln});const _=xt(a),v=xt(this.vsmShadowMapVertical.texture),I=dn("blurSamples","float",o).setGroup(_t),T=dn("radius","float",o).setGroup(_t),w=dn("mapSize","vec2",o).setGroup(_t);let C=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Tt);C.fragmentNode=sU({samples:I,radius:T,size:w,shadowPass:_}).context(e.getSharedContext()),C.name="VSMVertical",C=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Tt),C.fragmentNode=rU({samples:I,radius:T,size:w,shadowPass:v}).context(e.getSharedContext()),C.name="VSMHorizontal"}const l=dn("intensity","float",o).setGroup(_t),u=dn("bias","float",o).setGroup(_t),h=dn("normalBias","float",o).setGroup(_t),d=t.material.shadowPositionNode||vh;let p=pe(o.matrix).setGroup(_t).mul(d.add(Ed.mul(h)));p=p.xyz.div(p.w);let f=p.z.add(u);n.coordinateSystem===Qr&&(f=f.mul(2).sub(1)),p=D(p.x,p.y.oneMinus(),f);const x=p.x.greaterThanEqual(0).and(p.x.lessThanEqual(1)).and(p.y.greaterThanEqual(0)).and(p.y.lessThanEqual(1)).and(p.z.lessThanEqual(1)),m=o.filterNode||oU[n.shadowMap.type]||null;if(m===null)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const g=xt(c.texture,p),y=x.select(m({depthTexture:r===oi?this.vsmShadowMapHorizontal.texture:a,shadowCoord:p,shadow:o}),A(1));this.shadowMap=c,this.light.shadow.map=c,this.shadowNode=y,this.shadowColorNode=i=this.colorNode.mul(it(1,y.rgb.mix(g,1),l.mul(g.a))),this.baseColorNode=this.colorNode}this.colorNode=i,this.updateBeforeType=We.RENDER}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):this.shadowNode!==null&&this.disposeShadow()}updateShadow(e){const{shadowMap:t,light:n}=this,{renderer:i,scene:r,camera:o}=e,a=i.shadowMap.type,c=t.depthTexture.version;this._depthVersionCached=c;const l=r.overrideMaterial;r.overrideMaterial=Oo,t.setSize(n.shadow.mapSize.width,n.shadow.mapSize.height),n.shadow.updateMatrices(n),n.shadow.camera.layers.mask=o.layers.mask;const u=i.getRenderTarget(),h=i.getRenderObjectFunction();i.setRenderObjectFunction((d,...p)=>{(d.castShadow===!0||d.receiveShadow&&a===oi)&&i.renderObject(d,...p)}),i.setRenderTarget(t),i.render(r,n.shadow.camera),i.setRenderObjectFunction(h),n.isPointLight!==!0&&a===oi&&this.vsmPass(e,n),i.setRenderTarget(u),r.overrideMaterial=l}vsmPass(e,t){const{renderer:n}=e;this.vsmShadowMapVertical.setSize(t.shadow.mapSize.width,t.shadow.mapSize.height),this.vsmShadowMapHorizontal.setSize(t.shadow.mapSize.width,t.shadow.mapSize.height),n.setRenderTarget(this.vsmShadowMapVertical),wu.material=this.vsmMaterialVertical,wu.render(n),n.setRenderTarget(this.vsmShadowMapHorizontal),wu.material=this.vsmMaterialHorizontal,wu.render(n)}disposeShadow(){this.shadowMap.dispose(),this.shadowMap=null,this.vsmShadowMapVertical!==null&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),this.vsmShadowMapHorizontal!==null&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),this.shadowNode=null,this.shadowColorNode=null,this.baseColorNode=null,this.updateBeforeType=We.NONE}updateBefore(e){const t=this.light.shadow;(t.needsUpdate||t.autoUpdate)&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const n0=U(s=>{const{lightDistance:e,cutoffDistance:t,decayExponent:n}=s,i=e.pow(n).max(.01).reciprocal();return t.greaterThan(0).select(i.mul(e.div(t).pow4().oneMinus().clamp().pow2()),i)});let Au;function i0(s){Au=Au||new WeakMap;let e=Au.get(s);return e===void 0&&Au.set(s,e={}),e}function s0(s){const e=i0(s);return e.position||(e.position=pe(new E).setGroup(_t).onRenderUpdate((t,n)=>n.value.setFromMatrixPosition(s.matrixWorld)))}function yw(s){const e=i0(s);return e.targetPosition||(e.targetPosition=pe(new E).setGroup(_t).onRenderUpdate((t,n)=>n.value.setFromMatrixPosition(s.target.matrixWorld)))}function zd(s){const e=i0(s);return e.viewPosition||(e.viewPosition=pe(new E).setGroup(_t).onRenderUpdate(({camera:t},n)=>{n.value=n.value||new E,n.value.setFromMatrixPosition(s.matrixWorld),n.value.applyMatrix4(t.matrixWorldInverse)}))}const r0=s=>pi.transformDirection(s0(s).sub(yw(s))),aU=U(([s])=>{const e=s.toUint().mul(747796405).add(2891336453),t=e.shiftRight(e.shiftRight(28).add(4)).bitXor(e).mul(277803737);return t.shiftRight(22).bitXor(t).toFloat().mul(1/2**32)}),Pf=(s,e)=>Kn(ot(4,s.mul(Ft(1,s))),e),cU=(s,e)=>s.lessThan(.5)?Pf(s.mul(2),e).div(2):Ft(1,Pf(ot(Ft(1,s),2),e).div(2)),lU=(s,e,t)=>Kn(ns(Kn(s,e),Wt(Kn(s,e),Kn(Ft(1,s),t))),1/e),uU=(s,e)=>Cn(to.mul(e.mul(s).sub(1))).div(to.mul(e.mul(s).sub(1))),us=U(([s])=>s.fract().sub(.5).abs()).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),vw=U(([s])=>D(us(s.z.add(us(s.y.mul(1)))),us(s.z.add(us(s.x.mul(1)))),us(s.y.add(us(s.x.mul(1)))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),hU=U(([s,e,t])=>{const n=D(s).toVar(),i=A(1.4).toVar(),r=A(0).toVar(),o=D(n).toVar();return mt({start:A(0),end:A(3),type:"float",condition:"<="},()=>{const a=D(vw(o.mul(2))).toVar();n.addAssign(a.add(t.mul(A(.1).mul(e)))),o.mulAssign(1.8),i.mulAssign(1.5),n.mulAssign(1.2);const c=A(us(n.z.add(us(n.x.add(us(n.y)))))).toVar();r.addAssign(c.div(i)),o.addAssign(.14)}),r}).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"p",type:"vec3"},{name:"spd",type:"float"},{name:"time",type:"float"}]}),dU=U(([s,e,t=z(.5)])=>Wg(s.sub(t),e).add(t)),pU=U(([s,e,t=z(.5)])=>{const n=s.sub(t),i=n.dot(n),o=i.mul(i).mul(e);return s.add(n.mul(o))}),fU=U(({position:s=null,horizontal:e=!0,vertical:t=!1})=>{let n;s!==null?(n=Ui.toVar(),n[3][0]=s.x,n[3][1]=s.y,n[3][2]=s.z):n=Ui;const i=pi.mul(n);return Oc(e)&&(i[0][0]=Ui[0].length(),i[0][1]=0,i[0][2]=0),Oc(t)&&(i[1][0]=0,i[1][1]=Ui[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,ci.mul(i).mul(en)}),mU=U(([s=null])=>{const e=Sh();return Sh(Og(s)).sub(e).lessThan(0).select(_r,s)}),B_=new WeakMap;class gU extends pt{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.updateType=We.OBJECT,this.updateAfterType=We.OBJECT,this.previousModelWorldMatrix=pe(new Fe),this.previousProjectionMatrix=pe(new Fe).setGroup(_t),this.previousCameraViewMatrix=pe(new Fe)}update({frameId:e,camera:t,object:n}){const i=z_(n);this.previousModelWorldMatrix.value.copy(i);const r=Mw(t);r.frameId!==e&&(r.frameId=e,r.previousProjectionMatrix===void 0?(r.previousProjectionMatrix=new Fe,r.previousCameraViewMatrix=new Fe,r.currentProjectionMatrix=new Fe,r.currentCameraViewMatrix=new Fe,r.previousProjectionMatrix.copy(t.projectionMatrix),r.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(r.previousProjectionMatrix.copy(r.currentProjectionMatrix),r.previousCameraViewMatrix.copy(r.currentCameraViewMatrix)),r.currentProjectionMatrix.copy(t.projectionMatrix),r.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(r.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(r.previousCameraViewMatrix))}updateAfter({object:e}){z_(e).copy(e.matrixWorld)}setup(){const e=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),t=ci.mul(xs).mul(en),n=this.previousProjectionMatrix.mul(e).mul(yh),i=t.xy.div(t.w),r=n.xy.div(n.w);return Ft(i,r)}}function Mw(s){let e=B_.get(s);return e===void 0&&(e={},B_.set(s,e)),e}function z_(s,e=0){const t=Mw(s);let n=t[e];return n===void 0&&(t[e]=n=new Fe),n}const xU=fe(gU),_U=U(([s,e])=>Mn(1,s.oneMinus().div(e)).oneMinus()).setLayout({name:"burnBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),yU=U(([s,e])=>Mn(s.div(e.oneMinus()),1)).setLayout({name:"dodgeBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),vU=U(([s,e])=>s.oneMinus().mul(e.oneMinus()).oneMinus()).setLayout({name:"screenBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),MU=U(([s,e])=>it(s.mul(2).mul(e),s.oneMinus().mul(2).mul(e.oneMinus()).oneMinus(),ll(.5,s))).setLayout({name:"overlayBlend",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),SU=U(([s,e,t=L(16)])=>{const n=a=>s.uv(a),i=rt(),r=n(i).toVar(),o=A(t);return mt({start:L(1),end:t,type:"int",condition:"<="},({i:a})=>{const c=e.mul(A(a).div(o.sub(1)).sub(.5));r.addAssign(n(i.add(c)))}),r.divAssign(o),r}),TU=U(([s,e=1])=>{const t=s,n=En(t.rgb),i=D(n),r=Mn(1,ft(0,A(10).mul(n.sub(.45)))),o=i.mul(t.rgb).mul(2),a=A(2).mul(i.oneMinus()).mul(t.rgb.oneMinus()).oneMinus(),c=it(o,a,r),l=t.a.mul(e),u=l.mul(c.rgb);return u.addAssign(t.rgb.mul(l.oneMinus())),oe(u,t.a)}),bU=U(([s])=>{const e=D(s);return oe($t(e,D(.393,.769,.189)),$t(e,D(.349,.686,.168)),$t(e,D(.272,.534,.131)),s.a)}),Sw=U(([s])=>{const e=s.mul(.9478672986).add(.0521327014).pow(2.4),t=s.mul(.0773993808),n=s.lessThanEqual(.04045);return it(e,t,n)}).setLayout({name:"sRGBToLinearSRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Tw=U(([s])=>{const e=s.pow(.41666).mul(1.055).sub(.055),t=s.mul(12.92),n=s.lessThanEqual(.0031308);return it(e,t,n)}).setLayout({name:"linearSRGBTosRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),bw=U(([s,e])=>s.mul(e).clamp()).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),ww=U(([s,e])=>(s=s.mul(e),s.div(s.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Aw=U(([s,e])=>{s=s.mul(e),s=s.sub(.004).max(0);const t=s.mul(s.mul(6.2).add(.5)),n=s.mul(s.mul(6.2).add(1.7)).add(.06);return t.div(n).pow(2.2)}).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),wU=U(([s])=>{const e=s.mul(s.add(.0245786)).sub(90537e-9),t=s.mul(s.add(.432951).mul(.983729)).add(.238081);return e.div(t)}),Nw=U(([s,e])=>{const t=Tn(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),n=Tn(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return s=s.mul(e).div(.6),s=t.mul(s),s=wU(s),s=n.mul(s),s.clamp()}).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),AU=Tn(D(1.6605,-.1246,-.0182),D(-.5876,1.1329,-.1006),D(-.0728,-.0083,1.1187)),NU=Tn(D(.6274,.0691,.0164),D(.3293,.9195,.088),D(.0433,.0113,.8956)),EU=U(([s])=>{const e=D(s).toVar(),t=D(e.mul(e)).toVar(),n=D(t.mul(t)).toVar();return A(15.5).mul(n.mul(t)).sub(ot(40.14,n.mul(e))).add(ot(31.96,n).sub(ot(6.868,t.mul(e))).add(ot(.4298,t).add(ot(.1191,e).sub(.00232))))}),Ew=U(([s,e])=>{const t=D(s).toVar(),n=Tn(D(.856627153315983,.137318972929847,.11189821299995),D(.0951212405381588,.761241990602591,.0767994186031903),D(.0482516061458583,.101439036467562,.811302368396859)),i=Tn(D(1.1271005818144368,-.1413297634984383,-.14132976349843826),D(-.11060664309660323,1.157823702216272,-.11060664309660294),D(-.016493938717834573,-.016493938717834257,1.2519364065950405)),r=A(-12.47393),o=A(4.026069);return t.mulAssign(e),t.assign(NU.mul(t)),t.assign(n.mul(t)),t.assign(ft(t,1e-10)),t.assign(al(t)),t.assign(t.sub(r).div(o.sub(r))),t.assign(cn(t,0,1)),t.assign(EU(t)),t.assign(i.mul(t)),t.assign(Kn(ft(D(0),t),D(2.2))),t.assign(AU.mul(t)),t.assign(cn(t,0,1)),t}).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Cw=U(([s,e])=>{const t=A(.76),n=A(.15);s=s.mul(e);const i=Mn(s.r,Mn(s.g,s.b)),r=In(i.lessThan(.08),i.sub(ot(6.25,i.mul(i))),.04);s.subAssign(r);const o=ft(s.r,ft(s.g,s.b));Oe(o.lessThan(t),()=>s);const a=Ft(1,t),c=Ft(1,a.mul(a).div(o.add(a.sub(t))));s.mulAssign(c.div(o));const l=Ft(1,ns(1,n.mul(o.sub(c)).add(1)));return it(s,D(c),l)}).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class CU extends Ye{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}getNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){e.hasBuiltin(this._builtinName)}generate(e,t){const n=this.getBuiltinName(e),i=this.getNodeType(e);return e.shaderStage==="compute"?e.format(n,i,t):(console.warn(`ComputeBuiltinNode: Compute built-in value ${n} can not be accessed in the ${e.shaderStage} stage`),e.generateConst(i))}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const kd=(s,e)=>H(new CU(s,e)),RU=kd("numWorkgroups","uvec3"),IU=kd("workgroupId","uvec3"),PU=kd("localId","uvec3"),LU=kd("subgroupSize","uint");class DU extends Ye{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:n}=e;n.backend.isWebGLBackend===!0?e.addFlowCode(` // ${t}Barrier
|
|
3870
|
-
`):e.addLineFlowCode(`${t}Barrier()`,this)}}const o0=K(DU),UU=()=>o0("workgroup").append(),FU=()=>o0("storage").append(),OU=()=>o0("texture").append();class VU extends mr{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let n;const i=e.context.assign;if(n=super.generate(e),i!==!0){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}class BU extends Ye{constructor(e,t,n=0){super(t),this.bufferType=t,this.bufferCount=n,this.isWorkgroupInfoNode=!0,this.scope=e}label(e){return this.name=e,this}getHash(){return this.uuid}setScope(e){return this.scope=e,this}getInputType(){return`${this.scope}Array`}element(e){return H(new VU(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const zU=(s,e)=>H(new BU("Workgroup",s,e));class wn extends pt{static get type(){return"AtomicFunctionNode"}constructor(e,t,n,i=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.storeNode=i}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,n=this.getNodeType(e),i=this.getInputType(e),r=this.pointerNode,o=this.valueNode,a=[];a.push(`&${r.build(e,i)}`),a.push(o.build(e,i));const c=`${e.getMethod(t,n)}( ${a.join(", ")} )`;if(this.storeNode!==null){const l=this.storeNode.build(e,i);e.addLineFlowCode(`${l} = ${c}`,this)}else e.addLineFlowCode(c,this)}}wn.ATOMIC_LOAD="atomicLoad";wn.ATOMIC_STORE="atomicStore";wn.ATOMIC_ADD="atomicAdd";wn.ATOMIC_SUB="atomicSub";wn.ATOMIC_MAX="atomicMax";wn.ATOMIC_MIN="atomicMin";wn.ATOMIC_AND="atomicAnd";wn.ATOMIC_OR="atomicOr";wn.ATOMIC_XOR="atomicXor";const kU=K(wn),Os=(s,e,t,n)=>{const i=kU(s,e,t,n);return i.append(),i},GU=(s,e,t=null)=>Os(wn.ATOMIC_STORE,s,e,t),HU=(s,e,t=null)=>Os(wn.ATOMIC_ADD,s,e,t),WU=(s,e,t=null)=>Os(wn.ATOMIC_SUB,s,e,t),XU=(s,e,t=null)=>Os(wn.ATOMIC_MAX,s,e,t),qU=(s,e,t=null)=>Os(wn.ATOMIC_MIN,s,e,t),$U=(s,e,t=null)=>Os(wn.ATOMIC_AND,s,e,t),YU=(s,e,t=null)=>Os(wn.ATOMIC_OR,s,e,t),ZU=(s,e,t=null)=>Os(wn.ATOMIC_XOR,s,e,t),JU=U(([s=rt()])=>{const e=s.mul(2),t=e.x.floor(),n=e.y.floor();return t.add(n).mod(2).sign()}),ac=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=cr(s).toVar();return In(r,i,n)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),bh=U(([s,e])=>{const t=cr(e).toVar(),n=A(s).toVar();return In(t,n.negate(),n)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),rn=U(([s])=>{const e=A(s).toVar();return L(gr(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),Ht=U(([s,e])=>{const t=A(s).toVar();return e.assign(rn(t)),t.sub(A(e))}),KU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=A(n).toVar(),l=A(t).toVar(),u=A(e).toVar(),h=A(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),jU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=D(n).toVar(),l=D(t).toVar(),u=D(e).toVar(),h=D(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),Rw=On([KU,jU]),QU=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=A(a).toVar(),x=A(o).toVar(),m=A(r).toVar(),g=A(i).toVar(),y=A(n).toVar(),_=A(t).toVar(),v=A(e).toVar(),I=A(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),eF=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=D(a).toVar(),x=D(o).toVar(),m=D(r).toVar(),g=D(i).toVar(),y=D(n).toVar(),_=D(t).toVar(),v=D(e).toVar(),I=D(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),Iw=On([QU,eF]),tF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=ve(s).toVar(),o=ve(r.bitAnd(ve(7))).toVar(),a=A(ac(o.lessThan(ve(4)),i,n)).toVar(),c=A(ot(2,ac(o.lessThan(ve(4)),n,i))).toVar();return bh(a,cr(o.bitAnd(ve(1)))).add(bh(c,cr(o.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),nF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=ve(s).toVar(),c=ve(a.bitAnd(ve(15))).toVar(),l=A(ac(c.lessThan(ve(8)),o,r)).toVar(),u=A(ac(c.lessThan(ve(4)),r,ac(c.equal(ve(12)).or(c.equal(ve(14))),o,i))).toVar();return bh(l,cr(c.bitAnd(ve(1)))).add(bh(u,cr(c.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yn=On([tF,nF]),iF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=wa(s).toVar();return D(yn(r.x,i,n),yn(r.y,i,n),yn(r.z,i,n))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),sF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=wa(s).toVar();return D(yn(a.x,o,r,i),yn(a.y,o,r,i),yn(a.z,o,r,i))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),Ri=On([iF,sF]),rF=U(([s])=>{const e=A(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),oF=U(([s])=>{const e=A(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),aF=U(([s])=>{const e=D(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Pw=On([rF,aF]),cF=U(([s])=>{const e=D(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Lw=On([oF,cF]),yi=U(([s,e])=>{const t=L(e).toVar(),n=ve(s).toVar();return n.shiftLeft(t).bitOr(n.shiftRight(L(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),Dw=U(([s,e,t])=>{s.subAssign(t),s.bitXorAssign(yi(t,L(4))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(6))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(8))),e.addAssign(s),s.subAssign(t),s.bitXorAssign(yi(t,L(16))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(19))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(4))),e.addAssign(s)}),Sl=U(([s,e,t])=>{const n=ve(t).toVar(),i=ve(e).toVar(),r=ve(s).toVar();return n.bitXorAssign(i),n.subAssign(yi(i,L(14))),r.bitXorAssign(n),r.subAssign(yi(n,L(11))),i.bitXorAssign(r),i.subAssign(yi(r,L(25))),n.bitXorAssign(i),n.subAssign(yi(i,L(16))),r.bitXorAssign(n),r.subAssign(yi(n,L(4))),i.bitXorAssign(r),i.subAssign(yi(r,L(14))),n.bitXorAssign(i),n.subAssign(yi(i,L(24))),n}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Wn=U(([s])=>{const e=ve(s).toVar();return A(e).div(A(ve(L(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),ps=U(([s])=>{const e=A(s).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),lF=U(([s])=>{const e=L(s).toVar(),t=ve(ve(1)).toVar(),n=ve(ve(L(3735928559)).add(t.shiftLeft(ve(2))).add(ve(13))).toVar();return Sl(n.add(ve(e)),n,n)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),uF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(ve(2)).toVar(),r=ve().toVar(),o=ve().toVar(),a=ve().toVar();return r.assign(o.assign(a.assign(ve(L(3735928559)).add(i.shiftLeft(ve(2))).add(ve(13))))),r.addAssign(ve(n)),o.addAssign(ve(t)),Sl(r,o,a)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),hF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(ve(3)).toVar(),a=ve().toVar(),c=ve().toVar(),l=ve().toVar();return a.assign(c.assign(l.assign(ve(L(3735928559)).add(o.shiftLeft(ve(2))).add(ve(13))))),a.addAssign(ve(r)),c.addAssign(ve(i)),l.addAssign(ve(n)),Sl(a,c,l)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),dF=U(([s,e,t,n])=>{const i=L(n).toVar(),r=L(t).toVar(),o=L(e).toVar(),a=L(s).toVar(),c=ve(ve(4)).toVar(),l=ve().toVar(),u=ve().toVar(),h=ve().toVar();return l.assign(u.assign(h.assign(ve(L(3735928559)).add(c.shiftLeft(ve(2))).add(ve(13))))),l.addAssign(ve(a)),u.addAssign(ve(o)),h.addAssign(ve(r)),Dw(l,u,h),l.addAssign(ve(i)),Sl(l,u,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),pF=U(([s,e,t,n,i])=>{const r=L(i).toVar(),o=L(n).toVar(),a=L(t).toVar(),c=L(e).toVar(),l=L(s).toVar(),u=ve(ve(5)).toVar(),h=ve().toVar(),d=ve().toVar(),p=ve().toVar();return h.assign(d.assign(p.assign(ve(L(3735928559)).add(u.shiftLeft(ve(2))).add(ve(13))))),h.addAssign(ve(l)),d.addAssign(ve(c)),p.addAssign(ve(a)),Dw(h,d,p),h.addAssign(ve(o)),d.addAssign(ve(r)),Sl(h,d,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Pt=On([lF,uF,hF,dF,pF]),fF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(Pt(n,t)).toVar(),r=wa().toVar();return r.x.assign(i.bitAnd(L(255))),r.y.assign(i.shiftRight(L(8)).bitAnd(L(255))),r.z.assign(i.shiftRight(L(16)).bitAnd(L(255))),r}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),mF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(Pt(r,i,n)).toVar(),a=wa().toVar();return a.x.assign(o.bitAnd(L(255))),a.y.assign(o.shiftRight(L(8)).bitAnd(L(255))),a.z.assign(o.shiftRight(L(16)).bitAnd(L(255))),a}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),Ii=On([fF,mF]),gF=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=A(Rw(yn(Pt(t,n),i,r),yn(Pt(t.add(L(1)),n),i.sub(1),r),yn(Pt(t,n.add(L(1))),i,r.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),xF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=A(Iw(yn(Pt(t,n,i),r,o,a),yn(Pt(t.add(L(1)),n,i),r.sub(1),o,a),yn(Pt(t,n.add(L(1)),i),r,o.sub(1),a),yn(Pt(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),yn(Pt(t,n,i.add(L(1))),r,o,a.sub(1)),yn(Pt(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),yn(Pt(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),a0=On([gF,xF]),_F=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=D(Rw(Ri(Ii(t,n),i,r),Ri(Ii(t.add(L(1)),n),i.sub(1),r),Ri(Ii(t,n.add(L(1))),i,r.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),yF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=D(Iw(Ri(Ii(t,n,i),r,o,a),Ri(Ii(t.add(L(1)),n,i),r.sub(1),o,a),Ri(Ii(t,n.add(L(1)),i),r,o.sub(1),a),Ri(Ii(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),Ri(Ii(t,n,i.add(L(1))),r,o,a.sub(1)),Ri(Ii(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),Ri(Ii(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),c0=On([_F,yF]),vF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return Wn(Pt(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),MF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return Wn(Pt(t,n))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),SF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return Wn(Pt(t,n,i))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),TF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return Wn(Pt(t,n,i,r))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),bF=On([vF,MF,SF,TF]),wF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return D(Wn(Pt(t,L(0))),Wn(Pt(t,L(1))),Wn(Pt(t,L(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),AF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return D(Wn(Pt(t,n,L(0))),Wn(Pt(t,n,L(1))),Wn(Pt(t,n,L(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),NF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return D(Wn(Pt(t,n,i,L(0))),Wn(Pt(t,n,i,L(1))),Wn(Pt(t,n,i,L(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),EF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return D(Wn(Pt(t,n,i,r,L(0))),Wn(Pt(t,n,i,r,L(1))),Wn(Pt(t,n,i,r,L(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),Uw=On([wF,AF,NF,EF]),wh=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=A(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(a0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),Fw=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(c0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar();return z(wh(a,o,r,i),wh(a.add(D(L(19),L(193),L(17))),o,r,i))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),RF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(Fw(a,o,r,i)).toVar(),l=A(wh(a.add(D(L(19),L(193),L(17))),o,r,i)).toVar();return oe(c,l)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IF=U(([s,e,t,n,i,r,o])=>{const a=L(o).toVar(),c=A(r).toVar(),l=L(i).toVar(),u=L(n).toVar(),h=L(t).toVar(),d=L(e).toVar(),p=z(s).toVar(),f=D(Uw(z(d.add(u),h.add(l)))).toVar(),x=z(f.x,f.y).toVar();x.subAssign(.5),x.mulAssign(c),x.addAssign(.5);const m=z(z(A(d),A(h)).add(x)).toVar(),g=z(m.sub(p)).toVar();return Oe(a.equal(L(2)),()=>Dt(g.x).add(Dt(g.y))),Oe(a.equal(L(3)),()=>ft(Dt(g.x),Dt(g.y))),$t(g,g)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),PF=U(([s,e,t,n,i,r,o,a,c])=>{const l=L(c).toVar(),u=A(a).toVar(),h=L(o).toVar(),d=L(r).toVar(),p=L(i).toVar(),f=L(n).toVar(),x=L(t).toVar(),m=L(e).toVar(),g=D(s).toVar(),y=D(Uw(D(m.add(p),x.add(d),f.add(h)))).toVar();y.subAssign(.5),y.mulAssign(u),y.addAssign(.5);const _=D(D(A(m),A(x),A(f)).add(y)).toVar(),v=D(_.sub(g)).toVar();return Oe(l.equal(L(2)),()=>Dt(v.x).add(Dt(v.y)).add(Dt(v.z))),Oe(l.equal(L(3)),()=>ft(ft(Dt(v.x),Dt(v.y)),Dt(v.z))),$t(v,v)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),Ea=On([IF,PF]),LF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();l.assign(Mn(l,d))})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.y.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.z.assign(l.y),l.y.assign(d)}).ElseIf(d.lessThan(l.z),()=>{l.z.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),FF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();u.assign(Mn(u,f))})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OF=On([LF,FF]),VF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.y.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),BF=On([DF,VF]),zF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(f)}).ElseIf(f.lessThan(u.z),()=>{u.z.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kF=On([UF,zF]),GF=U(([s])=>{const e=s.y,t=s.z,n=D().toVar();return Oe(e.lessThan(1e-4),()=>{n.assign(D(t,t,t))}).Else(()=>{let i=s.x;i=i.sub(gr(i)).mul(6).toVar();const r=L(mg(i)),o=i.sub(A(r)),a=t.mul(e.oneMinus()),c=t.mul(e.mul(o).oneMinus()),l=t.mul(e.mul(o.oneMinus()).oneMinus());Oe(r.equal(L(0)),()=>{n.assign(D(t,l,a))}).ElseIf(r.equal(L(1)),()=>{n.assign(D(c,t,a))}).ElseIf(r.equal(L(2)),()=>{n.assign(D(a,t,l))}).ElseIf(r.equal(L(3)),()=>{n.assign(D(a,c,t))}).ElseIf(r.equal(L(4)),()=>{n.assign(D(l,a,t))}).Else(()=>{n.assign(D(t,a,c))})}),n}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),HF=U(([s])=>{const e=D(s).toVar(),t=A(e.x).toVar(),n=A(e.y).toVar(),i=A(e.z).toVar(),r=A(Mn(t,Mn(n,i))).toVar(),o=A(ft(t,ft(n,i))).toVar(),a=A(o.sub(r)).toVar(),c=A().toVar(),l=A().toVar(),u=A().toVar();return u.assign(o),Oe(o.greaterThan(0),()=>{l.assign(a.div(o))}).Else(()=>{l.assign(0)}),Oe(l.lessThanEqual(0),()=>{c.assign(0)}).Else(()=>{Oe(t.greaterThanEqual(o),()=>{c.assign(n.sub(i).div(a))}).ElseIf(n.greaterThanEqual(o),()=>{c.assign(Wt(2,i.sub(t).div(a)))}).Else(()=>{c.assign(Wt(4,t.sub(n).div(a)))}),c.mulAssign(1/6),Oe(c.lessThan(0),()=>{c.addAssign(1)})}),D(c,l,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),WF=U(([s])=>{const e=D(s).toVar(),t=Qm(ug(e,D(.04045))).toVar(),n=D(e.div(12.92)).toVar(),i=D(Kn(ft(e.add(D(.055)),D(0)).div(1.055),D(2.4))).toVar();return it(n,i,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Ow=(s,e)=>{s=A(s),e=A(e);const t=z(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return ti(s.sub(t),s.add(t),e)},Vw=(s,e,t,n)=>it(s,e,t[n].clamp()),XF=(s,e,t=rt())=>Vw(s,e,t,"x"),qF=(s,e,t=rt())=>Vw(s,e,t,"y"),Bw=(s,e,t,n,i)=>it(s,e,Ow(t,n[i])),$F=(s,e,t,n=rt())=>Bw(s,e,t,n,"x"),YF=(s,e,t,n=rt())=>Bw(s,e,t,n,"y"),ZF=(s=1,e=0,t=rt())=>t.mul(s).add(e),JF=(s,e=1)=>(s=A(s),s.abs().pow(e).mul(s.sign())),KF=(s,e=1,t=.5)=>A(s).sub(t).mul(e).add(t),jF=(s=rt(),e=1,t=0)=>a0(s.convert("vec2|vec3")).mul(e).add(t),QF=(s=rt(),e=1,t=0)=>c0(s.convert("vec2|vec3")).mul(e).add(t),eO=(s=rt(),e=1,t=0)=>(s=s.convert("vec2|vec3"),oe(c0(s),a0(s.add(z(19,73)))).mul(e).add(t)),tO=(s=rt(),e=1)=>OF(s.convert("vec2|vec3"),e,L(1)),nO=(s=rt(),e=1)=>BF(s.convert("vec2|vec3"),e,L(1)),iO=(s=rt(),e=1)=>kF(s.convert("vec2|vec3"),e,L(1)),sO=(s=rt())=>bF(s.convert("vec2|vec3")),rO=(s=rt(),e=3,t=2,n=.5,i=1)=>wh(s,L(e),t,n).mul(i),oO=(s=rt(),e=3,t=2,n=.5,i=1)=>CF(s,L(e),t,n).mul(i),aO=(s=rt(),e=3,t=2,n=.5,i=1)=>Fw(s,L(e),t,n).mul(i),cO=(s=rt(),e=3,t=2,n=.5,i=1)=>RF(s,L(e),t,n).mul(i),zw=U(([s,e])=>{const t=s.x,n=s.y,i=s.z;let r=e.element(0).mul(.886227);return r=r.add(e.element(1).mul(2*.511664).mul(n)),r=r.add(e.element(2).mul(2*.511664).mul(i)),r=r.add(e.element(3).mul(2*.511664).mul(t)),r=r.add(e.element(4).mul(2*.429043).mul(t).mul(n)),r=r.add(e.element(5).mul(2*.429043).mul(n).mul(i)),r=r.add(e.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),r=r.add(e.element(7).mul(2*.429043).mul(t).mul(i)),r=r.add(e.element(8).mul(.429043).mul(ot(t,t).sub(ot(n,n)))),r});class kw extends yr{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setup(e){const{colorNode:t,cutoffDistanceNode:n,decayExponentNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r).sub(Pn),c=a.normalize(),l=a.length(),u=n0({lightDistance:l,cutoffDistance:n,decayExponent:i}),h=t.mul(u),d=e.context.reflectedLight;o.direct({lightDirection:c,lightColor:h,reflectedLight:d},e.stack,e)}}class Gw extends yr{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,n=this.colorNode,i=r0(this.light),r=e.context.reflectedLight;t.direct({lightDirection:i,lightColor:n,reflectedLight:r},e.stack,e)}}const nf=new Fe,Nu=new Fe;let Ya=null;class Hw extends yr{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=pe(new E).setGroup(_t),this.halfWidth=pe(new E).setGroup(_t)}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;Nu.identity(),nf.copy(t.matrixWorld),nf.premultiply(n),Nu.extractRotation(nf),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(Nu),this.halfHeight.value.applyMatrix4(Nu)}setup(e){super.setup(e);let t,n;e.isAvailable("float32Filterable")?(t=xt(Ya.LTC_FLOAT_1),n=xt(Ya.LTC_FLOAT_2)):(t=xt(Ya.LTC_HALF_1),n=xt(Ya.LTC_HALF_2));const{colorNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r),c=e.context.reflectedLight;o.directRectArea({lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:c,ltc_1:t,ltc_2:n},e.stack,e)}static setLTC(e){Ya=e}}class l0 extends yr{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=pe(0).setGroup(_t),this.penumbraCosNode=pe(0).setGroup(_t),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:n}=this;return ti(t,n,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:n,cutoffDistanceNode:i,decayExponentNode:r,light:o}=this,a=zd(o).sub(Pn),c=a.normalize(),l=c.dot(r0(o)),u=this.getSpotAttenuation(l),h=a.length(),d=n0({lightDistance:h,cutoffDistance:i,decayExponent:r}),p=n.mul(u).mul(d),f=e.context.reflectedLight;t.direct({lightDirection:c,lightColor:p,reflectedLight:f},e.stack,e)}}class Ww extends l0{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let n=null;if(t&&t.isTexture===!0){const i=e.acos().mul(1/Math.PI);n=xt(t,z(i,0),0).r}else n=super.getSpotAttenuation(e);return n}}class Xw extends yr{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class qw extends yr{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=s0(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=pe(new _e).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:i}=this,o=di.dot(i).mul(.5).add(.5),a=it(n,t,o);e.context.irradiance.addAssign(a)}}class $w extends yr{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let n=0;n<9;n++)t.push(new E);this.lightProbe=ds(t)}update(e){const{light:t}=this;super.update(e);for(let n=0;n<9;n++)this.lightProbe.array[n].copy(t.sh.coefficients[n]).multiplyScalar(t.intensity)}setup(e){const t=zw(Ed,this.lightProbe);e.context.irradiance.addAssign(t)}}class lO{parseFunction(){console.warn("Abstract function.")}}class Yw{constructor(e,t,n="",i=""){this.type=e,this.inputs=t,this.name=n,this.precision=i}getCode(){console.warn("Abstract function.")}}Yw.isNodeFunction=!0;const uO=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,hO=/[a-z_0-9]+/ig,k_="#pragma main",dO=s=>{s=s.trim();const e=s.indexOf(k_),t=e!==-1?s.slice(e+k_.length):s,n=t.match(uO);if(n!==null&&n.length===5){const i=n[4],r=[];let o=null;for(;(o=hO.exec(i))!==null;)r.push(o);const a=[];let c=0;for(;c<r.length;){const f=r[c][0]==="const";f===!0&&c++;let x=r[c][0];x==="in"||x==="out"||x==="inout"?c++:x="";const m=r[c++][0];let g=Number.parseInt(r[c][0]);Number.isNaN(g)===!1?c++:g=null;const y=r[c++][0];a.push(new Kg(m,y,g,x,f))}const l=t.substring(n[0].length),u=n[3]!==void 0?n[3]:"",h=n[2],d=n[1]!==void 0?n[1]:"",p=e!==-1?s.slice(0,e):"";return{type:h,inputs:a,name:u,precision:d,inputsCode:i,blockCode:l,headerCode:p}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class pO extends Yw{constructor(e){const{type:t,inputs:n,name:i,precision:r,inputsCode:o,blockCode:a,headerCode:c}=dO(e);super(t,n,i,r),this.inputsCode=o,this.blockCode=a,this.headerCode=c}getCode(e=this.name){let t;const n=this.blockCode;if(n!==""){const{type:i,inputsCode:r,headerCode:o,precision:a}=this;let c=`${i} ${e} ( ${r.trim()} )`;a!==""&&(c=`${a} ${c}`),t=o+c+n}else t="";return t}}class Zw extends lO{parseFunction(e){return new pO(e)}}class fO{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(n!==null){t=new n;for(const i in e)t[i]=e[i]}return t}addColorSpace(e,t){this.addType(e,t,this.colorSpaceNodes)}getColorSpaceFunction(e){return this.colorSpaceNodes.get(e)||null}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t.name,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}addClass(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}class mO extends il{constructor(e,t,n,i,r,o){super(e,t,n,i,r,o),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class Jw extends fO{constructor(){super(),this.addLight(kw,_d),this.addLight(Gw,yd),this.addLight(Hw,Im),this.addLight(l0,il),this.addLight(Xw,vd),this.addLight(qw,xd),this.addLight($w,Pm),this.addLight(Ww,mO),this.addToneMapping(bw,Ah),this.addToneMapping(ww,Nh),this.addToneMapping(Aw,Bf),this.addToneMapping(Nw,Eh),this.addToneMapping(Ew,Ch),this.addToneMapping(Cw,Rh),this.addColorSpace(Tw,xh(li,kn)),this.addColorSpace(Sw,xh(kn,li))}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ks}}));if(typeof window<"u"){try{typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-qj71I7J3.umd.cjs",document.baseURI).href,window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-qj71I7J3.umd.cjs",document.baseURI).href,revision:Ks})}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Ks),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Ks}const gO=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Eh,AONode:OT,AddEquation:Zs,AddOperation:Vf,AdditiveAnimationBlendMode:Yf,AdditiveBlending:cc,AfterImageNode:qb,AgXToneMapping:Ch,AlphaFormat:Gf,AlwaysCompare:Dy,AlwaysDepth:uc,AlwaysStencilFunc:ih,AmbientLight:vd,AmbientLightNode:Xw,AnaglyphPassNode:uw,AnalyticLightNode:yr,AnamorphicNode:Yb,AnimationAction:Tv,AnimationClip:la,AnimationLoader:FI,AnimationMixer:bv,AnimationObjectGroup:tP,AnimationUtils:PI,ArcCurve:tv,ArrayCamera:rm,ArrayElementNode:mr,ArrowHelper:mP,AssignNode:oM,AttachedBindMode:af,AttributeNode:Ag,Audio:Fm,AudioAnalyser:XI,AudioContext:Md,AudioListener:vv,AudioLoader:yv,AxesHelper:Fv,BRDF_GGX:Af,BRDF_Lambert:no,BackSide:ln,BasicDepthPacking:Zf,BasicEnvironmentNode:Dd,BasicNodeLibrary:Jw,BasicShadowMap:nA,BatchNode:CT,BatchedMesh:hm,BloomNode:sw,Bone:Kh,BooleanKeyframeTrack:pr,Box2:aP,Box3:Hn,Box3Helper:Uv,BoxGeometry:_s,BoxHelper:Dv,Break:Ld,BufferAttribute:At,BufferAttributeNode:fS,BufferGeometry:at,BufferGeometryLoader:gv,BufferNode:Rd,BumpMapNode:JS,BypassNode:yS,ByteType:zf,Cache:Rs,CacheNode:_S,Camera:Yc,CameraHelper:Lv,CanvasTexture:ev,CapsuleGeometry:Qh,CatmullRomCurve3:gm,CineonToneMapping:Bf,CircleGeometry:ed,ClampToEdgeWrapping:Si,Clock:Um,CodeNode:$g,Color:_e,ColorKeyframeTrack:md,ColorManagement:gt,ColorSpaceNode:hl,CompressedArrayTexture:jy,CompressedCubeTexture:Qy,CompressedTexture:Kc,CompressedTextureLoader:OI,ComputeNode:gS,ConeGeometry:td,ConstNode:Wi,ConstantAlphaFactor:oy,ConstantColorFactor:sy,ContextNode:vg,Continue:wL,Controls:Vv,ConvertNode:$m,CubeCamera:Xh,CubeReflectionMapping:wi,CubeRefractionMapping:Vi,CubeTexture:so,CubeTextureLoader:VI,CubeTextureNode:GS,CubeUVReflectionMapping:hr,CubicBezierCurve:xm,CubicBezierCurve3:nv,CubicInterpolant:uv,CullFaceBack:sf,CullFaceFront:X_,CullFaceFrontBack:tA,CullFaceNone:W_,Curve:Gi,CurvePath:sv,CustomBlending:Uf,CustomToneMapping:cy,CylinderGeometry:co,Cylindrical:oP,DFGApprox:Hg,D_GGX:eb,Data3DTexture:Hh,DataArrayTexture:qc,DataTexture:Oi,DataTextureLoader:pv,DataUtils:By,DecrementStencilOp:_y,DecrementWrapStencilOp:vy,DefaultLoadingManager:Cm,DenoiseNode:nw,DepthFormat:Qs,DepthOfFieldNode:Jb,DepthStencilFormat:ar,DepthTexture:ao,DetachedBindMode:ly,DirectionalLight:yd,DirectionalLightHelper:Pv,DirectionalLightNode:Gw,Discard:bS,DiscreteInterpolant:hv,DisplayP3ColorSpace:kh,DodecahedronGeometry:nd,DotScreenNode:Kb,DoubleSide:Ji,DstAlphaFactor:Q_,DstColorFactor:ty,DynamicCopyUsage:fA,DynamicDrawUsage:Gr,DynamicReadUsage:hA,EPSILON:AM,EdgesGeometry:Sm,EllipseCurve:jh,EnvironmentNode:hb,EqualCompare:Ry,EqualDepth:dc,EqualStencilFunc:by,EquirectUVNode:YT,EquirectangularReflectionMapping:ir,EquirectangularRefractionMapping:sr,Euler:ui,EventDispatcher:Ai,ExpressionNode:TS,ExtrudeGeometry:Qc,FXAANode:iw,F_Schlick:pa,FileLoader:ts,FilmNode:Qb,Float16BufferAttribute:zy,Float32BufferAttribute:Ve,FloatType:Gn,Fn:U,Fog:om,FogExp2:Zh,FogExp2Node:xw,FogNode:Bd,FogRangeNode:gw,FramebufferTexture:fm,FrontFacingNode:LS,FrontSide:fs,Frustum:ga,FunctionCallNode:cM,FunctionNode:Yg,FunctionOverloadingNode:Cb,GLBufferAttribute:rP,GLSL1:gA,GLSL3:sh,GLSLNodeParser:Zw,GTAONode:tw,GaussianBlurNode:Xb,GreaterCompare:Iy,GreaterDepth:fc,GreaterEqualCompare:Ly,GreaterEqualDepth:pc,GreaterEqualStencilFunc:Ey,GreaterStencilFunc:Ay,GridHelper:Iv,Group:Hr,HalfFloatType:Ln,HemisphereLight:xd,HemisphereLightHelper:dP,HemisphereLightNode:qw,IESSpotLightNode:Ww,INFINITY:zP,IcosahedronGeometry:sd,If:Oe,ImageBitmapLoader:_v,ImageLoader:Dc,ImageUtils:Oy,IncrementStencilOp:xy,IncrementWrapStencilOp:yy,IndexNode:zt,InstanceNode:NT,InstancedBufferAttribute:Us,InstancedBufferGeometry:Lm,InstancedInterleavedBuffer:Bm,InstancedMesh:um,InstancedPointsNodeMaterial:zL,Int16BufferAttribute:e1,Int32BufferAttribute:t1,Int8BufferAttribute:KA,IntType:ma,InterleavedBuffer:_a,InterleavedBufferAttribute:Ds,Interpolant:Sa,InterpolateDiscrete:ia,InterpolateLinear:bc,InterpolateSmooth:Eu,InvertStencilOp:My,IrradianceNode:zT,JoinNode:Gv,KeepStencilOp:$s,KeyframeTrack:Hi,LOD:cm,LatheGeometry:jc,Layers:$c,LessCompare:jf,LessDepth:hc,LessEqualCompare:Qf,LessEqualDepth:nr,LessEqualStencilFunc:wy,LessStencilFunc:Ty,Light:fr,LightProbe:Pm,LightProbeNode:$w,LightingContextNode:VT,LightingModel:Ml,LightingNode:ho,LightsNode:UT,Line:Fs,Line2NodeMaterial:qL,Line3:Cv,LineBasicMaterial:Fn,LineBasicNodeMaterial:GL,LineCurve:_m,LineCurve3:iv,LineDashedMaterial:fd,LineDashedNodeMaterial:WL,LineLoop:dm,LineSegments:rs,LinearDisplayP3ColorSpace:Xc,LinearFilter:Ut,LinearInterpolant:Em,LinearMipMapLinearFilter:uy,LinearMipMapNearestFilter:rA,LinearMipmapLinearFilter:Jn,LinearMipmapNearestFilter:js,LinearSRGBColorSpace:li,LinearToneMapping:Ah,LinearTransfer:Ac,Loader:Xn,LoaderUtils:lh,LoadingManager:gd,Loop:mt,LoopNode:PT,LoopOnce:qf,LoopPingPong:hy,LoopRepeat:$f,LuminanceAlphaFormat:Wf,LuminanceFormat:Hf,Lut3DNode:ew,MOUSE:G_,MRTNode:Eb,MatcapUVNode:fb,Material:mn,MaterialLoader:sl,MaterialNode:j,MaterialReferenceNode:HS,MathUtils:Gh,Matrix2:zm,Matrix3:Ke,Matrix4:Fe,MaxEquation:Ff,MaxMipLevelNode:ES,Mesh:kt,MeshBasicMaterial:ss,MeshBasicNodeMaterial:t2,MeshDepthMaterial:Yh,MeshDistanceMaterial:sm,MeshLambertMaterial:pd,MeshLambertNodeMaterial:o2,MeshMatcapMaterial:Am,MeshMatcapNodeMaterial:W2,MeshNormalMaterial:dd,MeshNormalNodeMaterial:ZL,MeshPhongMaterial:hd,MeshPhongNodeMaterial:c2,MeshPhysicalMaterial:ud,MeshPhysicalNodeMaterial:pb,MeshSSSNodeMaterial:V2,MeshStandardMaterial:nl,MeshStandardNodeMaterial:db,MeshToonMaterial:wm,MeshToonNodeMaterial:G2,MinEquation:Y_,MirroredRepeatWrapping:ea,MixOperation:Of,ModelNode:is,ModelViewProjectionNode:bT,MorphNode:LT,MultiplyBlending:of,MultiplyOperation:fa,NearestFilter:Qt,NearestMipMapLinearFilter:sA,NearestMipMapNearestFilter:iA,NearestMipmapLinearFilter:Cs,NearestMipmapNearestFilter:Ph,NeutralToneMapping:Rh,NeverCompare:Cy,NeverDepth:lc,NeverStencilFunc:Sy,NoBlending:Fi,NoColorSpace:Li,NoToneMapping:Ti,Node:Ye,NodeAttribute:If,NodeBuilder:Ab,NodeCache:Lu,NodeCode:Tb,NodeFrame:Nb,NodeFunctionInput:Kg,NodeLoader:yb,NodeMaterial:Tt,NodeMaterialLoader:vb,NodeMaterialObserver:Bv,NodeObjectLoader:e3,NodeShaderStage:mf,NodeType:yP,NodeUniform:Mb,NodeUpdateType:We,NodeUtils:_P,NodeVar:Xg,NodeVarying:Sb,NormalAnimationBlendMode:zh,NormalBlending:Ps,NormalMapNode:ZS,NotEqualCompare:Py,NotEqualDepth:mc,NotEqualStencilFunc:Ny,NumberKeyframeTrack:aa,Object3D:yt,Object3DNode:wt,ObjectLoader:xv,ObjectSpaceNormalMap:Kf,OctahedronGeometry:va,OneFactor:J_,OneMinusConstantAlphaFactor:ay,OneMinusConstantColorFactor:ry,OneMinusDstAlphaFactor:ey,OneMinusDstColorFactor:ny,OneMinusSrcAlphaFactor:Vu,OneMinusSrcColorFactor:j_,OrthographicCamera:oo,OscNode:pn,OutputStructNode:jg,P3Primaries:Ec,PCFShadowMap:Lf,PCFSoftShadowMap:Df,PI:to,PI2:kP,PMREMGenerator:rh,PMREMNode:lb,ParallaxBarrierPassNode:hw,ParameterNode:qg,PassNode:bn,Path:Rc,PerspectiveCamera:hn,PhongLightingModel:kg,PhysicalLightingModel:Fd,PixelationPassNode:ow,Plane:cs,PlaneGeometry:ro,PlaneHelper:fP,PointLight:_d,PointLightHelper:uP,PointLightNode:kw,PointUVNode:Vb,Points:pm,PointsMaterial:ya,PointsNodeMaterial:q2,PolarGridHelper:pP,PolyhedronGeometry:dr,PositionalAudio:Mv,PosterizeNode:Gb,PropertyBinding:St,PropertyMixer:Sv,PropertyNode:Nt,QuadraticBezierCurve:ym,QuadraticBezierCurve3:vm,Quaternion:Qn,QuaternionKeyframeTrack:Ta,QuaternionLinearInterpolant:dv,RED_GREEN_RGTC2_Format:th,RED_RGTC1_Format:Xf,REVISION:Ks,RGBADepthPacking:Jf,RGBAFormat:Rn,RGBAIntegerFormat:Bh,RGBA_ASTC_10x10_Format:Ju,RGBA_ASTC_10x5_Format:$u,RGBA_ASTC_10x6_Format:Yu,RGBA_ASTC_10x8_Format:Zu,RGBA_ASTC_12x10_Format:Ku,RGBA_ASTC_12x12_Format:ju,RGBA_ASTC_4x4_Format:Mc,RGBA_ASTC_5x4_Format:ku,RGBA_ASTC_5x5_Format:Gu,RGBA_ASTC_6x5_Format:Hu,RGBA_ASTC_6x6_Format:Sc,RGBA_ASTC_8x5_Format:Wu,RGBA_ASTC_8x6_Format:Xu,RGBA_ASTC_8x8_Format:qu,RGBA_BPTC_Format:Ko,RGBA_ETC2_EAC_Format:vc,RGBA_PVRTC_2BPPV1_Format:zu,RGBA_PVRTC_4BPPV1_Format:xc,RGBA_S3TC_DXT1_Format:Yo,RGBA_S3TC_DXT3_Format:Zo,RGBA_S3TC_DXT5_Format:Jo,RGBDepthPacking:aA,RGBFormat:Oh,RGBIntegerFormat:oA,RGBShiftNode:jb,RGB_BPTC_SIGNED_Format:Qu,RGB_BPTC_UNSIGNED_Format:Tc,RGB_ETC1_Format:_c,RGB_ETC2_Format:yc,RGB_PVRTC_2BPPV1_Format:Bu,RGB_PVRTC_4BPPV1_Format:gc,RGB_S3TC_DXT1_Format:$o,RGDepthPacking:cA,RGFormat:na,RGIntegerFormat:Vh,RTTNode:Ub,RangeNode:_w,RawShaderMaterial:bm,Ray:io,Raycaster:Nv,Rec709Primaries:Nc,RectAreaLight:Im,RectAreaLightNode:Hw,RedFormat:Hc,RedIntegerFormat:Wc,ReferenceNode:ml,ReflectorNode:Db,ReinhardToneMapping:Nh,RemapNode:wg,RenderOutputNode:wS,RenderTarget:fn,RendererReferenceNode:lS,RepeatWrapping:rr,ReplaceStencilOp:gy,Return:qP,ReverseSubtractEquation:$_,RingGeometry:el,RotateNode:gb,SIGNED_RED_GREEN_RGTC2_Format:nh,SIGNED_RED_RGTC1_Format:eh,SRGBColorSpace:kn,SRGBTransfer:Vt,SSAAPassNode:aw,Scene:Jh,SceneNode:Qi,Schlick_to_F0:nb,ScreenNode:sn,ScriptableNode:mw,ScriptableValueNode:pw,SetNode:Hv,ShaderChunk:lt,ShaderLib:Pi,ShaderMaterial:ki,ShaderNode:ec,ShadowMaterial:ld,ShadowNodeMaterial:K2,Shape:er,ShapeGeometry:rd,ShapePath:Ov,ShapeUtils:ji,ShortType:kf,Skeleton:Jc,SkeletonHelper:lP,SkinnedMesh:lm,SkinningNode:Fg,SobelOperatorNode:Zb,Source:Js,Sphere:Dn,SphereGeometry:Ma,Spherical:Ev,SphericalHarmonics3:mv,SplineCurve:Mm,SplitNode:uh,SpotLight:il,SpotLightHelper:cP,SpotLightNode:l0,Sprite:am,SpriteMaterial:Zc,SpriteNodeMaterial:Y2,SpriteSheetUVNode:Rb,SrcAlphaFactor:Ou,SrcAlphaSaturateFactor:iy,SrcColorFactor:K_,StackNode:wb,StaticCopyUsage:pA,StaticDrawUsage:sa,StaticReadUsage:uA,StereoCamera:Dm,StereoPassNode:cw,StorageArrayElementNode:Ib,StorageBufferNode:t0,StorageTextureNode:Bb,StreamCopyUsage:mA,StreamDrawUsage:lA,StreamReadUsage:dA,StringKeyframeTrack:lo,SubtractEquation:q_,SubtractiveBlending:rf,TBNViewMatrix:qr,TOUCH:H_,TangentSpaceNormalMap:ms,TempNode:pt,TetrahedronGeometry:od,Texture:Xt,Texture3DNode:xb,TextureLoader:fv,TextureNode:gs,TextureSizeNode:NS,TextureUtils:OR,TimerNode:Sn,ToneMappingNode:hS,ToonOutlinePassNode:dw,TorusGeometry:tl,TorusKnotGeometry:ad,TransitionNode:rw,Triangle:Zn,TriangleFanDrawMode:fy,TriangleStripDrawMode:py,TrianglesDrawMode:dy,TriplanarTexturesNode:Pb,TubeGeometry:cd,UVMapping:Ih,Uint16BufferAttribute:Wh,Uint32BufferAttribute:tm,Uint8BufferAttribute:jA,Uint8ClampedBufferAttribute:QA,Uniform:wv,UniformArrayNode:Ig,UniformGroupNode:eg,UniformNode:uo,UniformsGroup:sP,UniformsLib:Se,UniformsUtils:nm,UnsignedByteType:es,UnsignedInt101111Type:Fh,UnsignedInt248Type:or,UnsignedInt5999Type:Uh,UnsignedIntType:Bi,UnsignedShort4444Type:Lh,UnsignedShort5551Type:Dh,UnsignedShortType:ta,UserDataNode:kb,VSMShadowMap:oi,V_GGX_SmithCorrelated:QT,VarNode:iS,VaryingNode:sS,Vector2:J,Vector3:E,Vector4:st,VectorKeyframeTrack:ca,VertexColorNode:Ob,VideoTexture:Ky,ViewportDepthNode:jn,ViewportDepthTextureNode:WT,ViewportSharedTextureNode:Hb,ViewportTextureNode:vl,VolumeNodeMaterial:Q2,WebGL3DRenderTarget:kA,WebGLArrayRenderTarget:zA,WebGLCoordinateSystem:Di,WebGLCubeRenderTarget:qh,WebGLMultipleRenderTargets:gP,WebGLRenderTarget:zi,WebGLRenderer:Yy,WebGLUtils:$y,WebGPUCoordinateSystem:Qr,WireframeGeometry:Tm,WrapAroundEnding:wc,ZeroCurvatureEnding:zr,ZeroFactor:Z_,ZeroSlopeEnding:kr,ZeroStencilOp:my,abs:Dt,acesFilmicToneMapping:Nw,acos:gh,add:Wt,addMethodChaining:te,addNodeElement:$P,afterImage:lD,agxToneMapping:Ew,all:hg,alphaT:dh,anaglyphPass:XD,anamorphic:mD,and:mM,anisotropy:Ys,anisotropyB:Jr,anisotropyT:tc,any:NM,ao:wD,append:Yv,arrayBuffer:FP,asin:LM,assign:aM,atan:DM,atan2:HM,atomicAdd:HU,atomicAnd:$U,atomicFunc:Os,atomicMax:XU,atomicMin:qU,atomicOr:YU,atomicStore:GU,atomicSub:WU,atomicXor:ZU,attenuationColor:ag,attenuationDistance:og,attribute:vn,backgroundBlurriness:K3,backgroundIntensity:j3,batch:RT,billboarding:fU,bitAnd:yM,bitNot:vM,bitOr:MM,bitXor:SM,bitangentGeometry:pL,bitangentLocal:fL,bitangentView:XS,bitangentWorld:mL,bitcast:GP,bleach:TU,bloom:DD,blur:cb,bool:cr,buffer:fl,bufferAttribute:dl,bumpMap:KS,burn:_U,bvec2:Kv,bvec3:Qm,bvec4:tM,bypass:vS,cache:ic,call:lM,cameraFar:Bo,cameraLogDepth:RS,cameraNear:Vo,cameraNormalMatrix:KP,cameraPosition:Ng,cameraProjectionMatrix:ci,cameraProjectionMatrixInverse:ZP,cameraViewMatrix:pi,cameraWorldMatrix:JP,cbrt:JM,ceil:fg,checker:JU,cineonToneMapping:Aw,clamp:cn,clearcoat:hh,clearcoatRoughness:zc,code:Od,color:Zv,colorSpaceToWorking:bg,colorToDirection:$L,compute:xS,cond:tS,context:Mg,convert:iM,convertToTexture:ei,cos:Mi,createCanvasElement:Fy,cross:Qo,cubeTexture:Cd,dFdx:OM,dFdy:VM,dashSize:Kr,defaultBuildStages:gf,defaultShaderStages:qm,defined:Oc,degrees:RM,denoise:ED,densityFog:jD,depth:Bg,depthPass:aD,difference:qM,diffuseColor:Ct,directionToColor:$T,dispersion:cg,distance:XM,div:ns,dodge:yU,dof:xD,dot:$t,dotScreen:_D,drawIndex:AT,dynamicBufferAttribute:mS,element:nM,emissive:yf,equal:uM,equals:EM,equirectUV:zg,exp:dg,exp2:mh,expression:lr,faceDirection:pl,faceForward:jM,film:vD,float:A,floor:gr,fog:JD,fract:xr,frameGroup:VP,frameId:F3,frontFacing:DS,fwidth:kM,fxaa:CD,gain:cU,gapSize:Gc,gaussianBlur:cD,getColorSpaceMethod:xh,getConstNodeType:$v,getCurrentStack:jm,getDirection:ob,getDistanceAttenuation:n0,getGeometryRoughness:jT,getRoughness:Gg,getShIrradianceAt:zw,getTextureIndex:Qg,global:Fu,glsl:r3,glslFn:o3,grayscale:uD,greaterThan:ug,greaterThanEqual:fM,hash:aU,highPrecisionModelNormalViewMatrix:cL,highPrecisionModelViewMatrix:aL,hue:pD,instance:ET,instanceIndex:yl,instancedBufferAttribute:_h,instancedDynamicBufferAttribute:vf,int:L,inverseSqrt:IM,invocationLocalIndex:TL,invocationSubgroupIndex:SL,ior:nc,iridescence:wd,iridescenceIOR:ng,iridescenceThickness:ig,ivec2:ls,ivec3:jv,ivec4:Qv,js:i3,label:nS,length:jr,lengthSq:xg,lessThan:dM,lessThanEqual:pM,lightPosition:s0,lightTargetDirection:r0,lightTargetPosition:yw,lightViewPosition:zd,lightingContext:BT,lights:FT,linearDepth:Sh,linearSRGBTosRGB:Tw,linearToneMapping:bw,localId:PU,log:pg,log2:al,loop:AL,luminance:En,lut3D:MD,mat2:ol,mat3:Tn,mat4:Zr,matcapUV:mb,materialAOMap:TT,materialAlphaTest:jS,materialAnisotropy:dT,materialAnisotropyVector:zo,materialAttenuationColor:vT,materialAttenuationDistance:yT,materialClearcoat:oT,materialClearcoatNormal:cT,materialClearcoatRoughness:aT,materialColor:ha,materialDispersion:ST,materialEmissive:eT,materialIOR:_T,materialIridescence:pT,materialIridescenceIOR:fT,materialIridescenceThickness:mT,materialLightMap:Ug,materialLineDashOffset:bf,materialLineDashSize:Lg,materialLineGapSize:Dg,materialLineScale:Mh,materialLineWidth:Pu,materialMetalness:sT,materialNormal:rT,materialOpacity:Pd,materialPointWidth:MT,materialReference:Ki,materialReflectivity:Iu,materialRefractionRatio:OS,materialRotation:lT,materialRoughness:iT,materialSheen:uT,materialSheenRoughness:hT,materialShininess:QS,materialSpecular:tT,materialSpecularColor:nT,materialSpecularIntensity:Tf,materialSpecularStrength:sc,materialThickness:xT,materialTransmission:gT,max:ft,maxMipLevel:CS,metalness:Bc,min:Mn,mix:it,mixElement:QM,mod:Ad,modInt:lg,modelDirection:iL,modelNormalMatrix:IS,modelPosition:sL,modelScale:rL,modelViewMatrix:xs,modelViewPosition:oL,modelViewProjection:wf,modelWorldMatrix:Ui,modelWorldMatrixInverse:PS,morphReference:DT,motionBlur:SU,mrt:Vd,mul:ot,mx_aastep:Ow,mx_cell_noise_float:sO,mx_contrast:KF,mx_fractal_noise_float:rO,mx_fractal_noise_vec2:oO,mx_fractal_noise_vec3:aO,mx_fractal_noise_vec4:cO,mx_hsvtorgb:GF,mx_noise_float:jF,mx_noise_vec3:QF,mx_noise_vec4:eO,mx_ramplr:XF,mx_ramptb:qF,mx_rgbtohsv:HF,mx_safepower:JF,mx_splitlr:$F,mx_splittb:YF,mx_srgb_texture_to_lin_rec709:WF,mx_transform_uv:ZF,mx_worley_noise_float:tO,mx_worley_noise_vec2:nO,mx_worley_noise_vec3:iO,negate:UM,neutralToneMapping:Cw,nodeArray:Yr,nodeImmutable:fe,nodeObject:H,nodeObjects:rl,nodeProxy:K,normalFlat:US,normalGeometry:Nd,normalLocal:hi,normalMap:Sf,normalView:di,normalWorld:Ed,normalize:vi,not:xM,notEqual:hM,numWorkgroups:RU,objectDirection:jP,objectGroup:rM,objectPosition:eL,objectScale:tL,objectViewPosition:nL,objectWorldMatrix:QP,oneMinus:FM,or:gM,orthographicDepthToViewZ:UL,oscSawtooth:z3,oscSine:O3,oscSquare:V3,oscTriangle:B3,output:sg,outputStruct:P3,overlay:MU,overloadingFn:On,parabola:Pf,parallaxBarrierPass:qD,parallaxDirection:$S,parallaxUV:xL,parameter:n3,pass:oD,passTexture:Na,pcurve:lU,perspectiveDepthToViewZ:Vg,pixelationPass:VD,pmremTexture:ub,pointUV:J3,pointWidth:BP,positionGeometry:Nn,positionLocal:en,positionPrevious:yh,positionView:Pn,positionViewDirection:Bt,positionWorld:vh,positionWorldDirection:Eg,posterize:iD,pow:Kn,pow2:gg,pow3:$M,pow4:YM,property:ai,radians:CM,rand:yg,range:QD,rangeFog:KD,reciprocal:zM,reference:dn,referenceBuffer:Mf,reflect:WM,reflectVector:zS,reflectView:VS,reflector:X3,refract:_g,refractVector:kS,refractView:BS,reinhardToneMapping:ww,remainder:wM,remap:MS,remapClamp:SS,renderGroup:_t,renderOutput:AS,rendererReference:uS,rgbShift:yD,rotate:Wg,rotateUV:dU,roughness:hs,round:BM,rtt:Fb,sRGBToLinearSRGB:Sw,sampler:YP,saturate:KM,saturation:hD,screen:vU,screenCoordinate:Aa,screenSize:da,screenUV:_r,scriptable:ZD,scriptableValue:Uu,select:In,sepia:bU,setCurrentStack:Vc,shaderStages:xf,sharedUniformGroup:tg,sheen:Xr,sheenRoughness:bd,shiftLeft:TM,shiftRight:bM,shininess:ph,sign:cl,sin:Cn,sinc:uU,skinning:bL,skinningReference:IT,smoothstep:ti,smoothstepElement:eS,sobel:gD,specularColor:ri,specularF90:kc,spherizeUV:pU,split:OP,spritesheetUV:k3,sqrt:os,ssaaPass:kD,stack:Du,step:ll,stereoPass:HD,storage:Q3,storageBarrier:FU,storageObject:eD,storageTexture:zb,string:UP,sub:Ft,subgroupIndex:ML,subgroupSize:LU,tan:PM,tangentGeometry:Id,tangentLocal:gl,tangentView:xl,tangentWorld:WS,temp:Sg,texture:xt,texture3D:_b,textureBarrier:OU,textureBicubic:rb,textureCubeUV:ab,textureLoad:Ci,textureSize:tr,textureStore:tD,thickness:rg,threshold:$b,timerDelta:U3,timerGlobal:D3,timerLocal:e0,toOutputColorSpace:rS,toWorkingColorSpace:oS,toneMapping:dS,toneMappingExposure:pS,toonOutlinePass:$D,transformDirection:ZM,transformNormal:FS,transformNormalToView:Rg,transformedBentNormalView:YS,transformedBitangentView:qS,transformedBitangentWorld:gL,transformedClearcoatNormalView:Xo,transformedNormalView:Yt,transformedNormalWorld:Cg,transformedTangentView:Pg,transformedTangentWorld:dL,transition:UD,transmission:fh,transpose:GM,tri:us,tri3:vw,triNoise3D:hU,triplanarTexture:H3,triplanarTextures:Lb,trunc:mg,tslFn:DP,uint:ve,uniform:pe,uniformArray:ds,uniformGroup:sM,uniforms:uL,userData:nD,uv:rt,uvec2:Jv,uvec3:wa,uvec4:eM,varying:Un,varyingProperty:Zi,vec2:z,vec3:D,vec4:oe,vectorComponents:ba,velocity:xU,vertexColor:Z3,vertexIndex:wT,vibrance:dD,viewZToOrthographicDepth:rc,viewZToPerspectiveDepth:XT,viewport:Ls,viewportBottomLeft:LL,viewportCoordinate:GT,viewportDepthTexture:Og,viewportLinearDepth:FL,viewportMipTexture:HT,viewportResolution:IL,viewportSafeUV:mU,viewportSharedTexture:sD,viewportSize:kT,viewportTexture:DL,viewportTopLeft:PL,viewportUV:RL,wgsl:s3,wgslFn:a3,workgroupArray:zU,workgroupBarrier:UU,workgroupId:IU,workingToColorSpace:aS,xor:_M},Symbol.toStringTag,{value:"Module"}));exports.ACESFilmicToneMapping=Eh;exports.AdditiveBlending=cc;exports.AgXToneMapping=Ch;exports.AlwaysDepth=uc;exports.AlwaysStencilFunc=ih;exports.AmbientLight=vd;exports.AnimationClip=la;exports.AnimationMixer=bv;exports.ArrayCamera=rm;exports.Audio=Fm;exports.AudioContext=Md;exports.AudioListener=vv;exports.AudioLoader=yv;exports.AxesHelper=Fv;exports.BackSide=ln;exports.BasicDepthPacking=Zf;exports.BasicNodeLibrary=Jw;exports.BatchedMesh=hm;exports.Bone=Kh;exports.BooleanKeyframeTrack=pr;exports.Box3=Hn;exports.Box3Helper=Uv;exports.BoxGeometry=_s;exports.BoxHelper=Dv;exports.BufferAttribute=At;exports.BufferGeometry=at;exports.Camera=Yc;exports.CameraHelper=Lv;exports.CanvasTexture=ev;exports.CatmullRomCurve3=gm;exports.ClampToEdgeWrapping=Si;exports.Clock=Um;exports.Color=_e;exports.ColorKeyframeTrack=md;exports.ColorManagement=gt;exports.CompressedArrayTexture=jy;exports.CompressedCubeTexture=Qy;exports.CompressedTexture=Kc;exports.Controls=Vv;exports.CubeCamera=Xh;exports.CubeTexture=so;exports.CubeUVReflectionMapping=hr;exports.Curve=Gi;exports.CustomBlending=Uf;exports.CylinderGeometry=co;exports.Data3DTexture=Hh;exports.DataTexture=Oi;exports.DataTextureLoader=pv;exports.DataUtils=By;exports.DecrementStencilOp=_y;exports.DecrementWrapStencilOp=vy;exports.DefaultLoadingManager=Cm;exports.DepthFormat=Qs;exports.DepthStencilFormat=ar;exports.DepthTexture=ao;exports.DirectionalLight=yd;exports.DirectionalLightHelper=Pv;exports.DoubleSide=Ji;exports.DynamicDrawUsage=Gr;exports.EdgesGeometry=Sm;exports.EqualDepth=dc;exports.EqualStencilFunc=by;exports.EquirectangularReflectionMapping=ir;exports.EquirectangularRefractionMapping=sr;exports.Euler=ui;exports.EventDispatcher=Ai;exports.ExtrudeGeometry=Qc;exports.FileLoader=ts;exports.Float32BufferAttribute=Ve;exports.FloatType=Gn;exports.Fog=om;exports.FrontSide=fs;exports.Frustum=ga;exports.GLSL3=sh;exports.GLSLNodeParser=Zw;exports.GreaterDepth=fc;exports.GreaterEqualDepth=pc;exports.GreaterEqualStencilFunc=Ey;exports.GreaterStencilFunc=Ay;exports.GridHelper=Iv;exports.Group=Hr;exports.HalfFloatType=Ln;exports.HemisphereLight=xd;exports.ImageBitmapLoader=_v;exports.IncrementStencilOp=xy;exports.IncrementWrapStencilOp=yy;exports.InstancedBufferAttribute=Us;exports.InstancedBufferGeometry=Lm;exports.InstancedInterleavedBuffer=Bm;exports.InstancedMesh=um;exports.InterleavedBuffer=_a;exports.InterleavedBufferAttribute=Ds;exports.Interpolant=Sa;exports.InterpolateDiscrete=ia;exports.InterpolateLinear=bc;exports.InvertStencilOp=My;exports.KeepStencilOp=$s;exports.KeyframeTrack=Hi;exports.LOD=cm;exports.Layers=$c;exports.LessDepth=hc;exports.LessEqualDepth=nr;exports.LessEqualStencilFunc=wy;exports.LessStencilFunc=Ty;exports.Line=Fs;exports.Line3=Cv;exports.LineBasicMaterial=Fn;exports.LineLoop=dm;exports.LineSegments=rs;exports.LinearFilter=Ut;exports.LinearMipmapLinearFilter=Jn;exports.LinearMipmapNearestFilter=js;exports.LinearSRGBColorSpace=li;exports.LinearToneMapping=Ah;exports.Loader=Xn;exports.LoaderUtils=lh;exports.LoadingManager=gd;exports.LoopOnce=qf;exports.LoopRepeat=$f;exports.MOUSE=G_;exports.Material=mn;exports.MathUtils=Gh;exports.Matrix3=Ke;exports.Matrix4=Fe;exports.MaxEquation=Ff;exports.Mesh=kt;exports.MeshBasicMaterial=ss;exports.MeshDepthMaterial=Yh;exports.MeshLambertMaterial=pd;exports.MeshNormalMaterial=dd;exports.MeshPhongMaterial=hd;exports.MeshPhysicalMaterial=ud;exports.MeshStandardMaterial=nl;exports.MirroredRepeatWrapping=ea;exports.NearestFilter=Qt;exports.NearestMipmapLinearFilter=Cs;exports.NearestMipmapNearestFilter=Ph;exports.NeutralToneMapping=Rh;exports.NeverDepth=lc;exports.NeverStencilFunc=Sy;exports.NoBlending=Fi;exports.NoColorSpace=Li;exports.NoToneMapping=Ti;exports.Node=Ye;exports.NodeBuilder=Ab;exports.NodeFrame=Nb;exports.NormalBlending=Ps;exports.NotEqualDepth=mc;exports.NotEqualStencilFunc=Ny;exports.NumberKeyframeTrack=aa;exports.Object3D=yt;exports.OctahedronGeometry=va;exports.OrthographicCamera=oo;exports.PCFSoftShadowMap$1=Df;exports.PMREMGenerator$1=rh;exports.PerspectiveCamera=hn;exports.Plane=cs;exports.PlaneGeometry=ro;exports.PointLight=_d;exports.Points=pm;exports.PointsMaterial=ya;exports.PositionalAudio=Mv;exports.PropertyBinding=St;exports.Quaternion=Qn;exports.QuaternionKeyframeTrack=Ta;exports.REVISION=Ks;exports.RGBADepthPacking=Jf;exports.RGBAFormat=Rn;exports.RGBA_ASTC_4x4_Format=Mc;exports.RGBA_ASTC_6x6_Format=Sc;exports.RGBA_BPTC_Format=Ko;exports.RGBA_ETC2_EAC_Format=vc;exports.RGBA_PVRTC_4BPPV1_Format=xc;exports.RGBA_S3TC_DXT1_Format=Yo;exports.RGBA_S3TC_DXT3_Format=Zo;exports.RGBA_S3TC_DXT5_Format=Jo;exports.RGBFormat=Oh;exports.RGB_BPTC_UNSIGNED_Format=Tc;exports.RGB_ETC1_Format=_c;exports.RGB_ETC2_Format=yc;exports.RGB_PVRTC_4BPPV1_Format=gc;exports.RGB_S3TC_DXT1_Format=$o;exports.RGFormat=na;exports.RawShaderMaterial=bm;exports.Ray=io;exports.Raycaster=Nv;exports.RedFormat=Hc;exports.ReinhardToneMapping=Nh;exports.RepeatWrapping=rr;exports.ReplaceStencilOp=gy;exports.RingGeometry=el;exports.SRGBColorSpace=kn;exports.Scene=Jh;exports.ShaderChunk=lt;exports.ShaderLib=Pi;exports.ShaderMaterial=ki;exports.ShadowMaterial=ld;exports.Shape=er;exports.ShapePath=Ov;exports.ShapeUtils=ji;exports.Skeleton=Jc;exports.SkinnedMesh=lm;exports.Source=Js;exports.Sphere=Dn;exports.SphereGeometry=Ma;exports.Spherical=Ev;exports.SpotLight=il;exports.Sprite=am;exports.SpriteMaterial=Zc;exports.THREE=gO;exports.TOUCH=H_;exports.Texture=Xt;exports.TextureLoader=fv;exports.TorusGeometry=tl;exports.Triangle=Zn;exports.TriangleFanDrawMode=fy;exports.TriangleStripDrawMode=py;exports.TrianglesDrawMode=dy;exports.Uint16BufferAttribute=Wh;exports.Uniform$1=wv;exports.UniformsLib=Se;exports.UniformsUtils=nm;exports.UnsignedByteType=es;exports.UnsignedInt101111Type=Fh;exports.UnsignedInt248Type=or;exports.UnsignedInt5999Type=Uh;exports.UnsignedIntType=Bi;exports.Vector2=J;exports.Vector3=E;exports.Vector4=st;exports.VectorKeyframeTrack=ca;exports.VideoTexture=Ky;exports.WebGLCubeRenderTarget=qh;exports.WebGLRenderTarget=zi;exports.WebGLRenderer=Yy;exports.WireframeGeometry=Tm;exports.ZeroStencilOp=my;exports.defaultShaderStages=qm;exports.normalView=di;
|
|
3870
|
+
`):e.addLineFlowCode(`${t}Barrier()`,this)}}const o0=K(DU),UU=()=>o0("workgroup").append(),FU=()=>o0("storage").append(),OU=()=>o0("texture").append();class VU extends mr{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let n;const i=e.context.assign;if(n=super.generate(e),i!==!0){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}class BU extends Ye{constructor(e,t,n=0){super(t),this.bufferType=t,this.bufferCount=n,this.isWorkgroupInfoNode=!0,this.scope=e}label(e){return this.name=e,this}getHash(){return this.uuid}setScope(e){return this.scope=e,this}getInputType(){return`${this.scope}Array`}element(e){return H(new VU(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}const zU=(s,e)=>H(new BU("Workgroup",s,e));class wn extends pt{static get type(){return"AtomicFunctionNode"}constructor(e,t,n,i=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.storeNode=i}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,n=this.getNodeType(e),i=this.getInputType(e),r=this.pointerNode,o=this.valueNode,a=[];a.push(`&${r.build(e,i)}`),a.push(o.build(e,i));const c=`${e.getMethod(t,n)}( ${a.join(", ")} )`;if(this.storeNode!==null){const l=this.storeNode.build(e,i);e.addLineFlowCode(`${l} = ${c}`,this)}else e.addLineFlowCode(c,this)}}wn.ATOMIC_LOAD="atomicLoad";wn.ATOMIC_STORE="atomicStore";wn.ATOMIC_ADD="atomicAdd";wn.ATOMIC_SUB="atomicSub";wn.ATOMIC_MAX="atomicMax";wn.ATOMIC_MIN="atomicMin";wn.ATOMIC_AND="atomicAnd";wn.ATOMIC_OR="atomicOr";wn.ATOMIC_XOR="atomicXor";const kU=K(wn),Os=(s,e,t,n)=>{const i=kU(s,e,t,n);return i.append(),i},GU=(s,e,t=null)=>Os(wn.ATOMIC_STORE,s,e,t),HU=(s,e,t=null)=>Os(wn.ATOMIC_ADD,s,e,t),WU=(s,e,t=null)=>Os(wn.ATOMIC_SUB,s,e,t),XU=(s,e,t=null)=>Os(wn.ATOMIC_MAX,s,e,t),qU=(s,e,t=null)=>Os(wn.ATOMIC_MIN,s,e,t),$U=(s,e,t=null)=>Os(wn.ATOMIC_AND,s,e,t),YU=(s,e,t=null)=>Os(wn.ATOMIC_OR,s,e,t),ZU=(s,e,t=null)=>Os(wn.ATOMIC_XOR,s,e,t),JU=U(([s=rt()])=>{const e=s.mul(2),t=e.x.floor(),n=e.y.floor();return t.add(n).mod(2).sign()}),ac=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=cr(s).toVar();return In(r,i,n)}).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),bh=U(([s,e])=>{const t=cr(e).toVar(),n=A(s).toVar();return In(t,n.negate(),n)}).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),rn=U(([s])=>{const e=A(s).toVar();return L(gr(e))}).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),Ht=U(([s,e])=>{const t=A(s).toVar();return e.assign(rn(t)),t.sub(A(e))}),KU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=A(n).toVar(),l=A(t).toVar(),u=A(e).toVar(),h=A(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),jU=U(([s,e,t,n,i,r])=>{const o=A(r).toVar(),a=A(i).toVar(),c=D(n).toVar(),l=D(t).toVar(),u=D(e).toVar(),h=D(s).toVar(),d=A(Ft(1,a)).toVar();return Ft(1,o).mul(h.mul(d).add(u.mul(a))).add(o.mul(l.mul(d).add(c.mul(a))))}).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),Rw=On([KU,jU]),QU=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=A(a).toVar(),x=A(o).toVar(),m=A(r).toVar(),g=A(i).toVar(),y=A(n).toVar(),_=A(t).toVar(),v=A(e).toVar(),I=A(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),eF=U(([s,e,t,n,i,r,o,a,c,l,u])=>{const h=A(u).toVar(),d=A(l).toVar(),p=A(c).toVar(),f=D(a).toVar(),x=D(o).toVar(),m=D(r).toVar(),g=D(i).toVar(),y=D(n).toVar(),_=D(t).toVar(),v=D(e).toVar(),I=D(s).toVar(),T=A(Ft(1,p)).toVar(),w=A(Ft(1,d)).toVar();return A(Ft(1,h)).toVar().mul(w.mul(I.mul(T).add(v.mul(p))).add(d.mul(_.mul(T).add(y.mul(p))))).add(h.mul(w.mul(g.mul(T).add(m.mul(p))).add(d.mul(x.mul(T).add(f.mul(p))))))}).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),Iw=On([QU,eF]),tF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=ve(s).toVar(),o=ve(r.bitAnd(ve(7))).toVar(),a=A(ac(o.lessThan(ve(4)),i,n)).toVar(),c=A(ot(2,ac(o.lessThan(ve(4)),n,i))).toVar();return bh(a,cr(o.bitAnd(ve(1)))).add(bh(c,cr(o.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),nF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=ve(s).toVar(),c=ve(a.bitAnd(ve(15))).toVar(),l=A(ac(c.lessThan(ve(8)),o,r)).toVar(),u=A(ac(c.lessThan(ve(4)),r,ac(c.equal(ve(12)).or(c.equal(ve(14))),o,i))).toVar();return bh(l,cr(c.bitAnd(ve(1)))).add(bh(u,cr(c.bitAnd(ve(2)))))}).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yn=On([tF,nF]),iF=U(([s,e,t])=>{const n=A(t).toVar(),i=A(e).toVar(),r=wa(s).toVar();return D(yn(r.x,i,n),yn(r.y,i,n),yn(r.z,i,n))}).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),sF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=A(e).toVar(),a=wa(s).toVar();return D(yn(a.x,o,r,i),yn(a.y,o,r,i),yn(a.z,o,r,i))}).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),Ri=On([iF,sF]),rF=U(([s])=>{const e=A(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),oF=U(([s])=>{const e=A(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),aF=U(([s])=>{const e=D(s).toVar();return ot(.6616,e)}).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Pw=On([rF,aF]),cF=U(([s])=>{const e=D(s).toVar();return ot(.982,e)}).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),Lw=On([oF,cF]),yi=U(([s,e])=>{const t=L(e).toVar(),n=ve(s).toVar();return n.shiftLeft(t).bitOr(n.shiftRight(L(32).sub(t)))}).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),Dw=U(([s,e,t])=>{s.subAssign(t),s.bitXorAssign(yi(t,L(4))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(6))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(8))),e.addAssign(s),s.subAssign(t),s.bitXorAssign(yi(t,L(16))),t.addAssign(e),e.subAssign(s),e.bitXorAssign(yi(s,L(19))),s.addAssign(t),t.subAssign(e),t.bitXorAssign(yi(e,L(4))),e.addAssign(s)}),Sl=U(([s,e,t])=>{const n=ve(t).toVar(),i=ve(e).toVar(),r=ve(s).toVar();return n.bitXorAssign(i),n.subAssign(yi(i,L(14))),r.bitXorAssign(n),r.subAssign(yi(n,L(11))),i.bitXorAssign(r),i.subAssign(yi(r,L(25))),n.bitXorAssign(i),n.subAssign(yi(i,L(16))),r.bitXorAssign(n),r.subAssign(yi(n,L(4))),i.bitXorAssign(r),i.subAssign(yi(r,L(14))),n.bitXorAssign(i),n.subAssign(yi(i,L(24))),n}).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),Wn=U(([s])=>{const e=ve(s).toVar();return A(e).div(A(ve(L(4294967295))))}).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),ps=U(([s])=>{const e=A(s).toVar();return e.mul(e).mul(e).mul(e.mul(e.mul(6).sub(15)).add(10))}).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),lF=U(([s])=>{const e=L(s).toVar(),t=ve(ve(1)).toVar(),n=ve(ve(L(3735928559)).add(t.shiftLeft(ve(2))).add(ve(13))).toVar();return Sl(n.add(ve(e)),n,n)}).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),uF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(ve(2)).toVar(),r=ve().toVar(),o=ve().toVar(),a=ve().toVar();return r.assign(o.assign(a.assign(ve(L(3735928559)).add(i.shiftLeft(ve(2))).add(ve(13))))),r.addAssign(ve(n)),o.addAssign(ve(t)),Sl(r,o,a)}).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),hF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(ve(3)).toVar(),a=ve().toVar(),c=ve().toVar(),l=ve().toVar();return a.assign(c.assign(l.assign(ve(L(3735928559)).add(o.shiftLeft(ve(2))).add(ve(13))))),a.addAssign(ve(r)),c.addAssign(ve(i)),l.addAssign(ve(n)),Sl(a,c,l)}).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),dF=U(([s,e,t,n])=>{const i=L(n).toVar(),r=L(t).toVar(),o=L(e).toVar(),a=L(s).toVar(),c=ve(ve(4)).toVar(),l=ve().toVar(),u=ve().toVar(),h=ve().toVar();return l.assign(u.assign(h.assign(ve(L(3735928559)).add(c.shiftLeft(ve(2))).add(ve(13))))),l.addAssign(ve(a)),u.addAssign(ve(o)),h.addAssign(ve(r)),Dw(l,u,h),l.addAssign(ve(i)),Sl(l,u,h)}).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),pF=U(([s,e,t,n,i])=>{const r=L(i).toVar(),o=L(n).toVar(),a=L(t).toVar(),c=L(e).toVar(),l=L(s).toVar(),u=ve(ve(5)).toVar(),h=ve().toVar(),d=ve().toVar(),p=ve().toVar();return h.assign(d.assign(p.assign(ve(L(3735928559)).add(u.shiftLeft(ve(2))).add(ve(13))))),h.addAssign(ve(l)),d.addAssign(ve(c)),p.addAssign(ve(a)),Dw(h,d,p),h.addAssign(ve(o)),d.addAssign(ve(r)),Sl(h,d,p)}).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),Pt=On([lF,uF,hF,dF,pF]),fF=U(([s,e])=>{const t=L(e).toVar(),n=L(s).toVar(),i=ve(Pt(n,t)).toVar(),r=wa().toVar();return r.x.assign(i.bitAnd(L(255))),r.y.assign(i.shiftRight(L(8)).bitAnd(L(255))),r.z.assign(i.shiftRight(L(16)).bitAnd(L(255))),r}).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),mF=U(([s,e,t])=>{const n=L(t).toVar(),i=L(e).toVar(),r=L(s).toVar(),o=ve(Pt(r,i,n)).toVar(),a=wa().toVar();return a.x.assign(o.bitAnd(L(255))),a.y.assign(o.shiftRight(L(8)).bitAnd(L(255))),a.z.assign(o.shiftRight(L(16)).bitAnd(L(255))),a}).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),Ii=On([fF,mF]),gF=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=A(Rw(yn(Pt(t,n),i,r),yn(Pt(t.add(L(1)),n),i.sub(1),r),yn(Pt(t,n.add(L(1))),i,r.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),xF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=A(Iw(yn(Pt(t,n,i),r,o,a),yn(Pt(t.add(L(1)),n,i),r.sub(1),o,a),yn(Pt(t,n.add(L(1)),i),r,o.sub(1),a),yn(Pt(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),yn(Pt(t,n,i.add(L(1))),r,o,a.sub(1)),yn(Pt(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),yn(Pt(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),yn(Pt(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),a0=On([gF,xF]),_F=U(([s])=>{const e=z(s).toVar(),t=L().toVar(),n=L().toVar(),i=A(Ht(e.x,t)).toVar(),r=A(Ht(e.y,n)).toVar(),o=A(ps(i)).toVar(),a=A(ps(r)).toVar(),c=D(Rw(Ri(Ii(t,n),i,r),Ri(Ii(t.add(L(1)),n),i.sub(1),r),Ri(Ii(t,n.add(L(1))),i,r.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1))),i.sub(1),r.sub(1)),o,a)).toVar();return Pw(c)}).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),yF=U(([s])=>{const e=D(s).toVar(),t=L().toVar(),n=L().toVar(),i=L().toVar(),r=A(Ht(e.x,t)).toVar(),o=A(Ht(e.y,n)).toVar(),a=A(Ht(e.z,i)).toVar(),c=A(ps(r)).toVar(),l=A(ps(o)).toVar(),u=A(ps(a)).toVar(),h=D(Iw(Ri(Ii(t,n,i),r,o,a),Ri(Ii(t.add(L(1)),n,i),r.sub(1),o,a),Ri(Ii(t,n.add(L(1)),i),r,o.sub(1),a),Ri(Ii(t.add(L(1)),n.add(L(1)),i),r.sub(1),o.sub(1),a),Ri(Ii(t,n,i.add(L(1))),r,o,a.sub(1)),Ri(Ii(t.add(L(1)),n,i.add(L(1))),r.sub(1),o,a.sub(1)),Ri(Ii(t,n.add(L(1)),i.add(L(1))),r,o.sub(1),a.sub(1)),Ri(Ii(t.add(L(1)),n.add(L(1)),i.add(L(1))),r.sub(1),o.sub(1),a.sub(1)),c,l,u)).toVar();return Lw(h)}).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),c0=On([_F,yF]),vF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return Wn(Pt(t))}).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),MF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return Wn(Pt(t,n))}).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),SF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return Wn(Pt(t,n,i))}).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),TF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return Wn(Pt(t,n,i,r))}).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),bF=On([vF,MF,SF,TF]),wF=U(([s])=>{const e=A(s).toVar(),t=L(rn(e)).toVar();return D(Wn(Pt(t,L(0))),Wn(Pt(t,L(1))),Wn(Pt(t,L(2))))}).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),AF=U(([s])=>{const e=z(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar();return D(Wn(Pt(t,n,L(0))),Wn(Pt(t,n,L(1))),Wn(Pt(t,n,L(2))))}).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),NF=U(([s])=>{const e=D(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar();return D(Wn(Pt(t,n,i,L(0))),Wn(Pt(t,n,i,L(1))),Wn(Pt(t,n,i,L(2))))}).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),EF=U(([s])=>{const e=oe(s).toVar(),t=L(rn(e.x)).toVar(),n=L(rn(e.y)).toVar(),i=L(rn(e.z)).toVar(),r=L(rn(e.w)).toVar();return D(Wn(Pt(t,n,i,r,L(0))),Wn(Pt(t,n,i,r,L(1))),Wn(Pt(t,n,i,r,L(2))))}).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),Uw=On([wF,AF,NF,EF]),wh=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=A(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(a0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),Fw=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(0).toVar(),l=A(1).toVar();return mt(o,()=>{c.addAssign(l.mul(c0(a))),l.mulAssign(i),a.mulAssign(r)}),c}).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar();return z(wh(a,o,r,i),wh(a.add(D(L(19),L(193),L(17))),o,r,i))}).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),RF=U(([s,e,t,n])=>{const i=A(n).toVar(),r=A(t).toVar(),o=L(e).toVar(),a=D(s).toVar(),c=D(Fw(a,o,r,i)).toVar(),l=A(wh(a.add(D(L(19),L(193),L(17))),o,r,i)).toVar();return oe(c,l)}).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IF=U(([s,e,t,n,i,r,o])=>{const a=L(o).toVar(),c=A(r).toVar(),l=L(i).toVar(),u=L(n).toVar(),h=L(t).toVar(),d=L(e).toVar(),p=z(s).toVar(),f=D(Uw(z(d.add(u),h.add(l)))).toVar(),x=z(f.x,f.y).toVar();x.subAssign(.5),x.mulAssign(c),x.addAssign(.5);const m=z(z(A(d),A(h)).add(x)).toVar(),g=z(m.sub(p)).toVar();return Oe(a.equal(L(2)),()=>Dt(g.x).add(Dt(g.y))),Oe(a.equal(L(3)),()=>ft(Dt(g.x),Dt(g.y))),$t(g,g)}).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),PF=U(([s,e,t,n,i,r,o,a,c])=>{const l=L(c).toVar(),u=A(a).toVar(),h=L(o).toVar(),d=L(r).toVar(),p=L(i).toVar(),f=L(n).toVar(),x=L(t).toVar(),m=L(e).toVar(),g=D(s).toVar(),y=D(Uw(D(m.add(p),x.add(d),f.add(h)))).toVar();y.subAssign(.5),y.mulAssign(u),y.addAssign(.5);const _=D(D(A(m),A(x),A(f)).add(y)).toVar(),v=D(_.sub(g)).toVar();return Oe(l.equal(L(2)),()=>Dt(v.x).add(Dt(v.y)).add(Dt(v.z))),Oe(l.equal(L(3)),()=>ft(ft(Dt(v.x),Dt(v.y)),Dt(v.z))),$t(v,v)}).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),Ea=On([IF,PF]),LF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();l.assign(Mn(l,d))})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.y.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=z(s).toVar(),o=L().toVar(),a=L().toVar(),c=z(Ht(r.x,o),Ht(r.y,a)).toVar(),l=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:u})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:h})=>{const d=A(Ea(c,u,h,o,a,i,n)).toVar();Oe(d.lessThan(l.x),()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(d)}).ElseIf(d.lessThan(l.y),()=>{l.z.assign(l.y),l.y.assign(d)}).ElseIf(d.lessThan(l.z),()=>{l.z.assign(d)})})}),Oe(n.equal(L(0)),()=>{l.assign(os(l))}),l}).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),FF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=A(1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();u.assign(Mn(u,f))})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OF=On([LF,FF]),VF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=z(1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.y.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),BF=On([DF,VF]),zF=U(([s,e,t])=>{const n=L(t).toVar(),i=A(e).toVar(),r=D(s).toVar(),o=L().toVar(),a=L().toVar(),c=L().toVar(),l=D(Ht(r.x,o),Ht(r.y,a),Ht(r.z,c)).toVar(),u=D(1e6,1e6,1e6).toVar();return mt({start:-1,end:L(1),name:"x",condition:"<="},({x:h})=>{mt({start:-1,end:L(1),name:"y",condition:"<="},({y:d})=>{mt({start:-1,end:L(1),name:"z",condition:"<="},({z:p})=>{const f=A(Ea(l,h,d,p,o,a,c,i,n)).toVar();Oe(f.lessThan(u.x),()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(f)}).ElseIf(f.lessThan(u.y),()=>{u.z.assign(u.y),u.y.assign(f)}).ElseIf(f.lessThan(u.z),()=>{u.z.assign(f)})})})}),Oe(n.equal(L(0)),()=>{u.assign(os(u))}),u}).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kF=On([UF,zF]),GF=U(([s])=>{const e=s.y,t=s.z,n=D().toVar();return Oe(e.lessThan(1e-4),()=>{n.assign(D(t,t,t))}).Else(()=>{let i=s.x;i=i.sub(gr(i)).mul(6).toVar();const r=L(mg(i)),o=i.sub(A(r)),a=t.mul(e.oneMinus()),c=t.mul(e.mul(o).oneMinus()),l=t.mul(e.mul(o.oneMinus()).oneMinus());Oe(r.equal(L(0)),()=>{n.assign(D(t,l,a))}).ElseIf(r.equal(L(1)),()=>{n.assign(D(c,t,a))}).ElseIf(r.equal(L(2)),()=>{n.assign(D(a,t,l))}).ElseIf(r.equal(L(3)),()=>{n.assign(D(a,c,t))}).ElseIf(r.equal(L(4)),()=>{n.assign(D(l,a,t))}).Else(()=>{n.assign(D(t,a,c))})}),n}).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),HF=U(([s])=>{const e=D(s).toVar(),t=A(e.x).toVar(),n=A(e.y).toVar(),i=A(e.z).toVar(),r=A(Mn(t,Mn(n,i))).toVar(),o=A(ft(t,ft(n,i))).toVar(),a=A(o.sub(r)).toVar(),c=A().toVar(),l=A().toVar(),u=A().toVar();return u.assign(o),Oe(o.greaterThan(0),()=>{l.assign(a.div(o))}).Else(()=>{l.assign(0)}),Oe(l.lessThanEqual(0),()=>{c.assign(0)}).Else(()=>{Oe(t.greaterThanEqual(o),()=>{c.assign(n.sub(i).div(a))}).ElseIf(n.greaterThanEqual(o),()=>{c.assign(Wt(2,i.sub(t).div(a)))}).Else(()=>{c.assign(Wt(4,t.sub(n).div(a)))}),c.mulAssign(1/6),Oe(c.lessThan(0),()=>{c.addAssign(1)})}),D(c,l,u)}).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),WF=U(([s])=>{const e=D(s).toVar(),t=Qm(ug(e,D(.04045))).toVar(),n=D(e.div(12.92)).toVar(),i=D(Kn(ft(e.add(D(.055)),D(0)).div(1.055),D(2.4))).toVar();return it(n,i,t)}).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Ow=(s,e)=>{s=A(s),e=A(e);const t=z(e.dFdx(),e.dFdy()).length().mul(.7071067811865476);return ti(s.sub(t),s.add(t),e)},Vw=(s,e,t,n)=>it(s,e,t[n].clamp()),XF=(s,e,t=rt())=>Vw(s,e,t,"x"),qF=(s,e,t=rt())=>Vw(s,e,t,"y"),Bw=(s,e,t,n,i)=>it(s,e,Ow(t,n[i])),$F=(s,e,t,n=rt())=>Bw(s,e,t,n,"x"),YF=(s,e,t,n=rt())=>Bw(s,e,t,n,"y"),ZF=(s=1,e=0,t=rt())=>t.mul(s).add(e),JF=(s,e=1)=>(s=A(s),s.abs().pow(e).mul(s.sign())),KF=(s,e=1,t=.5)=>A(s).sub(t).mul(e).add(t),jF=(s=rt(),e=1,t=0)=>a0(s.convert("vec2|vec3")).mul(e).add(t),QF=(s=rt(),e=1,t=0)=>c0(s.convert("vec2|vec3")).mul(e).add(t),eO=(s=rt(),e=1,t=0)=>(s=s.convert("vec2|vec3"),oe(c0(s),a0(s.add(z(19,73)))).mul(e).add(t)),tO=(s=rt(),e=1)=>OF(s.convert("vec2|vec3"),e,L(1)),nO=(s=rt(),e=1)=>BF(s.convert("vec2|vec3"),e,L(1)),iO=(s=rt(),e=1)=>kF(s.convert("vec2|vec3"),e,L(1)),sO=(s=rt())=>bF(s.convert("vec2|vec3")),rO=(s=rt(),e=3,t=2,n=.5,i=1)=>wh(s,L(e),t,n).mul(i),oO=(s=rt(),e=3,t=2,n=.5,i=1)=>CF(s,L(e),t,n).mul(i),aO=(s=rt(),e=3,t=2,n=.5,i=1)=>Fw(s,L(e),t,n).mul(i),cO=(s=rt(),e=3,t=2,n=.5,i=1)=>RF(s,L(e),t,n).mul(i),zw=U(([s,e])=>{const t=s.x,n=s.y,i=s.z;let r=e.element(0).mul(.886227);return r=r.add(e.element(1).mul(2*.511664).mul(n)),r=r.add(e.element(2).mul(2*.511664).mul(i)),r=r.add(e.element(3).mul(2*.511664).mul(t)),r=r.add(e.element(4).mul(2*.429043).mul(t).mul(n)),r=r.add(e.element(5).mul(2*.429043).mul(n).mul(i)),r=r.add(e.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),r=r.add(e.element(7).mul(2*.429043).mul(t).mul(i)),r=r.add(e.element(8).mul(.429043).mul(ot(t,t).sub(ot(n,n)))),r});class kw extends yr{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setup(e){const{colorNode:t,cutoffDistanceNode:n,decayExponentNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r).sub(Pn),c=a.normalize(),l=a.length(),u=n0({lightDistance:l,cutoffDistance:n,decayExponent:i}),h=t.mul(u),d=e.context.reflectedLight;o.direct({lightDirection:c,lightColor:h,reflectedLight:d},e.stack,e)}}class Gw extends yr{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setup(e){super.setup(e);const t=e.context.lightingModel,n=this.colorNode,i=r0(this.light),r=e.context.reflectedLight;t.direct({lightDirection:i,lightColor:n,reflectedLight:r},e.stack,e)}}const nf=new Fe,Nu=new Fe;let Ya=null;class Hw extends yr{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=pe(new E).setGroup(_t),this.halfWidth=pe(new E).setGroup(_t)}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;Nu.identity(),nf.copy(t.matrixWorld),nf.premultiply(n),Nu.extractRotation(nf),this.halfWidth.value.set(t.width*.5,0,0),this.halfHeight.value.set(0,t.height*.5,0),this.halfWidth.value.applyMatrix4(Nu),this.halfHeight.value.applyMatrix4(Nu)}setup(e){super.setup(e);let t,n;e.isAvailable("float32Filterable")?(t=xt(Ya.LTC_FLOAT_1),n=xt(Ya.LTC_FLOAT_2)):(t=xt(Ya.LTC_HALF_1),n=xt(Ya.LTC_HALF_2));const{colorNode:i,light:r}=this,o=e.context.lightingModel,a=zd(r),c=e.context.reflectedLight;o.directRectArea({lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:c,ltc_1:t,ltc_2:n},e.stack,e)}static setLTC(e){Ya=e}}class l0 extends yr{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=pe(0).setGroup(_t),this.penumbraCosNode=pe(0).setGroup(_t),this.cutoffDistanceNode=pe(0).setGroup(_t),this.decayExponentNode=pe(0).setGroup(_t)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e){const{coneCosNode:t,penumbraCosNode:n}=this;return ti(t,n,e)}setup(e){super.setup(e);const t=e.context.lightingModel,{colorNode:n,cutoffDistanceNode:i,decayExponentNode:r,light:o}=this,a=zd(o).sub(Pn),c=a.normalize(),l=c.dot(r0(o)),u=this.getSpotAttenuation(l),h=a.length(),d=n0({lightDistance:h,cutoffDistance:i,decayExponent:r}),p=n.mul(u).mul(d),f=e.context.reflectedLight;t.direct({lightDirection:c,lightColor:p,reflectedLight:f},e.stack,e)}}class Ww extends l0{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e){const t=this.light.iesMap;let n=null;if(t&&t.isTexture===!0){const i=e.acos().mul(1/Math.PI);n=xt(t,z(i,0),0).r}else n=super.getSpotAttenuation(e);return n}}class Xw extends yr{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class qw extends yr{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=s0(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=pe(new _e).setGroup(_t)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:i}=this,o=di.dot(i).mul(.5).add(.5),a=it(n,t,o);e.context.irradiance.addAssign(a)}}class $w extends yr{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let n=0;n<9;n++)t.push(new E);this.lightProbe=ds(t)}update(e){const{light:t}=this;super.update(e);for(let n=0;n<9;n++)this.lightProbe.array[n].copy(t.sh.coefficients[n]).multiplyScalar(t.intensity)}setup(e){const t=zw(Ed,this.lightProbe);e.context.irradiance.addAssign(t)}}class lO{parseFunction(){console.warn("Abstract function.")}}class Yw{constructor(e,t,n="",i=""){this.type=e,this.inputs=t,this.name=n,this.precision=i}getCode(){console.warn("Abstract function.")}}Yw.isNodeFunction=!0;const uO=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,hO=/[a-z_0-9]+/ig,k_="#pragma main",dO=s=>{s=s.trim();const e=s.indexOf(k_),t=e!==-1?s.slice(e+k_.length):s,n=t.match(uO);if(n!==null&&n.length===5){const i=n[4],r=[];let o=null;for(;(o=hO.exec(i))!==null;)r.push(o);const a=[];let c=0;for(;c<r.length;){const f=r[c][0]==="const";f===!0&&c++;let x=r[c][0];x==="in"||x==="out"||x==="inout"?c++:x="";const m=r[c++][0];let g=Number.parseInt(r[c][0]);Number.isNaN(g)===!1?c++:g=null;const y=r[c++][0];a.push(new Kg(m,y,g,x,f))}const l=t.substring(n[0].length),u=n[3]!==void 0?n[3]:"",h=n[2],d=n[1]!==void 0?n[1]:"",p=e!==-1?s.slice(0,e):"";return{type:h,inputs:a,name:u,precision:d,inputsCode:i,blockCode:l,headerCode:p}}else throw new Error("FunctionNode: Function is not a GLSL code.")};class pO extends Yw{constructor(e){const{type:t,inputs:n,name:i,precision:r,inputsCode:o,blockCode:a,headerCode:c}=dO(e);super(t,n,i,r),this.inputsCode=o,this.blockCode=a,this.headerCode=c}getCode(e=this.name){let t;const n=this.blockCode;if(n!==""){const{type:i,inputsCode:r,headerCode:o,precision:a}=this;let c=`${i} ${e} ( ${r.trim()} )`;a!==""&&(c=`${a} ${c}`),t=o+c+n}else t="";return t}}class Zw extends lO{parseFunction(e){return new pO(e)}}class fO{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(n!==null){t=new n;for(const i in e)t[i]=e[i]}return t}addColorSpace(e,t){this.addType(e,t,this.colorSpaceNodes)}getColorSpaceFunction(e){return this.colorSpaceNodes.get(e)||null}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t.name,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t=="function"||typeof t=="object")throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}addClass(e,t,n){if(n.has(t)){console.warn(`Redefinition of node ${t.name}`);return}if(typeof e!="function")throw new Error(`Node class ${e.name} is not a class.`);if(typeof t!="function")throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}class mO extends il{constructor(e,t,n,i,r,o){super(e,t,n,i,r,o),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class Jw extends fO{constructor(){super(),this.addLight(kw,_d),this.addLight(Gw,yd),this.addLight(Hw,Im),this.addLight(l0,il),this.addLight(Xw,vd),this.addLight(qw,xd),this.addLight($w,Pm),this.addLight(Ww,mO),this.addToneMapping(bw,Ah),this.addToneMapping(ww,Nh),this.addToneMapping(Aw,Bf),this.addToneMapping(Nw,Eh),this.addToneMapping(Ew,Ch),this.addToneMapping(Cw,Rh),this.addColorSpace(Tw,xh(li,kn)),this.addColorSpace(Sw,xh(kn,li))}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ks}}));if(typeof window<"u"){try{typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-Bf2NBxAw.umd.cjs",document.baseURI).href,window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("three-Bf2NBxAw.umd.cjs",document.baseURI).href,revision:Ks})}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Ks),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Ks}const gO=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Eh,AONode:OT,AddEquation:Zs,AddOperation:Vf,AdditiveAnimationBlendMode:Yf,AdditiveBlending:cc,AfterImageNode:qb,AgXToneMapping:Ch,AlphaFormat:Gf,AlwaysCompare:Dy,AlwaysDepth:uc,AlwaysStencilFunc:ih,AmbientLight:vd,AmbientLightNode:Xw,AnaglyphPassNode:uw,AnalyticLightNode:yr,AnamorphicNode:Yb,AnimationAction:Tv,AnimationClip:la,AnimationLoader:FI,AnimationMixer:bv,AnimationObjectGroup:tP,AnimationUtils:PI,ArcCurve:tv,ArrayCamera:rm,ArrayElementNode:mr,ArrowHelper:mP,AssignNode:oM,AttachedBindMode:af,AttributeNode:Ag,Audio:Fm,AudioAnalyser:XI,AudioContext:Md,AudioListener:vv,AudioLoader:yv,AxesHelper:Fv,BRDF_GGX:Af,BRDF_Lambert:no,BackSide:ln,BasicDepthPacking:Zf,BasicEnvironmentNode:Dd,BasicNodeLibrary:Jw,BasicShadowMap:nA,BatchNode:CT,BatchedMesh:hm,BloomNode:sw,Bone:Kh,BooleanKeyframeTrack:pr,Box2:aP,Box3:Hn,Box3Helper:Uv,BoxGeometry:_s,BoxHelper:Dv,Break:Ld,BufferAttribute:At,BufferAttributeNode:fS,BufferGeometry:at,BufferGeometryLoader:gv,BufferNode:Rd,BumpMapNode:JS,BypassNode:yS,ByteType:zf,Cache:Rs,CacheNode:_S,Camera:Yc,CameraHelper:Lv,CanvasTexture:ev,CapsuleGeometry:Qh,CatmullRomCurve3:gm,CineonToneMapping:Bf,CircleGeometry:ed,ClampToEdgeWrapping:Si,Clock:Um,CodeNode:$g,Color:_e,ColorKeyframeTrack:md,ColorManagement:gt,ColorSpaceNode:hl,CompressedArrayTexture:jy,CompressedCubeTexture:Qy,CompressedTexture:Kc,CompressedTextureLoader:OI,ComputeNode:gS,ConeGeometry:td,ConstNode:Wi,ConstantAlphaFactor:oy,ConstantColorFactor:sy,ContextNode:vg,Continue:wL,Controls:Vv,ConvertNode:$m,CubeCamera:Xh,CubeReflectionMapping:wi,CubeRefractionMapping:Vi,CubeTexture:so,CubeTextureLoader:VI,CubeTextureNode:GS,CubeUVReflectionMapping:hr,CubicBezierCurve:xm,CubicBezierCurve3:nv,CubicInterpolant:uv,CullFaceBack:sf,CullFaceFront:X_,CullFaceFrontBack:tA,CullFaceNone:W_,Curve:Gi,CurvePath:sv,CustomBlending:Uf,CustomToneMapping:cy,CylinderGeometry:co,Cylindrical:oP,DFGApprox:Hg,D_GGX:eb,Data3DTexture:Hh,DataArrayTexture:qc,DataTexture:Oi,DataTextureLoader:pv,DataUtils:By,DecrementStencilOp:_y,DecrementWrapStencilOp:vy,DefaultLoadingManager:Cm,DenoiseNode:nw,DepthFormat:Qs,DepthOfFieldNode:Jb,DepthStencilFormat:ar,DepthTexture:ao,DetachedBindMode:ly,DirectionalLight:yd,DirectionalLightHelper:Pv,DirectionalLightNode:Gw,Discard:bS,DiscreteInterpolant:hv,DisplayP3ColorSpace:kh,DodecahedronGeometry:nd,DotScreenNode:Kb,DoubleSide:Ji,DstAlphaFactor:Q_,DstColorFactor:ty,DynamicCopyUsage:fA,DynamicDrawUsage:Gr,DynamicReadUsage:hA,EPSILON:AM,EdgesGeometry:Sm,EllipseCurve:jh,EnvironmentNode:hb,EqualCompare:Ry,EqualDepth:dc,EqualStencilFunc:by,EquirectUVNode:YT,EquirectangularReflectionMapping:ir,EquirectangularRefractionMapping:sr,Euler:ui,EventDispatcher:Ai,ExpressionNode:TS,ExtrudeGeometry:Qc,FXAANode:iw,F_Schlick:pa,FileLoader:ts,FilmNode:Qb,Float16BufferAttribute:zy,Float32BufferAttribute:Ve,FloatType:Gn,Fn:U,Fog:om,FogExp2:Zh,FogExp2Node:xw,FogNode:Bd,FogRangeNode:gw,FramebufferTexture:fm,FrontFacingNode:LS,FrontSide:fs,Frustum:ga,FunctionCallNode:cM,FunctionNode:Yg,FunctionOverloadingNode:Cb,GLBufferAttribute:rP,GLSL1:gA,GLSL3:sh,GLSLNodeParser:Zw,GTAONode:tw,GaussianBlurNode:Xb,GreaterCompare:Iy,GreaterDepth:fc,GreaterEqualCompare:Ly,GreaterEqualDepth:pc,GreaterEqualStencilFunc:Ey,GreaterStencilFunc:Ay,GridHelper:Iv,Group:Hr,HalfFloatType:Ln,HemisphereLight:xd,HemisphereLightHelper:dP,HemisphereLightNode:qw,IESSpotLightNode:Ww,INFINITY:zP,IcosahedronGeometry:sd,If:Oe,ImageBitmapLoader:_v,ImageLoader:Dc,ImageUtils:Oy,IncrementStencilOp:xy,IncrementWrapStencilOp:yy,IndexNode:zt,InstanceNode:NT,InstancedBufferAttribute:Us,InstancedBufferGeometry:Lm,InstancedInterleavedBuffer:Bm,InstancedMesh:um,InstancedPointsNodeMaterial:zL,Int16BufferAttribute:e1,Int32BufferAttribute:t1,Int8BufferAttribute:KA,IntType:ma,InterleavedBuffer:_a,InterleavedBufferAttribute:Ds,Interpolant:Sa,InterpolateDiscrete:ia,InterpolateLinear:bc,InterpolateSmooth:Eu,InvertStencilOp:My,IrradianceNode:zT,JoinNode:Gv,KeepStencilOp:$s,KeyframeTrack:Hi,LOD:cm,LatheGeometry:jc,Layers:$c,LessCompare:jf,LessDepth:hc,LessEqualCompare:Qf,LessEqualDepth:nr,LessEqualStencilFunc:wy,LessStencilFunc:Ty,Light:fr,LightProbe:Pm,LightProbeNode:$w,LightingContextNode:VT,LightingModel:Ml,LightingNode:ho,LightsNode:UT,Line:Fs,Line2NodeMaterial:qL,Line3:Cv,LineBasicMaterial:Fn,LineBasicNodeMaterial:GL,LineCurve:_m,LineCurve3:iv,LineDashedMaterial:fd,LineDashedNodeMaterial:WL,LineLoop:dm,LineSegments:rs,LinearDisplayP3ColorSpace:Xc,LinearFilter:Ut,LinearInterpolant:Em,LinearMipMapLinearFilter:uy,LinearMipMapNearestFilter:rA,LinearMipmapLinearFilter:Jn,LinearMipmapNearestFilter:js,LinearSRGBColorSpace:li,LinearToneMapping:Ah,LinearTransfer:Ac,Loader:Xn,LoaderUtils:lh,LoadingManager:gd,Loop:mt,LoopNode:PT,LoopOnce:qf,LoopPingPong:hy,LoopRepeat:$f,LuminanceAlphaFormat:Wf,LuminanceFormat:Hf,Lut3DNode:ew,MOUSE:G_,MRTNode:Eb,MatcapUVNode:fb,Material:mn,MaterialLoader:sl,MaterialNode:j,MaterialReferenceNode:HS,MathUtils:Gh,Matrix2:zm,Matrix3:Ke,Matrix4:Fe,MaxEquation:Ff,MaxMipLevelNode:ES,Mesh:kt,MeshBasicMaterial:ss,MeshBasicNodeMaterial:t2,MeshDepthMaterial:Yh,MeshDistanceMaterial:sm,MeshLambertMaterial:pd,MeshLambertNodeMaterial:o2,MeshMatcapMaterial:Am,MeshMatcapNodeMaterial:W2,MeshNormalMaterial:dd,MeshNormalNodeMaterial:ZL,MeshPhongMaterial:hd,MeshPhongNodeMaterial:c2,MeshPhysicalMaterial:ud,MeshPhysicalNodeMaterial:pb,MeshSSSNodeMaterial:V2,MeshStandardMaterial:nl,MeshStandardNodeMaterial:db,MeshToonMaterial:wm,MeshToonNodeMaterial:G2,MinEquation:Y_,MirroredRepeatWrapping:ea,MixOperation:Of,ModelNode:is,ModelViewProjectionNode:bT,MorphNode:LT,MultiplyBlending:of,MultiplyOperation:fa,NearestFilter:Qt,NearestMipMapLinearFilter:sA,NearestMipMapNearestFilter:iA,NearestMipmapLinearFilter:Cs,NearestMipmapNearestFilter:Ph,NeutralToneMapping:Rh,NeverCompare:Cy,NeverDepth:lc,NeverStencilFunc:Sy,NoBlending:Fi,NoColorSpace:Li,NoToneMapping:Ti,Node:Ye,NodeAttribute:If,NodeBuilder:Ab,NodeCache:Lu,NodeCode:Tb,NodeFrame:Nb,NodeFunctionInput:Kg,NodeLoader:yb,NodeMaterial:Tt,NodeMaterialLoader:vb,NodeMaterialObserver:Bv,NodeObjectLoader:e3,NodeShaderStage:mf,NodeType:yP,NodeUniform:Mb,NodeUpdateType:We,NodeUtils:_P,NodeVar:Xg,NodeVarying:Sb,NormalAnimationBlendMode:zh,NormalBlending:Ps,NormalMapNode:ZS,NotEqualCompare:Py,NotEqualDepth:mc,NotEqualStencilFunc:Ny,NumberKeyframeTrack:aa,Object3D:yt,Object3DNode:wt,ObjectLoader:xv,ObjectSpaceNormalMap:Kf,OctahedronGeometry:va,OneFactor:J_,OneMinusConstantAlphaFactor:ay,OneMinusConstantColorFactor:ry,OneMinusDstAlphaFactor:ey,OneMinusDstColorFactor:ny,OneMinusSrcAlphaFactor:Vu,OneMinusSrcColorFactor:j_,OrthographicCamera:oo,OscNode:pn,OutputStructNode:jg,P3Primaries:Ec,PCFShadowMap:Lf,PCFSoftShadowMap:Df,PI:to,PI2:kP,PMREMGenerator:rh,PMREMNode:lb,ParallaxBarrierPassNode:hw,ParameterNode:qg,PassNode:bn,Path:Rc,PerspectiveCamera:hn,PhongLightingModel:kg,PhysicalLightingModel:Fd,PixelationPassNode:ow,Plane:cs,PlaneGeometry:ro,PlaneHelper:fP,PointLight:_d,PointLightHelper:uP,PointLightNode:kw,PointUVNode:Vb,Points:pm,PointsMaterial:ya,PointsNodeMaterial:q2,PolarGridHelper:pP,PolyhedronGeometry:dr,PositionalAudio:Mv,PosterizeNode:Gb,PropertyBinding:St,PropertyMixer:Sv,PropertyNode:Nt,QuadraticBezierCurve:ym,QuadraticBezierCurve3:vm,Quaternion:Qn,QuaternionKeyframeTrack:Ta,QuaternionLinearInterpolant:dv,RED_GREEN_RGTC2_Format:th,RED_RGTC1_Format:Xf,REVISION:Ks,RGBADepthPacking:Jf,RGBAFormat:Rn,RGBAIntegerFormat:Bh,RGBA_ASTC_10x10_Format:Ju,RGBA_ASTC_10x5_Format:$u,RGBA_ASTC_10x6_Format:Yu,RGBA_ASTC_10x8_Format:Zu,RGBA_ASTC_12x10_Format:Ku,RGBA_ASTC_12x12_Format:ju,RGBA_ASTC_4x4_Format:Mc,RGBA_ASTC_5x4_Format:ku,RGBA_ASTC_5x5_Format:Gu,RGBA_ASTC_6x5_Format:Hu,RGBA_ASTC_6x6_Format:Sc,RGBA_ASTC_8x5_Format:Wu,RGBA_ASTC_8x6_Format:Xu,RGBA_ASTC_8x8_Format:qu,RGBA_BPTC_Format:Ko,RGBA_ETC2_EAC_Format:vc,RGBA_PVRTC_2BPPV1_Format:zu,RGBA_PVRTC_4BPPV1_Format:xc,RGBA_S3TC_DXT1_Format:Yo,RGBA_S3TC_DXT3_Format:Zo,RGBA_S3TC_DXT5_Format:Jo,RGBDepthPacking:aA,RGBFormat:Oh,RGBIntegerFormat:oA,RGBShiftNode:jb,RGB_BPTC_SIGNED_Format:Qu,RGB_BPTC_UNSIGNED_Format:Tc,RGB_ETC1_Format:_c,RGB_ETC2_Format:yc,RGB_PVRTC_2BPPV1_Format:Bu,RGB_PVRTC_4BPPV1_Format:gc,RGB_S3TC_DXT1_Format:$o,RGDepthPacking:cA,RGFormat:na,RGIntegerFormat:Vh,RTTNode:Ub,RangeNode:_w,RawShaderMaterial:bm,Ray:io,Raycaster:Nv,Rec709Primaries:Nc,RectAreaLight:Im,RectAreaLightNode:Hw,RedFormat:Hc,RedIntegerFormat:Wc,ReferenceNode:ml,ReflectorNode:Db,ReinhardToneMapping:Nh,RemapNode:wg,RenderOutputNode:wS,RenderTarget:fn,RendererReferenceNode:lS,RepeatWrapping:rr,ReplaceStencilOp:gy,Return:qP,ReverseSubtractEquation:$_,RingGeometry:el,RotateNode:gb,SIGNED_RED_GREEN_RGTC2_Format:nh,SIGNED_RED_RGTC1_Format:eh,SRGBColorSpace:kn,SRGBTransfer:Vt,SSAAPassNode:aw,Scene:Jh,SceneNode:Qi,Schlick_to_F0:nb,ScreenNode:sn,ScriptableNode:mw,ScriptableValueNode:pw,SetNode:Hv,ShaderChunk:lt,ShaderLib:Pi,ShaderMaterial:ki,ShaderNode:ec,ShadowMaterial:ld,ShadowNodeMaterial:K2,Shape:er,ShapeGeometry:rd,ShapePath:Ov,ShapeUtils:ji,ShortType:kf,Skeleton:Jc,SkeletonHelper:lP,SkinnedMesh:lm,SkinningNode:Fg,SobelOperatorNode:Zb,Source:Js,Sphere:Dn,SphereGeometry:Ma,Spherical:Ev,SphericalHarmonics3:mv,SplineCurve:Mm,SplitNode:uh,SpotLight:il,SpotLightHelper:cP,SpotLightNode:l0,Sprite:am,SpriteMaterial:Zc,SpriteNodeMaterial:Y2,SpriteSheetUVNode:Rb,SrcAlphaFactor:Ou,SrcAlphaSaturateFactor:iy,SrcColorFactor:K_,StackNode:wb,StaticCopyUsage:pA,StaticDrawUsage:sa,StaticReadUsage:uA,StereoCamera:Dm,StereoPassNode:cw,StorageArrayElementNode:Ib,StorageBufferNode:t0,StorageTextureNode:Bb,StreamCopyUsage:mA,StreamDrawUsage:lA,StreamReadUsage:dA,StringKeyframeTrack:lo,SubtractEquation:q_,SubtractiveBlending:rf,TBNViewMatrix:qr,TOUCH:H_,TangentSpaceNormalMap:ms,TempNode:pt,TetrahedronGeometry:od,Texture:Xt,Texture3DNode:xb,TextureLoader:fv,TextureNode:gs,TextureSizeNode:NS,TextureUtils:OR,TimerNode:Sn,ToneMappingNode:hS,ToonOutlinePassNode:dw,TorusGeometry:tl,TorusKnotGeometry:ad,TransitionNode:rw,Triangle:Zn,TriangleFanDrawMode:fy,TriangleStripDrawMode:py,TrianglesDrawMode:dy,TriplanarTexturesNode:Pb,TubeGeometry:cd,UVMapping:Ih,Uint16BufferAttribute:Wh,Uint32BufferAttribute:tm,Uint8BufferAttribute:jA,Uint8ClampedBufferAttribute:QA,Uniform:wv,UniformArrayNode:Ig,UniformGroupNode:eg,UniformNode:uo,UniformsGroup:sP,UniformsLib:Se,UniformsUtils:nm,UnsignedByteType:es,UnsignedInt101111Type:Fh,UnsignedInt248Type:or,UnsignedInt5999Type:Uh,UnsignedIntType:Bi,UnsignedShort4444Type:Lh,UnsignedShort5551Type:Dh,UnsignedShortType:ta,UserDataNode:kb,VSMShadowMap:oi,V_GGX_SmithCorrelated:QT,VarNode:iS,VaryingNode:sS,Vector2:J,Vector3:E,Vector4:st,VectorKeyframeTrack:ca,VertexColorNode:Ob,VideoTexture:Ky,ViewportDepthNode:jn,ViewportDepthTextureNode:WT,ViewportSharedTextureNode:Hb,ViewportTextureNode:vl,VolumeNodeMaterial:Q2,WebGL3DRenderTarget:kA,WebGLArrayRenderTarget:zA,WebGLCoordinateSystem:Di,WebGLCubeRenderTarget:qh,WebGLMultipleRenderTargets:gP,WebGLRenderTarget:zi,WebGLRenderer:Yy,WebGLUtils:$y,WebGPUCoordinateSystem:Qr,WireframeGeometry:Tm,WrapAroundEnding:wc,ZeroCurvatureEnding:zr,ZeroFactor:Z_,ZeroSlopeEnding:kr,ZeroStencilOp:my,abs:Dt,acesFilmicToneMapping:Nw,acos:gh,add:Wt,addMethodChaining:te,addNodeElement:$P,afterImage:lD,agxToneMapping:Ew,all:hg,alphaT:dh,anaglyphPass:XD,anamorphic:mD,and:mM,anisotropy:Ys,anisotropyB:Jr,anisotropyT:tc,any:NM,ao:wD,append:Yv,arrayBuffer:FP,asin:LM,assign:aM,atan:DM,atan2:HM,atomicAdd:HU,atomicAnd:$U,atomicFunc:Os,atomicMax:XU,atomicMin:qU,atomicOr:YU,atomicStore:GU,atomicSub:WU,atomicXor:ZU,attenuationColor:ag,attenuationDistance:og,attribute:vn,backgroundBlurriness:K3,backgroundIntensity:j3,batch:RT,billboarding:fU,bitAnd:yM,bitNot:vM,bitOr:MM,bitXor:SM,bitangentGeometry:pL,bitangentLocal:fL,bitangentView:XS,bitangentWorld:mL,bitcast:GP,bleach:TU,bloom:DD,blur:cb,bool:cr,buffer:fl,bufferAttribute:dl,bumpMap:KS,burn:_U,bvec2:Kv,bvec3:Qm,bvec4:tM,bypass:vS,cache:ic,call:lM,cameraFar:Bo,cameraLogDepth:RS,cameraNear:Vo,cameraNormalMatrix:KP,cameraPosition:Ng,cameraProjectionMatrix:ci,cameraProjectionMatrixInverse:ZP,cameraViewMatrix:pi,cameraWorldMatrix:JP,cbrt:JM,ceil:fg,checker:JU,cineonToneMapping:Aw,clamp:cn,clearcoat:hh,clearcoatRoughness:zc,code:Od,color:Zv,colorSpaceToWorking:bg,colorToDirection:$L,compute:xS,cond:tS,context:Mg,convert:iM,convertToTexture:ei,cos:Mi,createCanvasElement:Fy,cross:Qo,cubeTexture:Cd,dFdx:OM,dFdy:VM,dashSize:Kr,defaultBuildStages:gf,defaultShaderStages:qm,defined:Oc,degrees:RM,denoise:ED,densityFog:jD,depth:Bg,depthPass:aD,difference:qM,diffuseColor:Ct,directionToColor:$T,dispersion:cg,distance:XM,div:ns,dodge:yU,dof:xD,dot:$t,dotScreen:_D,drawIndex:AT,dynamicBufferAttribute:mS,element:nM,emissive:yf,equal:uM,equals:EM,equirectUV:zg,exp:dg,exp2:mh,expression:lr,faceDirection:pl,faceForward:jM,film:vD,float:A,floor:gr,fog:JD,fract:xr,frameGroup:VP,frameId:F3,frontFacing:DS,fwidth:kM,fxaa:CD,gain:cU,gapSize:Gc,gaussianBlur:cD,getColorSpaceMethod:xh,getConstNodeType:$v,getCurrentStack:jm,getDirection:ob,getDistanceAttenuation:n0,getGeometryRoughness:jT,getRoughness:Gg,getShIrradianceAt:zw,getTextureIndex:Qg,global:Fu,glsl:r3,glslFn:o3,grayscale:uD,greaterThan:ug,greaterThanEqual:fM,hash:aU,highPrecisionModelNormalViewMatrix:cL,highPrecisionModelViewMatrix:aL,hue:pD,instance:ET,instanceIndex:yl,instancedBufferAttribute:_h,instancedDynamicBufferAttribute:vf,int:L,inverseSqrt:IM,invocationLocalIndex:TL,invocationSubgroupIndex:SL,ior:nc,iridescence:wd,iridescenceIOR:ng,iridescenceThickness:ig,ivec2:ls,ivec3:jv,ivec4:Qv,js:i3,label:nS,length:jr,lengthSq:xg,lessThan:dM,lessThanEqual:pM,lightPosition:s0,lightTargetDirection:r0,lightTargetPosition:yw,lightViewPosition:zd,lightingContext:BT,lights:FT,linearDepth:Sh,linearSRGBTosRGB:Tw,linearToneMapping:bw,localId:PU,log:pg,log2:al,loop:AL,luminance:En,lut3D:MD,mat2:ol,mat3:Tn,mat4:Zr,matcapUV:mb,materialAOMap:TT,materialAlphaTest:jS,materialAnisotropy:dT,materialAnisotropyVector:zo,materialAttenuationColor:vT,materialAttenuationDistance:yT,materialClearcoat:oT,materialClearcoatNormal:cT,materialClearcoatRoughness:aT,materialColor:ha,materialDispersion:ST,materialEmissive:eT,materialIOR:_T,materialIridescence:pT,materialIridescenceIOR:fT,materialIridescenceThickness:mT,materialLightMap:Ug,materialLineDashOffset:bf,materialLineDashSize:Lg,materialLineGapSize:Dg,materialLineScale:Mh,materialLineWidth:Pu,materialMetalness:sT,materialNormal:rT,materialOpacity:Pd,materialPointWidth:MT,materialReference:Ki,materialReflectivity:Iu,materialRefractionRatio:OS,materialRotation:lT,materialRoughness:iT,materialSheen:uT,materialSheenRoughness:hT,materialShininess:QS,materialSpecular:tT,materialSpecularColor:nT,materialSpecularIntensity:Tf,materialSpecularStrength:sc,materialThickness:xT,materialTransmission:gT,max:ft,maxMipLevel:CS,metalness:Bc,min:Mn,mix:it,mixElement:QM,mod:Ad,modInt:lg,modelDirection:iL,modelNormalMatrix:IS,modelPosition:sL,modelScale:rL,modelViewMatrix:xs,modelViewPosition:oL,modelViewProjection:wf,modelWorldMatrix:Ui,modelWorldMatrixInverse:PS,morphReference:DT,motionBlur:SU,mrt:Vd,mul:ot,mx_aastep:Ow,mx_cell_noise_float:sO,mx_contrast:KF,mx_fractal_noise_float:rO,mx_fractal_noise_vec2:oO,mx_fractal_noise_vec3:aO,mx_fractal_noise_vec4:cO,mx_hsvtorgb:GF,mx_noise_float:jF,mx_noise_vec3:QF,mx_noise_vec4:eO,mx_ramplr:XF,mx_ramptb:qF,mx_rgbtohsv:HF,mx_safepower:JF,mx_splitlr:$F,mx_splittb:YF,mx_srgb_texture_to_lin_rec709:WF,mx_transform_uv:ZF,mx_worley_noise_float:tO,mx_worley_noise_vec2:nO,mx_worley_noise_vec3:iO,negate:UM,neutralToneMapping:Cw,nodeArray:Yr,nodeImmutable:fe,nodeObject:H,nodeObjects:rl,nodeProxy:K,normalFlat:US,normalGeometry:Nd,normalLocal:hi,normalMap:Sf,normalView:di,normalWorld:Ed,normalize:vi,not:xM,notEqual:hM,numWorkgroups:RU,objectDirection:jP,objectGroup:rM,objectPosition:eL,objectScale:tL,objectViewPosition:nL,objectWorldMatrix:QP,oneMinus:FM,or:gM,orthographicDepthToViewZ:UL,oscSawtooth:z3,oscSine:O3,oscSquare:V3,oscTriangle:B3,output:sg,outputStruct:P3,overlay:MU,overloadingFn:On,parabola:Pf,parallaxBarrierPass:qD,parallaxDirection:$S,parallaxUV:xL,parameter:n3,pass:oD,passTexture:Na,pcurve:lU,perspectiveDepthToViewZ:Vg,pixelationPass:VD,pmremTexture:ub,pointUV:J3,pointWidth:BP,positionGeometry:Nn,positionLocal:en,positionPrevious:yh,positionView:Pn,positionViewDirection:Bt,positionWorld:vh,positionWorldDirection:Eg,posterize:iD,pow:Kn,pow2:gg,pow3:$M,pow4:YM,property:ai,radians:CM,rand:yg,range:QD,rangeFog:KD,reciprocal:zM,reference:dn,referenceBuffer:Mf,reflect:WM,reflectVector:zS,reflectView:VS,reflector:X3,refract:_g,refractVector:kS,refractView:BS,reinhardToneMapping:ww,remainder:wM,remap:MS,remapClamp:SS,renderGroup:_t,renderOutput:AS,rendererReference:uS,rgbShift:yD,rotate:Wg,rotateUV:dU,roughness:hs,round:BM,rtt:Fb,sRGBToLinearSRGB:Sw,sampler:YP,saturate:KM,saturation:hD,screen:vU,screenCoordinate:Aa,screenSize:da,screenUV:_r,scriptable:ZD,scriptableValue:Uu,select:In,sepia:bU,setCurrentStack:Vc,shaderStages:xf,sharedUniformGroup:tg,sheen:Xr,sheenRoughness:bd,shiftLeft:TM,shiftRight:bM,shininess:ph,sign:cl,sin:Cn,sinc:uU,skinning:bL,skinningReference:IT,smoothstep:ti,smoothstepElement:eS,sobel:gD,specularColor:ri,specularF90:kc,spherizeUV:pU,split:OP,spritesheetUV:k3,sqrt:os,ssaaPass:kD,stack:Du,step:ll,stereoPass:HD,storage:Q3,storageBarrier:FU,storageObject:eD,storageTexture:zb,string:UP,sub:Ft,subgroupIndex:ML,subgroupSize:LU,tan:PM,tangentGeometry:Id,tangentLocal:gl,tangentView:xl,tangentWorld:WS,temp:Sg,texture:xt,texture3D:_b,textureBarrier:OU,textureBicubic:rb,textureCubeUV:ab,textureLoad:Ci,textureSize:tr,textureStore:tD,thickness:rg,threshold:$b,timerDelta:U3,timerGlobal:D3,timerLocal:e0,toOutputColorSpace:rS,toWorkingColorSpace:oS,toneMapping:dS,toneMappingExposure:pS,toonOutlinePass:$D,transformDirection:ZM,transformNormal:FS,transformNormalToView:Rg,transformedBentNormalView:YS,transformedBitangentView:qS,transformedBitangentWorld:gL,transformedClearcoatNormalView:Xo,transformedNormalView:Yt,transformedNormalWorld:Cg,transformedTangentView:Pg,transformedTangentWorld:dL,transition:UD,transmission:fh,transpose:GM,tri:us,tri3:vw,triNoise3D:hU,triplanarTexture:H3,triplanarTextures:Lb,trunc:mg,tslFn:DP,uint:ve,uniform:pe,uniformArray:ds,uniformGroup:sM,uniforms:uL,userData:nD,uv:rt,uvec2:Jv,uvec3:wa,uvec4:eM,varying:Un,varyingProperty:Zi,vec2:z,vec3:D,vec4:oe,vectorComponents:ba,velocity:xU,vertexColor:Z3,vertexIndex:wT,vibrance:dD,viewZToOrthographicDepth:rc,viewZToPerspectiveDepth:XT,viewport:Ls,viewportBottomLeft:LL,viewportCoordinate:GT,viewportDepthTexture:Og,viewportLinearDepth:FL,viewportMipTexture:HT,viewportResolution:IL,viewportSafeUV:mU,viewportSharedTexture:sD,viewportSize:kT,viewportTexture:DL,viewportTopLeft:PL,viewportUV:RL,wgsl:s3,wgslFn:a3,workgroupArray:zU,workgroupBarrier:UU,workgroupId:IU,workingToColorSpace:aS,xor:_M},Symbol.toStringTag,{value:"Module"}));exports.ACESFilmicToneMapping=Eh;exports.AdditiveBlending=cc;exports.AgXToneMapping=Ch;exports.AlwaysDepth=uc;exports.AlwaysStencilFunc=ih;exports.AmbientLight=vd;exports.AnimationClip=la;exports.AnimationMixer=bv;exports.ArrayCamera=rm;exports.Audio=Fm;exports.AudioContext=Md;exports.AudioListener=vv;exports.AudioLoader=yv;exports.AxesHelper=Fv;exports.BackSide=ln;exports.BasicDepthPacking=Zf;exports.BasicNodeLibrary=Jw;exports.BatchedMesh=hm;exports.Bone=Kh;exports.BooleanKeyframeTrack=pr;exports.Box3=Hn;exports.Box3Helper=Uv;exports.BoxGeometry=_s;exports.BoxHelper=Dv;exports.BufferAttribute=At;exports.BufferGeometry=at;exports.Camera=Yc;exports.CameraHelper=Lv;exports.CanvasTexture=ev;exports.CatmullRomCurve3=gm;exports.ClampToEdgeWrapping=Si;exports.Clock=Um;exports.Color=_e;exports.ColorKeyframeTrack=md;exports.ColorManagement=gt;exports.CompressedArrayTexture=jy;exports.CompressedCubeTexture=Qy;exports.CompressedTexture=Kc;exports.Controls=Vv;exports.CubeCamera=Xh;exports.CubeTexture=so;exports.CubeUVReflectionMapping=hr;exports.Curve=Gi;exports.CustomBlending=Uf;exports.CylinderGeometry=co;exports.Data3DTexture=Hh;exports.DataTexture=Oi;exports.DataTextureLoader=pv;exports.DataUtils=By;exports.DecrementStencilOp=_y;exports.DecrementWrapStencilOp=vy;exports.DefaultLoadingManager=Cm;exports.DepthFormat=Qs;exports.DepthStencilFormat=ar;exports.DepthTexture=ao;exports.DirectionalLight=yd;exports.DirectionalLightHelper=Pv;exports.DoubleSide=Ji;exports.DynamicDrawUsage=Gr;exports.EdgesGeometry=Sm;exports.EqualDepth=dc;exports.EqualStencilFunc=by;exports.EquirectangularReflectionMapping=ir;exports.EquirectangularRefractionMapping=sr;exports.Euler=ui;exports.EventDispatcher=Ai;exports.ExtrudeGeometry=Qc;exports.FileLoader=ts;exports.Float32BufferAttribute=Ve;exports.FloatType=Gn;exports.Fog=om;exports.FrontSide=fs;exports.Frustum=ga;exports.GLSL3=sh;exports.GLSLNodeParser=Zw;exports.GreaterDepth=fc;exports.GreaterEqualDepth=pc;exports.GreaterEqualStencilFunc=Ey;exports.GreaterStencilFunc=Ay;exports.GridHelper=Iv;exports.Group=Hr;exports.HalfFloatType=Ln;exports.HemisphereLight=xd;exports.ImageBitmapLoader=_v;exports.IncrementStencilOp=xy;exports.IncrementWrapStencilOp=yy;exports.InstancedBufferAttribute=Us;exports.InstancedBufferGeometry=Lm;exports.InstancedInterleavedBuffer=Bm;exports.InstancedMesh=um;exports.InterleavedBuffer=_a;exports.InterleavedBufferAttribute=Ds;exports.Interpolant=Sa;exports.InterpolateDiscrete=ia;exports.InterpolateLinear=bc;exports.InvertStencilOp=My;exports.KeepStencilOp=$s;exports.KeyframeTrack=Hi;exports.LOD=cm;exports.Layers=$c;exports.LessDepth=hc;exports.LessEqualDepth=nr;exports.LessEqualStencilFunc=wy;exports.LessStencilFunc=Ty;exports.Line=Fs;exports.Line3=Cv;exports.LineBasicMaterial=Fn;exports.LineLoop=dm;exports.LineSegments=rs;exports.LinearFilter=Ut;exports.LinearMipmapLinearFilter=Jn;exports.LinearMipmapNearestFilter=js;exports.LinearSRGBColorSpace=li;exports.LinearToneMapping=Ah;exports.Loader=Xn;exports.LoaderUtils=lh;exports.LoadingManager=gd;exports.LoopOnce=qf;exports.LoopRepeat=$f;exports.MOUSE=G_;exports.Material=mn;exports.MathUtils=Gh;exports.Matrix3=Ke;exports.Matrix4=Fe;exports.MaxEquation=Ff;exports.Mesh=kt;exports.MeshBasicMaterial=ss;exports.MeshDepthMaterial=Yh;exports.MeshLambertMaterial=pd;exports.MeshNormalMaterial=dd;exports.MeshPhongMaterial=hd;exports.MeshPhysicalMaterial=ud;exports.MeshStandardMaterial=nl;exports.MirroredRepeatWrapping=ea;exports.NearestFilter=Qt;exports.NearestMipmapLinearFilter=Cs;exports.NearestMipmapNearestFilter=Ph;exports.NeutralToneMapping=Rh;exports.NeverDepth=lc;exports.NeverStencilFunc=Sy;exports.NoBlending=Fi;exports.NoColorSpace=Li;exports.NoToneMapping=Ti;exports.Node=Ye;exports.NodeBuilder=Ab;exports.NodeFrame=Nb;exports.NormalBlending=Ps;exports.NotEqualDepth=mc;exports.NotEqualStencilFunc=Ny;exports.NumberKeyframeTrack=aa;exports.Object3D=yt;exports.OctahedronGeometry=va;exports.OrthographicCamera=oo;exports.PCFSoftShadowMap$1=Df;exports.PMREMGenerator$1=rh;exports.PerspectiveCamera=hn;exports.Plane=cs;exports.PlaneGeometry=ro;exports.PointLight=_d;exports.Points=pm;exports.PointsMaterial=ya;exports.PositionalAudio=Mv;exports.PropertyBinding=St;exports.Quaternion=Qn;exports.QuaternionKeyframeTrack=Ta;exports.REVISION=Ks;exports.RGBADepthPacking=Jf;exports.RGBAFormat=Rn;exports.RGBA_ASTC_4x4_Format=Mc;exports.RGBA_ASTC_6x6_Format=Sc;exports.RGBA_BPTC_Format=Ko;exports.RGBA_ETC2_EAC_Format=vc;exports.RGBA_PVRTC_4BPPV1_Format=xc;exports.RGBA_S3TC_DXT1_Format=Yo;exports.RGBA_S3TC_DXT3_Format=Zo;exports.RGBA_S3TC_DXT5_Format=Jo;exports.RGBFormat=Oh;exports.RGB_BPTC_UNSIGNED_Format=Tc;exports.RGB_ETC1_Format=_c;exports.RGB_ETC2_Format=yc;exports.RGB_PVRTC_4BPPV1_Format=gc;exports.RGB_S3TC_DXT1_Format=$o;exports.RGFormat=na;exports.RawShaderMaterial=bm;exports.Ray=io;exports.Raycaster=Nv;exports.RedFormat=Hc;exports.ReinhardToneMapping=Nh;exports.RepeatWrapping=rr;exports.ReplaceStencilOp=gy;exports.RingGeometry=el;exports.SRGBColorSpace=kn;exports.Scene=Jh;exports.ShaderChunk=lt;exports.ShaderLib=Pi;exports.ShaderMaterial=ki;exports.ShadowMaterial=ld;exports.Shape=er;exports.ShapePath=Ov;exports.ShapeUtils=ji;exports.Skeleton=Jc;exports.SkinnedMesh=lm;exports.Source=Js;exports.Sphere=Dn;exports.SphereGeometry=Ma;exports.Spherical=Ev;exports.SpotLight=il;exports.Sprite=am;exports.SpriteMaterial=Zc;exports.THREE=gO;exports.TOUCH=H_;exports.Texture=Xt;exports.TextureLoader=fv;exports.TorusGeometry=tl;exports.Triangle=Zn;exports.TriangleFanDrawMode=fy;exports.TriangleStripDrawMode=py;exports.TrianglesDrawMode=dy;exports.Uint16BufferAttribute=Wh;exports.Uniform$1=wv;exports.UniformsLib=Se;exports.UniformsUtils=nm;exports.UnsignedByteType=es;exports.UnsignedInt101111Type=Fh;exports.UnsignedInt248Type=or;exports.UnsignedInt5999Type=Uh;exports.UnsignedIntType=Bi;exports.Vector2=J;exports.Vector3=E;exports.Vector4=st;exports.VectorKeyframeTrack=ca;exports.VideoTexture=Ky;exports.WebGLCubeRenderTarget=qh;exports.WebGLRenderTarget=zi;exports.WebGLRenderer=Yy;exports.WireframeGeometry=Tm;exports.ZeroStencilOp=my;exports.defaultShaderStages=qm;exports.normalView=di;
|
|
@@ -3767,7 +3767,7 @@ void main() {
|
|
|
3767
3767
|
`;return n.precision==="highp"?e+=`
|
|
3768
3768
|
#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
|
|
3769
3769
|
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
|
|
3770
|
-
#define LOW_PRECISION`),e}function lR(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===jd?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Xd?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===rr&&(e="SHADOWMAP_TYPE_VSM"),e}function cR(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case fr:case Ar:e="ENVMAP_TYPE_CUBE";break;case Hn:e="ENVMAP_TYPE_CUBE_UV";break}return e}function uR(n){let e="ENVMAP_MODE_REFLECTION";
|
|
3770
|
+
#define LOW_PRECISION`),e}function lR(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===jd?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Xd?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===rr&&(e="SHADOWMAP_TYPE_VSM"),e}function cR(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case fr:case Ar:e="ENVMAP_TYPE_CUBE";break;case Hn:e="ENVMAP_TYPE_CUBE_UV";break}return e}function uR(n){let e="ENVMAP_MODE_REFLECTION";return n.envMap&&n.envMapMode===Ar&&(e="ENVMAP_MODE_REFRACTION"),e}function hR(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case pa:e="ENVMAP_BLENDING_MULTIPLY";break;case Kd:e="ENVMAP_BLENDING_MIX";break;case Zd:e="ENVMAP_BLENDING_ADD";break}return e}function dR(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:i,maxMip:t}}function pR(n,e,t,i){const r=n.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=lR(t),c=cR(t),u=uR(t),h=hR(t),d=dR(t),p=eR(t),m=tR(s),v=r.createProgram();let f,g,x=t.glslVersion?"#version "+t.glslVersion+`
|
|
3771
3771
|
`:"";t.isRawShaderMaterial?(f=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(ll).join(`
|
|
3772
3772
|
`),f.length>0&&(f+=`
|
|
3773
3773
|
`),g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(ll).join(`
|