1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69831],{69831:(e,t,a)=>{a.r(t),a.d(t,{_ENVTextureLoader:()=>n});var o=a(99825),r=a(88354),l=a(34114);let i=!1;class n{constructor(){this.supportCascades=!1}loadCubeData(e,t,a,n,s){if(Array.isArray(e))return;let h=(0,o.cU)(e);if(h){t.width=h.width,t.height=h.width;try{i||(i=!0,l.t.prototype._sphericalPolynomialTargetSize=0,l.t.prototype.forceSphericalPolynomialsRecompute=function(){this._texture&&(this._texture._sphericalPolynomial=null,this._texture._sphericalPolynomialPromise=null,this._texture._sphericalPolynomialComputed=!1)},Object.defineProperty(l.t.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial||this._texture._sphericalPolynomialComputed)return this._texture._sphericalPolynomial;this._texture.isReady&&(this._texture._sphericalPolynomialPromise||(this._texture._sphericalPolynomialPromise=r.d.ConvertCubeMapTextureToSphericalPolynomial(this),null===this._texture._sphericalPolynomialPromise?this._texture._sphericalPolynomialComputed=!0:this._texture._sphericalPolynomialPromise.then(e=>{this._texture._sphericalPolynomial=e,this._texture._sphericalPolynomialComputed=!0})))}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})),(0,o.ow)(t,h),(0,o.o5)(t,e,h).then(()=>{t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()},e=>{s?.("Can not upload environment levels",e)})}catch(e){s?.("Can not upload environment file",e)}}else s&&s("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}},88354:(e,t,a)=>{a.d(t,{d:()=>h});var o=a(55758),r=a(34466),l=a(9468),i=a(72422),n=a(89200);class s{constructor(e,t,a,o){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=a,this.worldAxisForFileY=o}}class h{static _NearestPow2Floor(e){return e<=1?1:1<<Math.floor(Math.log2(e))}static ConvertCubeMapTextureToSphericalPolynomial(e){let t,a;if(!e.isCube)return null;e.getScene()?.getEngine().flushFramebuffer();let o=e.getSize().width,r=e._sphericalPolynomialTargetSize,l=r>0?this._NearestPow2Floor(r):0,i=!e.noMipmap&&e._texture?.generateMipMaps===!0,n=l>0&&l<o&&i,s=n?Math.max(0,Math.round(Math.log2(o/l))):0,h=n?Math.max(1,Math.floor(o/Math.pow(2,s))):o,c=e.readPixels(0,s,void 0,!1),m=e.readPixels(1,s,void 0,!1);e.isRenderTarget?(t=e.readPixels(3,s,void 0,!1),a=e.readPixels(2,s,void 0,!1)):(t=e.readPixels(2,s,void 0,!1),a=e.readPixels(3,s,void 0,!1));let p=e.readPixels(4,s,void 0,!1),u=e.readPixels(5,s,void 0,!1),_=e.gammaSpace,P=l>0&&l<o&&!n;return new Promise(e=>{Promise.all([m,c,t,a,p,u]).then(([t,a,r,i,n,s])=>{let c=h;P&&(t=this._DownsampleFace(t,o,l,4),a=this._DownsampleFace(a,o,l,4),r=this._DownsampleFace(r,o,l,4),i=this._DownsampleFace(i,o,l,4),n=this._DownsampleFace(n,o,l,4),s=this._DownsampleFace(s,o,l,4),c=l);let m={size:c,right:a,left:t,up:r,down:i,front:n,back:s,format:5,type:+(t instanceof Float32Array),gammaSpace:_};e(this.ConvertCubeMapToSphericalPolynomial(m))})})}static _AreaElement(e,t){return Math.atan2(e*t,Math.sqrt(e*e+t*t+1))}static _DownsampleFace(e,t,a,o){let r=e instanceof Float32Array?e:Float32Array.from(e),l=a*a*o,i=new Float32Array(l),n=t/a,s=1/(n*n);for(let e=0;e<a;e++){let l=Math.floor(e*n),h=Math.floor((e+1)*n);for(let c=0;c<a;c++){let m=Math.floor(c*n),p=Math.floor((c+1)*n),u=(e*a+c)*o;for(let e=0;e<o;e++){let a=0;for(let i=l;i<h;i++)for(let l=m;l<p;l++)a+=r[(i*t+l)*o+e];i[u+e]=a*s}}}if(e instanceof Float32Array)return i;let h=new e.constructor(l);for(let e=0;e<l;e++)h[e]=i[e]+.5|0;return h}static ConvertCubeMapToSphericalPolynomial(e,t=0){let a=t>0?this._NearestPow2Floor(t):0;if(a>0&&e.size>a){let t=5===e.format?4:3,o={};for(let r of["right","left","up","down","front","back"])o[r]=this._DownsampleFace(e[r],e.size,a,t);e={...e,...o,size:a}}let o=new l.O,s=0,h=2/e.size,c=.5*h,m=c-1;for(let t=0;t<6;t++){let a=this._FileFaces[t],l=e[a.name],p=m,u=5===e.format?4:3;for(let t=0;t<e.size;t++){let _=m;for(let m=0;m<e.size;
1m++){let P=a.worldAxisForFileX.scale(_).add(a.worldAxisForFileY.scale(p)).add(a.worldAxisForNormal);P.normalize();let d=this._AreaElement(_-c,p-c)-this._AreaElement(_-c,p+c)-this._AreaElement(_+c,p-c)+this._AreaElement(_+c,p+c),w=l[t*e.size*u+m*u+0],f=l[t*e.size*u+m*u+1],x=l[t*e.size*u+m*u+2];isNaN(w)&&(w=0),isNaN(f)&&(f=0),isNaN(x)&&(x=0),0===e.type&&(w/=255,f/=255,x/=255),e.gammaSpace&&(w=Math.pow((0,r.OQ)(w),i.tk),f=Math.pow((0,r.OQ)(f),i.tk),x=Math.pow((0,r.OQ)(x),i.tk));let y=this.MAX_HDRI_VALUE;if(this.PRESERVE_CLAMPED_COLORS){let e=Math.max(w,f,x);if(e>y){let t=y/e;w*=t,f*=t,x*=t}}else w=(0,r.OQ)(w,0,y),f=(0,r.OQ)(f,0,y),x=(0,r.OQ)(x,0,y);let F=new n.v9(w,f,x);o.addLight(P,F,d),s+=d,_+=h}p+=h}}let p=4*Math.PI*6/6/s;return o.scaleInPlace(p),o.convertIncidentRadianceToIrradiance(),o.convertIrradianceToLambertianRadiance(),l.Q.FromHarmonics(o)}}h._FileFaces=[new s("right",new o.Pq(1,0,0),new o.Pq(0,0,-1),new o.Pq(0,-1,0)),new s("left",new o.Pq(-1,0,0),new o.Pq(0,0,1),new o.Pq(0,-1,0)),new s("up",new o.Pq(0,1,0),new o.Pq(1,0,0),new o.Pq(0,0,1)),new s("down",new o.Pq(0,-1,0),new o.Pq(1,0,0),new o.Pq(0,0,-1)),new s("front",new o.Pq(0,0,1),new o.Pq(1,0,0),new o.Pq(0,-1,0)),new s("back",new o.Pq(0,0,-1),new o.Pq(-1,0,0),new o.Pq(0,-1,0))],h.MAX_HDRI_VALUE=4096,h.PRESERVE_CLAMPED_COLORS=!1}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.