lingo3d-vanilla
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
1 lines • 28.7 kB
JavaScript
(self.webpackChunklingo3d_vanilla=self.webpackChunklingo3d_vanilla||[]).push([[666],{6666:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var i=r(7002),n=(r(650),r(5488),r(3781),r(2731),"varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}");var a=2,s=[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])],o=class extends i.jyz{constructor(e=new i.Ltg){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new i.xWb(null),texelSize:new i.xWb(new i.Ltg),scale:new i.xWb(1),kernel:new i.xWb(0)},blending:i.jFi,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include <encodings_fragment>\n}",vertexShader:"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);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernelSize=a}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get kernelSequence(){return s[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,.5*e,.5*t)}setSize(e,t){const r=1/e,i=1/t;this.uniforms.texelSize.value.set(r,i,.5*r,.5*i)}},l=class extends i.jyz{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new i.xWb(null),opacity:new i.xWb(1)},blending:i.jFi,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <dithering_pars_fragment>\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include <encodings_fragment>\n#include <dithering_fragment>\n}",vertexShader:n}),this.toneMapped=!1}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},h=new i.V1s,u=null;var c=class{constructor(e="Pass",t=new i.xsS,r=h){this.name=e,this.renderer=null,this.scene=t,this.camera=r,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;null!==t&&(t.needsUpdate=!0),this.rtt=!e}}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;null!==t?t.material=e:(t=new i.Kj0(function(){if(null===u){const e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(u=new i.u9r).setAttribute?(u.setAttribute("position",new i.TlE(e,3)),u.setAttribute("uv",new i.TlE(t,2))):(u.addAttribute("position",new i.TlE(e,3)),u.addAttribute("uv",new i.TlE(t,2)))}return u}(),e),t.frustumCulled=!1,null===this.scene&&(this.scene=new i.xsS),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=i.z81){}render(e,t,r,i,n){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,r){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof i.dd2||t instanceof i.F5T||t instanceof i.xEZ||t instanceof c)&&this[e].dispose()}}},d=(new i.Ilk,-1),f=class extends i.pBf{constructor(e,t=-1,r=-1,n=1){super(),this.resizable=e,this.baseSize=new i.FM8(1,1),this.preferredSize=new i.FM8(t,r),this.target=this.preferredSize,this.s=n,this.effectiveSize=new i.FM8,this.addEventListener("change",(()=>this.updateEffectiveSize())),this.updateEffectiveSize()}updateEffectiveSize(){const e=this.baseSize,t=this.preferredSize,r=this.effectiveSize,i=this.scale;t.width!==d?r.width=t.width:t.height!==d?r.width=Math.round(t.height*(e.width/Math.max(e.height,1))):r.width=Math.round(e.width*i),t.height!==d?r.height=t.height:t.width!==d?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(d),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.getBaseWidth(),e.getBaseHeight()),this.preferredSize.set(e.getPreferredWidth(),e.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return d}};new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var p=class extends c{constructor({kernelSize:e=a,resolutionScale:t=.5,width:r=f.AUTO_SIZE,height:n=f.AUTO_SIZE,resolutionX:s=r,resolutionY:h=n}={}){super("KawaseBlurPass"),this.renderTargetA=new i.dd2(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const u=this.resolution=new f(this,s,h,t);u.addEventListener("change",(e=>this.setSize(u.baseWidth,u.baseHeight))),this.blurMaterial=new o,this.copyMaterial=new l}getResolution(){return this.resolution}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,n){const a=this.scene,s=this.camera,o=this.renderTargetA,l=this.renderTargetB,h=this.blurMaterial,u=h.kernelSequence;let c=t;this.fullscreenMaterial=h;for(let d=0,f=u.length;d<f;++d){const t=0==(1&d)?o:l;h.kernel=u[d],h.inputBuffer=c.texture,e.setRenderTarget(t),e.render(a,s),c=t}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=c.texture,e.setRenderTarget(this.renderToScreen?null:r),e.render(a,s)}setSize(e,t){const r=this.resolution;r.setBaseSize(e,t);const i=r.width,n=r.height;this.renderTargetA.setSize(i,n),this.renderTargetB.setSize(i,n),this.blurMaterial.setSize(e,t)}initialize(e,t,r){void 0!==r&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==i.ywz?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e.outputEncoding===i.knz&&(this.renderTargetA.texture.encoding=i.knz,this.renderTargetB.texture.encoding=i.knz))}static get AUTO_SIZE(){return f.AUTO_SIZE}};Set;new i.Pa4,new i.yGw;new i.Ilk,new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),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]);new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),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]),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]);v(0,0,0,0),new Float32Array([0,0,0,0]),v(0,0,0,1),new Float32Array([0,0,0,1]),v(0,0,1,0),new Float32Array([0,0,1,0]),v(0,0,1,1),new Float32Array([0,0,1,1]),v(0,1,0,0),new Float32Array([0,1,0,0]),v(0,1,0,1),new Float32Array([0,1,0,1]),v(0,1,1,0),new Float32Array([0,1,1,0]),v(0,1,1,1),new Float32Array([0,1,1,1]),v(1,0,0,0),new Float32Array([1,0,0,0]),v(1,0,0,1),new Float32Array([1,0,0,1]),v(1,0,1,0),new Float32Array([1,0,1,0]),v(1,0,1,1),new Float32Array([1,0,1,1]),v(1,1,0,0),new Float32Array([1,1,0,0]),v(1,1,0,1),new Float32Array([1,1,0,1]),v(1,1,1,0),new Float32Array([1,1,1,0]),v(1,1,1,1),new Float32Array([1,1,1,1]);function g(e,t,r){return e+(t-e)*r}function v(e,t,r,i){const n=g(e,t,.75),a=g(r,i,.75);return g(n,a,.875)}Math.PI,new i.Pa4,new i.Pa4;class m extends i.Wid{constructor(e,t,r,n,{mixBlur:a=0,mixStrength:s=1,resolution:o=256,blur:l=[0,0],minDepthThreshold:h=.9,maxDepthThreshold:u=1,depthScale:c=0,depthToBlurRatioBias:d=.25,mirror:f=0,distortion:p=1,mixContrast:g=1,distortionMap:v,reflectorOffset:m=0,planeNormal:w=new i.Pa4(0,0,1)}={}){super(),this.gl=e,this.camera=t,this.scene=r,this.parent=n,this.hasBlur=l[0]+l[1]>0,this.reflectorPlane=new i.JOQ,this.normal=new i.Pa4,this.reflectorWorldPosition=new i.Pa4,this.cameraWorldPosition=new i.Pa4,this.rotationMatrix=new i.yGw,this.lookAtPosition=new i.Pa4(0,-1,0),this.clipPlane=new i.Ltg,this.view=new i.Pa4,this.target=new i.Pa4,this.q=new i.Ltg,this.textureMatrix=new i.yGw,this.virtualCamera=new i.cPb,this.reflectorOffset=m,this.planeNormal=w,this.setupBuffers(o,l),this.reflectorProps={mirror:f,textureMatrix:this.textureMatrix,mixBlur:a,tDiffuse:this.fbo1.texture,tDepth:this.fbo1.depthTexture,tDiffuseBlur:this.fbo2.texture,hasBlur:this.hasBlur,mixStrength:s,minDepthThreshold:h,maxDepthThreshold:u,depthScale:c,depthToBlurRatioBias:d,distortion:p,distortionMap:v,mixContrast:g,"defines-USE_BLUR":this.hasBlur?"":void 0,"defines-USE_DEPTH":c>0?"":void 0,"defines-USE_DISTORTION":v?"":void 0}}setupBuffers(e,t){const r={minFilter:i.wem,magFilter:i.wem,encoding:this.gl.outputEncoding},n=new i.dd2(e,e,r);n.depthBuffer=!0,n.depthTexture=new i.$YQ(e,e),n.depthTexture.format=i.qkB,n.depthTexture.type=i.LsT;const a=new i.dd2(e,e,r);this.fbo1=n,this.fbo2=a,this.kawaseBlurPass=new p,this.kawaseBlurPass.setSize(t[0],t[1])}beforeRender(){if(!this.parent)return;if(this.reflectorWorldPosition.setFromMatrixPosition(this.parent.matrixWorld),this.cameraWorldPosition.setFromMatrixPosition(this.camera.matrixWorld),this.rotationMatrix.extractRotation(this.parent.matrixWorld),this.normal.copy(this.planeNormal),this.normal.applyMatrix4(this.rotationMatrix),this.reflectorWorldPosition.addScaledVector(this.normal,this.reflectorOffset),this.view.subVectors(this.reflectorWorldPosition,this.cameraWorldPosition),this.view.dot(this.normal)>0)return;this.view.reflect(this.normal).negate(),this.view.add(this.reflectorWorldPosition),this.rotationMatrix.extractRotation(this.camera.matrixWorld),this.lookAtPosition.set(0,0,-1),this.lookAtPosition.applyMatrix4(this.rotationMatrix),this.lookAtPosition.add(this.cameraWorldPosition),this.target.subVectors(this.reflectorWorldPosition,this.lookAtPosition),this.target.reflect(this.normal).negate(),this.target.add(this.reflectorWorldPosition),this.virtualCamera.position.copy(this.view),this.virtualCamera.up.set(0,1,0),this.virtualCamera.up.applyMatrix4(this.rotationMatrix),this.virtualCamera.up.reflect(this.normal),this.virtualCamera.lookAt(this.target),this.virtualCamera.far=this.camera.far,this.virtualCamera.updateMatrixWorld(),this.virtualCamera.projectionMatrix.copy(this.camera.projectionMatrix),this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.virtualCamera.projectionMatrix),this.textureMatrix.multiply(this.virtualCamera.matrixWorldInverse),this.textureMatrix.multiply(this.parent.matrixWorld),this.reflectorPlane.setFromNormalAndCoplanarPoint(this.normal,this.reflectorWorldPosition),this.reflectorPlane.applyMatrix4(this.virtualCamera.matrixWorldInverse),this.clipPlane.set(this.reflectorPlane.normal.x,this.reflectorPlane.normal.y,this.reflectorPlane.normal.z,this.reflectorPlane.constant);const e=this.virtualCamera.projectionMatrix;this.q.x=(Math.sign(this.clipPlane.x)+e.elements[8])/e.elements[0],this.q.y=(Math.sign(this.clipPlane.y)+e.elements[9])/e.elements[5],this.q.z=-1,this.q.w=(1+e.elements[10])/e.elements[14],this.clipPlane.multiplyScalar(2/this.clipPlane.dot(this.q)),e.elements[2]=this.clipPlane.x,e.elements[6]=this.clipPlane.y,e.elements[10]=this.clipPlane.z+1,e.elements[14]=this.clipPlane.w}update(){if(this.parent.material!==this)return;this.parent.visible=!1;const e=this.gl.xr.enabled,t=this.gl.shadowMap.autoUpdate;this.beforeRender(),this.gl.xr.enabled=!1,this.gl.shadowMap.autoUpdate=!1,this.gl.setRenderTarget(this.fbo1),this.gl.state.buffers.depth.setMask(!0),this.gl.autoClear||this.gl.clear(),this.gl.render(this.scene,this.virtualCamera),this.hasBlur&&this.kawaseBlurPass.render(this.gl,this.fbo1,this.fbo2),this.gl.xr.enabled=e,this.gl.shadowMap.autoUpdate=t,this.parent.visible=!0,this.gl.setRenderTarget(null)}onBeforeCompile(e,...t){super.onBeforeCompile(e,...t),void 0===this.defines&&(this.defines={}),this.defines.USE_UV||(this.defines.USE_UV=""),void 0!==this.reflectorProps["defines-USE_BLUR"]&&(this.defines.USE_BLUR=""),void 0!==this.reflectorProps["defines-USE_DEPTH"]&&(this.defines.USE_DEPTH=""),void 0!==this.reflectorProps["defines-USE_DISTORTION"]&&(this.defines.USE_DISTORTION="");let r=this.reflectorProps;for(let i in r)e.uniforms[i]={get value(){return r[i]}};e.vertexShader=`\n uniform mat4 textureMatrix;\n varying vec4 my_vUv; \n ${e.vertexShader}`,e.vertexShader=e.vertexShader.replace("#include <project_vertex>","\n #include <project_vertex>\n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n "),e.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv; \n ${e.fragmentShader}`,e.fragmentShader=e.fragmentShader.replace("#include <emissivemap_fragment>","\n #include <emissivemap_fragment>\n \n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n \n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n \n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n \n vec4 merge = base;\n \n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05 * normalScale;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n \n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n \n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n \n #endif\n \n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n \n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n \n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n \n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n \n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}}},7345:(e,t,r)=>{var i=r(8297),n=r(7632),a=TypeError;e.exports=function(e){if(i(e))return e;throw a(n(e)+" is not a constructor")}},3025:(e,t,r)=>{"use strict";var i=r(7957).charAt;e.exports=function(e,t,r){return t+(r?i(e,t).length:1)}},8174:e=>{e.exports=function(e,t){return{value:e,done:t}}},4530:(e,t,r)=>{var i=r(7300);e.exports=i("document","documentElement")},8297:(e,t,r)=>{var i=r(9720),n=r(4141),a=r(1045),s=r(6837),o=r(7300),l=r(4554),h=function(){},u=[],c=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,f=i(d.exec),p=!d.exec(h),g=function(e){if(!a(e))return!1;try{return c(h,u,e),!0}catch(t){return!1}},v=function(e){if(!a(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(d,l(e))}catch(t){return!0}};v.sham=!0,e.exports=!c||n((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?v:g},3265:(e,t,r)=>{var i=r(7809),n=r(6027),a=r(9140)("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==n(e))}},9437:(e,t,r)=>{"use strict";var i=r(9549).IteratorPrototype,n=r(5565),a=r(2499),s=r(5125),o=r(9171),l=function(){return this};e.exports=function(e,t,r,h){var u=t+" Iterator";return e.prototype=n(i,{next:a(+!h,r)}),s(e,u,!1,!0),o[u]=l,e}},9549:(e,t,r)=>{"use strict";var i,n,a,s=r(4141),o=r(1045),l=r(7809),h=r(5565),u=r(2573),c=r(4405),d=r(9140),f=r(4726),p=d("iterator"),g=!1;[].keys&&("next"in(a=[].keys())?(n=u(u(a)))!==Object.prototype&&(i=n):g=!0),!l(i)||s((function(){var e={};return i[p].call(e)!==e}))?i={}:f&&(i=h(i)),o(i[p])||c(i,p,(function(){return this})),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:g}},9171:e=>{e.exports={}},5565:(e,t,r)=>{var i,n=r(1571),a=r(3633),s=r(7414),o=r(8164),l=r(4530),h=r(6459),u=r(6033),c=u("IE_PROTO"),d=function(){},f=function(e){return"<script>"+e+"</"+"script>"},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{i=new ActiveXObject("htmlfile")}catch(n){}var e,t;g="undefined"!=typeof document?document.domain&&i?p(i):((t=h("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):p(i);for(var r=s.length;r--;)delete g.prototype[s[r]];return g()};o[c]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(d.prototype=n(e),r=new d,d.prototype=null,r[c]=e):r=g(),void 0===t?r:a.f(r,t)}},3633:(e,t,r)=>{var i=r(2931),n=r(5957),a=r(4317),s=r(1571),o=r(4221),l=r(3555);t.f=i&&!n?Object.defineProperties:function(e,t){s(e);for(var r,i=o(t),n=l(t),h=n.length,u=0;h>u;)a.f(e,r=n[u++],i[r]);return e}},3555:(e,t,r)=>{var i=r(6984),n=r(7414);e.exports=Object.keys||function(e){return i(e,n)}},2146:(e,t,r)=>{var i=r(9107),n=r(1571),a=r(1045),s=r(6027),o=r(1660),l=TypeError;e.exports=function(e,t){var r=e.exec;if(a(r)){var h=i(r,e,t);return null!==h&&n(h),h}if("RegExp"===s(e))return i(o,e,t);throw l("RegExp#exec called on incompatible receiver")}},1660:(e,t,r)=>{"use strict";var i,n,a=r(9107),s=r(9720),o=r(9274),l=r(5316),h=r(4233),u=r(6402),c=r(5565),d=r(7417).get,f=r(5629),p=r(2231),g=u("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,m=v,w=s("".charAt),x=s("".indexOf),y=s("".replace),S=s("".slice),A=(n=/b*/g,a(v,i=/a/,"a"),a(v,n,"a"),0!==i.lastIndex||0!==n.lastIndex),b=h.BROKEN_CARET,U=void 0!==/()??/.exec("")[1];(A||U||b||f||p)&&(m=function(e){var t,r,i,n,s,h,u,f=this,p=d(f),F=o(e),z=p.raw;if(z)return z.lastIndex=f.lastIndex,t=a(m,z,F),f.lastIndex=z.lastIndex,t;var M=p.groups,E=b&&f.sticky,P=a(l,f),B=f.source,T=0,_=F;if(E&&(P=y(P,"y",""),-1===x(P,"g")&&(P+="g"),_=S(F,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==w(F,f.lastIndex-1))&&(B="(?: "+B+")",_=" "+_,T++),r=new RegExp("^(?:"+B+")",P)),U&&(r=new RegExp("^"+B+"$(?!\\s)",P)),A&&(i=f.lastIndex),n=a(v,E?r:f,_),E?n?(n.input=S(n.input,T),n[0]=S(n[0],T),n.index=f.lastIndex,f.lastIndex+=n[0].length):f.lastIndex=0:A&&n&&(f.lastIndex=f.global?n.index+n[0].length:i),U&&n&&n.length>1&&a(g,n[0],r,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(n[s]=void 0)})),n&&M)for(n.groups=h=c(null),s=0;s<M.length;s++)h[(u=M[s])[0]]=n[u[1]];return n}),e.exports=m},5316:(e,t,r)=>{"use strict";var i=r(1571);e.exports=function(){var e=i(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},8040:(e,t,r)=>{var i=r(9107),n=r(1163),a=r(8931),s=r(5316),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||n(e,"flags")||!a(o,e)?t:i(s,e)}},4233:(e,t,r)=>{var i=r(4141),n=r(2383).RegExp,a=i((function(){var e=n("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),s=a||i((function(){return!n("a","y").sticky})),o=a||i((function(){var e=n("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:o,MISSED_STICKY:s,UNSUPPORTED_Y:a}},5629:(e,t,r)=>{var i=r(4141),n=r(2383).RegExp;e.exports=i((function(){var e=n(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},2231:(e,t,r)=>{var i=r(4141),n=r(2383).RegExp;e.exports=i((function(){var e=n("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},5125:(e,t,r)=>{var i=r(4317).f,n=r(1163),a=r(9140)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!n(e,a)&&i(e,a,{configurable:!0,value:t})}},543:(e,t,r)=>{var i=r(1571),n=r(7345),a=r(7323),s=r(9140)("species");e.exports=function(e,t){var r,o=i(e).constructor;return void 0===o||a(r=i(o)[s])?t:n(r)}},7957:(e,t,r)=>{var i=r(9720),n=r(152),a=r(9274),s=r(6827),o=i("".charAt),l=i("".charCodeAt),h=i("".slice),u=function(e){return function(t,r){var i,u,c=a(s(t)),d=n(r),f=c.length;return d<0||d>=f?e?"":void 0:(i=l(c,d))<55296||i>56319||d+1===f||(u=l(c,d+1))<56320||u>57343?e?o(c,d):i:e?h(c,d,d+2):u-56320+(i-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},9274:(e,t,r)=>{var i=r(6837),n=String;e.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return n(e)}},7596:(e,t,r)=>{"use strict";var i=r(4866),n=r(9107),a=r(9720),s=r(9437),o=r(8174),l=r(6827),h=r(2844),u=r(9274),c=r(1571),d=r(7323),f=r(6027),p=r(3265),g=r(8040),v=r(466),m=r(4405),w=r(4141),x=r(9140),y=r(543),S=r(3025),A=r(2146),b=r(7417),U=r(4726),F=x("matchAll"),z="RegExp String",M="RegExp String Iterator",E=b.set,P=b.getterFor(M),B=RegExp.prototype,T=TypeError,_=a("".indexOf),R=a("".matchAll),I=!!R&&!w((function(){R("a",/./)})),D=s((function(e,t,r,i){E(this,{type:M,regexp:e,string:t,global:r,unicode:i,done:!1})}),z,(function(){var e=P(this);if(e.done)return o(void 0,!0);var t=e.regexp,r=e.string,i=A(t,r);return null===i?(e.done=!0,o(void 0,!0)):e.global?(""===u(i[0])&&(t.lastIndex=S(r,h(t.lastIndex),e.unicode)),o(i,!1)):(e.done=!0,o(i,!1))})),W=function(e){var t,r,i,n=c(this),a=u(e),s=y(n,RegExp),o=u(g(n));return t=new s(s===RegExp?n.source:n,o),r=!!~_(o,"g"),i=!!~_(o,"u"),t.lastIndex=h(n.lastIndex),new D(t,a,r,i)};i({target:"String",proto:!0,forced:I},{matchAll:function(e){var t,r,i,a,s=l(this);if(d(e)){if(I)return R(s,e)}else{if(p(e)&&(t=u(l(g(e))),!~_(t,"g")))throw T("`.matchAll` does not allow non-global regexes");if(I)return R(s,e);if(void 0===(i=v(e,F))&&U&&"RegExp"==f(e)&&(i=W),i)return n(i,e,s)}return r=u(s),a=new RegExp(e,"g"),U?n(W,a,r):a[F](r)}}),U||F in B||m(B,F,W)},3781:(e,t,r)=>{r(7596)}}]);