module.exports=[81455,a=>{"use strict";var b=a.i(35258);let c=new b.OrthographicCamera(-1,1,1,-1,0,1);class d extends b.BufferGeometry{constructor(){super(),this.setAttribute("position",new b.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new b.Float32BufferAttribute([0,2,0,0,2,0],2))}}let e=new d;a.s(["FullScreenQuad",0,class{constructor(a){this._mesh=new b.Mesh(e,a)}dispose(){this._mesh.geometry.dispose()}render(a){a.render(this._mesh,c)}get material(){return this._mesh.material}set material(a){this._mesh.material=a}},"Pass",0,class{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}])},61063,a=>{"use strict";let b={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`

		varying vec2 vUv;

		void main() {

			vUv = uv;
			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

		}`,fragmentShader:`

		uniform float opacity;

		uniform sampler2D tDiffuse;

		varying vec2 vUv;

		void main() {

			vec4 texel = texture2D( tDiffuse, vUv );
			gl_FragColor = opacity * texel;


		}`};a.s(["CopyShader",0,b])},57468,a=>{"use strict";var b=a.i(35258),c=a.i(81455),d=a.i(61063);let e={name:"LuminosityHighPassShader",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new b.Color(0)},defaultOpacity:{value:0}},vertexShader:`

		varying vec2 vUv;

		void main() {

			vUv = uv;

			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

		}`,fragmentShader:`

		uniform sampler2D tDiffuse;
		uniform vec3 defaultColor;
		uniform float defaultOpacity;
		uniform float luminosityThreshold;
		uniform float smoothWidth;

		varying vec2 vUv;

		void main() {

			vec4 texel = texture2D( tDiffuse, vUv );

			float v = luminance( texel.xyz );

			vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );

			float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );

			gl_FragColor = mix( outputColor, texel, alpha );

		}`};class f extends c.Pass{constructor(a,f=1,g,h){super(),this.strength=f,this.radius=g,this.threshold=h,this.resolution=void 0!==a?new b.Vector2(a.x,a.y):new b.Vector2(256,256),this.clearColor=new b.Color(0,0,0),this.needsSwap=!1,this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let i=Math.round(this.resolution.x/2),j=Math.round(this.resolution.y/2);this.renderTargetBright=new b.WebGLRenderTarget(i,j,{type:b.HalfFloatType}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let a=0;a<this.nMips;a++){const c=new b.WebGLRenderTarget(i,j,{type:b.HalfFloatType});c.texture.name="UnrealBloomPass.h"+a,c.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(c);const d=new b.WebGLRenderTarget(i,j,{type:b.HalfFloatType});d.texture.name="UnrealBloomPass.v"+a,d.texture.generateMipmaps=!1,this.renderTargetsVertical.push(d),i=Math.round(i/2),j=Math.round(j/2)}this.highPassUniforms=b.UniformsUtils.clone(e.uniforms),this.highPassUniforms.luminosityThreshold.value=h,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new b.ShaderMaterial({uniforms:this.highPassUniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.separableBlurMaterials=[];const k=[6,10,14,18,22];i=Math.round(this.resolution.x/2),j=Math.round(this.resolution.y/2);for(let a=0;a<this.nMips;a++)this.separableBlurMaterials.push(this._getSeparableBlurMaterial(k[a])),this.separableBlurMaterials[a].uniforms.invSize.value=new b.Vector2(1/i,1/j),i=Math.round(i/2),j=Math.round(j/2);this.compositeMaterial=this._getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=f,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new b.Vector3(1,1,1),new b.Vector3(1,1,1),new b.Vector3(1,1,1),new b.Vector3(1,1,1),new b.Vector3(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,this.copyUniforms=b.UniformsUtils.clone(d.CopyShader.uniforms),this.blendMaterial=new b.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:d.CopyShader.vertexShader,fragmentShader:d.CopyShader.fragmentShader,premultipliedAlpha:!0,blending:b.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this._oldClearColor=new b.Color,this._oldClearAlpha=1,this._basic=new b.MeshBasicMaterial,this._fsQuad=new c.FullScreenQuad(null)}dispose(){for(let a=0;a<this.renderTargetsHorizontal.length;a++)this.renderTargetsHorizontal[a].dispose();for(let a=0;a<this.renderTargetsVertical.length;a++)this.renderTargetsVertical[a].dispose();this.renderTargetBright.dispose();for(let a=0;a<this.separableBlurMaterials.length;a++)this.separableBlurMaterials[a].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this._basic.dispose(),this._fsQuad.dispose()}setSize(a,c){let d=Math.round(a/2),e=Math.round(c/2);this.renderTargetBright.setSize(d,e);for(let a=0;a<this.nMips;a++)this.renderTargetsHorizontal[a].setSize(d,e),this.renderTargetsVertical[a].setSize(d,e),this.separableBlurMaterials[a].uniforms.invSize.value=new b.Vector2(1/d,1/e),d=Math.round(d/2),e=Math.round(e/2)}render(a,b,c,d,e){a.getClearColor(this._oldClearColor),this._oldClearAlpha=a.getClearAlpha();let g=a.autoClear;a.autoClear=!1,a.setClearColor(this.clearColor,0),e&&a.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this._fsQuad.material=this._basic,this._basic.map=c.texture,a.setRenderTarget(null),a.clear(),this._fsQuad.render(a)),this.highPassUniforms.tDiffuse.value=c.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this._fsQuad.material=this.materialHighPassFilter,a.setRenderTarget(this.renderTargetBright),a.clear(),this._fsQuad.render(a);let h=this.renderTargetBright;for(let b=0;b<this.nMips;b++)this._fsQuad.material=this.separableBlurMaterials[b],this.separableBlurMaterials[b].uniforms.colorTexture.value=h.texture,this.separableBlurMaterials[b].uniforms.direction.value=f.BlurDirectionX,a.setRenderTarget(this.renderTargetsHorizontal[b]),a.clear(),this._fsQuad.render(a),this.separableBlurMaterials[b].uniforms.colorTexture.value=this.renderTargetsHorizontal[b].texture,this.separableBlurMaterials[b].uniforms.direction.value=f.BlurDirectionY,a.setRenderTarget(this.renderTargetsVertical[b]),a.clear(),this._fsQuad.render(a),h=this.renderTargetsVertical[b];this._fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,a.setRenderTarget(this.renderTargetsHorizontal[0]),a.clear(),this._fsQuad.render(a),this._fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,e&&a.state.buffers.stencil.setTest(!0),this.renderToScreen?a.setRenderTarget(null):a.setRenderTarget(c),this._fsQuad.render(a),a.setClearColor(this._oldClearColor,this._oldClearAlpha),a.autoClear=g}_getSeparableBlurMaterial(a){let c=[],d=a/3;for(let b=0;b<a;b++)c.push(.39894*Math.exp(-.5*b*b/(d*d))/d);return new b.ShaderMaterial({defines:{KERNEL_RADIUS:a},uniforms:{colorTexture:{value:null},invSize:{value:new b.Vector2(.5,.5)},direction:{value:new b.Vector2(.5,.5)},gaussianCoefficients:{value:c}},vertexShader:`

				varying vec2 vUv;

				void main() {

					vUv = uv;
					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

				}`,fragmentShader:`

				#include <common>

				varying vec2 vUv;

				uniform sampler2D colorTexture;
				uniform vec2 invSize;
				uniform vec2 direction;
				uniform float gaussianCoefficients[KERNEL_RADIUS];

				void main() {

					float weightSum = gaussianCoefficients[0];
					vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum;

					for ( int i = 1; i < KERNEL_RADIUS; i ++ ) {

						float x = float( i );
						float w = gaussianCoefficients[i];
						vec2 uvOffset = direction * invSize * x;
						vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb;
						vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb;
						diffuseSum += ( sample1 + sample2 ) * w;

					}

					gl_FragColor = vec4( diffuseSum, 1.0 );

				}`})}_getCompositeMaterial(a){return new b.ShaderMaterial({defines:{NUM_MIPS:a},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`

				varying vec2 vUv;

				void main() {

					vUv = uv;
					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

				}`,fragmentShader:`

				varying vec2 vUv;

				uniform sampler2D blurTexture1;
				uniform sampler2D blurTexture2;
				uniform sampler2D blurTexture3;
				uniform sampler2D blurTexture4;
				uniform sampler2D blurTexture5;
				uniform float bloomStrength;
				uniform float bloomRadius;
				uniform float bloomFactors[NUM_MIPS];
				uniform vec3 bloomTintColors[NUM_MIPS];

				float lerpBloomFactor( const in float factor ) {

					float mirrorFactor = 1.2 - factor;
					return mix( factor, mirrorFactor, bloomRadius );

				}

				void main() {

					// 3.0 for backwards compatibility with previous alpha-based intensity
					vec3 bloom = 3.0 * bloomStrength * (
						lerpBloomFactor( bloomFactors[ 0 ] ) * bloomTintColors[ 0 ] * texture2D( blurTexture1, vUv ).rgb +
						lerpBloomFactor( bloomFactors[ 1 ] ) * bloomTintColors[ 1 ] * texture2D( blurTexture2, vUv ).rgb +
						lerpBloomFactor( bloomFactors[ 2 ] ) * bloomTintColors[ 2 ] * texture2D( blurTexture3, vUv ).rgb +
						lerpBloomFactor( bloomFactors[ 3 ] ) * bloomTintColors[ 3 ] * texture2D( blurTexture4, vUv ).rgb +
						lerpBloomFactor( bloomFactors[ 4 ] ) * bloomTintColors[ 4 ] * texture2D( blurTexture5, vUv ).rgb
					);

					float bloomAlpha = max( bloom.r, max( bloom.g, bloom.b ) );
					gl_FragColor = vec4( bloom, bloomAlpha );

				}`})}}f.BlurDirectionX=new b.Vector2(1,0),f.BlurDirectionY=new b.Vector2(0,1),a.s(["UnrealBloomPass",0,f],57468)}];

//# sourceMappingURL=node_modules_three_examples_jsm_097cjx-._.js.map