<!-- SOLID-PLAYTIME · part 127 -->
recision:l,textureFormatReadable:r,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:f,reversedDepthBuffer:h,maxTextures:p,maxVertexTextures:v,maxTextureSize:y,maxCubemapSize:U,maxAttributes:d,maxVertexUniforms:g,maxVaryings:m,maxFragmentUniforms:x,vertexTextures:S,maxSamples:A}}function IR(t){let e=this,n=null,i=0,s=!1,a=!1,r=new Cs,o=new qt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let p=f.length!==0||h||i!==0||s;return s=h,i=f.length,p},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){n=u(f,h,0)},this.setState=function(f,h,p){let{clippingPlanes:v,clipIntersection:y,clipShadows:U}=f,d=t.get(f);if(!s||v===null||v.length===0||a&&!U)if(a)u(null);else c();else{let g=a?0:i,m=g*4,x=d.clippingState||null;l.value=x,x=u(v,h,m,p);for(let S=0;S!==m;++S)x[S]=n[S];d.clippingState=x,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=g}};function c(){if(l.value!==n)l.value=n,l.needsUpdate=i>0;e.numPlanes=i,e.numIntersection=0}function u(f,h,p,v){let y=f!==null?f.length:0,U=null;if(y!==0){if(U=l.value,v!==!0||U===null){let d=p+y*4,g=h.matrixWorldInverse;if(o.getNormalMatrix(g),U===null||U.length<d)U=new Float32Array(d);for(let m=0,x=p;m!==y;++m,x+=4)r.copy(f[m]).applyMatrix4(g,o),r.normal.toArray(U,x),U[x+3]=r.constant}l.value=U,l.needsUpdate=!0}return e.numPlanes=y,e.numIntersection=0,U}}function FR(t){let e=new WeakMap;function n(r,o){if(o===_f)r.mapping=Xo;else if(o===Tf)r.mapping=cr;return r}function i(r){if(r&&r.isTexture){let o=r.mapping;if(o===_f||o===Tf)if(e.has(r)){let l=e.get(r).texture;return n(l,r.mapping)}else{let l=r.image;if(l&&l.height>0){let c=new _U(l.height);return c.fromEquirectangularTexture(t,r),e.set(r,c),r.addEventListener("dispose",s),n(c.texture,r.mapping)}else return null}}return r}function s(r){let o=r.target;o.removeEventListener("dispose",s);let l=e.get(o);if(l!==void 0)e.delete(o),l.dispose()}function a(){e=new WeakMap}return{get:i,dispose:a}}var nl=4,GE=[0.125,0.215,0.35,0.446,0.526,0.582],yr=20,GU=new Xf,$E=new Xt,$U=null,JU=0,WU=0,YU=!1,vr=(1+Math.sqrt(5))/2,el=1/vr,JE=[new C(-vr,el,0),new C(vr,el,0),new C(-el,0,vr),new C(el,0,vr),new C(0,vr,-el),new C(0,vr,el),new C(-1,1,-1),new C(1,1,-1),new C(-1,1,1),new C(1,1,1)],NR=new C;class qU{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=0.1,i=100,s={}){let{size:a=256,position:r=NR}=s;$U=this._renderer.getRenderTarget(),JU=this._renderer.getActiveCubeFace(),WU=this._renderer.getActiveMipmapLevel(),YU=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();if(o.depthBuffer=!0,this._sceneToCubeUV(t,n,i,o,r),e>0)this._blur(o,0,0,e);return this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){if(this._cubemapMaterial===null)this._cubemapMaterial=QE(),this._compileMaterial(this._cubemapMaterial)}compileEquirectangularShader(){if(this._equirectMaterial===null)this._equirectMaterial=YE(),this._compileMaterial(this._equirectMaterial)}dispose(){if(this._dispose(),this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget($U,JU,WU),this._renderer.xr.enabled=YU,t.scissorTest=!1,Jf(t,0,0,t.width,t.height)}_fromTexture(t,e){if(t.mapping===Xo||t.mapping===cr)this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width);else this._setSize(t.image.width/4);$U=this._renderer.getRenderTarget(),JU=this._renderer.getActiveCubeFace(),WU=this._renderer.getActiveMipmapLevel(),YU=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:ur,minFilter:ur,generateMipmaps:!1,type:Cc,format:Qi,colorSpace:Pc,depthBuffer:!1},i=WE(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){if(this._pingPongRenderTarget!==null)this._dispose();this._pingPongRenderTarget=WE(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=BR(s)),this._blurMaterial=OR(s,t,e)}return i}_compileMaterial(t){