@volter/editor 0.5.57
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/BUNDLED_NOTICES +6196 -0
- package/LICENSE +686 -0
- package/LICENSE-BLENDER +1409 -0
- package/LICENSE-MCP +21 -0
- package/NOTICE +20 -0
- package/dist/.vite/manifest.json +1744 -0
- package/dist/assets/AudioViewer-DILwc7Pt.js +1 -0
- package/dist/assets/BVHLoader--2mLoe3e.js +1 -0
- package/dist/assets/BufferGeometryUtils-oP8-Ve4I.js +1 -0
- package/dist/assets/ColladaLoader-CyOCKXko.js +3 -0
- package/dist/assets/EntityModelDocument-DVlDQ_IJ.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-BVGDJjW4.js +5 -0
- package/dist/assets/FBXLoader-DzWtiWYm.js +1 -0
- package/dist/assets/GameplaySessionTimeline-X_nMT8Sa.js +142 -0
- package/dist/assets/ImageViewer-D-aZoyr1.js +1 -0
- package/dist/assets/InspectorCanvasPreview-CLDhscy0.js +1 -0
- package/dist/assets/InspectorObjectPreview-CpHEw6QH.js +1 -0
- package/dist/assets/JsonAssetDocument-CLVN1V9Z.js +3 -0
- package/dist/assets/LineSegments2-vfeDUBfs.js +370 -0
- package/dist/assets/MTLLoader-D8SKGOsv.js +2 -0
- package/dist/assets/ModelAssetDocument-C60lQ11c.js +1 -0
- package/dist/assets/NonThreeAuthoringBootstrap-D8oHDftw.js +2 -0
- package/dist/assets/OBJLoader-8SrBLZ7J.js +5 -0
- package/dist/assets/Object3DPreview-CSmLPKkk.js +2 -0
- package/dist/assets/OnlineAssetDetail-D8wVVoay.js +2 -0
- package/dist/assets/OrbitControls-BHxt84w6.js +1 -0
- package/dist/assets/PLYLoader-BXUWXVtV.js +2 -0
- package/dist/assets/RectAreaLightUniformsLib-BGT7Bu4n.js +1 -0
- package/dist/assets/STLLoader-U-3fQm8v.js +1 -0
- package/dist/assets/SourceAssetViewer-BcOCJ2ye.js +13 -0
- package/dist/assets/StageHost-B_YrFNiC.js +1126 -0
- package/dist/assets/TDSLoader-BtiaQ4S3.js +1 -0
- package/dist/assets/ToolObject3DPreview-Crowr7IN.js +1 -0
- package/dist/assets/TransientHint-GNwuzA4c.js +1 -0
- package/dist/assets/VideoViewer-CjQ4P9AJ.js +1 -0
- package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
- package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
- package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
- package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
- package/dist/assets/asset-editor-persistence-D3Yy77wZ.js +1 -0
- package/dist/assets/blender-emscripten-engine-C_uFxIuO.js +2 -0
- package/dist/assets/blender-node-editor.document-BfvoBocD.js +1 -0
- package/dist/assets/blender-outliner-model-B8b00oxr.js +1 -0
- package/dist/assets/blender-properties-tab-0M780SHF.js +3 -0
- package/dist/assets/blender-runtime-host-D8NHsAfD.js +4 -0
- package/dist/assets/blender-runtime-skin-DcwXD-m8.js +61 -0
- package/dist/assets/blender-runtime.document-BixTvrw8.js +7 -0
- package/dist/assets/blender-timeline.document-RtHIpbT1.js +1 -0
- package/dist/assets/blender-uv-editor.document-ChwaS3BG.js +1 -0
- package/dist/assets/blender-version.status-Bnhf8h1I.js +1 -0
- package/dist/assets/blender-wali-engine-C7bet0ss.js +2 -0
- package/dist/assets/blender.command-BCCEp0kb.js +1 -0
- package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
- package/dist/assets/blender.status-ujwGU6dU.js +1 -0
- package/dist/assets/blender.style-Dcem5f_T.js +1 -0
- package/dist/assets/browserAll-Do0ehj3Q.js +14 -0
- package/dist/assets/client-DNXj_opT.js +25 -0
- package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
- package/dist/assets/edit-mode-authoring-BX4IRQq9.js +1 -0
- package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
- package/dist/assets/events-156d8d12.esm-Dy_KXdhT.js +36 -0
- package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
- package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
- package/dist/assets/hosted-asset-materialization-BK7DHisS.js +2 -0
- package/dist/assets/index-5av5LJja.js +1691 -0
- package/dist/assets/index-BP6wv2A0.js +5 -0
- package/dist/assets/index-Bge9JUr6.js +1 -0
- package/dist/assets/index-BncK9THk.js +1 -0
- package/dist/assets/index-C5UECeSr.js +952 -0
- package/dist/assets/index-CJbYy-CF.js +3 -0
- package/dist/assets/index-CanA16PU.js +2 -0
- package/dist/assets/index-CinJrH5C.js +9 -0
- package/dist/assets/index-Cl83EGRl.js +2 -0
- package/dist/assets/index-CtzuWnCS.js +1 -0
- package/dist/assets/index-D2LwEE0L.js +562 -0
- package/dist/assets/index-D2fNXpHa.css +1 -0
- package/dist/assets/index-DUqP1RMl.js +1 -0
- package/dist/assets/index-D_NuPfjr.js +9 -0
- package/dist/assets/index-DaQZGF7d.js +1 -0
- package/dist/assets/index-DgapqSPi.js +7 -0
- package/dist/assets/index-IEjydI9d.js +1 -0
- package/dist/assets/index-gHZae-lw.js +13 -0
- package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
- package/dist/assets/model.layout-BJUEQYUI.js +1 -0
- package/dist/assets/models.finder-Bm1YfG95.js +1 -0
- package/dist/assets/product-Ywxte8eQ.js +1 -0
- package/dist/assets/properties-bone-constraints.inspector-Ck0Hzlvr.js +1 -0
- package/dist/assets/properties-bone.inspector-B8M42o0V.js +1 -0
- package/dist/assets/properties-collection.inspector-D-RSO5zy.js +1 -0
- package/dist/assets/properties-constraints.inspector-DbJa57oa.js +1 -0
- package/dist/assets/properties-data.inspector-DLgjbRW6.js +1 -0
- package/dist/assets/properties-material.inspector-B11LZYDW.js +1 -0
- package/dist/assets/properties-modifiers.inspector-BCWwuA26.js +1 -0
- package/dist/assets/properties-object.inspector-UZVJG49S.js +1 -0
- package/dist/assets/properties-output.inspector-XOwcBits.js +1 -0
- package/dist/assets/properties-particles.inspector-By04vT7R.js +1 -0
- package/dist/assets/properties-physics.inspector-D3T7FLdg.js +1 -0
- package/dist/assets/properties-render.inspector-Y0Rjr9gZ.js +1 -0
- package/dist/assets/properties-scene.inspector-CfyDWB4W.js +1 -0
- package/dist/assets/properties-texture.inspector-AFRsJx6-.js +1 -0
- package/dist/assets/properties-view-layer.inspector-Co07LAmQ.js +1 -0
- package/dist/assets/properties-world.inspector-C7T4JocI.js +1 -0
- package/dist/assets/react-18-DyywM-Z2.js +1 -0
- package/dist/assets/react-story-board-vrmj74Ng.js +1 -0
- package/dist/assets/react-three-rapier.esm-D874pLFD.js +1 -0
- package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
- package/dist/assets/session-1bPxsLdy.js +4167 -0
- package/dist/assets/shading.layout-DULYZV6M.js +1 -0
- package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
- package/dist/assets/spark.module-D1CUMLYS.js +12120 -0
- package/dist/assets/stage-keyboard-Cx90EYIT.js +1 -0
- package/dist/assets/stage-overlay-set-duu3P0mZ.js +1 -0
- package/dist/assets/stage-presence-markers-DKH3p_ao.js +1 -0
- package/dist/assets/story-capture-Dqurwlhr.js +1 -0
- package/dist/assets/story-mount-turn-2IYGgHob.js +1 -0
- package/dist/assets/story-pixi-preview-c78Aygdi.js +1 -0
- package/dist/assets/story-three-preview-CbZo5B3D.js +2 -0
- package/dist/assets/texture.layout-DASpHVht.js +1 -0
- package/dist/assets/three.module-BynznMJN.js +3840 -0
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
- package/dist/assets/vgai-shared-fontawesome-CFSkqz69.js +1 -0
- package/dist/assets/vgai-shared-jsx-dev-runtime-VfxIYu0y.js +9 -0
- package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
- package/dist/assets/vgai-shared-react-DL5U9FnC.js +1 -0
- package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
- package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
- package/dist/assets/vgai-shared-three-BWkbSQ3V.js +1 -0
- package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
- package/dist/assets/webworkerAll-iMzrvNir.js +101 -0
- package/dist/assets/worker-DTgfRRas.js +1 -0
- package/dist/assets/world-documents-CGbrcsYk.js +3 -0
- package/dist/vgai-shared-react.json +10 -0
- package/dist/vgai-shared-three.json +3 -0
- package/dist-node/cli.js +17823 -0
- package/dist-node/create.js +14084 -0
- package/package.json +56 -0
- package/presets.mjs +2 -0
- package/src/contributions.d.ts +4 -0
- package/src/index.ts +9 -0
- package/starter/cube.blend +0 -0
- package/starter/cube.py +81 -0
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
import{U as c,c as oe,d as X,a as g,e as Vt,f as Be,g as U,N as R,W as y,h as _,E as nt,i as w,j as H,k as pe,B as F,l as Me,A as Mt,L as K,m as q,F as Y,n as ut,V as z,o as Yt,p as ke,q as It,D as Pt,r as Wt,t as Xt,u as Kt,v as ae,w as $e,x as et,H as yt,y as He,z as ot,G as le,I as Ut,J as Ye,K as Rt,O as bt,X as Zt,Y as Ue,Z as Re,_ as jt,$ as Jt,a0 as qt,a1 as ze,a2 as tt,a3 as Lt,a4 as $t,a5 as er,a6 as tr,a7 as rr,a8 as ir,a9 as Ft,aa as sr,ab as ft,ac as ar}from"./three.module-BynznMJN.js";/**
|
|
2
|
+
* postprocessing v6.38.3 build Thu Feb 19 2026
|
|
3
|
+
* https://github.com/pmndrs/postprocessing
|
|
4
|
+
* Copyright 2015-2026 Raoul van Rüschen
|
|
5
|
+
* @license Zlib
|
|
6
|
+
*/var fa="6.38.3",ha=class{dispose(){}},We=1/1e3,nr=1e3,or=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(e){typeof document<"u"&&document.hidden!==void 0&&(e?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=e)}get delta(){return this._delta*We}get fixedDelta(){return this._fixedDelta*We}set fixedDelta(e){this._fixedDelta=e*nr}get elapsed(){return this._elapsed*We}update(e){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(e!==void 0?e:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},lr=(()=>{const e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]),r=new sr;return r.setAttribute("position",new ft(e,3)),r.setAttribute("uv",new ft(t,2)),r})(),O=class rt{static get fullscreenGeometry(){return lr}constructor(t="Pass",r=new $e,i=new Jt){this.name=t,this.renderer=null,this.scene=r,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(t){if(this.rtt===t){const r=this.fullscreenMaterial;r!==null&&(r.needsUpdate=!0),this.rtt=!t}}set mainScene(t){}set mainCamera(t){}setRenderer(t){this.renderer=t}isEnabled(){return this.enabled}setEnabled(t){this.enabled=t}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(t){let r=this.screen;r!==null?r.material=t:(r=new qt(rt.fullscreenGeometry,t),r.frustumCulled=!1,this.scene===null&&(this.scene=new $e),this.scene.add(r),this.screen=r)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(t){this.fullscreenMaterial=t}getDepthTexture(){return null}setDepthTexture(t,r=F){}render(t,r,i,s,a){throw new Error("Render method not implemented!")}setSize(t,r){}initialize(t,r,i){}dispose(){for(const t of Object.keys(this)){const r=this[t];(r instanceof y||r instanceof Ft||r instanceof ze||r instanceof rt)&&this[t].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},cr=class extends O{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(e,t,r,i,s){const a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},ur=`#ifdef COLOR_WRITE
|
|
7
|
+
#include <common>
|
|
8
|
+
#include <dithering_pars_fragment>
|
|
9
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
10
|
+
uniform mediump sampler2D inputBuffer;
|
|
11
|
+
#else
|
|
12
|
+
uniform lowp sampler2D inputBuffer;
|
|
13
|
+
#endif
|
|
14
|
+
#endif
|
|
15
|
+
#ifdef DEPTH_WRITE
|
|
16
|
+
#include <packing>
|
|
17
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
18
|
+
uniform highp sampler2D depthBuffer;
|
|
19
|
+
#else
|
|
20
|
+
uniform mediump sampler2D depthBuffer;
|
|
21
|
+
#endif
|
|
22
|
+
float readDepth(const in vec2 uv){
|
|
23
|
+
#if DEPTH_PACKING == 3201
|
|
24
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
25
|
+
#else
|
|
26
|
+
return texture2D(depthBuffer,uv).r;
|
|
27
|
+
#endif
|
|
28
|
+
}
|
|
29
|
+
#endif
|
|
30
|
+
#ifdef USE_WEIGHTS
|
|
31
|
+
uniform vec4 channelWeights;
|
|
32
|
+
#endif
|
|
33
|
+
uniform float opacity;varying vec2 vUv;void main(){
|
|
34
|
+
#ifdef COLOR_WRITE
|
|
35
|
+
vec4 texel=texture2D(inputBuffer,vUv);
|
|
36
|
+
#ifdef USE_WEIGHTS
|
|
37
|
+
texel*=channelWeights;
|
|
38
|
+
#endif
|
|
39
|
+
gl_FragColor=opacity*texel;
|
|
40
|
+
#ifdef COLOR_SPACE_CONVERSION
|
|
41
|
+
#include <colorspace_fragment>
|
|
42
|
+
#endif
|
|
43
|
+
#include <dithering_fragment>
|
|
44
|
+
#else
|
|
45
|
+
gl_FragColor=vec4(0.0);
|
|
46
|
+
#endif
|
|
47
|
+
#ifdef DEPTH_WRITE
|
|
48
|
+
gl_FragDepth=readDepth(vUv);
|
|
49
|
+
#endif
|
|
50
|
+
}`,re="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",_e=class extends U{constructor(){super({name:"CopyMaterial",defines:{COLOR_SPACE_CONVERSION:"1",DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new c(null),depthBuffer:new c(null),channelWeights:new c(null),opacity:new c(1)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ur,vertexShader:re}),this.depthFunc=Mt}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(e){const t=e!==null;this.colorWrite!==t&&(t?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=t,this.needsUpdate=!0),this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){const t=e!==null;this.depthWrite!==t&&(t?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=t,this.depthWrite=t,this.needsUpdate=!0),this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(e){this.colorSpaceConversion!==e&&(e?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(e){e!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=e):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},lt=class extends O{constructor(e,t=!0){super("CopyPass"),this.fullscreenMaterial=new _e,this.needsSwap=!1,this.renderTarget=e,e===void 0&&(this.renderTarget=new y(1,1,{minFilter:K,magFilter:K,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,r,i,s){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,r){r!==void 0&&(this.renderTarget.texture.type=r,r!==H?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":e!==null&&e.outputColorSpace===w&&(this.renderTarget.texture.colorSpace=w))}},ht=new X,Ie=class extends O{constructor(e=!0,t=!0,r=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=r,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,r){this.color=e,this.depth=t,this.stencil=r}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,r,i,s){const a=this.overrideClearColor,n=this.overrideClearAlpha,o=e.getClearAlpha(),l=a!==null,u=n>=0;l?(e.getClearColor(ht),e.setClearColor(a,u?n:o)):u&&e.setClearAlpha(n),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),l?e.setClearColor(ht,o):u&&e.setClearAlpha(o)}},fr=class extends O{constructor(e,t){super("MaskPass",e,t),this.needsSwap=!1,this.clearPass=new Ie(!1,!1,!0),this.inverse=!1}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,r,i,s){const a=e.getContext(),n=e.state.buffers,o=this.scene,l=this.camera,u=this.clearPass,h=this.inverted?0:1,f=1-h;n.color.setMask(!1),n.depth.setMask(!1),n.color.setLocked(!0),n.depth.setLocked(!0),n.stencil.setTest(!0),n.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),n.stencil.setFunc(a.ALWAYS,h,4294967295),n.stencil.setClear(f),n.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?u.render(e,null):(u.render(e,t),u.render(e,r))),this.renderToScreen?(e.setRenderTarget(null),e.render(o,l)):(e.setRenderTarget(t),e.render(o,l),e.setRenderTarget(r),e.render(o,l)),n.color.setLocked(!1),n.depth.setLocked(!1),n.stencil.setLocked(!1),n.stencil.setFunc(a.EQUAL,1,4294967295),n.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),n.stencil.setLocked(!0)}},da=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:r=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,r,s,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new lt,this.depthTexture=null,this.passes=[],this.timer=new or,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,r=this.multisampling;r>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):r!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new g),r=e.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===H&&e.outputColorSpace===w&&(this.inputBuffer.texture.colorSpace=w,this.outputBuffer.texture.colorSpace=w,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const s of this.passes)s.initialize(e,r,i)}}replaceRenderer(e,t=!0){const r=this.renderer,i=r.domElement.parentNode;return this.setRenderer(e),t&&i!==null&&(i.removeChild(r.domElement),i.appendChild(e.domElement)),r}createDepthTexture(){const e=this.depthTexture=new Pt;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=Wt,e.type=Xt):e.type=Kt,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,r,i){const s=this.renderer,a=s===null?new g:s.getDrawingBufferSize(new g),n={minFilter:K,magFilter:K,stencilBuffer:t,depthBuffer:e,type:r},o=new y(a.width,a.height,n);return i>0&&(o.samples=i),r===H&&s!==null&&s.outputColorSpace===w&&(o.texture.colorSpace=w),o.texture.name="EffectComposer.Buffer",o.texture.generateMipmaps=!1,o}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const r=this.passes,i=this.renderer,s=i.getDrawingBufferSize(new g),a=i.getContext().getContextAttributes().alpha,n=this.inputBuffer.texture.type;if(e.setRenderer(i),e.setSize(s.width,s.height),e.initialize(i,a,n),this.autoRenderToScreen&&(r.length>0&&(r[r.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?r.splice(t,0,e):r.push(e),this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const o=this.createDepthTexture();for(e of r)e.setDepthTexture(o)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,r=t.indexOf(e);if(r!==-1&&t.splice(r,1).length>0){if(this.depthTexture!==null){const a=(o,l)=>o||l.needsDepthTexture;t.reduce(a,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&r===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,r=this.copyPass;let i=this.inputBuffer,s=this.outputBuffer,a=!1,n,o,l;e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(const u of this.passes)u.enabled&&(u.render(t,i,s,e,a),u.needsSwap&&(a&&(r.renderToScreen=u.renderToScreen,n=t.getContext(),o=t.state.buffers.stencil,o.setFunc(n.NOTEQUAL,1,4294967295),r.render(t,i,s,e,a),o.setFunc(n.EQUAL,1,4294967295)),l=i,i=s,s=l),u instanceof fr?a=!0:u instanceof cr&&(a=!1))}setSize(e,t,r){const i=this.renderer,s=i.getSize(new g);(e===void 0||t===void 0)&&(e=s.width,t=s.height),(s.width!==e||s.height!==t)&&i.setSize(e,t,r);const a=i.getDrawingBufferSize(new g);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height);for(const n of this.passes)n.setSize(a.width,a.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),O.fullscreenGeometry.dispose()}},N={NONE:0,DEPTH:1,CONVOLUTION:2},S={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},hr=class{constructor(){this.shaderParts=new Map([[S.FRAGMENT_HEAD,null],[S.FRAGMENT_MAIN_UV,null],[S.FRAGMENT_MAIN_IMAGE,null],[S.VERTEX_HEAD,null],[S.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=N.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=ke}};function dt(e){let t;if(e===0)t=new Float64Array(0);else if(e===1)t=new Float64Array([1]);else if(e>1){let r=new Float64Array(e),i=new Float64Array(e);for(let s=1;s<=e;++s){for(let a=0;a<s;++a)i[a]=a===0||a===s-1?1:r[a-1]+r[a];t=i,i=r,r=t}}return t}var dr=class{constructor(e,t=2){this.weights=null,this.offsets=null,this.linearWeights=null,this.linearOffsets=null,this.generate(e,t)}get steps(){return this.offsets===null?0:this.offsets.length}get linearSteps(){return this.linearOffsets===null?0:this.linearOffsets.length}generate(e,t){if(e<3||e>1020)throw new Error("The kernel size must be in the range [3, 1020]");const r=e+t*2,i=t>0?dt(r).slice(t,-t):dt(r),s=Math.floor((i.length-1)/2),a=i.reduce((f,d)=>f+d,0),n=i.slice(s),o=[...Array(s+1).keys()],l=new Float64Array(Math.floor(o.length/2)),u=new Float64Array(l.length);l[0]=n[0]/a;for(let f=1,d=1,v=o.length-1;f<v;f+=2,++d){const A=o[f],p=o[f+1],x=n[f],C=n[f+1],T=x+C,D=(A*x+p*C)/T;l[d]=T/a,u[d]=D}for(let f=0,d=n.length,v=1/a;f<d;++f)n[f]*=v;const h=(l.reduce((f,d)=>f+d,0)-l[0]*.5)*2;if(h!==0)for(let f=0,d=l.length,v=1/h;f<d;++f)l[f]*=v;this.offsets=o,this.weights=n,this.linearOffsets=u,this.linearWeights=l}},va=class{getDelta(){return NaN}getElapsed(){return NaN}},ga=class{initialize(e,t,r){}},Xe=!1,vt=class{constructor(e=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=t=>{if(t.isMesh){let r;if(t.material.flatShading)switch(t.material.side){case Re:r=this.materialsFlatShadedDoubleSide;break;case Ue:r=this.materialsFlatShadedBackSide;break;default:r=this.materialsFlatShaded;break}else switch(t.material.side){case Re:r=this.materialsDoubleSide;break;case Ue:r=this.materialsBackSide;break;default:r=this.materials;break}this.originalMaterials.set(t,t.material),t.isSkinnedMesh?t.material=r[2]:t.isInstancedMesh?t.material=r[1]:t.material=r[0],++this.meshCount}}}cloneMaterial(e){if(!(e instanceof U))return e.clone();const t=e.uniforms,r=new Map;for(const s in t){const a=t[s].value;a.isRenderTargetTexture&&(t[s].value=null,r.set(s,a))}const i=e.clone();for(const s of r)t[s[0]].value=s[1],i.uniforms[s[0]].value=s[1];return i}setMaterial(e){if(this.disposeMaterials(),this.material=e,e!==null){const t=this.materials=[this.cloneMaterial(e),this.cloneMaterial(e),this.cloneMaterial(e)];for(const r of t)r.uniforms=Object.assign({},e.uniforms),r.side=jt;t[2].skinning=!0,this.materialsBackSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.side=Ue,i}),this.materialsDoubleSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.side=Re,i}),this.materialsFlatShaded=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i.side=Ue,i}),this.materialsFlatShadedDoubleSide=t.map(r=>{const i=this.cloneMaterial(r);return i.uniforms=Object.assign({},e.uniforms),i.flatShading=!0,i.side=Re,i})}}render(e,t,r){const i=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,Xe){const s=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,r);for(const a of s)a[0].material=a[1];this.meshCount!==s.size&&s.clear()}else{const s=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,r),t.overrideMaterial=s}e.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Xe}static set workaroundEnabled(e){Xe=e}},pa=class{setSize(e,t){}},te=-1,E=class extends nt{constructor(e,t=te,r=te,i=1){super(),this.resizable=e,this.baseSize=new g(1,1),this.preferredSize=new g(t,r),this.target=this.preferredSize,this.s=i,this.effectiveSize=new g,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const e=this.baseSize,t=this.preferredSize,r=this.effectiveSize,i=this.scale;t.width!==te?r.width=t.width:t.height!==te?r.width=Math.round(t.height*(e.width/Math.max(e.height,1))):r.width=Math.round(e.width*i),t.height!==te?r.height=t.height:t.width!==te?r.height=Math.round(t.width/Math.max(e.width/Math.max(e.height,1),1)):r.height=Math.round(e.height*i)}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(te),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.baseSize.width!==e||this.baseSize.height!==t)&&(this.baseSize.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferredSize.width!==e||this.preferredSize.height!==t)&&(this.preferredSize.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(e){this.s=e.scale,this.baseSize.set(e.baseWidth,e.baseHeight),this.preferredSize.set(e.preferredWidth,e.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return te}},vr=class{constructor(e=0){this.nextId=e}getNextId(){return this.nextId++}reset(e=0){return this.nextId=e,this}},Ke=new vr(2),Ot=class extends Set{constructor(e,t=Ke.getNextId()){super(),this.exclusive=!1,this._layer=t,(this._layer<1||this._layer>31)&&(console.warn("Layer out of range, resetting to 2"),Ke.reset(2),this._layer=Ke.getNextId()),e!==void 0&&this.set(e)}get layer(){return this._layer}set layer(e){const t=this._layer;for(const r of this)r.layers.disable(t),r.layers.enable(e);this._layer=e}getLayer(){return this.layer}setLayer(e){this.layer=e}isExclusive(){return this.exclusive}setExclusive(e){this.exclusive=e}clear(){const e=this.layer;for(const t of this)t.layers.disable(e);return super.clear()}set(e){this.clear();for(const t of e)this.add(t);return this}indexOf(e){return this.has(e)?0:-1}add(e){return this.exclusive?e.layers.set(this.layer):e.layers.enable(this.layer),super.add(e)}delete(e){return this.has(e)&&e.layers.disable(this.layer),super.delete(e)}toggle(e){let t;return this.has(e)?(this.delete(e),t=!1):(this.add(e),t=!0),t}setVisible(e){for(const t of this)e?t.layers.enable(0):t.layers.disable(0);return this}},m={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},gr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",pr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}",mr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ar="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",xr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Er="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Dr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",wr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Tr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Cr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Sr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Br="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Mr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ir="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Pr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",yr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ur="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Rr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",br="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Lr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Fr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Or="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Nr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}",Hr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Gr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",kr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",zr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",_r="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Qr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Vr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}",Yr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Wr="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Xr=new Map([[m.ADD,gr],[m.ALPHA,pr],[m.AVERAGE,mr],[m.COLOR,Ar],[m.COLOR_BURN,xr],[m.COLOR_DODGE,Er],[m.DARKEN,Dr],[m.DIFFERENCE,wr],[m.DIVIDE,Tr],[m.DST,null],[m.EXCLUSION,Cr],[m.HARD_LIGHT,Sr],[m.HARD_MIX,Br],[m.HUE,Mr],[m.INVERT,Ir],[m.INVERT_RGB,Pr],[m.LIGHTEN,yr],[m.LINEAR_BURN,Ur],[m.LINEAR_DODGE,Rr],[m.LINEAR_LIGHT,br],[m.LUMINOSITY,Lr],[m.MULTIPLY,Fr],[m.NEGATION,Or],[m.NORMAL,Nr],[m.OVERLAY,Hr],[m.PIN_LIGHT,Gr],[m.REFLECT,kr],[m.SATURATION,zr],[m.SCREEN,_r],[m.SOFT_LIGHT,Qr],[m.SRC,Vr],[m.SUBTRACT,Yr],[m.VIVID_LIGHT,Wr]]),Kr=class extends nt{constructor(e,t=1){super(),this._blendFunction=e,this.opacity=new c(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return Xr.get(this.blendFunction)}},Zr=class extends Vt{constructor({characters:e=" .:,'-^=*+?!|0#X%WM@",font:t="Arial",fontSize:r=54,size:i=1024,cellCount:s=16}={}){super(document.createElement("canvas"),void 0,Be,Be);const a=this.image;a.width=a.height=i;const n=a.getContext("2d"),o=i/s;n.font=`${r}px ${t}`,n.textAlign="center",n.textBaseline="middle",n.fillStyle="#ffffff";for(let l=0,u=e.length;l<u;++l){const h=e[l],f=l%s,d=Math.floor(l/s);n.fillText(h,f*o+o/2,d*o+o/2)}this.characterCount=e.length,this.cellCount=s}},B=class extends nt{constructor(e,t,{attributes:r=N.NONE,blendFunction:i=m.NORMAL,defines:s=new Map,uniforms:a=new Map,extensions:n=null,vertexShader:o=null}={}){super(),this.name=e,this.renderer=null,this.attributes=r,this.fragmentShader=t,this.vertexShader=o,this.defines=s,this.uniforms=a,this.extensions=n,this.blendMode=new Kr(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=ke,this._outputColorSpace=It}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=F){}update(e,t,r){}setSize(e,t){}initialize(e,t,r){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof y||t instanceof Ft||t instanceof ze||t instanceof O)&&this[e].dispose()}}},jr=`uniform sampler2D asciiTexture;uniform vec4 cellCount;
|
|
51
|
+
#ifdef USE_COLOR
|
|
52
|
+
uniform vec3 color;
|
|
53
|
+
#endif
|
|
54
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 pixelizedUv=cellCount.zw*(0.5+floor(uv*cellCount.xy));vec4 texel=texture(inputBuffer,pixelizedUv);float lum=min(luminance(texel.rgb),1.0);
|
|
55
|
+
#ifdef INVERTED
|
|
56
|
+
lum=1.0-lum;
|
|
57
|
+
#endif
|
|
58
|
+
float characterIndex=floor(CHAR_COUNT_MINUS_ONE*lum);vec2 characterPosition=vec2(mod(characterIndex,TEX_CELL_COUNT),floor(characterIndex*INV_TEX_CELL_COUNT));vec2 offset=vec2(characterPosition.x,-characterPosition.y)*INV_TEX_CELL_COUNT;vec2 characterUv=mod(uv*(cellCount.xy*INV_TEX_CELL_COUNT),INV_TEX_CELL_COUNT);characterUv=characterUv-vec2(0.0,INV_TEX_CELL_COUNT)+offset;float asciiCharacter=texture(asciiTexture,characterUv).r;
|
|
59
|
+
#ifdef USE_COLOR
|
|
60
|
+
outputColor=vec4(color*asciiCharacter,inputColor.a);
|
|
61
|
+
#else
|
|
62
|
+
outputColor=vec4(texel.rgb*asciiCharacter,inputColor.a);
|
|
63
|
+
#endif
|
|
64
|
+
}`,ma=class extends B{constructor({asciiTexture:e=new Zr,cellSize:t=16,color:r=null,inverted:i=!1}={}){super("ASCIIEffect",jr,{uniforms:new Map([["asciiTexture",new c(null)],["cellCount",new c(new oe)],["color",new c(new X)]])}),this._cellSize=-1,this.resolution=new g,this.asciiTexture=e,this.cellSize=t,this.color=r,this.inverted=i}get asciiTexture(){return this.uniforms.get("asciiTexture").value}set asciiTexture(e){const t=this.uniforms.get("asciiTexture").value;if(this.uniforms.get("asciiTexture").value=e,t!==null&&t!==e&&t.dispose(),e!==null){const r=e.cellCount;this.defines.set("CHAR_COUNT_MINUS_ONE",(e.characterCount-1).toFixed(1)),this.defines.set("TEX_CELL_COUNT",r.toFixed(1)),this.defines.set("INV_TEX_CELL_COUNT",(1/r).toFixed(9)),this.setChanged()}}get color(){return this.uniforms.get("color").value}set color(e){e!==null&&this.uniforms.get("color").value.set(e),this.defines.has("USE_COLOR")&&e===null?(this.defines.delete("USE_COLOR"),this.setChanged()):!this.defines.has("USE_COLOR")&&e!==null&&(this.defines.set("USE_COLOR","1"),this.setChanged())}get inverted(){return this.defines.has("INVERTED")}set inverted(e){this.inverted!==e&&(e?this.defines.set("INVERTED","1"):this.defines.delete("INVERTED"),this.setChanged())}get cellSize(){return this._cellSize}set cellSize(e){this._cellSize!==e&&(this._cellSize=e,this.updateCellCount())}updateCellCount(){const e=this.uniforms.get("cellCount").value,t=this.resolution;e.x=t.width/this.cellSize,e.y=t.height/this.cellSize,e.z=1/e.x,e.w=1/e.y}setSize(e,t){this.resolution.set(e,t),this.updateCellCount()}dispose(){this.asciiTexture!==null&&this.asciiTexture.dispose(),super.dispose()}},$={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},Jr=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
65
|
+
uniform mediump sampler2D inputBuffer;
|
|
66
|
+
#else
|
|
67
|
+
uniform lowp sampler2D inputBuffer;
|
|
68
|
+
#endif
|
|
69
|
+
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;
|
|
70
|
+
#include <colorspace_fragment>
|
|
71
|
+
}`,qr="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",$r=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],Nt=class extends U{constructor(e=new oe){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new c(null),texelSize:new c(new oe),scale:new c(1),kernel:new c(0)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Jr,vertexShader:qr}),this.setTexelSize(e.x,e.y),this.kernelSize=$.MEDIUM}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get kernelSequence(){return $r[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t,e*.5,t*.5)}setSize(e,t){const r=1/e,i=1/t;this.uniforms.texelSize.value.set(r,i,r*.5,i*.5)}},Pe=class extends O{constructor({kernelSize:e=$.MEDIUM,resolutionScale:t=.5,width:r=E.AUTO_SIZE,height:i=E.AUTO_SIZE,resolutionX:s=r,resolutionY:a=i}={}){super("KawaseBlurPass"),this.renderTargetA=new y(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const n=this.resolution=new E(this,s,a,t);n.addEventListener("change",o=>this.setSize(n.baseWidth,n.baseHeight)),this._blurMaterial=new Nt,this._blurMaterial.kernelSize=e,this.copyMaterial=new _e}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(e){this._blurMaterial=e}get dithering(){return this.copyMaterial.dithering}set dithering(e){this.copyMaterial.dithering=e}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(e){this.blurMaterial.kernelSize=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,i,s){const a=this.scene,n=this.camera,o=this.renderTargetA,l=this.renderTargetB,u=this.blurMaterial,h=u.kernelSequence;let f=t;this.fullscreenMaterial=u;for(let d=0,v=h.length;d<v;++d){const A=(d&1)===0?o:l;u.kernel=h[d],u.inputBuffer=f.texture,e.setRenderTarget(A),e.render(a,n),f=A}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=f.texture,e.setRenderTarget(this.renderToScreen?null:r),e.render(a,n)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.blurMaterial.setSize(e,t)}initialize(e,t,r){r!==void 0&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==H?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e!==null&&e.outputColorSpace===w&&(this.renderTargetA.texture.colorSpace=w,this.renderTargetB.texture.colorSpace=w))}static get AUTO_SIZE(){return E.AUTO_SIZE}},ei=`#include <common>
|
|
72
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
73
|
+
uniform mediump sampler2D inputBuffer;
|
|
74
|
+
#else
|
|
75
|
+
uniform lowp sampler2D inputBuffer;
|
|
76
|
+
#endif
|
|
77
|
+
#ifdef RANGE
|
|
78
|
+
uniform vec2 range;
|
|
79
|
+
#elif defined(THRESHOLD)
|
|
80
|
+
uniform float threshold;uniform float smoothing;
|
|
81
|
+
#endif
|
|
82
|
+
varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0;
|
|
83
|
+
#ifdef RANGE
|
|
84
|
+
float low=step(range.x,l);float high=step(l,range.y);mask=low*high;
|
|
85
|
+
#elif defined(THRESHOLD)
|
|
86
|
+
mask=smoothstep(threshold,threshold+smoothing,l);
|
|
87
|
+
#endif
|
|
88
|
+
#ifdef COLOR
|
|
89
|
+
gl_FragColor=texel*mask;
|
|
90
|
+
#else
|
|
91
|
+
gl_FragColor=vec4(l*mask);
|
|
92
|
+
#endif
|
|
93
|
+
}`,ti=class extends U{constructor(e=!1,t=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Me.replace(/\D+/g,"")},uniforms:{inputBuffer:new c(null),threshold:new c(0),smoothing:new c(1),range:new c(null)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ei,vertexShader:re}),this.colorOutput=e,this.luminanceRange=t}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get threshold(){return this.uniforms.threshold.value}set threshold(e){this.smoothing>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=e}getThreshold(){return this.threshold}setThreshold(e){this.threshold=e}get smoothing(){return this.uniforms.smoothing.value}set smoothing(e){this.threshold>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=e}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(e){this.smoothing=e}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(e){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(e){e?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(e){return this.colorOutput}setColorOutputEnabled(e){this.colorOutput=e}get useRange(){return this.luminanceRange!==null}set useRange(e){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(e){e!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=e,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(e){this.luminanceRange=e}},Ht=class extends O{constructor({renderTarget:e,luminanceRange:t,colorOutput:r,resolutionScale:i=1,width:s=E.AUTO_SIZE,height:a=E.AUTO_SIZE,resolutionX:n=s,resolutionY:o=a}={}){super("LuminancePass"),this.fullscreenMaterial=new ti(r,t),this.needsSwap=!1,this.renderTarget=e,this.renderTarget===void 0&&(this.renderTarget=new y(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const l=this.resolution=new E(this,n,o,i);l.addEventListener("change",u=>this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(e,t,r,i,s){const a=this.fullscreenMaterial;a.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height)}initialize(e,t,r){r!==void 0&&r!==H&&(this.renderTarget.texture.type=r,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},ri=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
94
|
+
uniform mediump sampler2D inputBuffer;
|
|
95
|
+
#else
|
|
96
|
+
uniform lowp sampler2D inputBuffer;
|
|
97
|
+
#endif
|
|
98
|
+
#define WEIGHT_INNER 0.125
|
|
99
|
+
#define WEIGHT_OUTER 0.05556
|
|
100
|
+
varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;
|
|
101
|
+
#include <colorspace_fragment>
|
|
102
|
+
}`,ii="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",si=class extends U{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new c(null),texelSize:new c(new g)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ri,vertexShader:ii})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},ai=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
103
|
+
uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;
|
|
104
|
+
#else
|
|
105
|
+
uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;
|
|
106
|
+
#endif
|
|
107
|
+
uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);
|
|
108
|
+
#include <colorspace_fragment>
|
|
109
|
+
}`,ni="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",oi=class extends U{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new c(null),supportBuffer:new c(null),texelSize:new c(new g),radius:new c(.85)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ai,vertexShader:ni})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}set supportBuffer(e){this.uniforms.supportBuffer.value=e}get radius(){return this.uniforms.radius.value}set radius(e){this.uniforms.radius.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},li=class extends O{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new y(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new si,this.upsamplingMaterial=new oi,this.resolution=new g}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(e){if(this.levels!==e){const t=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let r=0;r<e;++r){const i=t.clone();i.texture.name="Downsampling.Mipmap"+r,this.downsamplingMipmaps.push(i)}this.upsamplingMipmaps.push(t);for(let r=1,i=e-1;r<i;++r){const s=t.clone();s.texture.name="Upsampling.Mipmap"+r,this.upsamplingMipmaps.push(s)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(e){this.upsamplingMaterial.radius=e}render(e,t,r,i,s){const{scene:a,camera:n}=this,{downsamplingMaterial:o,upsamplingMaterial:l}=this,{downsamplingMipmaps:u,upsamplingMipmaps:h}=this;let f=t;this.fullscreenMaterial=o;for(let d=0,v=u.length;d<v;++d){const A=u[d];o.setSize(f.width,f.height),o.inputBuffer=f.texture,e.setRenderTarget(A),e.render(a,n),f=A}this.fullscreenMaterial=l;for(let d=h.length-1;d>=0;--d){const v=h[d];l.setSize(f.width,f.height),l.inputBuffer=f.texture,l.supportBuffer=u[d].texture,e.setRenderTarget(v),e.render(a,n),f=v}}setSize(e,t){const r=this.resolution;r.set(e,t);let i=r.width,s=r.height;for(let a=0,n=this.downsamplingMipmaps.length;a<n;++a)i=Math.round(i*.5),s=Math.round(s*.5),this.downsamplingMipmaps[a].setSize(i,s),a<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[a].setSize(i,s)}initialize(e,t,r){if(r!==void 0){const i=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(const s of i)s.texture.type=r;if(r!==H)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";else if(e!==null&&e.outputColorSpace===w)for(const s of i)s.texture.colorSpace=w}}dispose(){super.dispose();for(const e of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))e.dispose()}},ci=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
110
|
+
uniform mediump sampler2D map;
|
|
111
|
+
#else
|
|
112
|
+
uniform lowp sampler2D map;
|
|
113
|
+
#endif
|
|
114
|
+
uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,ui=class extends B{constructor({blendFunction:e=m.SCREEN,luminanceThreshold:t=1,luminanceSmoothing:r=.03,mipmapBlur:i=!0,intensity:s=1,radius:a=.85,levels:n=8,kernelSize:o=$.LARGE,resolutionScale:l=.5,width:u=E.AUTO_SIZE,height:h=E.AUTO_SIZE,resolutionX:f=u,resolutionY:d=h}={}){super("BloomEffect",ci,{blendFunction:e,uniforms:new Map([["map",new c(null)],["intensity",new c(s)]])}),this.renderTarget=new y(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new Pe({kernelSize:o}),this.luminancePass=new Ht({colorOutput:!0}),this.luminanceMaterial.threshold=t,this.luminanceMaterial.smoothing=r,this.mipmapBlurPass=new li,this.mipmapBlurPass.enabled=i,this.mipmapBlurPass.radius=a,this.mipmapBlurPass.levels=n,this.uniforms.get("map").value=i?this.mipmapBlurPass.texture:this.renderTarget.texture;const v=this.resolution=new E(this,f,d,l);v.addEventListener("change",A=>this.setSize(v.baseWidth,v.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(e){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(e){this.uniforms.get("intensity").value=e}getIntensity(){return this.intensity}setIntensity(e){this.intensity=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}update(e,t,r){const i=this.renderTarget,s=this.luminancePass;s.enabled?(s.render(e,t),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(e,s.renderTarget):this.blurPass.render(e,s.renderTarget,i)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(e,t):this.blurPass.render(e,t,i)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height),this.blurPass.resolution.copy(r),this.luminancePass.setSize(e,t),this.mipmapBlurPass.setSize(e,t)}initialize(e,t,r){this.blurPass.initialize(e,t,r),this.luminancePass.initialize(e,t,r),this.mipmapBlurPass.initialize(e,t,r),r!==void 0&&(this.renderTarget.texture.type=r,e!==null&&e.outputColorSpace===w&&(this.renderTarget.texture.colorSpace=w))}},fi=`uniform float focus;uniform float dof;uniform float aperture;uniform float maxBlur;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec2 aspectCorrection=vec2(1.0,aspect);
|
|
115
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
116
|
+
float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);
|
|
117
|
+
#else
|
|
118
|
+
float linearDepth=depth;
|
|
119
|
+
#endif
|
|
120
|
+
float focusNear=clamp(focus-dof,0.0,1.0);float focusFar=clamp(focus+dof,0.0,1.0);float low=step(linearDepth,focusNear);float high=step(focusFar,linearDepth);float factor=(linearDepth-focusNear)*low+(linearDepth-focusFar)*high;vec2 dofBlur=vec2(clamp(factor*aperture,-maxBlur,maxBlur));vec2 dofblur9=dofBlur*0.9;vec2 dofblur7=dofBlur*0.7;vec2 dofblur4=dofBlur*0.4;vec4 color=inputColor;color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.37,0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.40,0.0)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.37,-0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.15,-0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.15,0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.37,0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.37,-0.15)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,-0.37)*aspectCorrection)*dofBlur);color+=texture2D(inputBuffer,uv+(vec2(0.15,0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.37,0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.37,-0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.15,-0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.15,0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.37,0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(-0.37,-0.15)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.15,-0.37)*aspectCorrection)*dofblur9);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.40,0.0)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofblur7);color+=texture2D(inputBuffer,uv+(vec2(0.29,0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.4,0.0)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.29,-0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.0,-0.4)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.29,0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.4,0.0)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(-0.29,-0.29)*aspectCorrection)*dofblur4);color+=texture2D(inputBuffer,uv+(vec2(0.0,0.4)*aspectCorrection)*dofblur4);outputColor=color/41.0;}`,Aa=class extends B{constructor({blendFunction:e,focus:t=.5,dof:r=.02,aperture:i=.015,maxBlur:s=1}={}){super("BokehEffect",fi,{blendFunction:e,attributes:N.CONVOLUTION|N.DEPTH,uniforms:new Map([["focus",new c(t)],["dof",new c(r)],["aperture",new c(i)],["maxBlur",new c(s)]])})}},hi="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(color+vec3(0.5),inputColor.a);}",xa=class extends B{constructor({blendFunction:e=m.SRC,brightness:t=0,contrast:r=0}={}){super("BrightnessContrastEffect",hi,{blendFunction:e,uniforms:new Map([["brightness",new c(t)],["contrast",new c(r)]])}),this.inputColorSpace=w}get brightness(){return this.uniforms.get("brightness").value}set brightness(e){this.uniforms.get("brightness").value=e}getBrightness(){return this.brightness}setBrightness(e){this.brightness=e}get contrast(){return this.uniforms.get("contrast").value}set contrast(e){this.uniforms.get("contrast").value=e}getContrast(){return this.contrast}setContrast(e){this.contrast=e}},di="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",Ea=class extends B{constructor(e){super("ColorAverageEffect",di,{blendFunction:e})}},vi="uniform float factor;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(floor(inputColor.rgb*factor+0.5)/factor,inputColor.a);}",Da=class extends B{constructor({blendFunction:e,bits:t=16}={}){super("ColorDepthEffect",vi,{blendFunction:e,uniforms:new Map([["factor",new c(1)]])}),this.bits=0,this.bitDepth=t}get bitDepth(){return this.bits}set bitDepth(e){this.bits=e,this.uniforms.get("factor").value=Math.pow(2,e/3)}getBitDepth(){return this.bitDepth}setBitDepth(e){this.bitDepth=e}},gi=`#ifdef RADIAL_MODULATION
|
|
121
|
+
uniform float modulationOffset;
|
|
122
|
+
#endif
|
|
123
|
+
varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=inputColor.ra;vec2 ba=inputColor.ba;
|
|
124
|
+
#ifdef RADIAL_MODULATION
|
|
125
|
+
const vec2 center=vec2(0.5);float d=distance(uv,center)*2.0;d=max(d-modulationOffset,0.0);if(vActive>0.0&&d>0.0){ra=texture2D(inputBuffer,mix(uv,vUvR,d)).ra;ba=texture2D(inputBuffer,mix(uv,vUvB,d)).ba;}
|
|
126
|
+
#else
|
|
127
|
+
if(vActive>0.0){ra=texture2D(inputBuffer,vUvR).ra;ba=texture2D(inputBuffer,vUvB).ba;}
|
|
128
|
+
#endif
|
|
129
|
+
outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}`,pi="uniform vec2 offset;varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vActive=(shift.x!=0.0||shift.y!=0.0)?1.0:0.0;vUvR=uv+shift;vUvB=uv-shift;}",wa=class extends B{constructor({offset:e=new g(.001,5e-4),radialModulation:t=!1,modulationOffset:r=.15}={}){super("ChromaticAberrationEffect",gi,{vertexShader:pi,attributes:N.CONVOLUTION,uniforms:new Map([["offset",new c(e)],["modulationOffset",new c(r)]])}),this.radialModulation=t}get offset(){return this.uniforms.get("offset").value}set offset(e){this.uniforms.get("offset").value=e}get radialModulation(){return this.defines.has("RADIAL_MODULATION")}set radialModulation(e){e?this.defines.set("RADIAL_MODULATION","1"):this.defines.delete("RADIAL_MODULATION"),this.setChanged()}get modulationOffset(){return this.uniforms.get("modulationOffset").value}set modulationOffset(e){this.uniforms.get("modulationOffset").value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}},mi=`void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){
|
|
130
|
+
#ifdef INVERTED
|
|
131
|
+
vec3 color=vec3(1.0-depth);
|
|
132
|
+
#else
|
|
133
|
+
vec3 color=vec3(depth);
|
|
134
|
+
#endif
|
|
135
|
+
outputColor=vec4(color,inputColor.a);}`,Ta=class extends B{constructor({blendFunction:e=m.SRC,inverted:t=!1}={}){super("DepthEffect",mi,{blendFunction:e,attributes:N.DEPTH}),this.inverted=t}get inverted(){return this.defines.has("INVERTED")}set inverted(e){this.inverted!==e&&(e?this.defines.set("INVERTED","1"):this.defines.delete("INVERTED"),this.setChanged())}isInverted(){return this.inverted}setInverted(e){this.inverted=e}},ve={RED:0,GREEN:1,BLUE:2,ALPHA:3},Gt={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2,MULTIPLY_RGB:3},Ai=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
136
|
+
uniform mediump sampler2D inputBuffer;
|
|
137
|
+
#else
|
|
138
|
+
uniform lowp sampler2D inputBuffer;
|
|
139
|
+
#endif
|
|
140
|
+
#if PASS == 1
|
|
141
|
+
uniform vec4 kernel64[32];
|
|
142
|
+
#else
|
|
143
|
+
uniform vec4 kernel16[8];
|
|
144
|
+
#endif
|
|
145
|
+
uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;varying vec2 vUv;void main(){
|
|
146
|
+
#ifdef FOREGROUND
|
|
147
|
+
vec2 cocNearFar=texture2D(cocBuffer,vUv).rg*scale;float coc=cocNearFar.x;
|
|
148
|
+
#else
|
|
149
|
+
float coc=texture2D(cocBuffer,vUv).g*scale;
|
|
150
|
+
#endif
|
|
151
|
+
if(coc==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{
|
|
152
|
+
#ifdef FOREGROUND
|
|
153
|
+
vec2 step=texelSize*max(cocNearFar.x,cocNearFar.y);
|
|
154
|
+
#else
|
|
155
|
+
vec2 step=texelSize*coc;
|
|
156
|
+
#endif
|
|
157
|
+
#if PASS == 1
|
|
158
|
+
vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;
|
|
159
|
+
#else
|
|
160
|
+
vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;
|
|
161
|
+
#endif
|
|
162
|
+
}}`,be=class extends U{constructor(e=!1,t=!1){super({name:"BokehMaterial",defines:{PASS:e?"2":"1"},uniforms:{inputBuffer:new c(null),cocBuffer:new c(null),texelSize:new c(new g),kernel64:new c(null),kernel16:new c(null),scale:new c(1)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ai,vertexShader:re}),t&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set cocBuffer(e){this.uniforms.cocBuffer.value=e}setCoCBuffer(e){this.uniforms.cocBuffer.value=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(e){return this.scale}setScale(e){this.scale=e}generateKernel(){const e=2.39996323,t=new Float64Array(128),r=new Float64Array(32);let i=0,s=0;for(let a=0,n=Math.sqrt(80);a<80;++a){const o=a*e,l=Math.sqrt(a)/n,u=l*Math.cos(o),h=l*Math.sin(o);a%5===0?(r[s++]=u,r[s++]=h):(t[i++]=u,t[i++]=h)}this.uniforms.kernel64.value=t,this.uniforms.kernel16.value=r}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},xi=`#include <common>
|
|
163
|
+
#include <packing>
|
|
164
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
165
|
+
uniform highp sampler2D depthBuffer;
|
|
166
|
+
#else
|
|
167
|
+
uniform mediump sampler2D depthBuffer;
|
|
168
|
+
#endif
|
|
169
|
+
uniform mat4 projectionMatrix;uniform mat4 projectionMatrixInverse;uniform float cameraNear;uniform float cameraFar;uniform float focusDistance;uniform float focusRange;varying vec2 vUv;float readDepth(const in vec2 uv){
|
|
170
|
+
#if DEPTH_PACKING == 3201
|
|
171
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
172
|
+
#else
|
|
173
|
+
float depth=texture2D(depthBuffer,uv).r;
|
|
174
|
+
#endif
|
|
175
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
176
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
177
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
178
|
+
depth=1.0-depth;
|
|
179
|
+
#endif
|
|
180
|
+
return depth;}
|
|
181
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
182
|
+
#define getViewZ(depth) perspectiveDepthToViewZ(depth, cameraNear, cameraFar)
|
|
183
|
+
#else
|
|
184
|
+
#define getViewZ(depth) orthographicDepthToViewZ(depth, cameraNear, cameraFar)
|
|
185
|
+
#endif
|
|
186
|
+
vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(projectionMatrixInverse*clipPosition).xyz;}vec3 getViewPosition(const in vec2 screenPosition,const in float depth){return getViewPosition(screenPosition,depth,getViewZ(depth));}
|
|
187
|
+
#define getDistance(viewPosition) length(viewPosition)
|
|
188
|
+
void main(){float depth=readDepth(vUv);vec3 viewPosition=getViewPosition(vUv,depth);float distance=getDistance(viewPosition);float signedDistance=distance-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,Ei=class extends U{constructor(e=null){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new c(null),projectionMatrix:new c(null),projectionMatrixInverse:new c(null),cameraNear:new c(.3),cameraFar:new c(1e3),focusDistance:new c(0),focusRange:new c(0)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:xi,vertexShader:re}),this.uniforms.focalLength=this.uniforms.focusRange,e!==null&&this.copyCameraSettings(e)}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=F){this.depthBuffer=e,this.depthPacking=t}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(e){this.uniforms.focusDistance.value=e}get worldFocusDistance(){return this.focusDistance}set worldFocusDistance(e){this.focusDistance=e}getFocusDistance(e){this.uniforms.focusDistance.value=e}setFocusDistance(e){this.uniforms.focusDistance.value=e}get focalLength(){return this.focusRange}set focalLength(e){this.focusRange=e}get focusRange(){return this.uniforms.focusRange.value}set focusRange(e){this.uniforms.focusRange.value=e}get worldFocusRange(){return this.focusRange}set worldFocusRange(e){this.focusRange=e}getFocalLength(e){return this.focusRange}setFocalLength(e){this.focusRange=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){this.uniforms.projectionMatrix.value=e.projectionMatrix,this.uniforms.projectionMatrixInverse.value=e.projectionMatrixInverse,this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far;const t=this.defines.PERSPECTIVE_CAMERA!==void 0;e instanceof pe?t||(this.defines.PERSPECTIVE_CAMERA=!0,this.needsUpdate=!0):t&&(delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},Di=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
189
|
+
uniform mediump sampler2D inputBuffer;
|
|
190
|
+
#else
|
|
191
|
+
uniform lowp sampler2D inputBuffer;
|
|
192
|
+
#endif
|
|
193
|
+
#ifdef MASK_PRECISION_HIGH
|
|
194
|
+
uniform mediump sampler2D maskTexture;
|
|
195
|
+
#else
|
|
196
|
+
uniform lowp sampler2D maskTexture;
|
|
197
|
+
#endif
|
|
198
|
+
#if MASK_FUNCTION != 0
|
|
199
|
+
uniform float strength;
|
|
200
|
+
#endif
|
|
201
|
+
varying vec2 vUv;void main(){
|
|
202
|
+
#if COLOR_CHANNEL == 0
|
|
203
|
+
float mask=texture2D(maskTexture,vUv).r;
|
|
204
|
+
#elif COLOR_CHANNEL == 1
|
|
205
|
+
float mask=texture2D(maskTexture,vUv).g;
|
|
206
|
+
#elif COLOR_CHANNEL == 2
|
|
207
|
+
float mask=texture2D(maskTexture,vUv).b;
|
|
208
|
+
#else
|
|
209
|
+
float mask=texture2D(maskTexture,vUv).a;
|
|
210
|
+
#endif
|
|
211
|
+
#if MASK_FUNCTION == 0
|
|
212
|
+
#ifdef INVERTED
|
|
213
|
+
mask=(mask>0.0)?0.0:1.0;
|
|
214
|
+
#else
|
|
215
|
+
mask=(mask>0.0)?1.0:0.0;
|
|
216
|
+
#endif
|
|
217
|
+
#else
|
|
218
|
+
mask=clamp(mask*strength,0.0,1.0);
|
|
219
|
+
#ifdef INVERTED
|
|
220
|
+
mask=1.0-mask;
|
|
221
|
+
#endif
|
|
222
|
+
#endif
|
|
223
|
+
#if MASK_FUNCTION == 3
|
|
224
|
+
vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=vec4(mask*texel.rgb,texel.a);
|
|
225
|
+
#elif MASK_FUNCTION == 2
|
|
226
|
+
gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask);
|
|
227
|
+
#else
|
|
228
|
+
gl_FragColor=mask*texture2D(inputBuffer,vUv);
|
|
229
|
+
#endif
|
|
230
|
+
}`,wi=class extends U{constructor(e=null){super({name:"MaskMaterial",uniforms:{maskTexture:new c(e),inputBuffer:new c(null),strength:new c(1)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Di,vertexShader:re}),this.colorChannel=ve.RED,this.maskFunction=Gt.DISCARD}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}set maskTexture(e){this.uniforms.maskTexture.value=e,delete this.defines.MASK_PRECISION_HIGH,e.type!==H&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(e){this.maskTexture=e}set colorChannel(e){this.defines.COLOR_CHANNEL=e.toFixed(0),this.needsUpdate=!0}setColorChannel(e){this.colorChannel=e}set maskFunction(e){this.defines.MASK_FUNCTION=e.toFixed(0),this.needsUpdate=!0}setMaskFunction(e){this.maskFunction=e}get inverted(){return this.defines.INVERTED!==void 0}set inverted(e){this.inverted&&!e?delete this.defines.INVERTED:e&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(e){this.inverted=e}get strength(){return this.uniforms.strength.value}set strength(e){this.uniforms.strength.value=e}getStrength(){return this.strength}setStrength(e){this.strength=e}},W=class extends O{constructor(e,t="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=e,this.input=t}setInput(e){this.input=e}render(e,t,r,i,s){const a=this.fullscreenMaterial.uniforms;t!==null&&a!==void 0&&a[this.input]!==void 0&&(a[this.input].value=t.texture),e.setRenderTarget(this.renderToScreen?null:r),e.render(this.scene,this.camera)}initialize(e,t,r){r!==void 0&&r!==H&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Ti=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
231
|
+
uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer;
|
|
232
|
+
#else
|
|
233
|
+
uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer;
|
|
234
|
+
#endif
|
|
235
|
+
#if MASK_FUNCTION != 1 && MASK_FUNCTION != 2
|
|
236
|
+
uniform lowp sampler2D farCoCBuffer;
|
|
237
|
+
#endif
|
|
238
|
+
uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);
|
|
239
|
+
#if MASK_FUNCTION == 1 || MASK_FUNCTION == 2
|
|
240
|
+
vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,colorFar.a);cocNearFar.x=min(cocNearFar.x*scale,1.0);
|
|
241
|
+
#else
|
|
242
|
+
vec2 cocNearFar=vec2(texture2D(nearCoCBuffer,uv).r,texture2D(farCoCBuffer,uv).g);cocNearFar=min(cocNearFar*scale,1.0);colorFar.a*=cocNearFar.y;
|
|
243
|
+
#endif
|
|
244
|
+
vec4 result=inputColor*(1.0-cocNearFar.y)+colorFar;result=mix(result,colorNear,cocNearFar.x);outputColor=result;}`,Ci=new z,Ca=class extends B{constructor(e,{blendFunction:t,worldFocusDistance:r,worldFocusRange:i,focalLength:s,focusDistance:a=r||3,focusRange:n=i||s||2,bokehScale:o=1,resolutionScale:l=.5,width:u,height:h,resolutionX:f=u||E.AUTO_SIZE,resolutionY:d=h||E.AUTO_SIZE}={}){super("DepthOfFieldEffect",Ti,{blendFunction:t,attributes:N.DEPTH,uniforms:new Map([["nearColorBuffer",new c(null)],["farColorBuffer",new c(null)],["nearCoCBuffer",new c(null)],["farCoCBuffer",new c(null)],["scale",new c(1)]])}),this.camera=e,this.renderTarget=new y(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.uniforms.get("farCoCBuffer").value=this.renderTargetCoC.texture,this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new W(new Ei(e));const v=this.cocMaterial;v.focusDistance=a,v.focusRange=n,this.blurPass=new Pe({resolutionScale:l,resolutionX:f,resolutionY:d,kernelSize:$.MEDIUM}),this.maskPass=new W(new wi(this.renderTargetCoC.texture));const A=this.maskPass.fullscreenMaterial;A.colorChannel=ve.GREEN,this.maskFunction=Gt.MULTIPLY_RGB,this.bokehNearBasePass=new W(new be(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new W(new be(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new W(new be(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new W(new be(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null;const p=this.resolution=new E(this,f,d,l);p.addEventListener("change",x=>this.setSize(p.baseWidth,p.baseHeight)),this.bokehScale=o}set mainCamera(e){this.camera=e,this.cocMaterial.copyCameraSettings(e)}get cocTexture(){return this.renderTargetCoC.texture}get maskFunction(){return this.maskPass.fullscreenMaterial.maskFunction}set maskFunction(e){this.maskFunction!==e&&(this.defines.set("MASK_FUNCTION",e.toFixed(0)),this.maskPass.fullscreenMaterial.maskFunction=e,this.setChanged())}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.cocMaterial}getBlurPass(){return this.blurPass}getResolution(){return this.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(e){this.bokehNearBasePass.fullscreenMaterial.scale=e,this.bokehNearFillPass.fullscreenMaterial.scale=e,this.bokehFarBasePass.fullscreenMaterial.scale=e,this.bokehFarFillPass.fullscreenMaterial.scale=e,this.maskPass.fullscreenMaterial.strength=e,this.uniforms.get("scale").value=e}getBokehScale(){return this.bokehScale}setBokehScale(e){this.bokehScale=e}getTarget(){return this.target}setTarget(e){this.target=e}calculateFocusDistance(e){return this.camera.getWorldPosition(Ci).distanceTo(e)}setDepthTexture(e,t=F){this.cocMaterial.depthBuffer=e,this.cocMaterial.depthPacking=t}update(e,t,r){const i=this.renderTarget,s=this.renderTargetCoC,a=this.renderTargetCoCBlurred,n=this.renderTargetMasked;if(this.target!==null){const o=this.calculateFocusDistance(this.target);this.cocMaterial.focusDistance=o}this.cocPass.render(e,null,s),this.blurPass.render(e,s,a),this.maskPass.render(e,t,n),this.bokehFarBasePass.render(e,n,i),this.bokehFarFillPass.render(e,i,this.renderTargetFar),this.bokehNearBasePass.render(e,t,i),this.bokehNearFillPass.render(e,i,this.renderTargetNear)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.cocPass.setSize(e,t),this.blurPass.setSize(e,t),this.maskPass.setSize(e,t),this.renderTargetFar.setSize(e,t),this.renderTargetCoC.setSize(e,t),this.renderTargetMasked.setSize(e,t),this.renderTarget.setSize(i,s),this.renderTargetNear.setSize(i,s),this.renderTargetCoCBlurred.setSize(i,s),this.bokehNearBasePass.fullscreenMaterial.setSize(e,t),this.bokehNearFillPass.fullscreenMaterial.setSize(e,t),this.bokehFarBasePass.fullscreenMaterial.setSize(e,t),this.bokehFarFillPass.fullscreenMaterial.setSize(e,t)}initialize(e,t,r){this.cocPass.initialize(e,t,r),this.maskPass.initialize(e,t,r),this.bokehNearBasePass.initialize(e,t,r),this.bokehNearFillPass.initialize(e,t,r),this.bokehFarBasePass.initialize(e,t,r),this.bokehFarFillPass.initialize(e,t,r),this.blurPass.initialize(e,t,H),e.capabilities.logarithmicDepthBuffer&&(this.cocPass.fullscreenMaterial.defines.LOG_DEPTH="1"),r!==void 0&&(this.renderTarget.texture.type=r,this.renderTargetNear.texture.type=r,this.renderTargetFar.texture.type=r,this.renderTargetMasked.texture.type=r,e!==null&&e.outputColorSpace===w&&(this.renderTarget.texture.colorSpace=w,this.renderTargetNear.texture.colorSpace=w,this.renderTargetFar.texture.colorSpace=w,this.renderTargetMasked.texture.colorSpace=w))}},Si="uniform vec2 angle;uniform float scale;float pattern(const in vec2 uv){vec2 point=scale*vec2(dot(angle.yx,vec2(uv.x,-uv.y)),dot(angle,uv));return(sin(point.x)*sin(point.y))*4.0;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(inputColor.rgb*10.0-5.0+pattern(uv*resolution));outputColor=vec4(color,inputColor.a);}",Sa=class extends B{constructor({blendFunction:e,angle:t=Math.PI*.5,scale:r=1}={}){super("DotScreenEffect",Si,{blendFunction:e,uniforms:new Map([["angle",new c(new g)],["scale",new c(r)]])}),this.angle=t}get angle(){return Math.acos(this.uniforms.get("angle").value.y)}set angle(e){this.uniforms.get("angle").value.set(Math.sin(e),Math.cos(e))}getAngle(){return this.angle}setAngle(e){this.angle=e}get scale(){return this.uniforms.get("scale").value}set scale(e){this.uniforms.get("scale").value=e}},Bi=`#define QUALITY(q) ((q) < 5 ? 1.0 : ((q) > 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5))
|
|
245
|
+
#define ONE_OVER_TWELVE 0.08333333333333333
|
|
246
|
+
varying vec2 vUvDown;varying vec2 vUvUp;varying vec2 vUvLeft;varying vec2 vUvRight;varying vec2 vUvDownLeft;varying vec2 vUvUpRight;varying vec2 vUvUpLeft;varying vec2 vUvDownRight;vec4 fxaa(const in vec4 inputColor,const in vec2 uv){float lumaCenter=luminance(inputColor.rgb);float lumaDown=luminance(texture2D(inputBuffer,vUvDown).rgb);float lumaUp=luminance(texture2D(inputBuffer,vUvUp).rgb);float lumaLeft=luminance(texture2D(inputBuffer,vUvLeft).rgb);float lumaRight=luminance(texture2D(inputBuffer,vUvRight).rgb);float lumaMin=min(lumaCenter,min(min(lumaDown,lumaUp),min(lumaLeft,lumaRight)));float lumaMax=max(lumaCenter,max(max(lumaDown,lumaUp),max(lumaLeft,lumaRight)));float lumaRange=lumaMax-lumaMin;if(lumaRange<max(EDGE_THRESHOLD_MIN,lumaMax*EDGE_THRESHOLD_MAX)){return inputColor;}float lumaDownLeft=luminance(texture2D(inputBuffer,vUvDownLeft).rgb);float lumaUpRight=luminance(texture2D(inputBuffer,vUvUpRight).rgb);float lumaUpLeft=luminance(texture2D(inputBuffer,vUvUpLeft).rgb);float lumaDownRight=luminance(texture2D(inputBuffer,vUvDownRight).rgb);float lumaDownUp=lumaDown+lumaUp;float lumaLeftRight=lumaLeft+lumaRight;float lumaLeftCorners=lumaDownLeft+lumaUpLeft;float lumaDownCorners=lumaDownLeft+lumaDownRight;float lumaRightCorners=lumaDownRight+lumaUpRight;float lumaUpCorners=lumaUpRight+lumaUpLeft;float edgeHorizontal=(abs(-2.0*lumaLeft+lumaLeftCorners)+abs(-2.0*lumaCenter+lumaDownUp)*2.0+abs(-2.0*lumaRight+lumaRightCorners));float edgeVertical=(abs(-2.0*lumaUp+lumaUpCorners)+abs(-2.0*lumaCenter+lumaLeftRight)*2.0+abs(-2.0*lumaDown+lumaDownCorners));bool isHorizontal=(edgeHorizontal>=edgeVertical);float stepLength=isHorizontal?texelSize.y:texelSize.x;float luma1=isHorizontal?lumaDown:lumaLeft;float luma2=isHorizontal?lumaUp:lumaRight;float gradient1=abs(luma1-lumaCenter);float gradient2=abs(luma2-lumaCenter);bool is1Steepest=gradient1>=gradient2;float gradientScaled=0.25*max(gradient1,gradient2);float lumaLocalAverage=0.0;if(is1Steepest){stepLength=-stepLength;lumaLocalAverage=0.5*(luma1+lumaCenter);}else{lumaLocalAverage=0.5*(luma2+lumaCenter);}vec2 currentUv=uv;if(isHorizontal){currentUv.y+=stepLength*0.5;}else{currentUv.x+=stepLength*0.5;}vec2 offset=isHorizontal?vec2(texelSize.x,0.0):vec2(0.0,texelSize.y);vec2 uv1=currentUv-offset*QUALITY(0);vec2 uv2=currentUv+offset*QUALITY(0);float lumaEnd1=luminance(texture2D(inputBuffer,uv1).rgb);float lumaEnd2=luminance(texture2D(inputBuffer,uv2).rgb);lumaEnd1-=lumaLocalAverage;lumaEnd2-=lumaLocalAverage;bool reached1=abs(lumaEnd1)>=gradientScaled;bool reached2=abs(lumaEnd2)>=gradientScaled;bool reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(1);}if(!reached2){uv2+=offset*QUALITY(1);}if(!reachedBoth){for(int i=2;i<SAMPLES;++i){if(!reached1){lumaEnd1=luminance(texture2D(inputBuffer,uv1).rgb);lumaEnd1=lumaEnd1-lumaLocalAverage;}if(!reached2){lumaEnd2=luminance(texture2D(inputBuffer,uv2).rgb);lumaEnd2=lumaEnd2-lumaLocalAverage;}reached1=abs(lumaEnd1)>=gradientScaled;reached2=abs(lumaEnd2)>=gradientScaled;reachedBoth=reached1&&reached2;if(!reached1){uv1-=offset*QUALITY(i);}if(!reached2){uv2+=offset*QUALITY(i);}if(reachedBoth){break;}}}float distance1=isHorizontal?(uv.x-uv1.x):(uv.y-uv1.y);float distance2=isHorizontal?(uv2.x-uv.x):(uv2.y-uv.y);bool isDirection1=distance1<distance2;float distanceFinal=min(distance1,distance2);float edgeThickness=(distance1+distance2);bool isLumaCenterSmaller=lumaCenter<lumaLocalAverage;bool correctVariation1=(lumaEnd1<0.0)!=isLumaCenterSmaller;bool correctVariation2=(lumaEnd2<0.0)!=isLumaCenterSmaller;bool correctVariation=isDirection1?correctVariation1:correctVariation2;float pixelOffset=-distanceFinal/edgeThickness+0.5;float finalOffset=correctVariation?pixelOffset:0.0;float lumaAverage=ONE_OVER_TWELVE*(2.0*(lumaDownUp+lumaLeftRight)+lumaLeftCorners+lumaRightCorners);float subPixelOffset1=clamp(abs(lumaAverage-lumaCenter)/lumaRange,0.0,1.0);float subPixelOffset2=(-2.0*subPixelOffset1+3.0)*subPixelOffset1*subPixelOffset1;float subPixelOffsetFinal=subPixelOffset2*subPixelOffset2*SUBPIXEL_QUALITY;finalOffset=max(finalOffset,subPixelOffsetFinal);vec2 finalUv=uv;if(isHorizontal){finalUv.y+=finalOffset*stepLength;}else{finalUv.x+=finalOffset*stepLength;}return texture2D(inputBuffer,finalUv);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=fxaa(inputColor,uv);}`,Mi="varying vec2 vUvDown;varying vec2 vUvUp;varying vec2 vUvLeft;varying vec2 vUvRight;varying vec2 vUvDownLeft;varying vec2 vUvUpRight;varying vec2 vUvUpLeft;varying vec2 vUvDownRight;void mainSupport(const in vec2 uv){vUvDown=uv+vec2(0.0,-1.0)*texelSize;vUvUp=uv+vec2(0.0,1.0)*texelSize;vUvRight=uv+vec2(1.0,0.0)*texelSize;vUvLeft=uv+vec2(-1.0,0.0)*texelSize;vUvDownLeft=uv+vec2(-1.0,-1.0)*texelSize;vUvUpRight=uv+vec2(1.0,1.0)*texelSize;vUvUpLeft=uv+vec2(-1.0,1.0)*texelSize;vUvDownRight=uv+vec2(1.0,-1.0)*texelSize;}",Ba=class extends B{constructor({blendFunction:e=m.SRC}={}){super("FXAAEffect",Bi,{vertexShader:Mi,blendFunction:e,defines:new Map([["EDGE_THRESHOLD_MIN","0.0312"],["EDGE_THRESHOLD_MAX","0.125"],["SUBPIXEL_QUALITY","0.75"],["SAMPLES","12"]])})}get minEdgeThreshold(){return Number(this.defines.get("EDGE_THRESHOLD_MIN"))}set minEdgeThreshold(e){this.defines.set("EDGE_THRESHOLD_MIN",e.toFixed(12)),this.setChanged()}get maxEdgeThreshold(){return Number(this.defines.get("EDGE_THRESHOLD_MAX"))}set maxEdgeThreshold(e){this.defines.set("EDGE_THRESHOLD_MAX",e.toFixed(12)),this.setChanged()}get subpixelQuality(){return Number(this.defines.get("SUBPIXEL_QUALITY"))}set subpixelQuality(e){this.defines.set("SUBPIXEL_QUALITY",e.toFixed(12)),this.setChanged()}get samples(){return Number(this.defines.get("SAMPLES"))}set samples(e){this.defines.set("SAMPLES",e.toFixed(0)),this.setChanged()}},Ii="uniform float gamma;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=LinearToGamma(max(inputColor,0.0),gamma);}",Ma=class extends B{constructor({blendFunction:e=m.SRC,gamma:t=2}={}){super("GammaCorrectionEffect",Ii,{blendFunction:e,uniforms:new Map([["gamma",new c(t)]])})}},me={DISABLED:0,SPORADIC:1,CONSTANT_MILD:2,CONSTANT_WILD:3};function Pi(e,t,r){const i=new Map([[bt,1],[ar,2],[ae,4]]);let s;if(i.has(t)||console.error("Invalid noise texture format"),r===H){s=new Uint8Array(e*i.get(t));for(let a=0,n=s.length;a<n;++a)s[a]=Math.random()*255+.5}else{s=new Float32Array(e*i.get(t));for(let a=0,n=s.length;a<n;++a)s[a]=Math.random()}return s}var it=class extends Rt{constructor(e,t,r=bt,i=H){super(Pi(e*t,r,i),e,t,r,i),this.needsUpdate=!0}},yi="uniform lowp sampler2D perturbationMap;uniform bool active;uniform float columns;uniform float random;uniform vec2 seeds;uniform vec2 distortion;void mainUv(inout vec2 uv){if(active){if(uv.y<distortion.x+columns&&uv.y>distortion.x-columns*random){float sx=clamp(ceil(seeds.x),0.0,1.0);uv.y=sx*(1.0-(uv.y+distortion.y))+(1.0-sx)*distortion.y;}if(uv.x<distortion.y+columns&&uv.x>distortion.y-columns*random){float sy=clamp(ceil(seeds.y),0.0,1.0);uv.x=sy*distortion.x+(1.0-sy)*(1.0-(uv.x+distortion.x));}vec2 normal=texture2D(perturbationMap,uv*random*random).rg;uv+=normal*seeds*(random*0.2);}}",Le="Glitch.Generated";function Q(e,t){return e+Math.random()*(t-e)}var Ia=class extends B{constructor({chromaticAberrationOffset:e=null,delay:t=new g(1.5,3.5),duration:r=new g(.6,1),strength:i=new g(.3,1),columns:s=.05,ratio:a=.85,perturbationMap:n=null,dtSize:o=64}={}){if(super("GlitchEffect",yi,{uniforms:new Map([["perturbationMap",new c(null)],["columns",new c(s)],["active",new c(!1)],["random",new c(1)],["seeds",new c(new g)],["distortion",new c(new g)]])}),n===null){const l=new it(o,o,ae);l.name=Le,this.perturbationMap=l}else this.perturbationMap=n;this.time=0,this.distortion=this.uniforms.get("distortion").value,this.delay=t,this.duration=r,this.breakPoint=new g(Q(this.delay.x,this.delay.y),Q(this.duration.x,this.duration.y)),this.strength=i,this.mode=me.SPORADIC,this.ratio=a,this.chromaticAberrationOffset=e}get seeds(){return this.uniforms.get("seeds").value}get active(){return this.uniforms.get("active").value}isActive(){return this.active}get minDelay(){return this.delay.x}set minDelay(e){this.delay.x=e}getMinDelay(){return this.delay.x}setMinDelay(e){this.delay.x=e}get maxDelay(){return this.delay.y}set maxDelay(e){this.delay.y=e}getMaxDelay(){return this.delay.y}setMaxDelay(e){this.delay.y=e}get minDuration(){return this.duration.x}set minDuration(e){this.duration.x=e}getMinDuration(){return this.duration.x}setMinDuration(e){this.duration.x=e}get maxDuration(){return this.duration.y}set maxDuration(e){this.duration.y=e}getMaxDuration(){return this.duration.y}setMaxDuration(e){this.duration.y=e}get minStrength(){return this.strength.x}set minStrength(e){this.strength.x=e}getMinStrength(){return this.strength.x}setMinStrength(e){this.strength.x=e}get maxStrength(){return this.strength.y}set maxStrength(e){this.strength.y=e}getMaxStrength(){return this.strength.y}setMaxStrength(e){this.strength.y=e}getMode(){return this.mode}setMode(e){this.mode=e}getGlitchRatio(){return 1-this.ratio}setGlitchRatio(e){this.ratio=Math.min(Math.max(1-e,0),1)}get columns(){return this.uniforms.get("columns").value}set columns(e){this.uniforms.get("columns").value=e}getGlitchColumns(){return this.columns}setGlitchColumns(e){this.columns=e}getChromaticAberrationOffset(){return this.chromaticAberrationOffset}setChromaticAberrationOffset(e){this.chromaticAberrationOffset=e}get perturbationMap(){return this.uniforms.get("perturbationMap").value}set perturbationMap(e){const t=this.perturbationMap;t!==null&&t.name===Le&&t.dispose(),e.minFilter=e.magFilter=_,e.wrapS=e.wrapT=Be,e.generateMipmaps=!1,this.uniforms.get("perturbationMap").value=e}getPerturbationMap(){return this.perturbationMap}setPerturbationMap(e){this.perturbationMap=e}generatePerturbationMap(e=64){const t=new it(e,e,ae);return t.name=Le,t}update(e,t,r){const i=this.mode,s=this.breakPoint,a=this.chromaticAberrationOffset,n=this.strength;let o=this.time,l=!1,u=0,h=0,f;i!==me.DISABLED&&(i===me.SPORADIC&&(o+=r,f=o>s.x,o>=s.x+s.y&&(s.set(Q(this.delay.x,this.delay.y),Q(this.duration.x,this.duration.y)),o=0)),u=Math.random(),this.uniforms.get("random").value=u,f&&u>this.ratio||i===me.CONSTANT_WILD?(l=!0,u*=n.y*.03,h=Q(-Math.PI,Math.PI),this.seeds.set(Q(-n.y,n.y),Q(-n.y,n.y)),this.distortion.set(Q(0,1),Q(0,1))):(f||i===me.CONSTANT_MILD)&&(l=!0,u*=n.x*.03,h=Q(-Math.PI,Math.PI),this.seeds.set(Q(-n.x,n.x),Q(-n.x,n.x)),this.distortion.set(Q(0,1),Q(0,1))),this.time=o),a!==null&&(l?a.set(Math.cos(h),Math.sin(h)).multiplyScalar(u):a.set(0,0)),this.uniforms.get("active").value=l}dispose(){const e=this.perturbationMap;e!==null&&e.name===Le&&e.dispose()}},Ui=`#include <common>
|
|
247
|
+
#include <dithering_pars_fragment>
|
|
248
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
249
|
+
uniform mediump sampler2D inputBuffer;
|
|
250
|
+
#else
|
|
251
|
+
uniform lowp sampler2D inputBuffer;
|
|
252
|
+
#endif
|
|
253
|
+
uniform vec2 lightPosition;uniform float exposure;uniform float decay;uniform float density;uniform float weight;uniform float clampMax;varying vec2 vUv;void main(){vec2 coord=vUv;vec2 delta=lightPosition-coord;delta*=1.0/SAMPLES_FLOAT*density;float illuminationDecay=1.0;vec4 color=vec4(0.0);for(int i=0;i<SAMPLES_INT;++i){coord+=delta;vec4 texel=texture2D(inputBuffer,coord);texel*=illuminationDecay*weight;color+=texel;illuminationDecay*=decay;}gl_FragColor=clamp(color*exposure,0.0,clampMax);
|
|
254
|
+
#include <dithering_fragment>
|
|
255
|
+
}`,Ri=class extends U{constructor(e){super({name:"GodRaysMaterial",defines:{SAMPLES_INT:"60",SAMPLES_FLOAT:"60.0"},uniforms:{inputBuffer:new c(null),lightPosition:new c(e),density:new c(1),decay:new c(1),weight:new c(1),exposure:new c(1),clampMax:new c(1)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ui,vertexShader:re})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get lightPosition(){return this.uniforms.lightPosition.value}getLightPosition(){return this.uniforms.lightPosition.value}setLightPosition(e){this.uniforms.lightPosition.value=e}get density(){return this.uniforms.density.value}set density(e){this.uniforms.density.value=e}getDensity(){return this.uniforms.density.value}setDensity(e){this.uniforms.density.value=e}get decay(){return this.uniforms.decay.value}set decay(e){this.uniforms.decay.value=e}getDecay(){return this.uniforms.decay.value}setDecay(e){this.uniforms.decay.value=e}get weight(){return this.uniforms.weight.value}set weight(e){this.uniforms.weight.value=e}getWeight(){return this.uniforms.weight.value}setWeight(e){this.uniforms.weight.value=e}get exposure(){return this.uniforms.exposure.value}set exposure(e){this.uniforms.exposure.value=e}getExposure(){return this.uniforms.exposure.value}setExposure(e){this.uniforms.exposure.value=e}get maxIntensity(){return this.uniforms.clampMax.value}set maxIntensity(e){this.uniforms.clampMax.value=e}getMaxIntensity(){return this.uniforms.clampMax.value}setMaxIntensity(e){this.uniforms.clampMax.value=e}get samples(){return Number(this.defines.SAMPLES_INT)}set samples(e){const t=Math.floor(e);this.defines.SAMPLES_INT=t.toFixed(0),this.defines.SAMPLES_FLOAT=t.toFixed(1),this.needsUpdate=!0}getSamples(){return this.samples}setSamples(e){this.samples=e}},Qe=class extends O{constructor(e,t,r=null){super("RenderPass",e,t),this.needsSwap=!1,this.clearPass=new Ie,this.overrideMaterialManager=r===null?null:new vt(r),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){const e=this.overrideMaterialManager;return e!==null?e.material:null}set overrideMaterial(e){const t=this.overrideMaterialManager;e!==null?t!==null?t.setMaterial(e):this.overrideMaterialManager=new vt(e):t!==null&&(t.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,r,i,s){const a=this.scene,n=this.camera,o=this.selection,l=n.layers.mask,u=a.background,h=e.shadowMap.autoUpdate,f=this.renderToScreen?null:t;o!==null&&n.layers.set(o.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(f),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(e,a,n):e.render(a,n),n.layers.mask=l,a.background=u,e.shadowMap.autoUpdate=h}},bi=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
256
|
+
uniform mediump sampler2D map;
|
|
257
|
+
#else
|
|
258
|
+
uniform lowp sampler2D map;
|
|
259
|
+
#endif
|
|
260
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv);}`,Ze=new z,gt=new et,Pa=class extends B{constructor(e,t,{blendFunction:r=m.SCREEN,samples:i=60,density:s=.96,decay:a=.9,weight:n=.4,exposure:o=.6,clampMax:l=1,blur:u=!0,kernelSize:h=$.SMALL,resolutionScale:f=.5,width:d=E.AUTO_SIZE,height:v=E.AUTO_SIZE,resolutionX:A=d,resolutionY:p=v}={}){super("GodRaysEffect",bi,{blendFunction:r,attributes:N.DEPTH,uniforms:new Map([["map",new c(null)]])}),this.camera=e,this._lightSource=t,this.lightSource=t,this.lightScene=new $e,this.screenPosition=new g,this.renderTargetA=new y(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="GodRays.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="GodRays.Target.B",this.uniforms.get("map").value=this.renderTargetB.texture,this.renderTargetLight=new y(1,1),this.renderTargetLight.texture.name="GodRays.Light",this.renderTargetLight.depthTexture=new Pt,this.renderPassLight=new Qe(this.lightScene,e),this.renderPassLight.clearPass.enabled=!1,this.blurPass=new Pe({kernelSize:h}),this.blurPass.enabled=u,this.copyPass=new lt(this.renderTargetLight),this.copyPass.fullscreenMaterial.channelWeights=new oe(0,0,0,1),this.godRaysPass=new W(new Ri(this.screenPosition));const x=this.godRaysMaterial;x.density=s,x.decay=a,x.weight=n,x.exposure=o,x.maxIntensity=l,x.samples=i;const C=this.resolution=new E(this,A,p,f);C.addEventListener("change",T=>this.setSize(C.baseWidth,C.baseHeight))}set mainCamera(e){this.camera=e,this.renderPassLight.mainCamera=e}get lightSource(){return this._lightSource}set lightSource(e){this._lightSource=e,e!==null&&(e.material.depthWrite=!1,e.material.transparent=!0)}getBlurPass(){return this.blurPass}get texture(){return this.renderTargetB.texture}getTexture(){return this.texture}get godRaysMaterial(){return this.godRaysPass.fullscreenMaterial}getGodRaysMaterial(){return this.godRaysMaterial}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get dithering(){return this.godRaysMaterial.dithering}set dithering(e){const t=this.godRaysMaterial;t.dithering=e,t.needsUpdate=!0}get blur(){return this.blurPass.enabled}set blur(e){this.blurPass.enabled=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}get samples(){return this.godRaysMaterial.samples}set samples(e){this.godRaysMaterial.samples=e}setDepthTexture(e,t=F){this.copyPass.fullscreenMaterial.depthBuffer=e,this.copyPass.fullscreenMaterial.depthPacking=t}update(e,t,r){const i=this.lightSource,s=i.parent,a=i.matrixAutoUpdate,n=this.renderTargetA,o=this.renderTargetLight;i.material.depthWrite=!0,i.matrixAutoUpdate=!1,i.updateWorldMatrix(!0,!1),s!==null&&(a||gt.copy(i.matrix),i.matrix.copy(i.matrixWorld)),this.lightScene.add(i),this.copyPass.render(e,t),this.renderPassLight.render(e,o),i.material.depthWrite=!1,i.matrixAutoUpdate=a,s!==null&&(a||i.matrix.copy(gt),s.add(i)),Ze.setFromMatrixPosition(i.matrixWorld).project(this.camera),this.screenPosition.set(Math.min(Math.max((Ze.x+1)*.5,-1),2),Math.min(Math.max((Ze.y+1)*.5,-1),2));let l=o;this.blurPass.enabled&&(this.blurPass.render(e,l,n),l=n),this.godRaysPass.render(e,l,this.renderTargetB)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.renderTargetLight.setSize(e,t),this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.blurPass.resolution.copy(r)}initialize(e,t,r){this.blurPass.initialize(e,t,r),this.renderPassLight.initialize(e,t,r),this.copyPass.initialize(e,t,r),this.godRaysPass.initialize(e,t,r),r!==void 0&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,this.renderTargetLight.texture.type=r,e!==null&&e.outputColorSpace===w&&(this.renderTargetA.texture.colorSpace=w,this.renderTargetB.texture.colorSpace=w,this.renderTargetLight.texture.colorSpace=w))}},Li="uniform vec2 scale;uniform float lineWidth;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float grid=0.5-max(abs(mod(uv.x*scale.x,1.0)-0.5),abs(mod(uv.y*scale.y,1.0)-0.5));outputColor=vec4(vec3(smoothstep(0.0,lineWidth,grid)),inputColor.a);}",ya=class extends B{constructor({blendFunction:e=m.OVERLAY,scale:t=1,lineWidth:r=0}={}){super("GridEffect",Li,{blendFunction:e,uniforms:new Map([["scale",new c(new g)],["lineWidth",new c(r)]])}),this.resolution=new g,this.s=0,this.scale=t,this.l=0,this.lineWidth=r}get scale(){return this.s}set scale(e){this.s=Math.max(e,1e-6),this.setSize(this.resolution.width,this.resolution.height)}getScale(){return this.scale}setScale(e){this.scale=e}get lineWidth(){return this.l}set lineWidth(e){this.l=e,this.setSize(this.resolution.width,this.resolution.height)}getLineWidth(){return this.lineWidth}setLineWidth(e){this.lineWidth=e}setSize(e,t){this.resolution.set(e,t);const r=e/t,i=this.scale*(t*.125);this.uniforms.get("scale").value.set(r*i,i),this.uniforms.get("lineWidth").value=i/t+this.lineWidth}},Fi="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",Ua=class extends B{constructor({blendFunction:e=m.SRC,hue:t=0,saturation:r=0}={}){super("HueSaturationEffect",Fi,{blendFunction:e,uniforms:new Map([["hue",new c(new z)],["saturation",new c(r)]])}),this.hue=t}get saturation(){return this.uniforms.get("saturation").value}set saturation(e){this.uniforms.get("saturation").value=e}getSaturation(){return this.saturation}setSaturation(e){this.saturation=e}get hue(){const e=this.uniforms.get("hue").value;return Math.acos((e.x*3-1)/2)}set hue(e){const t=Math.sin(e),r=Math.cos(e);this.uniforms.get("hue").value.set((2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3)}getHue(){return this.hue}setHue(e){this.hue=e}},Oi="uniform vec2 distortion;uniform vec2 principalPoint;uniform vec2 focalLength;uniform float skew;float mask(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void mainUv(inout vec2 uv){vec2 xn=2.0*(uv.st-0.5);vec3 xDistorted=vec3((1.0+distortion*dot(xn,xn))*xn,1.0);mat3 kk=mat3(vec3(focalLength.x,0.0,0.0),vec3(skew*focalLength.x,focalLength.y,0.0),vec3(principalPoint.x,principalPoint.y,1.0));uv=(kk*xDistorted).xy*0.5+0.5;}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=mask(uv)*inputColor;}",Ra=class extends B{constructor({distortion:e=new g(0,0),principalPoint:t=new g(0,0),focalLength:r=new g(1,1),skew:i=0}={}){super("LensDistortionEffect",Oi,{uniforms:new Map([["distortion",new c(e)],["principalPoint",new c(t)],["focalLength",new c(r)],["skew",new c(i)]])})}get distortion(){return this.uniforms.get("distortion").value}set distortion(e){this.uniforms.get("distortion").value=e}get principalPoint(){return this.uniforms.get("principalPoint").value}set principalPoint(e){this.uniforms.get("principalPoint").value=e}get focalLength(){return this.uniforms.get("focalLength").value}set focalLength(e){this.uniforms.get("focalLength").value=e}get skew(){return this.uniforms.get("skew").value}set skew(e){this.uniforms.get("skew").value=e}},Ni=`#ifdef LUT_PRECISION_HIGH
|
|
261
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
262
|
+
uniform highp sampler2D lut;
|
|
263
|
+
#else
|
|
264
|
+
uniform mediump sampler2D lut;
|
|
265
|
+
#endif
|
|
266
|
+
#else
|
|
267
|
+
uniform lowp sampler2D lut;
|
|
268
|
+
#endif
|
|
269
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(texture2D(lut,vec2(inputColor.r,0.5)).r,texture2D(lut,vec2(inputColor.g,0.5)).r,texture2D(lut,vec2(inputColor.b,0.5)).r,inputColor.a);}`,ba=class extends B{constructor(e,{blendFunction:t=m.SRC}={}){super("LUT1DEffect",Ni,{blendFunction:t,uniforms:new Map([["lut",new c(null)]])}),this.lut=e}get lut(){return this.uniforms.get("lut").value}set lut(e){this.uniforms.get("lut").value=e,e!==null&&(e.type===Y||e.type===yt)&&this.defines.set("LUT_PRECISION_HIGH","1")}},Hi={SCALE_UP:"lut.scaleup"};function pt(e,t,r){const i=document.createElement("canvas"),s=i.getContext("2d");if(i.width=e,i.height=t,r instanceof Image)s.drawImage(r,0,0);else{const a=s.createImageData(e,t);a.data.set(r),s.putImageData(a,0,0)}return i}var ne=class kt{constructor(t=0,r=0,i=null){this.width=t,this.height=r,this.data=i}toCanvas(){return typeof document>"u"?null:pt(this.width,this.height,this.data)}static from(t){const{width:r,height:i}=t;let s;if(t instanceof Image){const a=pt(r,i,t);a!==null&&(s=a.getContext("2d").getImageData(0,0,r,i).data)}else s=t.data;return new kt(r,i,s)}},Gi=`"use strict";(()=>{var O={SCALE_UP:"lut.scaleup"};var _=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function d(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function V(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function k(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)V(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=_[0];P[0]=s,P[1]=F,P[2]=f;let o=_[1],L=x-w,S=u-c,U=b-l;o[0]=L*M[0]+w,o[1]=S*M[1]+c,o[2]=U*M[2]+l,V(a,t,o[0],o[1],o[2],n[0]),o[0]=L*g[0]+w,o[1]=S*g[1]+c,o[2]=U*g[2]+l,V(a,t,o[0],o[1],o[2],n[1]),o[0]=L*X[0]+w,o[1]=S*X[1]+c,o[2]=U*X[2]+l,V(a,t,o[0],o[1],o[2],n[2]),o[0]=L*Y[0]+w,o[1]=S*Y[1]+c,o[2]=U*Y[2]+l,V(a,t,o[0],o[1],o[2],n[3]);let T=d(g,X,Y,P)*6,q=d(M,X,Y,P)*6,C=d(M,g,Y,P)*6,E=d(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=q,n[1][1]*=q,n[1][2]*=q,n[2][0]*=C,n[2][1]*=C,n[2][2]*=C,n[3][0]*=E,n[3][1]*=E,n[3][2]*=E,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var v=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(r**3*4),y=t instanceof Uint8Array?255:1,h=r**2,A=1/(r-1);for(let w=0;w<r;++w)for(let c=0;c<r;++c)for(let l=0;l<r;++l){let x=l*A,u=c*A,b=w*A,s=Math.round(l+c*r+w*h)*4;k(t,m,x,u,b,i),e[s+0]=i[0],e[s+1]=i[1],e[s+2]=i[2],e[s+3]=y}return e}};self.addEventListener("message",a=>{let t=a.data,r=t.data;t.operation===O.SCALE_UP&&(r=v.expand(r,t.size)),postMessage(r,[r.buffer]),close()});})();
|
|
270
|
+
`,mt=new X,ct=class Ge extends He{constructor(t,r){super(t,r,r,r),this.type=Y,this.format=ae,this.minFilter=K,this.magFilter=K,this.wrapS=Ye,this.wrapT=Ye,this.wrapR=Ye,this.unpackAlignment=1,this.needsUpdate=!0,this.colorSpace=ke,this.domainMin=new z(0,0,0),this.domainMax=new z(1,1,1)}get isLookupTexture3D(){return!0}scaleUp(t,r=!0){const i=this.image;let s;return t<=i.width?s=Promise.reject(new Error("The target size must be greater than the current size")):s=new Promise((a,n)=>{const o=URL.createObjectURL(new Blob([Gi],{type:"text/javascript"})),l=new Worker(o);l.addEventListener("error",h=>n(h.error)),l.addEventListener("message",h=>{const f=new Ge(h.data,t);this.colorSpace=f.colorSpace,f.type=this.type,f.name=this.name,URL.revokeObjectURL(o),a(f)});const u=r?[i.data.buffer]:[];l.postMessage({operation:Hi.SCALE_UP,data:i.data,size:t},u)}),s}applyLUT(t){const r=this.image,i=t.image,s=Math.min(r.width,r.height,r.depth),a=Math.min(i.width,i.height,i.depth);if(s!==a)console.error("Size mismatch");else if(t.type!==Y||this.type!==Y)console.error("Both LUTs must be FloatType textures");else if(t.format!==ae||this.format!==ae)console.error("Both LUTs must be RGBA textures");else{const n=r.data,o=i.data,l=s,u=l**2,h=l-1;for(let f=0,d=l**3;f<d;++f){const v=f*4,A=n[v+0]*h,p=n[v+1]*h,x=n[v+2]*h,C=Math.round(A+p*l+x*u)*4;n[v+0]=o[C+0],n[v+1]=o[C+1],n[v+2]=o[C+2]}this.needsUpdate=!0}return this}convertToUint8(){if(this.type===Y){const t=this.image.data,r=new Uint8Array(t.length);for(let i=0,s=t.length;i<s;++i)r[i]=t[i]*255+.5;this.image.data=r,this.type=H,this.needsUpdate=!0}return this}convertToFloat(){if(this.type===H){const t=this.image.data,r=new Float32Array(t.length);for(let i=0,s=t.length;i<s;++i)r[i]=t[i]/255;this.image.data=r,this.type=Y,this.needsUpdate=!0}return this}convertToRGBA(){return console.warn("LookupTexture","convertToRGBA() is deprecated, LUTs are now RGBA by default"),this}convertLinearToSRGB(){const t=this.image.data;if(this.type===Y){for(let r=0,i=t.length;r<i;r+=4)mt.fromArray(t,r).convertLinearToSRGB().toArray(t,r);this.colorSpace=w,this.needsUpdate=!0}else console.error("Color space conversion requires FloatType data");return this}convertSRGBToLinear(){const t=this.image.data;if(this.type===Y){for(let r=0,i=t.length;r<i;r+=4)mt.fromArray(t,r).convertSRGBToLinear().toArray(t,r);this.colorSpace=ke,this.needsUpdate=!0}else console.error("Color space conversion requires FloatType data");return this}toDataTexture(){const t=this.image.width,r=this.image.height*this.image.depth,i=new Rt(this.image.data,t,r);return i.name=this.name,i.type=this.type,i.format=this.format,i.minFilter=K,i.magFilter=K,i.wrapS=this.wrapS,i.wrapT=this.wrapT,i.generateMipmaps=!1,i.needsUpdate=!0,this.colorSpace=i.colorSpace,i}static from(t){const r=t.image,{width:i,height:s}=r,a=Math.min(i,s);let n;if(r instanceof Image){const u=ne.from(r).data;if(i>s){n=new Uint8Array(u.length);for(let h=0;h<a;++h)for(let f=0;f<a;++f)for(let d=0;d<a;++d){const v=(d+h*a+f*a*a)*4,A=(d+f*a+h*a*a)*4;n[A+0]=u[v+0],n[A+1]=u[v+1],n[A+2]=u[v+2],n[A+3]=u[v+3]}}else n=new Uint8Array(u.buffer)}else n=r.data.slice();const o=new Ge(n,a);return o.type=t.type,o.name=t.name,t.colorSpace=o.colorSpace,o}static createNeutral(t){const r=new Float32Array(t**3*4),i=t**2,s=1/(t-1);for(let n=0;n<t;++n)for(let o=0;o<t;++o)for(let l=0;l<t;++l){const u=(n+o*t+l*i)*4;r[u+0]=n*s,r[u+1]=o*s,r[u+2]=l*s,r[u+3]=1}const a=new Ge(r,t);return a.name="neutral",a}},ki=`uniform vec3 scale;uniform vec3 offset;
|
|
271
|
+
#ifdef CUSTOM_INPUT_DOMAIN
|
|
272
|
+
uniform vec3 domainMin;uniform vec3 domainMax;
|
|
273
|
+
#endif
|
|
274
|
+
#ifdef LUT_3D
|
|
275
|
+
#ifdef LUT_PRECISION_HIGH
|
|
276
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
277
|
+
uniform highp sampler3D lut;
|
|
278
|
+
#else
|
|
279
|
+
uniform mediump sampler3D lut;
|
|
280
|
+
#endif
|
|
281
|
+
#else
|
|
282
|
+
uniform lowp sampler3D lut;
|
|
283
|
+
#endif
|
|
284
|
+
vec4 applyLUT(const in vec3 rgb){
|
|
285
|
+
#ifdef TETRAHEDRAL_INTERPOLATION
|
|
286
|
+
vec3 p=floor(rgb);vec3 f=rgb-p;vec3 v1=(p+0.5)*LUT_TEXEL_WIDTH;vec3 v4=(p+1.5)*LUT_TEXEL_WIDTH;vec3 v2,v3;vec3 frac;if(f.r>=f.g){if(f.g>f.b){frac=f.rgb;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else if(f.r>=f.b){frac=f.rbg;v2=vec3(v4.x,v1.y,v1.z);v3=vec3(v4.x,v1.y,v4.z);}else{frac=f.brg;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v4.x,v1.y,v4.z);}}else{if(f.b>f.g){frac=f.bgr;v2=vec3(v1.x,v1.y,v4.z);v3=vec3(v1.x,v4.y,v4.z);}else if(f.r>=f.b){frac=f.grb;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v4.x,v4.y,v1.z);}else{frac=f.gbr;v2=vec3(v1.x,v4.y,v1.z);v3=vec3(v1.x,v4.y,v4.z);}}vec4 n1=texture(lut,v1);vec4 n2=texture(lut,v2);vec4 n3=texture(lut,v3);vec4 n4=texture(lut,v4);vec4 weights=vec4(1.0-frac.x,frac.x-frac.y,frac.y-frac.z,frac.z);vec4 result=weights*mat4(vec4(n1.r,n2.r,n3.r,n4.r),vec4(n1.g,n2.g,n3.g,n4.g),vec4(n1.b,n2.b,n3.b,n4.b),vec4(1.0));return vec4(result.rgb,1.0);
|
|
287
|
+
#else
|
|
288
|
+
return texture(lut,rgb);
|
|
289
|
+
#endif
|
|
290
|
+
}
|
|
291
|
+
#else
|
|
292
|
+
#ifdef LUT_PRECISION_HIGH
|
|
293
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
294
|
+
uniform highp sampler2D lut;
|
|
295
|
+
#else
|
|
296
|
+
uniform mediump sampler2D lut;
|
|
297
|
+
#endif
|
|
298
|
+
#else
|
|
299
|
+
uniform lowp sampler2D lut;
|
|
300
|
+
#endif
|
|
301
|
+
vec4 applyLUT(const in vec3 rgb){float slice=rgb.b*LUT_SIZE;float slice0=floor(slice);float interp=slice-slice0;float centeredInterp=interp-0.5;float slice1=slice0+sign(centeredInterp);
|
|
302
|
+
#ifdef LUT_STRIP_HORIZONTAL
|
|
303
|
+
float xOffset=clamp(rgb.r*LUT_TEXEL_HEIGHT,LUT_TEXEL_WIDTH*0.5,LUT_TEXEL_HEIGHT-LUT_TEXEL_WIDTH*0.5);vec2 uv0=vec2(slice0*LUT_TEXEL_HEIGHT+xOffset,rgb.g);vec2 uv1=vec2(slice1*LUT_TEXEL_HEIGHT+xOffset,rgb.g);
|
|
304
|
+
#else
|
|
305
|
+
float yOffset=clamp(rgb.g*LUT_TEXEL_WIDTH,LUT_TEXEL_HEIGHT*0.5,LUT_TEXEL_WIDTH-LUT_TEXEL_HEIGHT*0.5);vec2 uv0=vec2(rgb.r,slice0*LUT_TEXEL_WIDTH+yOffset);vec2 uv1=vec2(rgb.r,slice1*LUT_TEXEL_WIDTH+yOffset);
|
|
306
|
+
#endif
|
|
307
|
+
vec4 sample0=texture2D(lut,uv0);vec4 sample1=texture2D(lut,uv1);return mix(sample0,sample1,abs(centeredInterp));}
|
|
308
|
+
#endif
|
|
309
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 c=inputColor.rgb;
|
|
310
|
+
#ifdef CUSTOM_INPUT_DOMAIN
|
|
311
|
+
if(c.r>=domainMin.r&&c.g>=domainMin.g&&c.b>=domainMin.b&&c.r<=domainMax.r&&c.g<=domainMax.g&&c.b<=domainMax.b){c=applyLUT(scale*c+offset).rgb;}else{c=inputColor.rgb;}
|
|
312
|
+
#else
|
|
313
|
+
#if !defined(LUT_3D) || defined(TETRAHEDRAL_INTERPOLATION)
|
|
314
|
+
c=clamp(c,0.0,1.0);
|
|
315
|
+
#endif
|
|
316
|
+
c=applyLUT(scale*c+offset).rgb;
|
|
317
|
+
#endif
|
|
318
|
+
outputColor=vec4(c,inputColor.a);}`,La=class extends B{constructor(e,{blendFunction:t=m.SRC,tetrahedralInterpolation:r=!1,inputColorSpace:i=w}={}){super("LUT3DEffect",ki,{blendFunction:t,uniforms:new Map([["lut",new c(null)],["scale",new c(new z)],["offset",new c(new z)],["domainMin",new c(null)],["domainMax",new c(null)]])}),this.tetrahedralInterpolation=r,this.inputColorSpace=i,this.lut=e}get lut(){return this.uniforms.get("lut").value}set lut(e){const t=this.defines,r=this.uniforms;if(this.lut!==e&&(r.get("lut").value=e,e!==null)){const i=e.image,s=this.tetrahedralInterpolation;if(t.clear(),t.set("LUT_SIZE",Math.min(i.width,i.height).toFixed(16)),t.set("LUT_TEXEL_WIDTH",(1/i.width).toFixed(16)),t.set("LUT_TEXEL_HEIGHT",(1/i.height).toFixed(16)),r.get("domainMin").value=null,r.get("domainMax").value=null,(e.type===Y||e.type===yt)&&t.set("LUT_PRECISION_HIGH","1"),i.width>i.height?t.set("LUT_STRIP_HORIZONTAL","1"):e instanceof He&&t.set("LUT_3D","1"),e instanceof ct){const a=e.domainMin,n=e.domainMax;(a.x!==0||a.y!==0||a.z!==0||n.x!==1||n.y!==1||n.z!==1)&&(t.set("CUSTOM_INPUT_DOMAIN","1"),r.get("domainMin").value=a.clone(),r.get("domainMax").value=n.clone())}this.tetrahedralInterpolation=s}}getLUT(){return this.lut}setLUT(e){this.lut=e}updateScaleOffset(){const e=this.lut;if(e!==null){const t=Math.min(e.image.width,e.image.height),r=this.uniforms.get("scale").value,i=this.uniforms.get("offset").value;if(this.tetrahedralInterpolation&&e instanceof He)if(this.defines.has("CUSTOM_INPUT_DOMAIN")){const s=e.domainMax.clone().sub(e.domainMin);r.setScalar(t-1).divide(s),i.copy(e.domainMin).negate().multiply(r)}else r.setScalar(t-1),i.setScalar(0);else if(this.defines.has("CUSTOM_INPUT_DOMAIN")){const s=e.domainMax.clone().sub(e.domainMin).multiplyScalar(t);r.setScalar(t-1).divide(s),i.copy(e.domainMin).negate().multiply(r).addScalar(1/(2*t))}else r.setScalar((t-1)/t),i.setScalar(1/(2*t))}}configureTetrahedralInterpolation(){const e=this.lut;e!==null&&(e.minFilter=K,e.magFilter=K,this.tetrahedralInterpolation&&(e instanceof He?(e.minFilter=_,e.magFilter=_):console.warn("Tetrahedral interpolation requires a 3D texture")),e.needsUpdate=!0)}get tetrahedralInterpolation(){return this.defines.has("TETRAHEDRAL_INTERPOLATION")}set tetrahedralInterpolation(e){e?this.defines.set("TETRAHEDRAL_INTERPOLATION","1"):this.defines.delete("TETRAHEDRAL_INTERPOLATION"),this.configureTetrahedralInterpolation(),this.updateScaleOffset(),this.setChanged()}setTetrahedralInterpolationEnabled(e){this.tetrahedralInterpolation=e}},we={FULL:0,SINGLE:1},Se={DEFAULT:0,KEEP_MAX_DEPTH:1,DISCARD_MAX_DEPTH:2},zt={DEPTH:0,LUMA:1,COLOR:2},zi={DISABLED:0,DEPTH:1,CUSTOM:2},Ae={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},V={LINEAR:0,REINHARD:1,REINHARD2:2,REINHARD2_ADAPTIVE:3,UNCHARTED2:4,OPTIMIZED_CINEON:5,CINEON:5,ACES_FILMIC:6,AGX:7,NEUTRAL:8},xe={DEFAULT:0,ESKIL:1},Fa={DERIVATIVES:"derivatives",FRAG_DEPTH:"fragDepth",DRAW_BUFFERS:"drawBuffers",SHADER_TEXTURE_LOD:"shaderTextureLOD"},_i=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*(1.0+time)));
|
|
319
|
+
#ifdef PREMULTIPLY
|
|
320
|
+
outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a);
|
|
321
|
+
#else
|
|
322
|
+
outputColor=vec4(noise,inputColor.a);
|
|
323
|
+
#endif
|
|
324
|
+
}`,Oa=class extends B{constructor({blendFunction:e=m.SCREEN,premultiply:t=!1}={}){super("NoiseEffect",_i,{blendFunction:e}),this.premultiply=t}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(e){this.premultiply!==e&&(e?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(e){this.premultiply=e}},Qi=`#include <packing>
|
|
325
|
+
#include <clipping_planes_pars_fragment>
|
|
326
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
327
|
+
uniform highp sampler2D depthBuffer;
|
|
328
|
+
#else
|
|
329
|
+
uniform mediump sampler2D depthBuffer;
|
|
330
|
+
#endif
|
|
331
|
+
uniform float cameraNear;uniform float cameraFar;centroid varying float vViewZ;centroid varying vec4 vProjTexCoord;void main(){
|
|
332
|
+
#include <clipping_planes_fragment>
|
|
333
|
+
vec2 projTexCoord=(vProjTexCoord.xy/vProjTexCoord.w)*0.5+0.5;
|
|
334
|
+
#if DEPTH_PACKING == 3201
|
|
335
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,projTexCoord));
|
|
336
|
+
#else
|
|
337
|
+
float depth=texture2D(depthBuffer,projTexCoord).r;
|
|
338
|
+
#endif
|
|
339
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
340
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
341
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
342
|
+
depth=1.0-depth;
|
|
343
|
+
#endif
|
|
344
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
345
|
+
float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
|
|
346
|
+
#else
|
|
347
|
+
float viewZ=orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
348
|
+
#endif
|
|
349
|
+
float depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}`,Vi=`#include <common>
|
|
350
|
+
#include <morphtarget_pars_vertex>
|
|
351
|
+
#include <skinning_pars_vertex>
|
|
352
|
+
#include <clipping_planes_pars_vertex>
|
|
353
|
+
varying float vViewZ;varying vec4 vProjTexCoord;void main(){
|
|
354
|
+
#include <skinbase_vertex>
|
|
355
|
+
#include <begin_vertex>
|
|
356
|
+
#include <morphtarget_vertex>
|
|
357
|
+
#include <skinning_vertex>
|
|
358
|
+
#include <project_vertex>
|
|
359
|
+
vViewZ=mvPosition.z;vProjTexCoord=gl_Position;
|
|
360
|
+
#include <clipping_planes_vertex>
|
|
361
|
+
}`,Yi=class extends U{constructor(e=null,t){super({name:"DepthComparisonMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new c(null),cameraNear:new c(.3),cameraFar:new c(1e3)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Qi,vertexShader:Vi}),this.depthBuffer=e,this.depthPacking=q,this.copyCameraSettings(t)}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=q){this.depthBuffer=e,this.depthPacking=t}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof pe?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},Wi="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",Xi="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",Ki=class extends U{constructor(e=new g){super({name:"OutlineMaterial",uniforms:{inputBuffer:new c(null),texelSize:new c(new g)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Wi,vertexShader:Xi}),this.uniforms.texelSize.value.set(e.x,e.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},_t=class extends O{constructor(e,t,{renderTarget:r,resolutionScale:i=1,width:s=E.AUTO_SIZE,height:a=E.AUTO_SIZE,resolutionX:n=s,resolutionY:o=a}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new Qe(e,t,new Yt({depthPacking:q}));const l=this.renderPass;l.skipShadowMapUpdate=!0,l.ignoreBackground=!0,this.renderTarget=r,this.renderTarget===void 0&&(this.renderTarget=new y(1,1,{minFilter:_,magFilter:_}),this.renderTarget.texture.name="DepthPass.Target");const u=this.resolution=new E(this,n,o,i);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,i,s){const a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height)}initialize(e,t,r){const i=e.capabilities.reversedDepthBuffer?0:16777215,s=this.renderPass.clearPass;s.overrideClearColor=new X(i),s.overrideClearAlpha=1}},Zi=`uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength;
|
|
362
|
+
#ifdef USE_PATTERN
|
|
363
|
+
uniform lowp sampler2D patternTexture;varying vec2 vUvPattern;
|
|
364
|
+
#endif
|
|
365
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 edge=texture2D(edgeTexture,uv).rg;vec2 mask=texture2D(maskTexture,uv).rg;
|
|
366
|
+
#ifndef X_RAY
|
|
367
|
+
edge.y=0.0;
|
|
368
|
+
#endif
|
|
369
|
+
edge*=(edgeStrength*mask.x*pulse);vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;float visibilityFactor=0.0;
|
|
370
|
+
#ifdef USE_PATTERN
|
|
371
|
+
vec4 patternColor=texture2D(patternTexture,vUvPattern);
|
|
372
|
+
#ifdef X_RAY
|
|
373
|
+
float hiddenFactor=0.5;
|
|
374
|
+
#else
|
|
375
|
+
float hiddenFactor=0.0;
|
|
376
|
+
#endif
|
|
377
|
+
visibilityFactor=(1.0-mask.y>0.0)?1.0:hiddenFactor;visibilityFactor*=(1.0-mask.x)*patternColor.a;color+=visibilityFactor*patternColor.rgb;
|
|
378
|
+
#endif
|
|
379
|
+
float alpha=max(max(edge.x,edge.y),visibilityFactor);
|
|
380
|
+
#ifdef ALPHA
|
|
381
|
+
outputColor=vec4(color,alpha);
|
|
382
|
+
#else
|
|
383
|
+
outputColor=vec4(color,max(alpha,inputColor.a));
|
|
384
|
+
#endif
|
|
385
|
+
}`,ji="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",Na=class extends B{constructor(e,t,{blendFunction:r=m.SCREEN,patternTexture:i=null,patternScale:s=1,edgeStrength:a=1,pulseSpeed:n=0,visibleEdgeColor:o=16777215,hiddenEdgeColor:l=2230538,kernelSize:u=$.VERY_SMALL,blur:h=!1,xRay:f=!0,multisampling:d=0,resolutionScale:v=.5,width:A=E.AUTO_SIZE,height:p=E.AUTO_SIZE,resolutionX:x=A,resolutionY:C=p}={}){super("OutlineEffect",Zi,{uniforms:new Map([["maskTexture",new c(null)],["edgeTexture",new c(null)],["edgeStrength",new c(a)],["visibleEdgeColor",new c(new X(o))],["hiddenEdgeColor",new c(new X(l))],["pulse",new c(1)],["patternScale",new c(s)],["patternTexture",new c(null)]])}),this.blendMode.addEventListener("change",Z=>{this.blendMode.blendFunction===m.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.blendFunction=r,this.patternTexture=i,this.xRay=f,this.scene=e,this.camera=t,this.renderTargetMask=new y(1,1),this.renderTargetMask.samples=d,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new y(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new Ie,this.clearPass.overrideClearColor=new X(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new _t(e,t),this.maskPass=new Qe(e,t,new Yi(this.depthPass.texture,t));const T=this.maskPass.clearPass;T.overrideClearColor=new X(16777215),T.overrideClearAlpha=1,this.blurPass=new Pe({resolutionScale:v,resolutionX:x,resolutionY:C,kernelSize:u}),this.blurPass.enabled=h;const D=this.blurPass.resolution;D.addEventListener("change",Z=>this.setSize(D.baseWidth,D.baseHeight)),this.outlinePass=new W(new Ki);const G=this.outlinePass.fullscreenMaterial;G.inputBuffer=this.renderTargetMask.texture,this.time=0,this.forceUpdate=!0,this.selection=new Ot,this.pulseSpeed=n}set mainScene(e){this.scene=e,this.depthPass.mainScene=e,this.maskPass.mainScene=e}set mainCamera(e){this.camera=e,this.depthPass.mainCamera=e,this.maskPass.mainCamera=e,this.maskPass.overrideMaterial.copyCameraSettings(e)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(e){this.renderTargetMask.samples=e,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(e){this.uniforms.get("patternScale").value=e}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(e){this.uniforms.get("edgeStrength").value=e}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(e){this.uniforms.get("visibleEdgeColor").value=e}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(e){this.uniforms.get("hiddenEdgeColor").value=e}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(e){this.pulseSpeed=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get selectionLayer(){return this.selection.layer}set selectionLayer(e){this.selection.layer=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get blur(){return this.blurPass.enabled}set blur(e){this.blurPass.enabled=e}get xRay(){return this.defines.has("X_RAY")}set xRay(e){this.xRay!==e&&(e?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(e){this.xRay=e}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(e){e!==null?(e.wrapS=e.wrapT=Be,this.defines.set("USE_PATTERN","1"),this.setVertexShader(ji)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=e,this.setChanged()}setPatternTexture(e){this.patternTexture=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}setSelection(e){return this.selection.set(e),this}clearSelection(){return this.selection.clear(),this}selectObject(e){return this.selection.add(e),this}deselectObject(e){return this.selection.delete(e),this}update(e,t,r){const i=this.scene,s=this.camera,a=this.selection,o=this.uniforms.get("pulse"),l=i.background,u=s.layers.mask;(this.forceUpdate||a.size>0)&&(i.background=null,o.value=1,this.pulseSpeed>0&&(o.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.time+=r,a.setVisible(!1),this.depthPass.render(e),a.setVisible(!0),s.layers.set(a.layer),this.maskPass.render(e,this.renderTargetMask),s.layers.mask=u,i.background=l,this.outlinePass.render(e,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(e,this.renderTargetOutline,this.renderTargetOutline)),this.forceUpdate=a.size>0}setSize(e,t){this.blurPass.setSize(e,t),this.renderTargetMask.setSize(e,t);const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.depthPass.setSize(i,s),this.renderTargetOutline.setSize(i,s),this.outlinePass.fullscreenMaterial.setSize(i,s)}initialize(e,t,r){this.blurPass.initialize(e,t,H),r!==void 0&&(this.depthPass.initialize(e,t,r),this.maskPass.initialize(e,t,r),this.outlinePass.initialize(e,t,r))}},Ji="uniform bool active;uniform vec4 d;void mainUv(inout vec2 uv){if(active){uv=d.xy*(floor(uv*d.zw)+0.5);}}",Ha=class extends B{constructor(e=30){super("PixelationEffect",Ji,{uniforms:new Map([["active",new c(!1)],["d",new c(new oe)]])}),this.resolution=new g,this._granularity=0,this.granularity=e}get granularity(){return this._granularity}set granularity(e){let t=Math.floor(e);t%2>0&&(t+=1),this._granularity=t,this.uniforms.get("active").value=t>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(e){this.granularity=e}setSize(e,t){const r=this.resolution;r.set(e,t);const i=this.granularity,s=i/r.x,a=i/r.y;this.uniforms.get("d").value.set(s,a,1/s,1/a)}},qi=`uniform float focus;uniform float focalLength;uniform float fStop;uniform float maxBlur;uniform float luminanceThreshold;uniform float luminanceGain;uniform float bias;uniform float fringe;
|
|
386
|
+
#ifdef MANUAL_DOF
|
|
387
|
+
uniform vec4 dof;
|
|
388
|
+
#endif
|
|
389
|
+
#ifdef PENTAGON
|
|
390
|
+
float pentagon(const in vec2 coords){const vec4 HS0=vec4(1.0,0.0,0.0,1.0);const vec4 HS1=vec4(0.309016994,0.951056516,0.0,1.0);const vec4 HS2=vec4(-0.809016994,0.587785252,0.0,1.0);const vec4 HS3=vec4(-0.809016994,-0.587785252,0.0,1.0);const vec4 HS4=vec4(0.309016994,-0.951056516,0.0,1.0);const vec4 HS5=vec4(0.0,0.0,1.0,1.0);const vec4 ONE=vec4(1.0);const float P_FEATHER=0.4;const float N_FEATHER=-P_FEATHER;float inOrOut=-4.0;vec4 P=vec4(coords,vec2(RINGS_FLOAT-1.3));vec4 dist=vec4(dot(P,HS0),dot(P,HS1),dot(P,HS2),dot(P,HS3));dist=smoothstep(N_FEATHER,P_FEATHER,dist);inOrOut+=dot(dist,ONE);dist.x=dot(P,HS4);dist.y=HS5.w-abs(P.z);dist=smoothstep(N_FEATHER,P_FEATHER,dist);inOrOut+=dist.x;return clamp(inOrOut,0.0,1.0);}
|
|
391
|
+
#endif
|
|
392
|
+
vec3 processTexel(const in vec2 coords,const in float blur){vec2 scale=texelSize*fringe*blur;vec3 c=vec3(texture2D(inputBuffer,coords+vec2(0.0,1.0)*scale).r,texture2D(inputBuffer,coords+vec2(-0.866,-0.5)*scale).g,texture2D(inputBuffer,coords+vec2(0.866,-0.5)*scale).b);float luminance=linearToRelativeLuminance(c);float threshold=max((luminance-luminanceThreshold)*luminanceGain,0.0);return c+mix(vec3(0.0),c,threshold*blur);}float gather(const in float i,const in float j,const in float ringSamples,const in vec2 uv,const in vec2 blurFactor,const in float blur,inout vec3 color){float step=PI2/ringSamples;vec2 wh=vec2(cos(j*step)*i,sin(j*step)*i);
|
|
393
|
+
#ifdef PENTAGON
|
|
394
|
+
float p=pentagon(wh);
|
|
395
|
+
#else
|
|
396
|
+
float p=1.0;
|
|
397
|
+
#endif
|
|
398
|
+
color+=processTexel(wh*blurFactor+uv,blur)*mix(1.0,i/RINGS_FLOAT,bias)*p;return mix(1.0,i/RINGS_FLOAT,bias)*p;}void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){
|
|
399
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
400
|
+
float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);
|
|
401
|
+
#else
|
|
402
|
+
float linearDepth=depth;
|
|
403
|
+
#endif
|
|
404
|
+
#ifdef MANUAL_DOF
|
|
405
|
+
float focalPlane=linearDepth-focus;float farDoF=(focalPlane-dof.z)/dof.w;float nearDoF=(-focalPlane-dof.x)/dof.y;float blur=(focalPlane>0.0)?farDoF:nearDoF;
|
|
406
|
+
#else
|
|
407
|
+
const float CIRCLE_OF_CONFUSION=0.03;float focalPlaneMM=focus*1000.0;float depthMM=linearDepth*1000.0;float focalPlane=(depthMM*focalLength)/(depthMM-focalLength);float farDoF=(focalPlaneMM*focalLength)/(focalPlaneMM-focalLength);float nearDoF=(focalPlaneMM-focalLength)/(focalPlaneMM*fStop*CIRCLE_OF_CONFUSION);float blur=abs(focalPlane-farDoF)*nearDoF;
|
|
408
|
+
#endif
|
|
409
|
+
const int MAX_RING_SAMPLES=RINGS_INT*SAMPLES_INT;blur=clamp(blur,0.0,1.0);vec3 color=inputColor.rgb;if(blur>=0.05){vec2 blurFactor=blur*maxBlur*texelSize;float s=1.0;int ringSamples;for(int i=1;i<=RINGS_INT;i++){ringSamples=i*SAMPLES_INT;for(int j=0;j<MAX_RING_SAMPLES;j++){if(j>=ringSamples){break;}s+=gather(float(i),float(j),float(ringSamples),uv,blurFactor,blur,color);}}color/=s;}
|
|
410
|
+
#ifdef SHOW_FOCUS
|
|
411
|
+
float edge=0.002*linearDepth;float m=clamp(smoothstep(0.0,edge,blur),0.0,1.0);float e=clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);color=mix(color,vec3(1.0,0.5,0.0),(1.0-m)*0.6);color=mix(color,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);
|
|
412
|
+
#endif
|
|
413
|
+
outputColor=vec4(color,inputColor.a);}`,Ga=class extends B{constructor({blendFunction:e,focus:t=1,focalLength:r=24,fStop:i=.9,luminanceThreshold:s=.5,luminanceGain:a=2,bias:n=.5,fringe:o=.7,maxBlur:l=1,rings:u=3,samples:h=2,showFocus:f=!1,manualDoF:d=!1,pentagon:v=!1}={}){super("RealisticBokehEffect",qi,{blendFunction:e,attributes:N.CONVOLUTION|N.DEPTH,uniforms:new Map([["focus",new c(t)],["focalLength",new c(r)],["fStop",new c(i)],["luminanceThreshold",new c(s)],["luminanceGain",new c(a)],["bias",new c(n)],["fringe",new c(o)],["maxBlur",new c(l)],["dof",new c(null)]])}),this.rings=u,this.samples=h,this.showFocus=f,this.manualDoF=d,this.pentagon=v}get rings(){return Number.parseInt(this.defines.get("RINGS_INT"))}set rings(e){const t=Math.floor(e);this.defines.set("RINGS_INT",t.toFixed(0)),this.defines.set("RINGS_FLOAT",t.toFixed(1)),this.setChanged()}get samples(){return Number.parseInt(this.defines.get("SAMPLES_INT"))}set samples(e){const t=Math.floor(e);this.defines.set("SAMPLES_INT",t.toFixed(0)),this.defines.set("SAMPLES_FLOAT",t.toFixed(1)),this.setChanged()}get showFocus(){return this.defines.has("SHOW_FOCUS")}set showFocus(e){this.showFocus!==e&&(e?this.defines.set("SHOW_FOCUS","1"):this.defines.delete("SHOW_FOCUS"),this.setChanged())}get manualDoF(){return this.defines.has("MANUAL_DOF")}set manualDoF(e){this.manualDoF!==e&&(e?(this.defines.set("MANUAL_DOF","1"),this.uniforms.get("dof").value=new oe(.2,1,.2,2)):(this.defines.delete("MANUAL_DOF"),this.uniforms.get("dof").value=null),this.setChanged())}get pentagon(){return this.defines.has("PENTAGON")}set pentagon(e){this.pentagon!==e&&(e?this.defines.set("PENTAGON","1"):this.defines.delete("PENTAGON"),this.setChanged())}},$i=`uniform float count;
|
|
414
|
+
#ifdef SCROLL
|
|
415
|
+
uniform float scrollSpeed;
|
|
416
|
+
#endif
|
|
417
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float y=uv.y;
|
|
418
|
+
#ifdef SCROLL
|
|
419
|
+
y+=time*scrollSpeed;
|
|
420
|
+
#endif
|
|
421
|
+
vec2 sl=vec2(sin(y*count),cos(y*count));outputColor=vec4(sl.xyx,inputColor.a);}`,ka=class extends B{constructor({blendFunction:e=m.OVERLAY,density:t=1.25,scrollSpeed:r=0}={}){super("ScanlineEffect",$i,{blendFunction:e,uniforms:new Map([["count",new c(0)],["scrollSpeed",new c(0)]])}),this.resolution=new g,this.d=t,this.scrollSpeed=r}get density(){return this.d}set density(e){this.d=e,this.setSize(this.resolution.width,this.resolution.height)}getDensity(){return this.density}setDensity(e){this.density=e}get scrollSpeed(){return this.uniforms.get("scrollSpeed").value}set scrollSpeed(e){this.uniforms.get("scrollSpeed").value=e,e===0?this.defines.delete("SCROLL")&&this.setChanged():this.defines.has("SCROLL")||(this.defines.set("SCROLL","1"),this.setChanged())}setSize(e,t){this.resolution.set(e,t),this.uniforms.get("count").value=Math.round(t*this.density)}},es="uniform bool active;uniform vec2 center;uniform float waveSize;uniform float radius;uniform float maxRadius;uniform float amplitude;varying float vSize;void mainUv(inout vec2 uv){if(active){vec2 aspectCorrection=vec2(aspect,1.0);vec2 difference=uv*aspectCorrection-center*aspectCorrection;float distance=sqrt(dot(difference,difference))*vSize;if(distance>radius){if(distance<radius+waveSize){float angle=(distance-radius)*PI2/waveSize;float cosSin=(1.0-cos(angle))*0.5;float extent=maxRadius+waveSize;float decay=max(extent-distance*distance,0.0)/extent;uv-=((cosSin*amplitude*difference)/distance)*decay;}}}}",ts="uniform float size;uniform float cameraDistance;varying float vSize;void mainSupport(){vSize=(0.1*cameraDistance)/size;}",rs=Math.PI*.5,Ee=new z,At=new z,za=class extends B{constructor(e,t=new z,{speed:r=2,maxRadius:i=1,waveSize:s=.2,amplitude:a=.05}={}){super("ShockWaveEffect",es,{vertexShader:ts,uniforms:new Map([["active",new c(!1)],["center",new c(new g(.5,.5))],["cameraDistance",new c(1)],["size",new c(1)],["radius",new c(-s)],["maxRadius",new c(i)],["waveSize",new c(s)],["amplitude",new c(a)]])}),this.position=t,this.speed=r,this.camera=e,this.screenPosition=this.uniforms.get("center").value,this.time=0,this.active=!1}set mainCamera(e){this.camera=e}get amplitude(){return this.uniforms.get("amplitude").value}set amplitude(e){this.uniforms.get("amplitude").value=e}get waveSize(){return this.uniforms.get("waveSize").value}set waveSize(e){this.uniforms.get("waveSize").value=e}get maxRadius(){return this.uniforms.get("maxRadius").value}set maxRadius(e){this.uniforms.get("maxRadius").value=e}get epicenter(){return this.position}set epicenter(e){this.position=e}getPosition(){return this.position}setPosition(e){this.position=e}getSpeed(){return this.speed}setSpeed(e){this.speed=e}explode(){this.time=0,this.active=!0,this.uniforms.get("active").value=!0}update(e,t,r){const i=this.position,s=this.camera,a=this.uniforms,n=a.get("active");if(this.active){const o=a.get("waveSize").value;s.getWorldDirection(Ee),At.copy(s.position).sub(i),n.value=Ee.angleTo(At)>rs,n.value&&(a.get("cameraDistance").value=s.position.distanceTo(i),Ee.copy(i).project(s),this.screenPosition.set((Ee.x+1)*.5,(Ee.y+1)*.5)),this.time+=r*this.speed;const l=this.time-o;a.get("radius").value=l,l>=(a.get("maxRadius").value+o)*2&&(this.active=!1,n.value=!1)}}},is=`#include <common>
|
|
422
|
+
#include <packing>
|
|
423
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
424
|
+
uniform highp sampler2D depthBuffer0;uniform highp sampler2D depthBuffer1;
|
|
425
|
+
#else
|
|
426
|
+
uniform mediump sampler2D depthBuffer0;uniform mediump sampler2D depthBuffer1;
|
|
427
|
+
#endif
|
|
428
|
+
uniform sampler2D inputBuffer;uniform vec2 cameraNearFar;float getViewZ(const in float depth){
|
|
429
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
430
|
+
return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);
|
|
431
|
+
#else
|
|
432
|
+
return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);
|
|
433
|
+
#endif
|
|
434
|
+
}varying vec2 vUv;void main(){vec2 depth;
|
|
435
|
+
#if DEPTH_PACKING_0 == 3201
|
|
436
|
+
depth.x=unpackRGBAToDepth(texture2D(depthBuffer0,vUv));
|
|
437
|
+
#else
|
|
438
|
+
depth.x=texture2D(depthBuffer0,vUv).r;
|
|
439
|
+
#endif
|
|
440
|
+
#if DEPTH_PACKING_1 == 3201
|
|
441
|
+
depth.y=unpackRGBAToDepth(texture2D(depthBuffer1,vUv));
|
|
442
|
+
#else
|
|
443
|
+
depth.y=texture2D(depthBuffer1,vUv).r;
|
|
444
|
+
#endif
|
|
445
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
446
|
+
float a=cameraNearFar.y/(cameraNearFar.y-cameraNearFar.x);float b=cameraNearFar.y*cameraNearFar.x/(cameraNearFar.x-cameraNearFar.y);float c=log2(cameraNearFar.y+1.0);float d=pow(2.0,depth.x*c)-1.0;depth.x=a+b/d;d=pow(2.0,depth.y*c)-1.0;depth.y=a+b/d;
|
|
447
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
448
|
+
depth.x=1.0-depth.x;depth.y=1.0-depth.y;
|
|
449
|
+
#endif
|
|
450
|
+
bool isMaxDepth=(depth.x==1.0);
|
|
451
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
452
|
+
depth.x=viewZToOrthographicDepth(getViewZ(depth.x),cameraNearFar.x,cameraNearFar.y);depth.y=viewZToOrthographicDepth(getViewZ(depth.y),cameraNearFar.x,cameraNearFar.y);
|
|
453
|
+
#endif
|
|
454
|
+
#if DEPTH_TEST_STRATEGY == 0
|
|
455
|
+
bool keep=depthTest(depth.x,depth.y);
|
|
456
|
+
#elif DEPTH_TEST_STRATEGY == 1
|
|
457
|
+
bool keep=isMaxDepth||depthTest(depth.x,depth.y);
|
|
458
|
+
#else
|
|
459
|
+
bool keep=!isMaxDepth&&depthTest(depth.x,depth.y);
|
|
460
|
+
#endif
|
|
461
|
+
if(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}`,ss=class extends U{constructor(){super({name:"DepthMaskMaterial",defines:{DEPTH_EPSILON:"0.0001",DEPTH_PACKING_0:"0",DEPTH_PACKING_1:"0",DEPTH_TEST_STRATEGY:Se.KEEP_MAX_DEPTH},uniforms:{inputBuffer:new c(null),depthBuffer0:new c(null),depthBuffer1:new c(null),cameraNearFar:new c(new g(1,1))},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:is,vertexShader:re}),this.depthMode=ut}set depthBuffer0(e){this.uniforms.depthBuffer0.value=e}set depthPacking0(e){this.defines.DEPTH_PACKING_0=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer0(e,t=F){this.depthBuffer0=e,this.depthPacking0=t}set depthBuffer1(e){this.uniforms.depthBuffer1.value=e}set depthPacking1(e){this.defines.DEPTH_PACKING_1=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer1(e,t=F){this.depthBuffer1=e,this.depthPacking1=t}get maxDepthStrategy(){return Number(this.defines.DEPTH_TEST_STRATEGY)}set maxDepthStrategy(e){this.defines.DEPTH_TEST_STRATEGY=e.toFixed(0),this.needsUpdate=!0}get keepFar(){return this.maxDepthStrategy}set keepFar(e){this.maxDepthStrategy=e?Se.KEEP_MAX_DEPTH:Se.DISCARD_MAX_DEPTH}getMaxDepthStrategy(){return this.maxDepthStrategy}setMaxDepthStrategy(e){this.maxDepthStrategy=e}get epsilon(){return Number(this.defines.DEPTH_EPSILON)}set epsilon(e){this.defines.DEPTH_EPSILON=e.toFixed(16),this.needsUpdate=!0}getEpsilon(){return this.epsilon}setEpsilon(e){this.epsilon=e}get depthMode(){return Number(this.defines.DEPTH_MODE)}set depthMode(e){let t;switch(e){case ir:t="false";break;case Mt:t="true";break;case tt:t="abs(d1 - d0) <= DEPTH_EPSILON";break;case Lt:t="abs(d1 - d0) > DEPTH_EPSILON";break;case ut:t="d0 > d1";break;case rr:t="d0 >= d1";break;case tr:t="d0 <= d1";break;case er:default:t="d0 < d1";break}this.defines.DEPTH_MODE=e.toFixed(0),this.defines["depthTest(d0, d1)"]=t,this.needsUpdate=!0}getDepthMode(){return this.depthMode}setDepthMode(e){this.depthMode=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNearFar.value.set(e.near,e.far),e instanceof pe?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},_a=class extends ui{constructor(e,t,r){super(r),this.setAttributes(this.getAttributes()|N.DEPTH),this.camera=t,this.depthPass=new _t(e,t),this.clearPass=new Ie(!0,!1,!1),this.clearPass.overrideClearColor=new X(0),this.depthMaskPass=new W(new ss);const i=this.depthMaskMaterial;i.copyCameraSettings(t),i.depthBuffer1=this.depthPass.texture,i.depthPacking1=q,i.depthMode=tt,this.renderTargetMasked=new y(1,1,{depthBuffer:!1}),this.renderTargetMasked.texture.name="Bloom.Masked",this.selection=new Ot,this._inverted=!1,this._ignoreBackground=!1}set mainScene(e){this.depthPass.mainScene=e}set mainCamera(e){this.camera=e,this.depthPass.mainCamera=e,this.depthMaskMaterial.copyCameraSettings(e)}getSelection(){return this.selection}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get inverted(){return this._inverted}set inverted(e){this._inverted=e,this.depthMaskMaterial.depthMode=e?Lt:tt}isInverted(){return this.inverted}setInverted(e){this.inverted=e}get ignoreBackground(){return this._ignoreBackground}set ignoreBackground(e){this._ignoreBackground=e,this.depthMaskMaterial.maxDepthStrategy=e?Se.DISCARD_MAX_DEPTH:Se.KEEP_MAX_DEPTH}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}setDepthTexture(e,t=F){this.depthMaskMaterial.depthBuffer0=e,this.depthMaskMaterial.depthPacking0=t}update(e,t,r){const i=this.camera,s=this.selection,a=this.inverted;let n=t;if(this.ignoreBackground||!a||s.size>0){const o=i.layers.mask;i.layers.set(s.layer),this.depthPass.render(e),i.layers.mask=o,n=this.renderTargetMasked,this.clearPass.render(e,n),this.depthMaskPass.render(e,t,n)}super.update(e,n,r)}setSize(e,t){super.setSize(e,t),this.renderTargetMasked.setSize(e,t),this.depthPass.setSize(e,t)}initialize(e,t,r){super.initialize(e,t,r),this.clearPass.initialize(e,t,r),this.depthPass.initialize(e,t,r),this.depthMaskPass.initialize(e,t,r),e!==null&&e.capabilities.logarithmicDepthBuffer&&(this.depthMaskPass.fullscreenMaterial.defines.LOG_DEPTH="1"),r!==void 0&&(this.renderTargetMasked.texture.type=r,e!==null&&e.outputColorSpace===w&&(this.renderTargetMasked.texture.colorSpace=w))}},as="uniform vec3 weightsR;uniform vec3 weightsG;uniform vec3 weightsB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,weightsR),dot(inputColor.rgb,weightsG),dot(inputColor.rgb,weightsB));outputColor=vec4(color,inputColor.a);}",Qa=class extends B{constructor({blendFunction:e,intensity:t=1}={}){super("SepiaEffect",as,{blendFunction:e,uniforms:new Map([["weightsR",new c(new z(.393,.769,.189))],["weightsG",new c(new z(.349,.686,.168))],["weightsB",new c(new z(.272,.534,.131))]])})}get intensity(){return this.blendMode.opacity.value}set intensity(e){this.blendMode.opacity.value=e}getIntensity(){return this.intensity}setIntensity(e){this.intensity=e}get weightsR(){return this.uniforms.get("weightsR").value}get weightsG(){return this.uniforms.get("weightsG").value}get weightsB(){return this.uniforms.get("weightsB").value}},ns=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;
|
|
462
|
+
#if EDGE_DETECTION_MODE != 0
|
|
463
|
+
varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;
|
|
464
|
+
#endif
|
|
465
|
+
#if EDGE_DETECTION_MODE == 1
|
|
466
|
+
#include <common>
|
|
467
|
+
#endif
|
|
468
|
+
#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1
|
|
469
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
470
|
+
uniform highp sampler2D depthBuffer;
|
|
471
|
+
#else
|
|
472
|
+
uniform mediump sampler2D depthBuffer;
|
|
473
|
+
#endif
|
|
474
|
+
float readDepth(const in vec2 uv){
|
|
475
|
+
#if DEPTH_PACKING == 3201
|
|
476
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
477
|
+
#else
|
|
478
|
+
return texture2D(depthBuffer,uv).r;
|
|
479
|
+
#endif
|
|
480
|
+
}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);}
|
|
481
|
+
#elif PREDICATION_MODE == 2
|
|
482
|
+
uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);}
|
|
483
|
+
#endif
|
|
484
|
+
#if PREDICATION_MODE != 0
|
|
485
|
+
vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);}
|
|
486
|
+
#endif
|
|
487
|
+
#if EDGE_DETECTION_MODE != 0
|
|
488
|
+
uniform sampler2D inputBuffer;
|
|
489
|
+
#endif
|
|
490
|
+
void main(){
|
|
491
|
+
#if EDGE_DETECTION_MODE == 0
|
|
492
|
+
const vec2 threshold=vec2(DEPTH_THRESHOLD);
|
|
493
|
+
#elif PREDICATION_MODE != 0
|
|
494
|
+
vec2 threshold=calculatePredicatedThreshold();
|
|
495
|
+
#else
|
|
496
|
+
const vec2 threshold=vec2(EDGE_THRESHOLD);
|
|
497
|
+
#endif
|
|
498
|
+
#if EDGE_DETECTION_MODE == 0
|
|
499
|
+
vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0);
|
|
500
|
+
#elif EDGE_DETECTION_MODE == 1
|
|
501
|
+
float l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);
|
|
502
|
+
#elif EDGE_DETECTION_MODE == 2
|
|
503
|
+
vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);
|
|
504
|
+
#endif
|
|
505
|
+
}`,os=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;
|
|
506
|
+
#if EDGE_DETECTION_MODE != 0
|
|
507
|
+
varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;
|
|
508
|
+
#endif
|
|
509
|
+
void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0);
|
|
510
|
+
#if EDGE_DETECTION_MODE != 0
|
|
511
|
+
vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);
|
|
512
|
+
#endif
|
|
513
|
+
gl_Position=vec4(position.xy,1.0,1.0);}`,ls=class extends U{constructor(e=new g,t=zt.COLOR){super({name:"EdgeDetectionMaterial",defines:{THREE_REVISION:Me.replace(/\D+/g,""),LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new c(null),depthBuffer:new c(null),predicationBuffer:new c(null),texelSize:new c(e)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ns,vertexShader:os}),this.edgeDetectionMode=t}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=F){this.depthBuffer=e,this.depthPacking=t}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(e){this.defines.EDGE_DETECTION_MODE=e.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(e){this.edgeDetectionMode=e}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(e){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=e.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(e){this.localContrastAdaptationFactor=e}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(e){this.defines.EDGE_THRESHOLD=e.toFixed("6"),this.defines.DEPTH_THRESHOLD=(e*.1).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(e){this.edgeDetectionThreshold=e}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(e){this.defines.PREDICATION_MODE=e.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(e){this.predicationMode=e}set predicationBuffer(e){this.uniforms.predicationBuffer.value=e}setPredicationBuffer(e){this.uniforms.predicationBuffer.value=e}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(e){this.defines.PREDICATION_THRESHOLD=e.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(e){this.predicationThreshold=e}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(e){this.defines.PREDICATION_SCALE=e.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(e){this.predicationScale=e}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(e){this.defines.PREDICATION_STRENGTH=e.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(e){this.predicationStrength=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},cs=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)
|
|
514
|
+
#if __VERSION__ < 300
|
|
515
|
+
#define round(v) floor(v + 0.5)
|
|
516
|
+
#endif
|
|
517
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
518
|
+
uniform mediump sampler2D inputBuffer;
|
|
519
|
+
#else
|
|
520
|
+
uniform lowp sampler2D inputBuffer;
|
|
521
|
+
#endif
|
|
522
|
+
uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x>end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x<end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.y>end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;i++){if(!(texCoord.y<end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){
|
|
523
|
+
#if !defined(DISABLE_CORNER_DETECTION)
|
|
524
|
+
vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0);
|
|
525
|
+
#endif
|
|
526
|
+
}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){
|
|
527
|
+
#if !defined(DISABLE_CORNER_DETECTION)
|
|
528
|
+
vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0);
|
|
529
|
+
#endif
|
|
530
|
+
}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){
|
|
531
|
+
#if !defined(DISABLE_DIAG_DETECTION)
|
|
532
|
+
weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){
|
|
533
|
+
#endif
|
|
534
|
+
vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d);
|
|
535
|
+
#if !defined(DISABLE_DIAG_DETECTION)
|
|
536
|
+
}else{e.r=0.0;}
|
|
537
|
+
#endif
|
|
538
|
+
}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,us="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",fs=class extends U{constructor(e=new g,t=new g){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new c(null),searchTexture:new c(null),areaTexture:new c(null),resolution:new c(t),texelSize:new c(e)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:cs,vertexShader:us})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(e){this.uniforms.searchTexture.value=e}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(e){this.uniforms.areaTexture.value=e}setLookupTextures(e,t){this.searchTexture=e,this.areaTexture=t}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(e){const t=Math.min(Math.max(e,0),112);this.defines.MAX_SEARCH_STEPS_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(e){this.orthogonalSearchSteps=e}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(e){const t=Math.min(Math.max(e,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(e){this.diagonalSearchSteps=e}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(e){e?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(e){this.diagonalDetection=e}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(e){const t=Math.min(Math.max(e,0),100);this.defines.CORNER_ROUNDING=t.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(t/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(e){this.cornerRounding=e}get cornerDetection(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerDetection(e){e?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(e){this.cornerDetection=e}setSize(e,t){const r=this.uniforms;r.texelSize.value.set(1/e,1/t),r.resolution.value.set(e,t)}},st="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",at="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0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FlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",hs="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",ds="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",Va=class extends B{constructor({blendFunction:e=m.SRC,preset:t=Ae.MEDIUM,edgeDetectionMode:r=zt.COLOR,predicationMode:i=zi.DISABLED}={}){super("SMAAEffect",hs,{vertexShader:ds,blendFunction:e,attributes:N.CONVOLUTION|N.DEPTH,uniforms:new Map([["weightMap",new c(null)]])});let s,a;arguments.length>1&&(s=arguments[0],a=arguments[1],arguments.length>2&&(t=arguments[2]),arguments.length>3&&(r=arguments[3])),this.renderTargetEdges=new y(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new Ie(!0,!1,!1),this.clearPass.overrideClearColor=new X(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new W(new ls),this.edgeDetectionMaterial.edgeDetectionMode=r,this.edgeDetectionMaterial.predicationMode=i,this.weightsPass=new W(new fs);const n=new le;n.onLoad=()=>{const o=new ze(s);o.name="SMAA.Search",o.magFilter=_,o.minFilter=_,o.generateMipmaps=!1,o.needsUpdate=!0,o.flipY=!0,this.weightsMaterial.searchTexture=o;const l=new ze(a);l.name="SMAA.Area",l.magFilter=K,l.minFilter=K,l.generateMipmaps=!1,l.needsUpdate=!0,l.flipY=!1,this.weightsMaterial.areaTexture=l,this.dispatchEvent({type:"load"})},n.itemStart("search"),n.itemStart("area"),s!==void 0&&a!==void 0?(n.itemEnd("search"),n.itemEnd("area")):typeof Image<"u"&&(s=new Image,a=new Image,s.addEventListener("load",()=>n.itemEnd("search")),a.addEventListener("load",()=>n.itemEnd("area")),s.src=st,a.src=at),this.applyPreset(t)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(e){this.edgeDetectionMaterial.edgeDetectionThreshold=e}setOrthogonalSearchSteps(e){this.weightsMaterial.orthogonalSearchSteps=e}applyPreset(e){const t=this.edgeDetectionMaterial,r=this.weightsMaterial;switch(e){case Ae.LOW:t.edgeDetectionThreshold=.15,r.orthogonalSearchSteps=4,r.diagonalDetection=!1,r.cornerDetection=!1;break;case Ae.MEDIUM:t.edgeDetectionThreshold=.1,r.orthogonalSearchSteps=8,r.diagonalDetection=!1,r.cornerDetection=!1;break;case Ae.HIGH:t.edgeDetectionThreshold=.1,r.orthogonalSearchSteps=16,r.diagonalSearchSteps=8,r.cornerRounding=25,r.diagonalDetection=!0,r.cornerDetection=!0;break;case Ae.ULTRA:t.edgeDetectionThreshold=.05,r.orthogonalSearchSteps=32,r.diagonalSearchSteps=16,r.cornerRounding=25,r.diagonalDetection=!0,r.cornerDetection=!0;break}}setDepthTexture(e,t=F){this.edgeDetectionMaterial.depthBuffer=e,this.edgeDetectionMaterial.depthPacking=t}update(e,t,r){this.clearPass.render(e,this.renderTargetEdges),this.edgeDetectionPass.render(e,t,this.renderTargetEdges),this.weightsPass.render(e,this.renderTargetEdges,this.renderTargetWeights)}setSize(e,t){this.edgeDetectionMaterial.setSize(e,t),this.weightsMaterial.setSize(e,t),this.renderTargetEdges.setSize(e,t),this.renderTargetWeights.setSize(e,t)}dispose(){const{searchTexture:e,areaTexture:t}=this.weightsMaterial;e!==null&&t!==null&&(e.dispose(),t.dispose()),super.dispose()}static get searchImageDataURL(){return st}static get areaImageDataURL(){return at}};function Te(e,t,r){return e*(t-r)-t}function Ce(e,t,r){return Math.min(Math.max((e+t)/(t-r),0),1)}var vs=`#include <common>
|
|
539
|
+
#include <packing>
|
|
540
|
+
uniform vec2 cameraNearFar;
|
|
541
|
+
#define cameraNear cameraNearFar.x
|
|
542
|
+
#define cameraFar cameraNearFar.y
|
|
543
|
+
#ifdef NORMAL_DEPTH
|
|
544
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
545
|
+
uniform highp sampler2D normalDepthBuffer;
|
|
546
|
+
#else
|
|
547
|
+
uniform mediump sampler2D normalDepthBuffer;
|
|
548
|
+
#endif
|
|
549
|
+
float readDepth(const in vec2 uv){float depth=texture2D(normalDepthBuffer,uv).a;
|
|
550
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
551
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
552
|
+
#endif
|
|
553
|
+
return depth;}
|
|
554
|
+
#else
|
|
555
|
+
uniform lowp sampler2D normalBuffer;
|
|
556
|
+
#if DEPTH_PACKING == 3201
|
|
557
|
+
uniform lowp sampler2D depthBuffer;
|
|
558
|
+
#elif defined(GL_FRAGMENT_PRECISION_HIGH)
|
|
559
|
+
uniform highp sampler2D depthBuffer;
|
|
560
|
+
#else
|
|
561
|
+
uniform mediump sampler2D depthBuffer;
|
|
562
|
+
#endif
|
|
563
|
+
float readDepth(const in vec2 uv){
|
|
564
|
+
#if DEPTH_PACKING == 3201
|
|
565
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
566
|
+
#else
|
|
567
|
+
float depth=texture2D(depthBuffer,uv).r;
|
|
568
|
+
#endif
|
|
569
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
570
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
571
|
+
#endif
|
|
572
|
+
return depth;}
|
|
573
|
+
#endif
|
|
574
|
+
uniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform float intensity;uniform float minRadiusScale;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){
|
|
575
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
576
|
+
return perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
|
|
577
|
+
#else
|
|
578
|
+
return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
579
|
+
#endif
|
|
580
|
+
}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){float radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;float noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i<SAMPLES_INT;++i){float alpha=(float(i)+0.5)*INV_SAMPLES_FLOAT;float angle=alpha*rings+baseAngle;vec2 rotation=vec2(cos(angle),sin(angle));vec2 coords=alpha*radius*rotation*texelSize+uv;if(coords.s<0.0||coords.s>1.0||coords.t<0.0||coords.t>1.0){continue;}float sampleDepth=readDepth(coords);float viewZ=getViewZ(sampleDepth);
|
|
581
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
582
|
+
float linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);
|
|
583
|
+
#else
|
|
584
|
+
float linearSampleDepth=sampleDepth;
|
|
585
|
+
#endif
|
|
586
|
+
float proximity=abs(depth-linearSampleDepth);if(proximity<proximityCutoff.y){float falloff=1.0-smoothstep(proximityCutoff.x,proximityCutoff.y,proximity);vec3 Q=getViewPosition(coords,sampleDepth,viewZ);vec3 v=Q-p;float vv=dot(v,v);float vn=dot(v,n)-bias;float f=max(RADIUS_SQ-vv,0.0)/RADIUS_SQ;occlusion+=(f*f*f*max(vn/(fade+vv),0.0))*falloff;}++taps;}return occlusion/(4.0*max(float(taps),1.0));}void main(){
|
|
587
|
+
#ifdef NORMAL_DEPTH
|
|
588
|
+
vec4 normalDepth=texture2D(normalDepthBuffer,vUv);
|
|
589
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
590
|
+
float d=pow(2.0,normalDepth.a*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);normalDepth.a=a+b/d;
|
|
591
|
+
#endif
|
|
592
|
+
#else
|
|
593
|
+
vec4 normalDepth=vec4(texture2D(normalBuffer,vUv).xyz,readDepth(vUv));
|
|
594
|
+
#endif
|
|
595
|
+
float ao=0.0;float depth=normalDepth.a;float viewZ=getViewZ(depth);
|
|
596
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
597
|
+
float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);
|
|
598
|
+
#else
|
|
599
|
+
float linearDepth=depth;
|
|
600
|
+
#endif
|
|
601
|
+
if(linearDepth<distanceCutoff.y){vec3 viewPosition=getViewPosition(vUv,depth,viewZ);vec3 viewNormal=unpackRGBToNormal(normalDepth.rgb);ao+=getAmbientOcclusion(viewPosition,viewNormal,linearDepth,vUv);float d=smoothstep(distanceCutoff.x,distanceCutoff.y,linearDepth);ao=mix(ao,0.0,d);
|
|
602
|
+
#ifdef LEGACY_INTENSITY
|
|
603
|
+
ao=clamp(1.0-pow(1.0-ao,abs(intensity)),0.0,1.0);
|
|
604
|
+
#endif
|
|
605
|
+
}gl_FragColor.r=ao;}`,gs="uniform vec2 noiseScale;varying vec2 vUv;varying vec2 vUv2;void main(){vUv=position.xy*0.5+0.5;vUv2=vUv*noiseScale;gl_Position=vec4(position.xy,1.0,1.0);}",ps=class extends U{constructor(e){super({name:"SSAOMaterial",defines:{SAMPLES_INT:"0",INV_SAMPLES_FLOAT:"0.0",SPIRAL_TURNS:"0.0",RADIUS:"1.0",RADIUS_SQ:"1.0",DISTANCE_SCALING:"1",DEPTH_PACKING:"0"},uniforms:{depthBuffer:new c(null),normalBuffer:new c(null),normalDepthBuffer:new c(null),noiseTexture:new c(null),inverseProjectionMatrix:new c(new et),projectionMatrix:new c(new et),texelSize:new c(new g),cameraNearFar:new c(new g),distanceCutoff:new c(new g),proximityCutoff:new c(new g),noiseScale:new c(new g),minRadiusScale:new c(.33),intensity:new c(1),fade:new c(.01),bias:new c(0)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:vs,vertexShader:gs}),this.copyCameraSettings(e),this.resolution=new g,this.r=1}get near(){return this.uniforms.cameraNearFar.value.x}get far(){return this.uniforms.cameraNearFar.value.y}set normalDepthBuffer(e){this.uniforms.normalDepthBuffer.value=e,e!==null?this.defines.NORMAL_DEPTH="1":delete this.defines.NORMAL_DEPTH,this.needsUpdate=!0}setNormalDepthBuffer(e){this.normalDepthBuffer=e}set normalBuffer(e){this.uniforms.normalBuffer.value=e}setNormalBuffer(e){this.uniforms.normalBuffer.value=e}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=F){this.depthBuffer=e,this.depthPacking=t}set noiseTexture(e){this.uniforms.noiseTexture.value=e}setNoiseTexture(e){this.uniforms.noiseTexture.value=e}get samples(){return Number(this.defines.SAMPLES_INT)}set samples(e){this.defines.SAMPLES_INT=e.toFixed(0),this.defines.INV_SAMPLES_FLOAT=(1/e).toFixed(9),this.needsUpdate=!0}getSamples(){return this.samples}setSamples(e){this.samples=e}get rings(){return Number(this.defines.SPIRAL_TURNS)}set rings(e){this.defines.SPIRAL_TURNS=e.toFixed(1),this.needsUpdate=!0}getRings(){return this.rings}setRings(e){this.rings=e}get intensity(){return this.uniforms.intensity.value}set intensity(e){this.uniforms.intensity.value=e,this.defines.LEGACY_INTENSITY===void 0&&(this.defines.LEGACY_INTENSITY="1",this.needsUpdate=!0)}getIntensity(){return this.uniforms.intensity.value}setIntensity(e){this.uniforms.intensity.value=e}get fade(){return this.uniforms.fade.value}set fade(e){this.uniforms.fade.value=e}getFade(){return this.uniforms.fade.value}setFade(e){this.uniforms.fade.value=e}get bias(){return this.uniforms.bias.value}set bias(e){this.uniforms.bias.value=e}getBias(){return this.uniforms.bias.value}setBias(e){this.uniforms.bias.value=e}get minRadiusScale(){return this.uniforms.minRadiusScale.value}set minRadiusScale(e){this.uniforms.minRadiusScale.value=e}getMinRadiusScale(){return this.uniforms.minRadiusScale.value}setMinRadiusScale(e){this.uniforms.minRadiusScale.value=e}updateRadius(){const e=this.r*this.resolution.height;this.defines.RADIUS=e.toFixed(11),this.defines.RADIUS_SQ=(e*e).toFixed(11),this.needsUpdate=!0}get radius(){return this.r}set radius(e){this.r=Math.min(Math.max(e,1e-6),1),this.updateRadius()}getRadius(){return this.radius}setRadius(e){this.radius=e}get distanceScaling(){return!0}set distanceScaling(e){}isDistanceScalingEnabled(){return this.distanceScaling}setDistanceScalingEnabled(e){this.distanceScaling=e}get distanceThreshold(){return this.uniforms.distanceCutoff.value.x}set distanceThreshold(e){this.uniforms.distanceCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+this.distanceFalloff,0),1))}get worldDistanceThreshold(){return-Te(this.distanceThreshold,this.near,this.far)}set worldDistanceThreshold(e){this.distanceThreshold=Ce(-e,this.near,this.far)}get distanceFalloff(){return this.uniforms.distanceCutoff.value.y-this.distanceThreshold}set distanceFalloff(e){this.uniforms.distanceCutoff.value.y=Math.min(Math.max(this.distanceThreshold+e,0),1)}get worldDistanceFalloff(){return-Te(this.distanceFalloff,this.near,this.far)}set worldDistanceFalloff(e){this.distanceFalloff=Ce(-e,this.near,this.far)}setDistanceCutoff(e,t){this.uniforms.distanceCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+t,0),1))}get proximityThreshold(){return this.uniforms.proximityCutoff.value.x}set proximityThreshold(e){this.uniforms.proximityCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+this.proximityFalloff,0),1))}get worldProximityThreshold(){return-Te(this.proximityThreshold,this.near,this.far)}set worldProximityThreshold(e){this.proximityThreshold=Ce(-e,this.near,this.far)}get proximityFalloff(){return this.uniforms.proximityCutoff.value.y-this.proximityThreshold}set proximityFalloff(e){this.uniforms.proximityCutoff.value.y=Math.min(Math.max(this.proximityThreshold+e,0),1)}get worldProximityFalloff(){return-Te(this.proximityFalloff,this.near,this.far)}set worldProximityFalloff(e){this.proximityFalloff=Ce(-e,this.near,this.far)}setProximityCutoff(e,t){this.uniforms.proximityCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+t,0),1))}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNearFar.value.set(e.near,e.far),this.uniforms.projectionMatrix.value.copy(e.projectionMatrix),this.uniforms.inverseProjectionMatrix.value.copy(e.projectionMatrix).invert(),e instanceof pe?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){const r=this.uniforms,i=r.noiseTexture.value;i!==null&&r.noiseScale.value.set(e/i.image.width,t/i.image.height),r.texelSize.value.set(1/e,1/t),this.resolution.set(e,t),this.updateRadius()}},ms=`#include <packing>
|
|
606
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
607
|
+
uniform highp sampler2D depthBuffer;
|
|
608
|
+
#else
|
|
609
|
+
uniform mediump sampler2D depthBuffer;
|
|
610
|
+
#endif
|
|
611
|
+
#ifdef DOWNSAMPLE_NORMALS
|
|
612
|
+
uniform lowp sampler2D normalBuffer;
|
|
613
|
+
#endif
|
|
614
|
+
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){
|
|
615
|
+
#if DEPTH_PACKING == 3201
|
|
616
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
617
|
+
#else
|
|
618
|
+
return texture2D(depthBuffer,uv).r;
|
|
619
|
+
#endif
|
|
620
|
+
}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d);
|
|
621
|
+
#ifdef DOWNSAMPLE_NORMALS
|
|
622
|
+
vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb;
|
|
623
|
+
#else
|
|
624
|
+
vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0);
|
|
625
|
+
#endif
|
|
626
|
+
gl_FragColor=vec4(n[index],d[index]);}`,As="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",xs=class extends U{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new c(null),normalBuffer:new c(null),texelSize:new c(new g)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ms,vertexShader:As})}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=F){this.depthBuffer=e,this.depthPacking=t}set normalBuffer(e){this.uniforms.normalBuffer.value=e,e!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(e){this.normalBuffer=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},Es=class extends O{constructor({normalBuffer:e=null,resolutionScale:t=.5,width:r=E.AUTO_SIZE,height:i=E.AUTO_SIZE,resolutionX:s=r,resolutionY:a=i}={}){super("DepthDownsamplingPass");const n=new xs;n.normalBuffer=e,this.fullscreenMaterial=n,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new y(1,1,{minFilter:_,magFilter:_,depthBuffer:!1,type:Y}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const o=this.resolution=new E(this,s,a,t);o.addEventListener("change",l=>this.setSize(o.baseWidth,o.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(e,t=F){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,r,i,s){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height),this.fullscreenMaterial.setSize(e,t)}initialize(e,t,r){const i=e.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},Ds=`uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity;
|
|
627
|
+
#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH)
|
|
628
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
629
|
+
uniform highp sampler2D normalDepthBuffer;
|
|
630
|
+
#else
|
|
631
|
+
uniform mediump sampler2D normalDepthBuffer;
|
|
632
|
+
#endif
|
|
633
|
+
#endif
|
|
634
|
+
#ifdef COLORIZE
|
|
635
|
+
uniform vec3 color;
|
|
636
|
+
#endif
|
|
637
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r;
|
|
638
|
+
#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300
|
|
639
|
+
vec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distance<smallestDistance){smallestDistance=distance;index=i;}}ivec2 offsets[4];offsets[0]=ivec2(0,0);offsets[1]=ivec2(0,1);offsets[2]=ivec2(1,0);offsets[3]=ivec2(1,1);ivec2 coord=ivec2(uv*vec2(textureSize(aoBuffer,0)))+offsets[index];float aoNearest=texelFetch(aoBuffer,coord,0).r;float ao=mix(aoNearest,aoLinear,s);
|
|
640
|
+
#else
|
|
641
|
+
float ao=aoLinear;
|
|
642
|
+
#endif
|
|
643
|
+
float l=luminance(inputColor.rgb);ao=mix(ao,0.0,l*luminanceInfluence);ao=clamp(ao*intensity,0.0,1.0);
|
|
644
|
+
#ifdef COLORIZE
|
|
645
|
+
outputColor=vec4(1.0-ao*(1.0-color),inputColor.a);
|
|
646
|
+
#else
|
|
647
|
+
outputColor=vec4(vec3(1.0-ao),inputColor.a);
|
|
648
|
+
#endif
|
|
649
|
+
}`,xt=64,Ya=class extends B{constructor(e,t,{blendFunction:r=m.MULTIPLY,samples:i=9,rings:s=7,normalDepthBuffer:a=null,depthAwareUpsampling:n=!0,worldDistanceThreshold:o,worldDistanceFalloff:l,worldProximityThreshold:u,worldProximityFalloff:h,distanceThreshold:f=.97,distanceFalloff:d=.03,rangeThreshold:v=5e-4,rangeFalloff:A=.001,minRadiusScale:p=.1,luminanceInfluence:x=.7,radius:C=.1825,intensity:T=1,bias:D=.025,fade:G=.01,color:Z=null,resolutionScale:j=1,width:J=E.AUTO_SIZE,height:P=E.AUTO_SIZE,resolutionX:ce=J,resolutionY:ue=P}={}){super("SSAOEffect",Ds,{blendFunction:r,attributes:N.DEPTH,defines:new Map([["THRESHOLD","0.997"]]),uniforms:new Map([["aoBuffer",new c(null)],["normalDepthBuffer",new c(a)],["luminanceInfluence",new c(x)],["color",new c(null)],["intensity",new c(T)],["scale",new c(0)]])}),this.renderTarget=new y(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="AO.Target",this.uniforms.get("aoBuffer").value=this.renderTarget.texture;const ee=this.resolution=new E(this,ce,ue,j);ee.addEventListener("change",ye=>this.setSize(ee.baseWidth,ee.baseHeight)),this.camera=e,this.depthDownsamplingPass=new Es({normalBuffer:t,resolutionScale:j}),this.depthDownsamplingPass.enabled=a===null,this.ssaoPass=new W(new ps(e));const ie=new it(xt,xt,ae);ie.wrapS=ie.wrapT=Be;const b=this.ssaoMaterial;b.normalBuffer=t,b.noiseTexture=ie,b.minRadiusScale=p,b.samples=i,b.radius=C,b.rings=s,b.fade=G,b.bias=D,b.distanceThreshold=f,b.distanceFalloff=d,b.proximityThreshold=v,b.proximityFalloff=A,o!==void 0&&(b.worldDistanceThreshold=o),l!==void 0&&(b.worldDistanceFalloff=l),u!==void 0&&(b.worldProximityThreshold=u),h!==void 0&&(b.worldProximityFalloff=h),a!==null&&(this.ssaoMaterial.normalDepthBuffer=a,this.defines.set("NORMAL_DEPTH","1")),this.depthAwareUpsampling=n,this.color=Z}set mainCamera(e){this.camera=e,this.ssaoMaterial.copyCameraSettings(e)}get normalBuffer(){return this.ssaoMaterial.normalBuffer}set normalBuffer(e){this.ssaoMaterial.normalBuffer=e,this.depthDownsamplingPass.fullscreenMaterial.normalBuffer=e}getResolution(){return this.resolution}get ssaoMaterial(){return this.ssaoPass.fullscreenMaterial}getSSAOMaterial(){return this.ssaoMaterial}get samples(){return this.ssaoMaterial.samples}set samples(e){this.ssaoMaterial.samples=e}get rings(){return this.ssaoMaterial.rings}set rings(e){this.ssaoMaterial.rings=e}get radius(){return this.ssaoMaterial.radius}set radius(e){this.ssaoMaterial.radius=e}get depthAwareUpsampling(){return this.defines.has("DEPTH_AWARE_UPSAMPLING")}set depthAwareUpsampling(e){this.depthAwareUpsampling!==e&&(e?this.defines.set("DEPTH_AWARE_UPSAMPLING","1"):this.defines.delete("DEPTH_AWARE_UPSAMPLING"),this.setChanged())}isDepthAwareUpsamplingEnabled(){return this.depthAwareUpsampling}setDepthAwareUpsamplingEnabled(e){this.depthAwareUpsampling=e}get distanceScaling(){return!0}set distanceScaling(e){}get color(){return this.uniforms.get("color").value}set color(e){const t=this.uniforms,r=this.defines;e!==null?r.has("COLORIZE")?t.get("color").value.set(e):(r.set("COLORIZE","1"),t.get("color").value=new X(e),this.setChanged()):r.has("COLORIZE")&&(r.delete("COLORIZE"),t.get("color").value=null,this.setChanged())}get luminanceInfluence(){return this.uniforms.get("luminanceInfluence").value}set luminanceInfluence(e){this.uniforms.get("luminanceInfluence").value=e}get intensity(){return this.uniforms.get("intensity").value}set intensity(e){this.uniforms.get("intensity").value=e}getColor(){return this.color}setColor(e){this.color=e}setDistanceCutoff(e,t){this.ssaoMaterial.distanceThreshold=e,this.ssaoMaterial.distanceFalloff=t}setProximityCutoff(e,t){this.ssaoMaterial.proximityThreshold=e,this.ssaoMaterial.proximityFalloff=t}setDepthTexture(e,t=F){this.depthDownsamplingPass.setDepthTexture(e,t),this.ssaoMaterial.depthBuffer=e,this.ssaoMaterial.depthPacking=t}update(e,t,r){const i=this.renderTarget;this.depthDownsamplingPass.enabled&&this.depthDownsamplingPass.render(e),this.ssaoPass.render(e,null,i)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.ssaoMaterial.copyCameraSettings(this.camera),this.ssaoMaterial.setSize(i,s),this.renderTarget.setSize(i,s),this.depthDownsamplingPass.resolution.scale=r.scale,this.depthDownsamplingPass.setSize(e,t)}initialize(e,t,r){try{let i=this.uniforms.get("normalDepthBuffer").value;i===null&&(this.depthDownsamplingPass.initialize(e,t,r),i=this.depthDownsamplingPass.texture,this.uniforms.get("normalDepthBuffer").value=i,this.ssaoMaterial.normalDepthBuffer=i,this.defines.set("NORMAL_DEPTH","1"))}catch{this.depthDownsamplingPass.enabled=!1}}},ws=`#ifdef TEXTURE_PRECISION_HIGH
|
|
650
|
+
uniform mediump sampler2D map;
|
|
651
|
+
#else
|
|
652
|
+
uniform lowp sampler2D map;
|
|
653
|
+
#endif
|
|
654
|
+
varying vec2 vUv2;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){
|
|
655
|
+
#ifdef UV_TRANSFORM
|
|
656
|
+
vec4 texel=texture2D(map,vUv2);
|
|
657
|
+
#else
|
|
658
|
+
vec4 texel=texture2D(map,uv);
|
|
659
|
+
#endif
|
|
660
|
+
outputColor=TEXEL;outputColor.a=max(inputColor.a,outputColor.a);}`,Ts=`#ifdef ASPECT_CORRECTION
|
|
661
|
+
uniform float scale;
|
|
662
|
+
#else
|
|
663
|
+
uniform mat3 uvTransform;
|
|
664
|
+
#endif
|
|
665
|
+
varying vec2 vUv2;void mainSupport(const in vec2 uv){
|
|
666
|
+
#ifdef ASPECT_CORRECTION
|
|
667
|
+
vUv2=uv*vec2(aspect,1.0)*scale;
|
|
668
|
+
#else
|
|
669
|
+
vUv2=(uvTransform*vec3(uv,1.0)).xy;
|
|
670
|
+
#endif
|
|
671
|
+
}`,Wa=class extends B{constructor({blendFunction:e,texture:t=null,aspectCorrection:r=!1}={}){super("TextureEffect",ws,{blendFunction:e,defines:new Map([["TEXEL","texel"]]),uniforms:new Map([["map",new c(null)],["scale",new c(1)],["uvTransform",new c(null)]])}),this.texture=t,this.aspectCorrection=r}get texture(){return this.uniforms.get("map").value}set texture(e){const t=this.texture,r=this.uniforms,i=this.defines;t!==e&&(r.get("map").value=e,r.get("uvTransform").value=e.matrix,i.delete("TEXTURE_PRECISION_HIGH"),e!==null&&(e.matrixAutoUpdate?(i.set("UV_TRANSFORM","1"),this.setVertexShader(Ts)):(i.delete("UV_TRANSFORM"),this.setVertexShader(null)),e.type!==H&&i.set("TEXTURE_PRECISION_HIGH","1"),(t===null||t.type!==e.type||t.encoding!==e.encoding)&&this.setChanged()))}getTexture(){return this.texture}setTexture(e){this.texture=e}get aspectCorrection(){return this.defines.has("ASPECT_CORRECTION")}set aspectCorrection(e){this.aspectCorrection!==e&&(e?this.defines.set("ASPECT_CORRECTION","1"):this.defines.delete("ASPECT_CORRECTION"),this.setChanged())}get uvTransform(){const e=this.texture;return e!==null&&e.matrixAutoUpdate}set uvTransform(e){const t=this.texture;t!==null&&(t.matrixAutoUpdate=e)}setTextureSwizzleRGBA(e,t=e,r=e,i=e){const s="rgba";let a="";(e!==ve.RED||t!==ve.GREEN||r!==ve.BLUE||i!==ve.ALPHA)&&(a=[".",s[e],s[t],s[r],s[i]].join("")),this.defines.set("TEXEL","texel"+a),this.setChanged()}update(e,t,r){this.texture.matrixAutoUpdate&&this.texture.updateMatrix()}},Cs=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
672
|
+
uniform mediump sampler2D inputBuffer;
|
|
673
|
+
#else
|
|
674
|
+
uniform lowp sampler2D inputBuffer;
|
|
675
|
+
#endif
|
|
676
|
+
uniform vec4 maskParams;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;float linearGradientMask(const in float x){return smoothstep(maskParams.x,maskParams.y,x)-smoothstep(maskParams.w,maskParams.z,x);}void main(){vec2 dUv=vOffset*(1.0-linearGradientMask(vUv2.y));vec4 sum=texture2D(inputBuffer,vec2(vUv.x-dUv.x,vUv.y+dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x+dUv.x,vUv.y+dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x+dUv.x,vUv.y-dUv.y));sum+=texture2D(inputBuffer,vec2(vUv.x-dUv.x,vUv.y-dUv.y));gl_FragColor=sum*0.25;
|
|
677
|
+
#include <colorspace_fragment>
|
|
678
|
+
}`,Ss="uniform vec4 texelSize;uniform float kernel;uniform float scale;uniform float aspect;uniform vec2 rotation;varying vec2 vUv;varying vec2 vUv2;varying vec2 vOffset;void main(){vec2 uv=position.xy*0.5+0.5;vUv=uv;vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));vOffset=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;gl_Position=vec4(position.xy,1.0,1.0);}",Bs=class extends Nt{constructor({kernelSize:e=$.MEDIUM,offset:t=0,rotation:r=0,focusArea:i=.4,feather:s=.3}={}){super(),this.fragmentShader=Cs,this.vertexShader=Ss,this.kernelSize=e,this.uniforms.aspect=new c(1),this.uniforms.rotation=new c(new g),this.uniforms.maskParams=new c(new oe),this._offset=t,this._focusArea=i,this._feather=s,this.rotation=r,this.updateParams()}updateParams(){const e=this.uniforms.maskParams.value,t=Math.max(this.focusArea,0),r=Math.max(t-this.feather,0);e.set(this.offset-t,this.offset-r,this.offset+t,this.offset+r)}get rotation(){return Math.acos(this.uniforms.rotation.value.x)}set rotation(e){this.uniforms.rotation.value.set(Math.cos(e),Math.sin(e))}get offset(){return this._offset}set offset(e){this._offset=e,this.updateParams()}get focusArea(){return this._focusArea}set focusArea(e){this._focusArea=e,this.updateParams()}get feather(){return this._feather}set feather(e){this._feather=e,this.updateParams()}setSize(e,t){super.setSize(e,t),this.uniforms.aspect.value=e/t}},Ms=class extends Pe{constructor({offset:e=0,rotation:t=0,focusArea:r=.4,feather:i=.3,kernelSize:s=$.MEDIUM,resolutionScale:a=.5,resolutionX:n=E.AUTO_SIZE,resolutionY:o=E.AUTO_SIZE}={}){super({kernelSize:s,resolutionScale:a,resolutionX:n,resolutionY:o}),this.blurMaterial=new Bs({kernelSize:s,offset:e,rotation:t,focusArea:r,feather:i})}},Is=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
679
|
+
uniform mediump sampler2D map;
|
|
680
|
+
#else
|
|
681
|
+
uniform lowp sampler2D map;
|
|
682
|
+
#endif
|
|
683
|
+
uniform vec2 maskParams;varying vec2 vUv2;float linearGradientMask(const in float x){return step(maskParams.x,x)-step(maskParams.y,x);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float mask=linearGradientMask(vUv2.y);vec4 texel=texture2D(map,uv);outputColor=mix(texel,inputColor,mask);}`,Ps="uniform vec2 rotation;varying vec2 vUv2;void mainSupport(const in vec2 uv){vUv2=(uv-0.5)*2.0*vec2(aspect,1.0);vUv2=vec2(dot(rotation,vUv2),dot(rotation,vec2(vUv2.y,-vUv2.x)));}",Xa=class extends B{constructor({blendFunction:e,offset:t=0,rotation:r=0,focusArea:i=.4,feather:s=.3,kernelSize:a=$.MEDIUM,resolutionScale:n=.5,resolutionX:o=E.AUTO_SIZE,resolutionY:l=E.AUTO_SIZE}={}){super("TiltShiftEffect",Is,{vertexShader:Ps,blendFunction:e,uniforms:new Map([["rotation",new c(new g)],["maskParams",new c(new g)],["map",new c(null)]])}),this._offset=t,this._focusArea=i,this._feather=s,this.renderTarget=new y(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="TiltShift.Target",this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new Ms({kernelSize:a,resolutionScale:n,resolutionX:o,resolutionY:l,offset:t,rotation:r,focusArea:i,feather:s});const u=this.resolution=new E(this,o,l,n);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight)),this.rotation=r,this.updateParams()}updateParams(){const e=this.uniforms.get("maskParams").value,t=Math.max(this.focusArea-this.feather,0);e.set(this.offset-t,this.offset+t)}get rotation(){return Math.acos(this.uniforms.get("rotation").value.x)}set rotation(e){this.uniforms.get("rotation").value.set(Math.cos(e),Math.sin(e)),this.blurPass.blurMaterial.rotation=e}get offset(){return this._offset}set offset(e){this._offset=e,this.blurPass.blurMaterial.offset=e,this.updateParams()}get focusArea(){return this._focusArea}set focusArea(e){this._focusArea=e,this.blurPass.blurMaterial.focusArea=e,this.updateParams()}get feather(){return this._feather}set feather(e){this._feather=e,this.blurPass.blurMaterial.feather=e,this.updateParams()}get bias(){return 0}set bias(e){}update(e,t,r){this.blurPass.render(e,t,this.renderTarget)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height),this.blurPass.resolution.copy(r)}initialize(e,t,r){this.blurPass.initialize(e,t,r),r!==void 0&&(this.renderTarget.texture.type=r,e!==null&&e.outputColorSpace===w&&(this.renderTarget.texture.colorSpace=w))}},ys=`#include <packing>
|
|
684
|
+
#define packFloatToRGBA(v) packDepthToRGBA(v)
|
|
685
|
+
#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
|
|
686
|
+
uniform lowp sampler2D luminanceBuffer0;uniform lowp sampler2D luminanceBuffer1;uniform float minLuminance;uniform float deltaTime;uniform float tau;varying vec2 vUv;void main(){float l0=unpackRGBAToFloat(texture2D(luminanceBuffer0,vUv));
|
|
687
|
+
#if __VERSION__ < 300
|
|
688
|
+
float l1=texture2DLodEXT(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;
|
|
689
|
+
#else
|
|
690
|
+
float l1=textureLod(luminanceBuffer1,vUv,MIP_LEVEL_1X1).r;
|
|
691
|
+
#endif
|
|
692
|
+
l0=max(minLuminance,l0);l1=max(minLuminance,l1);float adaptedLum=l0+(l1-l0)*(1.0-exp(-deltaTime*tau));gl_FragColor=(adaptedLum==1.0)?vec4(1.0):packFloatToRGBA(adaptedLum);}`,Us=class extends U{constructor(){super({name:"AdaptiveLuminanceMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{luminanceBuffer0:new c(null),luminanceBuffer1:new c(null),minLuminance:new c(.01),deltaTime:new c(0),tau:new c(1)},extensions:{shaderTextureLOD:!0},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ys,vertexShader:re})}set luminanceBuffer0(e){this.uniforms.luminanceBuffer0.value=e}setLuminanceBuffer0(e){this.uniforms.luminanceBuffer0.value=e}set luminanceBuffer1(e){this.uniforms.luminanceBuffer1.value=e}setLuminanceBuffer1(e){this.uniforms.luminanceBuffer1.value=e}set mipLevel1x1(e){this.defines.MIP_LEVEL_1X1=e.toFixed(1),this.needsUpdate=!0}setMipLevel1x1(e){this.mipLevel1x1=e}set deltaTime(e){this.uniforms.deltaTime.value=e}setDeltaTime(e){this.uniforms.deltaTime.value=e}get minLuminance(){return this.uniforms.minLuminance.value}set minLuminance(e){this.uniforms.minLuminance.value=e}getMinLuminance(){return this.uniforms.minLuminance.value}setMinLuminance(e){this.uniforms.minLuminance.value=e}get adaptationRate(){return this.uniforms.tau.value}set adaptationRate(e){this.uniforms.tau.value=e}getAdaptationRate(){return this.uniforms.tau.value}setAdaptationRate(e){this.uniforms.tau.value=e}},Rs=class extends O{constructor(e,{minLuminance:t=.01,adaptationRate:r=1}={}){super("AdaptiveLuminancePass"),this.fullscreenMaterial=new Us,this.needsSwap=!1,this.renderTargetPrevious=new y(1,1,{minFilter:_,magFilter:_,depthBuffer:!1}),this.renderTargetPrevious.texture.name="Luminance.Previous";const i=this.fullscreenMaterial;i.luminanceBuffer0=this.renderTargetPrevious.texture,i.luminanceBuffer1=e,i.minLuminance=t,i.adaptationRate=r,this.renderTargetAdapted=this.renderTargetPrevious.clone(),this.renderTargetAdapted.texture.name="Luminance.Adapted",this.copyPass=new lt(this.renderTargetPrevious,!1)}get texture(){return this.renderTargetAdapted.texture}getTexture(){return this.renderTargetAdapted.texture}set mipLevel1x1(e){this.fullscreenMaterial.mipLevel1x1=e}get adaptationRate(){return this.fullscreenMaterial.adaptationRate}set adaptationRate(e){this.fullscreenMaterial.adaptationRate=e}render(e,t,r,i,s){this.fullscreenMaterial.deltaTime=i,e.setRenderTarget(this.renderToScreen?null:this.renderTargetAdapted),e.render(this.scene,this.camera),this.copyPass.render(e,this.renderTargetAdapted)}},bs=`#include <tonemapping_pars_fragment>
|
|
693
|
+
uniform float whitePoint;
|
|
694
|
+
#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3
|
|
695
|
+
uniform float middleGrey;
|
|
696
|
+
#if TONE_MAPPING_MODE == 3
|
|
697
|
+
uniform lowp sampler2D luminanceBuffer;
|
|
698
|
+
#else
|
|
699
|
+
uniform float averageLuminance;
|
|
700
|
+
#endif
|
|
701
|
+
vec3 Reinhard2ToneMapping(vec3 color){color*=toneMappingExposure;float l=luminance(color);
|
|
702
|
+
#if TONE_MAPPING_MODE == 3
|
|
703
|
+
float lumAvg=unpackRGBAToFloat(texture2D(luminanceBuffer,vec2(0.5)));
|
|
704
|
+
#else
|
|
705
|
+
float lumAvg=averageLuminance;
|
|
706
|
+
#endif
|
|
707
|
+
float lumScaled=(l*middleGrey)/max(lumAvg,1e-6);float lumCompressed=lumScaled*(1.0+lumScaled/(whitePoint*whitePoint));lumCompressed/=(1.0+lumScaled);return clamp(lumCompressed*color,0.0,1.0);}
|
|
708
|
+
#elif TONE_MAPPING_MODE == 4
|
|
709
|
+
#define A 0.15
|
|
710
|
+
#define B 0.50
|
|
711
|
+
#define C 0.10
|
|
712
|
+
#define D 0.20
|
|
713
|
+
#define E 0.02
|
|
714
|
+
#define F 0.30
|
|
715
|
+
vec3 Uncharted2Helper(const in vec3 x){return((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}vec3 Uncharted2ToneMapping(vec3 color){color*=toneMappingExposure;return clamp(Uncharted2Helper(color)/Uncharted2Helper(vec3(whitePoint)),0.0,1.0);}
|
|
716
|
+
#endif
|
|
717
|
+
void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){
|
|
718
|
+
#if TONE_MAPPING_MODE == 2 || TONE_MAPPING_MODE == 3
|
|
719
|
+
outputColor=vec4(Reinhard2ToneMapping(inputColor.rgb),inputColor.a);
|
|
720
|
+
#elif TONE_MAPPING_MODE == 4
|
|
721
|
+
outputColor=vec4(Uncharted2ToneMapping(inputColor.rgb),inputColor.a);
|
|
722
|
+
#else
|
|
723
|
+
outputColor=vec4(toneMapping(inputColor.rgb),inputColor.a);
|
|
724
|
+
#endif
|
|
725
|
+
}`,Ka=class extends B{constructor({blendFunction:e=m.SRC,adaptive:t=!1,mode:r=t?V.REINHARD2_ADAPTIVE:V.AGX,resolution:i=256,maxLuminance:s=4,whitePoint:a=s,middleGrey:n=.6,minLuminance:o=.01,averageLuminance:l=1,adaptationRate:u=1}={}){super("ToneMappingEffect",bs,{blendFunction:e,uniforms:new Map([["luminanceBuffer",new c(null)],["maxLuminance",new c(s)],["whitePoint",new c(a)],["middleGrey",new c(n)],["averageLuminance",new c(l)]])}),this.renderTargetLuminance=new y(1,1,{minFilter:$t,depthBuffer:!1}),this.renderTargetLuminance.texture.generateMipmaps=!0,this.renderTargetLuminance.texture.name="Luminance",this.luminancePass=new Ht({renderTarget:this.renderTargetLuminance}),this.adaptiveLuminancePass=new Rs(this.luminancePass.texture,{minLuminance:o,adaptationRate:u}),this.uniforms.get("luminanceBuffer").value=this.adaptiveLuminancePass.texture,this.resolution=i,this.mode=r}get mode(){return Number(this.defines.get("TONE_MAPPING_MODE"))}set mode(e){if(this.mode===e)return;const r=Me.replace(/\D+/g,"")>=168?"CineonToneMapping(texel)":"OptimizedCineonToneMapping(texel)";switch(this.defines.clear(),this.defines.set("TONE_MAPPING_MODE",e.toFixed(0)),e){case V.LINEAR:this.defines.set("toneMapping(texel)","LinearToneMapping(texel)");break;case V.REINHARD:this.defines.set("toneMapping(texel)","ReinhardToneMapping(texel)");break;case V.CINEON:case V.OPTIMIZED_CINEON:this.defines.set("toneMapping(texel)",r);break;case V.ACES_FILMIC:this.defines.set("toneMapping(texel)","ACESFilmicToneMapping(texel)");break;case V.AGX:this.defines.set("toneMapping(texel)","AgXToneMapping(texel)");break;case V.NEUTRAL:this.defines.set("toneMapping(texel)","NeutralToneMapping(texel)");break;default:this.defines.set("toneMapping(texel)","texel");break}this.adaptiveLuminancePass.enabled=e===V.REINHARD2_ADAPTIVE,this.setChanged()}getMode(){return this.mode}setMode(e){this.mode=e}get whitePoint(){return this.uniforms.get("whitePoint").value}set whitePoint(e){this.uniforms.get("whitePoint").value=e}get middleGrey(){return this.uniforms.get("middleGrey").value}set middleGrey(e){this.uniforms.get("middleGrey").value=e}get averageLuminance(){return this.uniforms.get("averageLuminance").value}set averageLuminance(e){this.uniforms.get("averageLuminance").value=e}get adaptiveLuminanceMaterial(){return this.adaptiveLuminancePass.fullscreenMaterial}getAdaptiveLuminanceMaterial(){return this.adaptiveLuminanceMaterial}get resolution(){return this.luminancePass.resolution.width}set resolution(e){const t=Math.max(0,Math.ceil(Math.log2(e))),r=Math.pow(2,t);this.luminancePass.resolution.setPreferredSize(r,r),this.adaptiveLuminanceMaterial.mipLevel1x1=t}getResolution(){return this.resolution}setResolution(e){this.resolution=e}get adaptive(){return this.mode===V.REINHARD2_ADAPTIVE}set adaptive(e){this.mode=e?V.REINHARD2_ADAPTIVE:V.REINHARD2}get adaptationRate(){return this.adaptiveLuminanceMaterial.adaptationRate}set adaptationRate(e){this.adaptiveLuminanceMaterial.adaptationRate=e}get distinction(){return console.warn(this.name,"distinction was removed."),1}set distinction(e){console.warn(this.name,"distinction was removed.")}update(e,t,r){this.adaptiveLuminancePass.enabled&&(this.luminancePass.render(e,t),this.adaptiveLuminancePass.render(e,null,null,r))}initialize(e,t,r){this.adaptiveLuminancePass.initialize(e,t,r)}},Ls=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;
|
|
726
|
+
#if VIGNETTE_TECHNIQUE == 0
|
|
727
|
+
float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));
|
|
728
|
+
#else
|
|
729
|
+
vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));
|
|
730
|
+
#endif
|
|
731
|
+
outputColor=vec4(color,inputColor.a);}`,Za=class extends B{constructor({blendFunction:e,eskil:t=!1,technique:r=t?xe.ESKIL:xe.DEFAULT,offset:i=.5,darkness:s=.5}={}){super("VignetteEffect",Ls,{blendFunction:e,defines:new Map([["VIGNETTE_TECHNIQUE",r.toFixed(0)]]),uniforms:new Map([["offset",new c(i)],["darkness",new c(s)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(e){this.technique!==e&&(this.defines.set("VIGNETTE_TECHNIQUE",e.toFixed(0)),this.setChanged())}get eskil(){return this.technique===xe.ESKIL}set eskil(e){this.technique=e?xe.ESKIL:xe.DEFAULT}getTechnique(){return this.technique}setTechnique(e){this.technique=e}get offset(){return this.uniforms.get("offset").value}set offset(e){this.uniforms.get("offset").value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}get darkness(){return this.uniforms.get("darkness").value}set darkness(e){this.uniforms.get("darkness").value=e}getDarkness(){return this.darkness}setDarkness(e){this.darkness=e}},ja=class extends ot{load(e,t=()=>{},r=()=>{},i=null){const s=this.manager,a=new le,n=new Ut(a);n.setPath(this.path),n.setResponseType("text"),s.itemStart(e),n.load(e,o=>{try{const l=this.parse(o);s.itemEnd(e),t(l)}catch(l){a.onError(e),i(l)}},r)}loadAsync(e,t=()=>{}){const r=this.manager,i=new le;return new Promise((s,a)=>{i.onError=n=>{r.itemError(n),a(`Failed to load ${n}`)},this.load(e,s,t)})}parse(e){const t=/^[\d ]+$/m,r=/^([\d.e+-]+) +([\d.e+-]+) +([\d.e+-]+) *$/gm;let i=t.exec(e);if(i===null)throw new Error("Missing grid information");const s=i[0].trim().split(/\s+/g).map(v=>Number(v)),a=s[1]-s[0],n=s.length,o=n**2;for(let v=1,A=s.length;v<A;++v)if(a!==s[v]-s[v-1])throw new Error("Inconsistent grid size");const l=new Float32Array(n**3*4);let u=0,h=0;for(;(i=r.exec(e))!==null;){const v=Number(i[1]),A=Number(i[2]),p=Number(i[3]);u=Math.max(u,v,A,p);const x=h%n,C=Math.floor(h/n)%n,T=Math.floor(h/o)%n,D=(x*o+C*n+T)*4;l[D+0]=v,l[D+1]=A,l[D+2]=p,l[D+3]=1,++h}const f=Math.ceil(Math.log2(u)),d=Math.pow(2,f);for(let v=0,A=l.length;v<A;v+=4)l[v+0]/=d,l[v+1]/=d,l[v+2]/=d;return new ct(l,n)}},Ja=class extends ot{load(e,t=()=>{},r=()=>{},i=null){const s=this.manager,a=new le,n=new Ut(a);n.setPath(this.path),n.setResponseType("text"),n.load(e,o=>{try{const l=this.parse(o);s.itemEnd(e),t(l)}catch(l){a.onError(e),i(l)}},r)}loadAsync(e,t=()=>{}){const r=this.manager,i=new le;return new Promise((s,a)=>{i.onError=n=>{r.itemError(n),a(`Failed to load ${n}`)},this.load(e,s,t)})}parse(e){const t=/TITLE +"([^"]*)"/,r=/LUT_3D_SIZE +(\d+)/,i=/DOMAIN_MIN +([\d.]+) +([\d.]+) +([\d.]+)/,s=/DOMAIN_MAX +([\d.]+) +([\d.]+) +([\d.]+)/,a=/^([\d.e+-]+) +([\d.e+-]+) +([\d.e+-]+) *$/gm;let n=t.exec(e);const o=n!==null?n[1]:null;if(n=r.exec(e),n===null)throw new Error("Missing LUT_3D_SIZE information");const l=Number(n[1]),u=new Float32Array(l**3*4),h=new z(0,0,0),f=new z(1,1,1);if(n=i.exec(e),n!==null&&h.set(Number(n[1]),Number(n[2]),Number(n[3])),n=s.exec(e),n!==null&&f.set(Number(n[1]),Number(n[2]),Number(n[3])),h.x>f.x||h.y>f.y||h.z>f.z)throw h.set(0,0,0),f.set(1,1,1),new Error("Invalid input domain");let d=0;for(;(n=a.exec(e))!==null;)u[d++]=Number(n[1]),u[d++]=Number(n[2]),u[d++]=Number(n[3]),u[d++]=1;const v=new ct(u,l);return v.domainMin.copy(h),v.domainMax.copy(f),o!==null&&(v.name=o),v}},qa=class extends ot{load(e=()=>{},t=null){arguments.length===4?(e=arguments[1],t=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(e=arguments[1],t=null);const r=this.manager,i=new le;return new Promise((s,a)=>{const n=new Image,o=new Image;i.onError=l=>{r.itemError(l),t!==null?(t(`Failed to load ${l}`),s()):a(`Failed to load ${l}`)},i.onLoad=()=>{const l=[n,o];e(l),s(l)},n.addEventListener("error",l=>{i.itemError("smaa-search")}),o.addEventListener("error",l=>{i.itemError("smaa-area")}),n.addEventListener("load",()=>{r.itemEnd("smaa-search"),i.itemEnd("smaa-search")}),o.addEventListener("load",()=>{r.itemEnd("smaa-area"),i.itemEnd("smaa-area")}),r.itemStart("smaa-search"),r.itemStart("smaa-area"),i.itemStart("smaa-search"),i.itemStart("smaa-area"),n.src=st,o.src=at})}},Fs=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
732
|
+
uniform mediump sampler2D inputBuffer;
|
|
733
|
+
#else
|
|
734
|
+
uniform lowp sampler2D inputBuffer;
|
|
735
|
+
#endif
|
|
736
|
+
#ifdef BILATERAL
|
|
737
|
+
#include <packing>
|
|
738
|
+
uniform vec2 cameraNearFar;
|
|
739
|
+
#define cameraNear cameraNearFar.x
|
|
740
|
+
#define cameraFar cameraNearFar.y
|
|
741
|
+
#ifdef NORMAL_DEPTH
|
|
742
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
743
|
+
uniform highp sampler2D normalDepthBuffer;
|
|
744
|
+
#else
|
|
745
|
+
uniform mediump sampler2D normalDepthBuffer;
|
|
746
|
+
#endif
|
|
747
|
+
float readDepth(const in vec2 uv){float depth=texture2D(normalDepthBuffer,uv).a;
|
|
748
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
749
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
750
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
751
|
+
depth=1.0-depth;
|
|
752
|
+
#endif
|
|
753
|
+
return depth;}
|
|
754
|
+
#else
|
|
755
|
+
#if DEPTH_PACKING == 3201
|
|
756
|
+
uniform lowp sampler2D depthBuffer;
|
|
757
|
+
#elif defined(GL_FRAGMENT_PRECISION_HIGH)
|
|
758
|
+
uniform highp sampler2D depthBuffer;
|
|
759
|
+
#else
|
|
760
|
+
uniform mediump sampler2D depthBuffer;
|
|
761
|
+
#endif
|
|
762
|
+
float readDepth(const in vec2 uv){
|
|
763
|
+
#if DEPTH_PACKING == 3201
|
|
764
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
765
|
+
#else
|
|
766
|
+
float depth=texture2D(depthBuffer,uv).r;
|
|
767
|
+
#endif
|
|
768
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
769
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
770
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
771
|
+
depth=1.0-depth;
|
|
772
|
+
#endif
|
|
773
|
+
return depth;}
|
|
774
|
+
#endif
|
|
775
|
+
float getViewZ(const in float depth){
|
|
776
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
777
|
+
return perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);
|
|
778
|
+
#else
|
|
779
|
+
return orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);
|
|
780
|
+
#endif
|
|
781
|
+
}
|
|
782
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
783
|
+
#define linearDepth(v) viewZToOrthographicDepth(getViewZ(readDepth(v)), cameraNearFar.x, cameraNearFar.y)
|
|
784
|
+
#else
|
|
785
|
+
#define linearDepth(v) readDepth(v)
|
|
786
|
+
#endif
|
|
787
|
+
#endif
|
|
788
|
+
#define getTexel(v) texture2D(inputBuffer, v)
|
|
789
|
+
#if KERNEL_SIZE == 3
|
|
790
|
+
varying vec2 vUv00,vUv01,vUv02;varying vec2 vUv03,vUv04,vUv05;varying vec2 vUv06,vUv07,vUv08;
|
|
791
|
+
#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13
|
|
792
|
+
varying vec2 vUv00,vUv01,vUv02,vUv03,vUv04;varying vec2 vUv05,vUv06,vUv07,vUv08,vUv09;varying vec2 vUv10,vUv11,vUv12,vUv13,vUv14;varying vec2 vUv15,vUv16,vUv17,vUv18,vUv19;varying vec2 vUv20,vUv21,vUv22,vUv23,vUv24;
|
|
793
|
+
#else
|
|
794
|
+
uniform vec2 texelSize;uniform float scale;varying vec2 vUv;
|
|
795
|
+
#endif
|
|
796
|
+
void main(){
|
|
797
|
+
#if KERNEL_SIZE == 3
|
|
798
|
+
vec4 c[]=vec4[KERNEL_SIZE_SQ](getTexel(vUv00),getTexel(vUv01),getTexel(vUv02),getTexel(vUv03),getTexel(vUv04),getTexel(vUv05),getTexel(vUv06),getTexel(vUv07),getTexel(vUv08));
|
|
799
|
+
#ifdef BILATERAL
|
|
800
|
+
float z[]=float[KERNEL_SIZE_SQ](linearDepth(vUv00),linearDepth(vUv01),linearDepth(vUv02),linearDepth(vUv03),linearDepth(vUv04),linearDepth(vUv05),linearDepth(vUv06),linearDepth(vUv07),linearDepth(vUv08));
|
|
801
|
+
#endif
|
|
802
|
+
#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13
|
|
803
|
+
vec4 c[]=vec4[KERNEL_SIZE_SQ](getTexel(vUv00),getTexel(vUv01),getTexel(vUv02),getTexel(vUv03),getTexel(vUv04),getTexel(vUv05),getTexel(vUv06),getTexel(vUv07),getTexel(vUv08),getTexel(vUv09),getTexel(vUv10),getTexel(vUv11),getTexel(vUv12),getTexel(vUv13),getTexel(vUv14),getTexel(vUv15),getTexel(vUv16),getTexel(vUv17),getTexel(vUv18),getTexel(vUv19),getTexel(vUv20),getTexel(vUv21),getTexel(vUv22),getTexel(vUv23),getTexel(vUv24));
|
|
804
|
+
#ifdef BILATERAL
|
|
805
|
+
float z[]=float[KERNEL_SIZE_SQ](linearDepth(vUv00),linearDepth(vUv01),linearDepth(vUv02),linearDepth(vUv03),linearDepth(vUv04),linearDepth(vUv05),linearDepth(vUv06),linearDepth(vUv07),linearDepth(vUv08),linearDepth(vUv09),linearDepth(vUv10),linearDepth(vUv11),linearDepth(vUv12),linearDepth(vUv13),linearDepth(vUv14),linearDepth(vUv15),linearDepth(vUv16),linearDepth(vUv17),linearDepth(vUv18),linearDepth(vUv19),linearDepth(vUv20),linearDepth(vUv21),linearDepth(vUv22),linearDepth(vUv23),linearDepth(vUv24));
|
|
806
|
+
#endif
|
|
807
|
+
#endif
|
|
808
|
+
vec4 result=vec4(0.0);
|
|
809
|
+
#ifdef BILATERAL
|
|
810
|
+
float w=0.0;
|
|
811
|
+
#if KERNEL_SIZE == 3 || (KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13)
|
|
812
|
+
float centerDepth=z[KERNEL_SIZE_SQ_HALF];for(int i=0;i<KERNEL_SIZE_SQ;++i){float d=step(abs(z[i]-centerDepth),DISTANCE_THRESHOLD);result+=c[i]*d;w+=d;}
|
|
813
|
+
#else
|
|
814
|
+
float centerDepth=linearDepth(vUv);vec2 s=texelSize*scale;for(int x=-KERNEL_SIZE_HALF;x<=KERNEL_SIZE_HALF;++x){for(int y=-KERNEL_SIZE_HALF;y<=KERNEL_SIZE_HALF;++y){vec2 coords=vUv+vec2(x,y)*s;vec4 c=getTexel(coords);float z=(x==0&&y==0)?centerDepth:linearDepth(coords);float d=step(abs(z-centerDepth),DISTANCE_THRESHOLD);result+=c*d;w+=d;}}
|
|
815
|
+
#endif
|
|
816
|
+
gl_FragColor=result/max(w,1.0);
|
|
817
|
+
#else
|
|
818
|
+
#if KERNEL_SIZE == 3 || (KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13)
|
|
819
|
+
for(int i=0;i<KERNEL_SIZE_SQ;++i){result+=c[i];}
|
|
820
|
+
#else
|
|
821
|
+
vec2 s=texelSize*scale;for(int x=-KERNEL_SIZE_HALF;x<=KERNEL_SIZE_HALF;++x){for(int y=-KERNEL_SIZE_HALF;y<=KERNEL_SIZE_HALF;++y){result+=getTexel(uv+vec2(x,y)*s);}}
|
|
822
|
+
#endif
|
|
823
|
+
gl_FragColor=result*INV_KERNEL_SIZE_SQ;
|
|
824
|
+
#endif
|
|
825
|
+
}`,Os=`uniform vec2 texelSize;uniform float scale;
|
|
826
|
+
#if KERNEL_SIZE == 3
|
|
827
|
+
varying vec2 vUv00,vUv01,vUv02;varying vec2 vUv03,vUv04,vUv05;varying vec2 vUv06,vUv07,vUv08;
|
|
828
|
+
#elif KERNEL_SIZE == 5 && MAX_VARYING_VECTORS >= 13
|
|
829
|
+
varying vec2 vUv00,vUv01,vUv02,vUv03,vUv04;varying vec2 vUv05,vUv06,vUv07,vUv08,vUv09;varying vec2 vUv10,vUv11,vUv12,vUv13,vUv14;varying vec2 vUv15,vUv16,vUv17,vUv18,vUv19;varying vec2 vUv20,vUv21,vUv22,vUv23,vUv24;
|
|
830
|
+
#else
|
|
831
|
+
varying vec2 vUv;
|
|
832
|
+
#endif
|
|
833
|
+
void main(){vec2 uv=position.xy*0.5+0.5;
|
|
834
|
+
#if KERNEL_SIZE == 3
|
|
835
|
+
vec2 s=texelSize*scale;vUv00=uv+s*vec2(-1.0,-1.0);vUv01=uv+s*vec2(0.0,-1.0);vUv02=uv+s*vec2(1.0,-1.0);vUv03=uv+s*vec2(-1.0,0.0);vUv04=uv;vUv05=uv+s*vec2(1.0,0.0);vUv06=uv+s*vec2(-1.0,1.0);vUv07=uv+s*vec2(0.0,1.0);vUv08=uv+s*vec2(1.0,1.0);
|
|
836
|
+
#elif KERNEL_SIZE == 5
|
|
837
|
+
vec2 s=texelSize*scale;vUv00=uv+s*vec2(-2.0,-2.0);vUv01=uv+s*vec2(-1.0,-2.0);vUv02=uv+s*vec2(0.0,-2.0);vUv03=uv+s*vec2(1.0,-2.0);vUv04=uv+s*vec2(2.0,-2.0);vUv05=uv+s*vec2(-2.0,-1.0);vUv06=uv+s*vec2(-1.0,-1.0);vUv07=uv+s*vec2(0.0,-1.0);vUv08=uv+s*vec2(1.0,-1.0);vUv09=uv+s*vec2(2.0,-1.0);vUv10=uv+s*vec2(-2.0,0.0);vUv11=uv+s*vec2(-1.0,0.0);vUv12=uv;vUv13=uv+s*vec2(1.0,0.0);vUv14=uv+s*vec2(2.0,0.0);vUv15=uv+s*vec2(-2.0,1.0);vUv16=uv+s*vec2(-1.0,1.0);vUv17=uv+s*vec2(0.0,1.0);vUv18=uv+s*vec2(1.0,1.0);vUv19=uv+s*vec2(2.0,1.0);vUv20=uv+s*vec2(-2.0,2.0);vUv21=uv+s*vec2(-1.0,2.0);vUv22=uv+s*vec2(0.0,2.0);vUv23=uv+s*vec2(1.0,2.0);vUv24=uv+s*vec2(2.0,2.0);
|
|
838
|
+
#else
|
|
839
|
+
vUv=uv;
|
|
840
|
+
#endif
|
|
841
|
+
gl_Position=vec4(position.xy,1.0,1.0);}`,Ns=class extends U{constructor({bilateral:e=!1,kernelSize:t=5}={}){super({name:"BoxBlurMaterial",defines:{DEPTH_PACKING:"0",DISTANCE_THRESHOLD:"0.1"},uniforms:{inputBuffer:new c(null),depthBuffer:new c(null),normalDepthBuffer:new c(null),texelSize:new c(new g),cameraNearFar:new c(new g),scale:new c(1)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Fs,vertexShader:Os}),this.bilateral=e,this.kernelSize=t,this.maxVaryingVectors=8}set maxVaryingVectors(e){this.defines.MAX_VARYING_VECTORS=e.toFixed(0)}get kernelSize(){return Number(this.defines.KERNEL_SIZE)}set kernelSize(e){if(e%2===0)throw new Error("The kernel size must be an odd number");this.defines.KERNEL_SIZE=e.toFixed(0),this.defines.KERNEL_SIZE_HALF=Math.floor(e/2).toFixed(0),this.defines.KERNEL_SIZE_SQ=(e**2).toFixed(0),this.defines.KERNEL_SIZE_SQ_HALF=Math.floor(e**2/2).toFixed(0),this.defines.INV_KERNEL_SIZE_SQ=(1/e**2).toFixed(6),this.needsUpdate=!0}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}get near(){return this.uniforms.cameraNearFar.value.x}get far(){return this.uniforms.cameraNearFar.value.y}set inputBuffer(e){this.uniforms.inputBuffer.value=e}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set normalDepthBuffer(e){this.uniforms.normalDepthBuffer.value=e,e!==null?this.defines.NORMAL_DEPTH="1":delete this.defines.NORMAL_DEPTH,this.needsUpdate=!0}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get bilateral(){return this.defines.BILATERAL!==void 0}set bilateral(e){e!==null?this.defines.BILATERAL="1":delete this.defines.BILATERAL,this.needsUpdate=!0}get worldDistanceThreshold(){return-Te(Number(this.defines.DISTANCE_THRESHOLD),this.near,this.far)}set worldDistanceThreshold(e){const t=Ce(-e,this.near,this.far);this.defines.DISTANCE_THRESHOLD=t.toFixed(12),this.needsUpdate=!0}copyCameraSettings(e){e&&(this.uniforms.cameraNearFar.value.set(e.near,e.far),e instanceof pe?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},Hs=`#include <packing>
|
|
842
|
+
varying vec2 vUv;
|
|
843
|
+
#ifdef NORMAL_DEPTH
|
|
844
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
845
|
+
uniform highp sampler2D normalDepthBuffer;
|
|
846
|
+
#else
|
|
847
|
+
uniform mediump sampler2D normalDepthBuffer;
|
|
848
|
+
#endif
|
|
849
|
+
float readDepth(const in vec2 uv){return texture2D(normalDepthBuffer,uv).a;}
|
|
850
|
+
#else
|
|
851
|
+
#if INPUT_DEPTH_PACKING == 3201
|
|
852
|
+
uniform lowp sampler2D depthBuffer;
|
|
853
|
+
#elif defined(GL_FRAGMENT_PRECISION_HIGH)
|
|
854
|
+
uniform highp sampler2D depthBuffer;
|
|
855
|
+
#else
|
|
856
|
+
uniform mediump sampler2D depthBuffer;
|
|
857
|
+
#endif
|
|
858
|
+
float readDepth(const in vec2 uv){
|
|
859
|
+
#if INPUT_DEPTH_PACKING == 3201
|
|
860
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
861
|
+
#else
|
|
862
|
+
return texture2D(depthBuffer,uv).r;
|
|
863
|
+
#endif
|
|
864
|
+
}
|
|
865
|
+
#endif
|
|
866
|
+
void main(){
|
|
867
|
+
#if INPUT_DEPTH_PACKING == OUTPUT_DEPTH_PACKING
|
|
868
|
+
gl_FragColor=texture2D(depthBuffer,vUv);
|
|
869
|
+
#else
|
|
870
|
+
float depth=readDepth(vUv);
|
|
871
|
+
#if OUTPUT_DEPTH_PACKING == 3201
|
|
872
|
+
gl_FragColor=(depth==1.0)?vec4(1.0):packDepthToRGBA(depth);
|
|
873
|
+
#else
|
|
874
|
+
gl_FragColor=vec4(vec3(depth),1.0);
|
|
875
|
+
#endif
|
|
876
|
+
#endif
|
|
877
|
+
}`,Gs=`varying vec2 vUv;
|
|
878
|
+
#if DEPTH_COPY_MODE == 1
|
|
879
|
+
uniform vec2 texelPosition;
|
|
880
|
+
#endif
|
|
881
|
+
void main(){
|
|
882
|
+
#if DEPTH_COPY_MODE == 1
|
|
883
|
+
vUv=texelPosition;
|
|
884
|
+
#else
|
|
885
|
+
vUv=position.xy*0.5+0.5;
|
|
886
|
+
#endif
|
|
887
|
+
gl_Position=vec4(position.xy,1.0,1.0);}`,ks=class extends U{constructor(){super({name:"DepthCopyMaterial",defines:{INPUT_DEPTH_PACKING:"0",OUTPUT_DEPTH_PACKING:"0",DEPTH_COPY_MODE:"0"},uniforms:{depthBuffer:new c(null),texelPosition:new c(new g)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Hs,vertexShader:Gs}),this.depthCopyMode=we.FULL}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set inputDepthPacking(e){this.defines.INPUT_DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get outputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}set outputDepthPacking(e){this.defines.OUTPUT_DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=F){this.depthBuffer=e,this.inputDepthPacking=t}getInputDepthPacking(){return Number(this.defines.INPUT_DEPTH_PACKING)}setInputDepthPacking(e){this.defines.INPUT_DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}getOutputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}setOutputDepthPacking(e){this.defines.OUTPUT_DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get texelPosition(){return this.uniforms.texelPosition.value}getTexelPosition(){return this.uniforms.texelPosition.value}setTexelPosition(e){this.uniforms.texelPosition.value=e}get mode(){return this.depthCopyMode}set mode(e){this.depthCopyMode=e,this.defines.DEPTH_COPY_MODE=e.toFixed(0),this.needsUpdate=!0}getMode(){return this.mode}setMode(e){this.mode=e}},zs=`#include <common>
|
|
888
|
+
#include <packing>
|
|
889
|
+
#include <dithering_pars_fragment>
|
|
890
|
+
#define packFloatToRGBA(v) packDepthToRGBA(v)
|
|
891
|
+
#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
|
|
892
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
893
|
+
uniform mediump sampler2D inputBuffer;
|
|
894
|
+
#else
|
|
895
|
+
uniform lowp sampler2D inputBuffer;
|
|
896
|
+
#endif
|
|
897
|
+
#if DEPTH_PACKING == 3201
|
|
898
|
+
uniform lowp sampler2D depthBuffer;
|
|
899
|
+
#elif defined(GL_FRAGMENT_PRECISION_HIGH)
|
|
900
|
+
uniform highp sampler2D depthBuffer;
|
|
901
|
+
#else
|
|
902
|
+
uniform mediump sampler2D depthBuffer;
|
|
903
|
+
#endif
|
|
904
|
+
uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){
|
|
905
|
+
#if DEPTH_PACKING == 3201
|
|
906
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
907
|
+
#else
|
|
908
|
+
float depth=texture2D(depthBuffer,uv).r;
|
|
909
|
+
#endif
|
|
910
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
911
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
912
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
913
|
+
depth=1.0-depth;
|
|
914
|
+
#endif
|
|
915
|
+
return depth;}float getViewZ(const in float depth){
|
|
916
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
917
|
+
return perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
|
|
918
|
+
#else
|
|
919
|
+
return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
920
|
+
#endif
|
|
921
|
+
}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0;
|
|
922
|
+
#ifdef ENCODE_OUTPUT
|
|
923
|
+
#include <colorspace_fragment>
|
|
924
|
+
#endif
|
|
925
|
+
#include <dithering_fragment>
|
|
926
|
+
}`,_s="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",Qs=class extends U{constructor(e,t,r,i,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Me.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new c(null),depthBuffer:new c(null),resolution:new c(new g),texelSize:new c(new g),cameraNear:new c(.3),cameraFar:new c(1e3),aspect:new c(1),time:new c(0)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:s}),e&&this.setShaderParts(e),t&&this.setDefines(t),r&&this.setUniforms(r),this.copyCameraSettings(i)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=F){this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){return this.fragmentShader=zs.replace(S.FRAGMENT_HEAD,e.get(S.FRAGMENT_HEAD)||"").replace(S.FRAGMENT_MAIN_UV,e.get(S.FRAGMENT_MAIN_UV)||"").replace(S.FRAGMENT_MAIN_IMAGE,e.get(S.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=_s.replace(S.VERTEX_HEAD,e.get(S.VERTEX_HEAD)||"").replace(S.VERTEX_MAIN_SUPPORT,e.get(S.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(e){for(const t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(const t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(const t of e)this.extensions[t]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof pe?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){const r=this.uniforms;r.resolution.value.set(e,t),r.texelSize.value.set(1/e,1/t),r.aspect.value=e/t}static get Section(){return S}},Vs=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
927
|
+
uniform mediump sampler2D inputBuffer;
|
|
928
|
+
#else
|
|
929
|
+
uniform lowp sampler2D inputBuffer;
|
|
930
|
+
#endif
|
|
931
|
+
uniform vec2 kernel[STEPS];varying vec2 vOffset;varying vec2 vUv;void main(){vec4 result=texture2D(inputBuffer,vUv)*kernel[0].y;for(int i=1;i<STEPS;++i){vec2 offset=kernel[i].x*vOffset;vec4 c0=texture2D(inputBuffer,vUv+offset);vec4 c1=texture2D(inputBuffer,vUv-offset);result+=(c0+c1)*kernel[i].y;}gl_FragColor=result;
|
|
932
|
+
#include <colorspace_fragment>
|
|
933
|
+
}`,Ys="uniform vec2 texelSize;uniform vec2 direction;uniform float scale;varying vec2 vOffset;varying vec2 vUv;void main(){vOffset=direction*texelSize*scale;vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",Ws=class extends U{constructor({kernelSize:e=35}={}){super({name:"GaussianBlurMaterial",uniforms:{inputBuffer:new c(null),texelSize:new c(new g),direction:new c(new g),kernel:new c(null),scale:new c(1)},blending:R,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Vs,vertexShader:Ys}),this._kernelSize=0,this.kernelSize=e}set inputBuffer(e){this.uniforms.inputBuffer.value=e}get kernelSize(){return this._kernelSize}set kernelSize(e){this._kernelSize=e,this.generateKernel(e)}get direction(){return this.uniforms.direction.value}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}generateKernel(e){const t=new dr(e),r=t.linearSteps,i=new Float64Array(r*2);for(let s=0,a=0;s<r;++s)i[a++]=t.linearOffsets[s],i[a++]=t.linearWeights[s];this.uniforms.kernel.value=i,this.defines.STEPS=r.toFixed(0),this.needsUpdate=!0}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},$a=class extends O{constructor({kernelSize:e=5,iterations:t=1,bilateral:r=!1,resolutionScale:i=1,resolutionX:s=E.AUTO_SIZE,resolutionY:a=E.AUTO_SIZE}={}){super("BoxBlurPass"),this.needsDepthTexture=r,this.renderTargetA=new y(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=new y(1,1,{depthBuffer:!1}),this.renderTargetB.texture.name="Blur.Target.B",this.blurMaterial=new Ns({bilateral:r,kernelSize:e}),this.copyMaterial=new _e;const n=this.resolution=new E(this,s,a,i);n.addEventListener("change",o=>this.setSize(n.baseWidth,n.baseHeight)),this.iterations=t}set mainCamera(e){this.blurMaterial.copyCameraSettings(e)}setDepthTexture(e,t=F){this.blurMaterial.depthBuffer=e,this.blurMaterial.depthPacking=t}render(e,t,r,i,s){const a=this.scene,n=this.camera,o=this.renderTargetA,l=this.renderTargetB,u=this.blurMaterial;this.fullscreenMaterial=u;let h=t;for(let f=0,d=Math.max(this.iterations,1);f<d;++f){const v=(f&1)===0?o:l;u.inputBuffer=h.texture,e.setRenderTarget(v),e.render(a,n),h=v}this.copyMaterial.inputBuffer=h.texture,this.fullscreenMaterial=this.copyMaterial,e.setRenderTarget(this.renderToScreen?null:r),e.render(a,n)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.blurMaterial.setSize(e,t)}initialize(e,t,r){e!==null&&(this.blurMaterial.maxVaryingVectors=e.capabilities.maxVaryings),r!==void 0&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==H?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":e!==null&&e.outputColorSpace===w&&(this.renderTargetA.texture.colorSpace=w,this.renderTargetB.texture.colorSpace=w))}},Xs=class extends O{constructor({depthPacking:e=q}={}){super("DepthCopyPass");const t=new ks;t.outputDepthPacking=e,this.fullscreenMaterial=t,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new y(1,1,{type:e===q?H:Y,minFilter:_,magFilter:_,depthBuffer:!1}),this.renderTarget.texture.name="DepthCopyPass.Target"}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get depthPacking(){return this.fullscreenMaterial.outputDepthPacking}getDepthPacking(){return this.fullscreenMaterial.outputDepthPacking}setDepthTexture(e,t=F){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.inputDepthPacking=t}render(e,t,r,i,s){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.renderTarget.setSize(e,t)}},Ks=Number(Me.replace(/\D+/g,"")),se=255/256,Zs=new Float32Array([se/256**3,se/256**2,se/256,se]),js=new Float32Array([se,se/256,se/256**2,1/256**3]);function Js(e){const t=Ks>=167?js:Zs;return(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3])/255}var en=class extends Xs{constructor({depthPacking:e=q,mode:t=we.SINGLE}={}){if(e!==q&&e!==F)throw new Error(`Unsupported depth packing: ${e}`);super({depthPacking:e}),this.name="DepthPickingPass",this.fullscreenMaterial.mode=t,this.pixelBuffer=e===q?new Uint8Array(4):new Float32Array(4),this.callback=null}readDepth(e){return this.fullscreenMaterial.texelPosition.set(e.x*.5+.5,e.y*.5+.5),new Promise(t=>{this.callback=t})}render(e,t,r,i,s){const a=this.fullscreenMaterial,n=a.mode;if(n===we.FULL&&super.render(e),this.callback!==null){const o=this.renderTarget,l=this.pixelBuffer,u=o.texture.type!==Y;let h=0,f=0;if(n===we.SINGLE)super.render(e);else{const d=a.texelPosition;h=Math.round(d.x*o.width),f=Math.round(d.y*o.height)}e.readRenderTargetPixels(o,h,f,1,1,l),this.callback(u?Js(l):l[0]),this.callback=null}}setSize(e,t){this.fullscreenMaterial.mode===we.FULL&&super.setSize(e,t)}};function Et(e,t,r){for(const i of t){const s="$1"+e+i.charAt(0).toUpperCase()+i.slice(1),a=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const n of r.entries())n[1]!==null&&r.set(n[0],n[1].replace(a,s))}}function qs(e,t,r){let i=t.getFragmentShader(),s=t.getVertexShader();const a=i!==void 0&&/mainImage/.test(i),n=i!==void 0&&/mainUv/.test(i);if(r.attributes|=t.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${t.name})`);if(n&&(r.attributes&N.CONVOLUTION)!==0)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!a&&!n)throw new Error(`Could not find mainImage or mainUv function (${t.name})`);{const o=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,l=r.shaderParts;let u=l.get(S.FRAGMENT_HEAD)||"",h=l.get(S.FRAGMENT_MAIN_UV)||"",f=l.get(S.FRAGMENT_MAIN_IMAGE)||"",d=l.get(S.VERTEX_HEAD)||"",v=l.get(S.VERTEX_MAIN_SUPPORT)||"";const A=new Set,p=new Set;if(n&&(h+=` ${e}MainUv(UV);
|
|
934
|
+
`,r.uvTransformation=!0),s!==null&&/mainSupport/.test(s)){const T=/mainSupport *\([\w\s]*?uv\s*?\)/.test(s);v+=` ${e}MainSupport(`,v+=T?`vUv);
|
|
935
|
+
`:`);
|
|
936
|
+
`;for(const D of s.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const G of D[1].split(/\s*,\s*/))r.varyings.add(G),A.add(G),p.add(G);for(const D of s.matchAll(o))p.add(D[1])}for(const T of i.matchAll(o))p.add(T[1]);for(const T of t.defines.keys())p.add(T.replace(/\([\w\s,]*\)/g,""));for(const T of t.uniforms.keys())p.add(T);p.delete("while"),p.delete("for"),p.delete("if"),t.uniforms.forEach((T,D)=>r.uniforms.set(e+D.charAt(0).toUpperCase()+D.slice(1),T)),t.defines.forEach((T,D)=>r.defines.set(e+D.charAt(0).toUpperCase()+D.slice(1),T));const x=new Map([["fragment",i],["vertex",s]]);Et(e,p,r.defines),Et(e,p,x),i=x.get("fragment"),s=x.get("vertex");const C=t.blendMode;if(r.blendModes.set(C.blendFunction,C),a){t.inputColorSpace!==null&&t.inputColorSpace!==r.colorSpace&&(f+=t.inputColorSpace===w?`color0 = sRGBTransferOETF(color0);
|
|
937
|
+
`:`color0 = sRGBToLinear(color0);
|
|
938
|
+
`),t.outputColorSpace!==It?r.colorSpace=t.outputColorSpace:t.inputColorSpace!==null&&(r.colorSpace=t.inputColorSpace);const T=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;f+=`${e}MainImage(color0, UV, `,(r.attributes&N.DEPTH)!==0&&T.test(i)&&(f+="depth, ",r.readDepth=!0),f+=`color1);
|
|
939
|
+
`;const D=e+"BlendOpacity";r.uniforms.set(D,C.opacity),f+=`color0 = blend${C.blendFunction}(color0, color1, ${D});
|
|
940
|
+
|
|
941
|
+
`,u+=`uniform float ${D};
|
|
942
|
+
|
|
943
|
+
`}if(u+=i+`
|
|
944
|
+
`,s!==null&&(d+=s+`
|
|
945
|
+
`),l.set(S.FRAGMENT_HEAD,u),l.set(S.FRAGMENT_MAIN_UV,h),l.set(S.FRAGMENT_MAIN_IMAGE,f),l.set(S.VERTEX_HEAD,d),l.set(S.VERTEX_MAIN_SUPPORT,v),t.extensions!==null)for(const T of t.extensions)r.extensions.add(T)}}var tn=class extends O{constructor(e,...t){super("EffectPass"),this.fullscreenMaterial=new Qs(null,null,null,e),this.listener=r=>this.handleEvent(r),this.effects=[],this.setEffects(t),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(e){for(const t of this.effects)t.mainScene=e}set mainCamera(e){this.fullscreenMaterial.copyCameraSettings(e);for(const t of this.effects)t.mainCamera=e}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(e){this.fullscreenMaterial.encodeOutput=e}get dithering(){return this.fullscreenMaterial.dithering}set dithering(e){const t=this.fullscreenMaterial;t.dithering=e,t.needsUpdate=!0}setEffects(e){for(const t of this.effects)t.removeEventListener("change",this.listener);this.effects=e.sort((t,r)=>r.attributes-t.attributes);for(const t of this.effects)t.addEventListener("change",this.listener)}updateMaterial(){const e=new hr;let t=0;for(const n of this.effects)if(n.blendMode.blendFunction===m.DST)e.attributes|=n.getAttributes()&N.DEPTH;else{if((e.attributes&n.getAttributes()&N.CONVOLUTION)!==0)throw new Error(`Convolution effects cannot be merged (${n.name})`);qs("e"+t++,n,e)}let r=e.shaderParts.get(S.FRAGMENT_HEAD),i=e.shaderParts.get(S.FRAGMENT_MAIN_IMAGE),s=e.shaderParts.get(S.FRAGMENT_MAIN_UV);const a=/\bblend\b/g;for(const n of e.blendModes.values())r+=n.getShaderCode().replace(a,`blend${n.blendFunction}`)+`
|
|
946
|
+
`;(e.attributes&N.DEPTH)!==0?(e.readDepth&&(i=`float depth = readDepth(UV);
|
|
947
|
+
|
|
948
|
+
`+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,e.colorSpace===w&&(i+=`color0 = sRGBToLinear(color0);
|
|
949
|
+
`),e.uvTransformation?(s=`vec2 transformedUv = vUv;
|
|
950
|
+
`+s,e.defines.set("UV","transformedUv")):e.defines.set("UV","vUv"),e.shaderParts.set(S.FRAGMENT_HEAD,r),e.shaderParts.set(S.FRAGMENT_MAIN_IMAGE,i),e.shaderParts.set(S.FRAGMENT_MAIN_UV,s);for(const[n,o]of e.shaderParts)o!==null&&e.shaderParts.set(n,o.trim().replace(/^#/,`
|
|
951
|
+
#`));this.skipRendering=t===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e,t=F){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(const r of this.effects)r.setDepthTexture(e,t)}render(e,t,r,i,s){for(const a of this.effects)a.update(e,t,i);if(!this.skipRendering||this.renderToScreen){const a=this.fullscreenMaterial;a.inputBuffer=t.texture,a.time+=i*this.timeScale,e.setRenderTarget(this.renderToScreen?null:r),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(const r of this.effects)r.setSize(e,t)}initialize(e,t,r){this.renderer=e;for(const i of this.effects)i.initialize(e,t,r);this.updateMaterial(),r!==void 0&&r!==H&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const e of this.effects)e.removeEventListener("change",this.listener),e.dispose()}handleEvent(e){switch(e.type){case"change":this.recompile();break}}},rn=class extends O{constructor({kernelSize:e=35,iterations:t=1,resolutionScale:r=1,resolutionX:i=E.AUTO_SIZE,resolutionY:s=E.AUTO_SIZE}={}){super("GaussianBlurPass"),this.renderTargetA=new y(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.blurMaterial=new Ws({kernelSize:e}),this.copyMaterial=new _e,this.copyMaterial.inputBuffer=this.renderTargetB.texture;const a=this.resolution=new E(this,i,s,r);a.addEventListener("change",n=>this.setSize(a.baseWidth,a.baseHeight)),this.iterations=t}render(e,t,r,i,s){const a=this.scene,n=this.camera,o=this.renderTargetA,l=this.renderTargetB,u=this.blurMaterial;this.fullscreenMaterial=u;let h=t;for(let f=0,d=Math.max(this.iterations,1);f<d;++f)u.direction.set(1,0),u.inputBuffer=h.texture,e.setRenderTarget(o),e.render(a,n),u.direction.set(0,1),u.inputBuffer=o.texture,e.setRenderTarget(l),e.render(a,n),f===0&&d>1&&(h=l);this.fullscreenMaterial=this.copyMaterial,e.setRenderTarget(this.renderToScreen?null:r),e.render(a,n)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,s=r.height;this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.blurMaterial.setSize(e,t)}initialize(e,t,r){r!==void 0&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==H?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e!==null&&e.outputColorSpace===w&&(this.renderTargetA.texture.colorSpace=w,this.renderTargetB.texture.colorSpace=w))}},sn=class extends O{constructor(e){super("LambdaPass",null,null),this.needsSwap=!1,this.f=e}render(e,t,r,i,s){this.f()}},an=class extends O{constructor(e,t,{renderTarget:r,resolutionScale:i=1,width:s=E.AUTO_SIZE,height:a=E.AUTO_SIZE,resolutionX:n=s,resolutionY:o=a}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new Qe(e,t,new Zt);const l=this.renderPass;l.ignoreBackground=!0,l.skipShadowMapUpdate=!0;const u=l.getClearPass();u.overrideClearColor=new X(7829503),u.overrideClearAlpha=1,this.renderTarget=r,this.renderTarget===void 0&&(this.renderTarget=new y(1,1,{minFilter:_,magFilter:_}),this.renderTarget.texture.name="NormalPass.Target");const h=this.resolution=new E(this,n,o,i);h.addEventListener("change",f=>this.setSize(h.baseWidth,h.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,r,i,s){const a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a,a)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t),this.renderTarget.setSize(r.width,r.height)}},Dt=[new Float32Array(3),new Float32Array(3)],I=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],fe=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function Fe(e,t,r,i){const s=r[0]-t[0],a=r[1]-t[1],n=r[2]-t[2],o=e[0]-t[0],l=e[1]-t[1],u=e[2]-t[2],h=a*u-n*l,f=n*o-s*u,d=s*l-a*o,v=Math.sqrt(h*h+f*f+d*d),A=v*.5,p=h/v,x=f/v,C=d/v,T=-(e[0]*p+e[1]*x+e[2]*C),D=i[0]*p+i[1]*x+i[2]*C;return Math.abs(D+T)*A/3}function De(e,t,r,i,s,a){const n=(r+i*t+s*t*t)*4;a[0]=e[n+0],a[1]=e[n+1],a[2]=e[n+2]}function $s(e,t,r,i,s,a){const n=r*(t-1),o=i*(t-1),l=s*(t-1),u=Math.floor(n),h=Math.floor(o),f=Math.floor(l),d=Math.ceil(n),v=Math.ceil(o),A=Math.ceil(l),p=n-u,x=o-h,C=l-f;if(u===n&&h===o&&f===l)De(e,t,n,o,l,a);else{let T;p>=x&&x>=C?T=fe[0]:p>=C&&C>=x?T=fe[1]:C>=p&&p>=x?T=fe[2]:x>=p&&p>=C?T=fe[3]:x>=C&&C>=p?T=fe[4]:C>=x&&x>=p&&(T=fe[5]);const[D,G,Z,j]=T,J=Dt[0];J[0]=p,J[1]=x,J[2]=C;const P=Dt[1],ce=d-u,ue=v-h,ee=A-f;P[0]=ce*D[0]+u,P[1]=ue*D[1]+h,P[2]=ee*D[2]+f,De(e,t,P[0],P[1],P[2],I[0]),P[0]=ce*G[0]+u,P[1]=ue*G[1]+h,P[2]=ee*G[2]+f,De(e,t,P[0],P[1],P[2],I[1]),P[0]=ce*Z[0]+u,P[1]=ue*Z[1]+h,P[2]=ee*Z[2]+f,De(e,t,P[0],P[1],P[2],I[2]),P[0]=ce*j[0]+u,P[1]=ue*j[1]+h,P[2]=ee*j[2]+f,De(e,t,P[0],P[1],P[2],I[3]);const ie=Fe(G,Z,j,J)*6,b=Fe(D,Z,j,J)*6,ye=Fe(D,G,j,J)*6,Ve=Fe(D,G,Z,J)*6;I[0][0]*=ie,I[0][1]*=ie,I[0][2]*=ie,I[1][0]*=b,I[1][1]*=b,I[1][2]*=b,I[2][0]*=ye,I[2][1]*=ye,I[2][2]*=ye,I[3][0]*=Ve,I[3][1]*=Ve,I[3][2]*=Ve,a[0]=I[0][0]+I[1][0]+I[2][0]+I[3][0],a[1]=I[0][1]+I[1][1]+I[2][1]+I[3][1],a[2]=I[0][2]+I[1][2]+I[2][2]+I[3][2]}}var nn=class{static expand(e,t){const r=Math.cbrt(e.length/4),i=new Float32Array(3),s=new e.constructor(t**3*4),a=e instanceof Uint8Array?255:1,n=t**2,o=1/(t-1);for(let l=0;l<t;++l)for(let u=0;u<t;++u)for(let h=0;h<t;++h){const f=h*o,d=u*o,v=l*o,A=Math.round(h+u*t+l*n)*4;$s(e,r,f,d,v,i),s[A+0]=i[0],s[A+1]=i[1],s[A+2]=i[2],s[A+3]=a}return s}},ge=[new Float32Array(2),new Float32Array(2)],he=16,je=20,de=30,ea=32,Je=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),wt=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],ta=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Qt=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];function Oe(e,t,r){return e+(t-e)*r}function ra(e){return Math.min(Math.max(e,0),1)}function Tt(e){const t=ge[0],r=ge[1],i=Math.sqrt(t[0]*2)*.5,s=Math.sqrt(t[1]*2)*.5,a=Math.sqrt(r[0]*2)*.5,n=Math.sqrt(r[1]*2)*.5,o=ra(e/ea);t[0]=Oe(i,t[0],o),t[1]=Oe(s,t[1],o),r[0]=Oe(a,r[0],o),r[1]=Oe(n,r[1],o)}function L(e,t,r,i,s,a){const n=r-e,o=i-t,l=s,u=s+1,h=t+o*(l-e)/n,f=t+o*(u-e)/n;if(l>=e&&l<r||u>e&&u<=r)if(Math.sign(h)===Math.sign(f)||Math.abs(h)<1e-4||Math.abs(f)<1e-4){const d=(h+f)/2;d<0?(a[0]=Math.abs(d),a[1]=0):(a[0]=0,a[1]=Math.abs(d))}else{const d=-t*n/o+e,v=Math.trunc(d),A=d>e?h*(d-v)/2:0,p=d<r?f*(1-(d-v))/2:0;(Math.abs(A)>Math.abs(p)?A:-p)<0?(a[0]=Math.abs(A),a[1]=Math.abs(p)):(a[0]=Math.abs(p),a[1]=Math.abs(A))}else a[0]=0,a[1]=0;return a}function ia(e,t,r,i,s){const a=ge[0],n=ge[1],o=.5+i,l=.5+i-1,u=t+r+1;switch(e){case 0:{s[0]=0,s[1]=0;break}case 1:{t<=r?L(0,l,u/2,0,t,s):(s[0]=0,s[1]=0);break}case 2:{t>=r?L(u/2,0,u,l,t,s):(s[0]=0,s[1]=0);break}case 3:{L(0,l,u/2,0,t,a),L(u/2,0,u,l,t,n),Tt(u),s[0]=a[0]+n[0],s[1]=a[1]+n[1];break}case 4:{t<=r?L(0,o,u/2,0,t,s):(s[0]=0,s[1]=0);break}case 5:{s[0]=0,s[1]=0;break}case 6:{Math.abs(i)>0?(L(0,o,u,l,t,a),L(0,o,u/2,0,t,n),L(u/2,0,u,l,t,s),n[0]=n[0]+s[0],n[1]=n[1]+s[1],s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2):L(0,o,u,l,t,s);break}case 7:{L(0,o,u,l,t,s);break}case 8:{t>=r?L(u/2,0,u,o,t,s):(s[0]=0,s[1]=0);break}case 9:{Math.abs(i)>0?(L(0,l,u,o,t,a),L(0,l,u/2,0,t,n),L(u/2,0,u,o,t,s),n[0]=n[0]+s[0],n[1]=n[1]+s[1],s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2):L(0,l,u,o,t,s);break}case 10:{s[0]=0,s[1]=0;break}case 11:{L(0,l,u,o,t,s);break}case 12:{L(0,o,u/2,0,t,a),L(u/2,0,u,o,t,n),Tt(u),s[0]=a[0]+n[0],s[1]=a[1]+n[1];break}case 13:{L(0,l,u,o,t,s);break}case 14:{L(0,o,u,l,t,s);break}case 15:{s[0]=0,s[1]=0;break}}return s}function sa(e,t,r,i,s,a){let n=e===r&&t===i;if(!n){const o=(e+r)/2,l=(t+i)/2,u=i-t,h=e-r;n=u*(s-o)+h*(a-l)>0}return n}function Ct(e,t,r,i,s,a){let n=0;for(let o=0;o<de;++o)for(let l=0;l<de;++l){const u=l/(de-1),h=o/(de-1);sa(e,t,r,i,s+u,a+h)&&++n}return n/(de*de)}function M(e,t,r,i,s,a,n,o){const l=Qt[e],u=l[0],h=l[1];return u>0&&(t+=n[0],r+=n[1]),h>0&&(i+=n[0],s+=n[1]),o[0]=1-Ct(t,r,i,s,1+a,0+a),o[1]=Ct(t,r,i,s,1+a,1+a),o}function aa(e,t,r,i,s){const a=ge[0],n=ge[1],o=t+r+1;switch(e){case 0:{M(e,1,1,1+o,1+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 1:{M(e,1,0,0+o,0+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 2:{M(e,0,0,1+o,0+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 3:{M(e,1,0,1+o,0+o,t,i,s);break}case 4:{M(e,1,1,0+o,0+o,t,i,a),M(e,1,1,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 5:{M(e,1,1,0+o,0+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 6:{M(e,1,1,1+o,0+o,t,i,s);break}case 7:{M(e,1,1,1+o,0+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 8:{M(e,0,0,1+o,1+o,t,i,a),M(e,1,0,1+o,1+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 9:{M(e,1,0,1+o,1+o,t,i,s),M(e,1,0,1+o,1+o,t,i,s);break}case 10:{M(e,0,0,1+o,1+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 11:{M(e,1,0,1+o,1+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 12:{M(e,1,1,1+o,1+o,t,i,s);break}case 13:{M(e,1,1,1+o,1+o,t,i,a),M(e,1,0,1+o,1+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 14:{M(e,1,1,1+o,1+o,t,i,a),M(e,1,1,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}case 15:{M(e,1,1,1+o,1+o,t,i,a),M(e,1,0,1+o,0+o,t,i,n),s[0]=(a[0]+n[0])/2,s[1]=(a[1]+n[1])/2;break}}return s}function St(e,t,r){const i=new Float32Array(2);for(let s=0,a=e.length;s<a;++s){const n=e[s],o=n.data,l=n.width;for(let u=0;u<l;++u)for(let h=0;h<l;++h){r?ia(s,h,u,t,i):aa(s,h,u,t,i);const f=(u*l+h)*2;o[f]=i[0]*255,o[f+1]=i[1]*255}}}function Bt(e,t,r,i,s,a,n){const o=n.data,l=n.width;for(let u=0,h=r.length;u<h;++u){const f=i[u],d=r[u],v=d.data,A=d.width;for(let p=0;p<s;++p)for(let x=0;x<s;++x){const C=f[0]*s+e+x,D=((f[1]*s+t+p)*l+C)*4,G=a?(p*p*A+x*x)*2:(p*A+x)*2;o[D]=v[G],o[D+1]=v[G+1],o[D+2]=0,o[D+3]=255}}}var on=class{static generate(){const e=10*he,t=Je.length*5*he,r=new Uint8ClampedArray(e*t*4),i=new ne(e,t,r),s=Math.pow(he-1,2)+1,a=je,n=[],o=[];for(let l=3,u=r.length;l<u;l+=4)r[l]=255;for(let l=0;l<16;++l)n.push(new ne(s,s,new Uint8ClampedArray(s*s*2),2)),o.push(new ne(a,a,new Uint8ClampedArray(a*a*2),2));for(let l=0,u=Je.length;l<u;++l)St(n,Je[l],!0),Bt(0,5*he*l,n,ta,he,!0,i);for(let l=0,u=wt.length;l<u;++l)St(o,wt[l],!1),Bt(5*he,4*je*l,o,Qt,je,!1,i);return i}},na=`"use strict";(()=>{function q(t,a,s){let e=document.createElement("canvas"),n=e.getContext("2d");if(e.width=t,e.height=a,s instanceof Image)n.drawImage(s,0,0);else{let r=n.createImageData(t,a);r.data.set(s),n.putImageData(r,0,0)}return e}var F=class t{constructor(a=0,s=0,e=null){this.width=a,this.height=s,this.data=e}toCanvas(){return typeof document=="undefined"?null:q(this.width,this.height,this.data)}static from(a){let{width:s,height:e}=a,n;if(a instanceof Image){let r=q(s,e,a);r!==null&&(n=r.getContext("2d").getImageData(0,0,s,e).data)}else n=a.data;return new t(s,e,n)}};var M=[new Float32Array(2),new Float32Array(2)],D=16,W=20,I=30,j=32,v=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),N=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],z=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],p=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];function C(t,a,s){return t+(a-t)*s}function B(t){return Math.min(Math.max(t,0),1)}function _(t){let a=M[0],s=M[1],e=Math.sqrt(a[0]*2)*.5,n=Math.sqrt(a[1]*2)*.5,r=Math.sqrt(s[0]*2)*.5,o=Math.sqrt(s[1]*2)*.5,c=B(t/j);a[0]=C(e,a[0],c),a[1]=C(n,a[1],c),s[0]=C(r,s[0],c),s[1]=C(o,s[1],c)}function d(t,a,s,e,n,r){let o=s-t,c=e-a,h=n,i=n+1,w=a+c*(h-t)/o,b=a+c*(i-t)/o;if(h>=t&&h<s||i>t&&i<=s)if(Math.sign(w)===Math.sign(b)||Math.abs(w)<1e-4||Math.abs(b)<1e-4){let g=(w+b)/2;g<0?(r[0]=Math.abs(g),r[1]=0):(r[0]=0,r[1]=Math.abs(g))}else{let g=-a*o/c+t,k=Math.trunc(g),m=g>t?w*(g-k)/2:0,U=g<s?b*(1-(g-k))/2:0;(Math.abs(m)>Math.abs(U)?m:-U)<0?(r[0]=Math.abs(m),r[1]=Math.abs(U)):(r[0]=Math.abs(U),r[1]=Math.abs(m))}else r[0]=0,r[1]=0;return r}function J(t,a,s,e,n){let r=M[0],o=M[1],c=.5+e,h=.5+e-1,i=a+s+1;switch(t){case 0:{n[0]=0,n[1]=0;break}case 1:{a<=s?d(0,h,i/2,0,a,n):(n[0]=0,n[1]=0);break}case 2:{a>=s?d(i/2,0,i,h,a,n):(n[0]=0,n[1]=0);break}case 3:{d(0,h,i/2,0,a,r),d(i/2,0,i,h,a,o),_(i,M),n[0]=r[0]+o[0],n[1]=r[1]+o[1];break}case 4:{a<=s?d(0,c,i/2,0,a,n):(n[0]=0,n[1]=0);break}case 5:{n[0]=0,n[1]=0;break}case 6:{Math.abs(e)>0?(d(0,c,i,h,a,r),d(0,c,i/2,0,a,o),d(i/2,0,i,h,a,n),o[0]=o[0]+n[0],o[1]=o[1]+n[1],n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2):d(0,c,i,h,a,n);break}case 7:{d(0,c,i,h,a,n);break}case 8:{a>=s?d(i/2,0,i,c,a,n):(n[0]=0,n[1]=0);break}case 9:{Math.abs(e)>0?(d(0,h,i,c,a,r),d(0,h,i/2,0,a,o),d(i/2,0,i,c,a,n),o[0]=o[0]+n[0],o[1]=o[1]+n[1],n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2):d(0,h,i,c,a,n);break}case 10:{n[0]=0,n[1]=0;break}case 11:{d(0,h,i,c,a,n);break}case 12:{d(0,c,i/2,0,a,r),d(i/2,0,i,c,a,o),_(i,M),n[0]=r[0]+o[0],n[1]=r[1]+o[1];break}case 13:{d(0,h,i,c,a,n);break}case 14:{d(0,c,i,h,a,n);break}case 15:{n[0]=0,n[1]=0;break}}return n}function K(t,a,s,e,n,r){let o=t===s&&a===e;if(!o){let c=(t+s)/2,h=(a+e)/2,i=e-a,w=t-s;o=i*(n-c)+w*(r-h)>0}return o}function G(t,a,s,e,n,r){let o=0;for(let c=0;c<I;++c)for(let h=0;h<I;++h){let i=h/(I-1),w=c/(I-1);K(t,a,s,e,n+i,r+w)&&++o}return o/(I*I)}function A(t,a,s,e,n,r,o,c){let h=p[t],i=h[0],w=h[1];return i>0&&(a+=o[0],s+=o[1]),w>0&&(e+=o[0],n+=o[1]),c[0]=1-G(a,s,e,n,1+r,0+r),c[1]=G(a,s,e,n,1+r,1+r),c}function Q(t,a,s,e,n){let r=M[0],o=M[1],c=a+s+1;switch(t){case 0:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 1:{A(t,1,0,0+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 2:{A(t,0,0,1+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 3:{A(t,1,0,1+c,0+c,a,e,n);break}case 4:{A(t,1,1,0+c,0+c,a,e,r),A(t,1,1,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 5:{A(t,1,1,0+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 6:{A(t,1,1,1+c,0+c,a,e,n);break}case 7:{A(t,1,1,1+c,0+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 8:{A(t,0,0,1+c,1+c,a,e,r),A(t,1,0,1+c,1+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 9:{A(t,1,0,1+c,1+c,a,e,n),A(t,1,0,1+c,1+c,a,e,n);break}case 10:{A(t,0,0,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 11:{A(t,1,0,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 12:{A(t,1,1,1+c,1+c,a,e,n);break}case 13:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,1+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 14:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,1,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}case 15:{A(t,1,1,1+c,1+c,a,e,r),A(t,1,0,1+c,0+c,a,e,o),n[0]=(r[0]+o[0])/2,n[1]=(r[1]+o[1])/2;break}}return n}function R(t,a,s){let e=new Float32Array(2);for(let n=0,r=t.length;n<r;++n){let o=t[n],c=o.data,h=o.width;for(let i=0;i<h;++i)for(let w=0;w<h;++w){s?J(n,w,i,a,e):Q(n,w,i,a,e);let b=(i*h+w)*2;c[b]=e[0]*255,c[b+1]=e[1]*255}}}function T(t,a,s,e,n,r,o){let c=o.data,h=o.width;for(let i=0,w=s.length;i<w;++i){let b=e[i],g=s[i],k=g.data,m=g.width;for(let U=0;U<n;++U)for(let x=0;x<n;++x){let Z=b[0]*n+t+x,O=((b[1]*n+a+U)*h+Z)*4,L=r?(U*U*m+x*x)*2:(U*m+x)*2;c[O]=k[L],c[O+1]=k[L+1],c[O+2]=0,c[O+3]=255}}}var S=class{static generate(){let a=10*D,s=v.length*5*D,e=new Uint8ClampedArray(a*s*4),n=new F(a,s,e),r=Math.pow(D-1,2)+1,o=W,c=[],h=[];for(let i=3,w=e.length;i<w;i+=4)e[i]=255;for(let i=0;i<16;++i)c.push(new F(r,r,new Uint8ClampedArray(r*r*2),2)),h.push(new F(o,o,new Uint8ClampedArray(o*o*2),2));for(let i=0,w=v.length;i<w;++i)R(c,v[i],!0),T(0,5*D*i,c,z,D,!0,n);for(let i=0,w=N.length;i<w;++i)R(h,N[i],!1),T(5*D,4*W*i,h,p,W,!1,n);return n}};var P=new Map([[y(0,0,0,0),new Float32Array([0,0,0,0])],[y(0,0,0,1),new Float32Array([0,0,0,1])],[y(0,0,1,0),new Float32Array([0,0,1,0])],[y(0,0,1,1),new Float32Array([0,0,1,1])],[y(0,1,0,0),new Float32Array([0,1,0,0])],[y(0,1,0,1),new Float32Array([0,1,0,1])],[y(0,1,1,0),new Float32Array([0,1,1,0])],[y(0,1,1,1),new Float32Array([0,1,1,1])],[y(1,0,0,0),new Float32Array([1,0,0,0])],[y(1,0,0,1),new Float32Array([1,0,0,1])],[y(1,0,1,0),new Float32Array([1,0,1,0])],[y(1,0,1,1),new Float32Array([1,0,1,1])],[y(1,1,0,0),new Float32Array([1,1,0,0])],[y(1,1,0,1),new Float32Array([1,1,0,1])],[y(1,1,1,0),new Float32Array([1,1,1,0])],[y(1,1,1,1),new Float32Array([1,1,1,1])]]);function H(t,a,s){return t+(a-t)*s}function y(t,a,s,e){let n=H(t,a,.75),r=H(s,e,1-.25);return H(n,r,1-.125)}function V(t,a){let s=0;return a[3]===1&&(s+=1),s===1&&a[2]===1&&t[1]!==1&&t[3]!==1&&(s+=1),s}function $(t,a){let s=0;return a[3]===1&&t[1]!==1&&t[3]!==1&&(s+=1),s===1&&a[2]===1&&t[0]!==1&&t[2]!==1&&(s+=1),s}var E=class{static generate(){let o=new Uint8ClampedArray(2178),c=new Uint8ClampedArray(1024*4);for(let h=0;h<33;++h)for(let i=0;i<66;++i){let w=.03125*i,b=.03125*h;if(P.has(w)&&P.has(b)){let g=P.get(w),k=P.get(b),m=h*66+i;o[m]=127*V(g,k),o[m+33]=127*$(g,k)}}for(let h=0,i=17;i<33;++i)for(let w=0;w<64;++w,h+=4)c[h]=o[i*66+w],c[h+3]=255;return new F(64,16,c)}};self.addEventListener("message",t=>{let a=S.generate(),s=E.generate();postMessage({areaImageData:a,searchImageData:s},[a.data.buffer,s.data.buffer]),close()});})();
|
|
952
|
+
`;function oa(e=!0){const t=URL.createObjectURL(new Blob([na],{type:"text/javascript"})),r=new Worker(t);return URL.revokeObjectURL(t),new Promise((i,s)=>{r.addEventListener("error",a=>s(a.error)),r.addEventListener("message",a=>{const n=ne.from(a.data.searchImageData),o=ne.from(a.data.areaImageData),l=[n.toCanvas().toDataURL("image/png",1),o.toCanvas().toDataURL("image/png",1)];e&&(localStorage.setItem("smaa-search",l[0]),localStorage.setItem("smaa-area",l[1])),i(l)}),r.postMessage(null)})}var ln=class{constructor(){this.disableCache=!1}setCacheEnabled(e){this.disableCache=!e}generate(){const e=!this.disableCache&&window.localStorage!==void 0,t=e?[localStorage.getItem("smaa-search"),localStorage.getItem("smaa-area")]:[null,null];return(t[0]!==null&&t[1]!==null?Promise.resolve(t):oa(e)).then(i=>new Promise((s,a)=>{const n=new Image,o=new Image,l=new le;l.onLoad=()=>s([n,o]),l.onError=a,n.addEventListener("error",u=>l.itemError("smaa-search")),o.addEventListener("error",u=>l.itemError("smaa-area")),n.addEventListener("load",()=>l.itemEnd("smaa-search")),o.addEventListener("load",()=>l.itemEnd("smaa-area")),l.itemStart("smaa-search"),l.itemStart("smaa-area"),n.src=i[0],o.src=i[1]}))}},Ne=new Map([[k(0,0,0,0),new Float32Array([0,0,0,0])],[k(0,0,0,1),new Float32Array([0,0,0,1])],[k(0,0,1,0),new Float32Array([0,0,1,0])],[k(0,0,1,1),new Float32Array([0,0,1,1])],[k(0,1,0,0),new Float32Array([0,1,0,0])],[k(0,1,0,1),new Float32Array([0,1,0,1])],[k(0,1,1,0),new Float32Array([0,1,1,0])],[k(0,1,1,1),new Float32Array([0,1,1,1])],[k(1,0,0,0),new Float32Array([1,0,0,0])],[k(1,0,0,1),new Float32Array([1,0,0,1])],[k(1,0,1,0),new Float32Array([1,0,1,0])],[k(1,0,1,1),new Float32Array([1,0,1,1])],[k(1,1,0,0),new Float32Array([1,1,0,0])],[k(1,1,0,1),new Float32Array([1,1,0,1])],[k(1,1,1,0),new Float32Array([1,1,1,0])],[k(1,1,1,1),new Float32Array([1,1,1,1])]]);function qe(e,t,r){return e+(t-e)*r}function k(e,t,r,i){const s=qe(e,t,.75),a=qe(r,i,1-.25);return qe(s,a,1-.125)}function la(e,t){let r=0;return t[3]===1&&(r+=1),r===1&&t[2]===1&&e[1]!==1&&e[3]!==1&&(r+=1),r}function ca(e,t){let r=0;return t[3]===1&&e[1]!==1&&e[3]!==1&&(r+=1),r===1&&t[2]===1&&e[0]!==1&&e[2]!==1&&(r+=1),r}var cn=class{static generate(){const a=new Uint8ClampedArray(2178),n=new Uint8ClampedArray(1024*4);for(let o=0;o<33;++o)for(let l=0;l<66;++l){const u=.03125*l,h=.03125*o;if(Ne.has(u)&&Ne.has(h)){const f=Ne.get(u),d=Ne.get(h),v=o*66+l;a[v]=127*la(f,d),a[v+33]=127*ca(f,d)}}for(let o=0,l=17;l<33;++l)for(let u=0;u<64;++u,o+=4)n[o]=a[l*66+u],n[o+3]=255;return new ne(64,16,n)}};export{ma as ASCIIEffect,Zr as ASCIITexture,Us as AdaptiveLuminanceMaterial,Rs as AdaptiveLuminancePass,m as BlendFunction,Kr as BlendMode,ui as BloomEffect,Pe as BlurPass,Aa as BokehEffect,be as BokehMaterial,Ns as BoxBlurMaterial,$a as BoxBlurPass,xa as BrightnessContrastEffect,wa as ChromaticAberrationEffect,Ei as CircleOfConfusionMaterial,cr as ClearMaskPass,Ie as ClearPass,Ea as ColorAverageEffect,ve as ColorChannel,Da as ColorDepthEffect,ls as ColorEdgesMaterial,Nt as ConvolutionMaterial,_e as CopyMaterial,lt as CopyPass,Yi as DepthComparisonMaterial,ks as DepthCopyMaterial,we as DepthCopyMode,Xs as DepthCopyPass,xs as DepthDownsamplingMaterial,Es as DepthDownsamplingPass,Ta as DepthEffect,ss as DepthMaskMaterial,Ca as DepthOfFieldEffect,_t as DepthPass,en as DepthPickingPass,Xs as DepthSavePass,Se as DepthTestStrategy,ha as Disposable,Sa as DotScreenEffect,si as DownsamplingMaterial,ls as EdgeDetectionMaterial,zt as EdgeDetectionMode,B as Effect,N as EffectAttribute,da as EffectComposer,Qs as EffectMaterial,tn as EffectPass,hr as EffectShaderData,S as EffectShaderSection,Ba as FXAAEffect,Ma as GammaCorrectionEffect,dr as GaussKernel,Ws as GaussianBlurMaterial,rn as GaussianBlurPass,Ia as GlitchEffect,me as GlitchMode,Pa as GodRaysEffect,Ri as GodRaysMaterial,ya as GridEffect,Ua as HueSaturationEffect,va as ImmutableTimer,ga as Initializable,Nt as KawaseBlurMaterial,Pe as KawaseBlurPass,$ as KernelSize,ba as LUT1DEffect,La as LUT3DEffect,ja as LUT3dlLoader,Ja as LUTCubeLoader,La as LUTEffect,Hi as LUTOperation,sn as LambdaPass,Ra as LensDistortionEffect,ct as LookupTexture,ct as LookupTexture3D,ti as LuminanceMaterial,Ht as LuminancePass,Gt as MaskFunction,wi as MaskMaterial,fr as MaskPass,li as MipmapBlurPass,Oa as NoiseEffect,it as NoiseTexture,an as NormalPass,Ki as OutlineEdgesMaterial,Na as OutlineEffect,Ki as OutlineMaterial,vt as OverrideMaterialManager,O as Pass,Ha as PixelationEffect,zi as PredicationMode,ne as RawImageData,Ga as RealisticBokehEffect,Qe as RenderPass,pa as Resizable,E as Resizer,E as Resolution,on as SMAAAreaImageData,Va as SMAAEffect,ln as SMAAImageGenerator,qa as SMAAImageLoader,Ae as SMAAPreset,cn as SMAASearchImageData,fs as SMAAWeightsMaterial,Ya as SSAOEffect,ps as SSAOMaterial,lt as SavePass,ka as ScanlineEffect,S as Section,Ot as Selection,_a as SelectiveBloomEffect,Qa as SepiaEffect,W as ShaderPass,za as ShockWaveEffect,nn as TetrahedralUpscaler,Wa as TextureEffect,Bs as TiltShiftBlurMaterial,Ms as TiltShiftBlurPass,Xa as TiltShiftEffect,or as Timer,Ka as ToneMappingEffect,V as ToneMappingMode,oi as UpsamplingMaterial,Za as VignetteEffect,xe as VignetteTechnique,Fa as WebGLExtension,fa as version};
|