@rings-webgpu/core 1.0.7 → 1.0.8

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.
@@ -40527,7 +40527,7 @@ class PostProcessingComponent extends ComponentBase {
40527
40527
  }
40528
40528
  }
40529
40529
 
40530
- const version = "1.0.7";
40530
+ const version = "1.0.8";
40531
40531
 
40532
40532
  class Engine3D {
40533
40533
  /**
package/dist/rings.umd.js CHANGED
@@ -7557,7 +7557,7 @@ $1\r
7557
7557
  `;class Gu{compute;constructor(){this.compute=new ue(Ou)}generateBRDFLUTTexture(){let e=new pe(256,256,X.rgba8unorm,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING);this.compute.setStorageTexture("brdflutTexture",e),this.compute.workerSizeX=256/8,this.compute.workerSizeY=256/8;let t=y.beginCommandEncoder();return y.computeCommand(t,[this.compute]),y.endCommandEncoder(t),e}}class Zi{id;guiTexture;uvRec=new K(0,0,1,1);uvBorder=new K(0,0,0,0);offsetSize=new K(0,0,4,4);borderSize=new K(0,0,0,0);trimSize=new j;isSliced=!1;height=4;width=4;xadvance=0;xoffset=0;yoffset=0;constructor(e){this.guiTexture=e||A.res.defaultGUITexture}}class ri{static _maxUid=-1;_staticId=-1;dynamicId=-1;texture;width=1;height=1;get staticId(){return this._staticId}constructor(e){e||=A.res.whiteTexture,e.addressModeU="clamp-to-edge",e.addressModeV="clamp-to-edge",this.texture=e,ri._maxUid++,this._staticId=ri._maxUid,this.init()}init(){this.dynamicId=-1,this.width=this.texture.width,this.height=this.texture.height}}class Hg{fntCache={};fntData={};addFontData(e,t,r){this.fntData[`${e}${t}`]=r}getFontData(e,t){return this.fntData[`${e}${t}`]}addFnt(e,t,r,i){let a=`${e}${t}`;this.fntCache[a]||(this.fntCache[a]={}),this.fntCache[a][r]=i}getFnt(e,t,r){let i=`${e}${t}`,a=this.fntCache[i];return a?a[r]:this.fntCache[" "]}}let Yi=new Hg;class zu{face="";size=0;bold=!1;italic=!1;stretchH=0;spacing="";outline=0;lineHeight=0;base=0;scaleW=0;scaleH=0;pages=0;packed=0;alphaChnl=0;redChnl=0;greenChnl=0;blueChnl=0;count=0;fontPage=[];fontChar={};constructor(){}}class Wu{id=0;file=""}class Ju{id=-1;x=0;y=0;width=0;height=0;xoffset=0;yoffset=0;xadvance=0;page=0;chnl=0}class Lr extends at{static format=Ge.TEXT;static parseSprite(e,t){for(const r in t.fontChar)if(Object.prototype.hasOwnProperty.call(t.fontChar,r)){const i=t.fontChar[r];let a=new Zi;a.id=i.id.toString(),a.offsetSize.set(0,0,i.width,i.height),a.trimSize.set(i.width,i.height),a.width=i.width,a.height=i.height,a.xadvance=i.xadvance,a.xoffset=i.xoffset,a.yoffset=i.yoffset,a.guiTexture=e[i.page],a.uvRec.set(i.x/t.scaleW,(t.scaleH-(i.y+i.height))/t.scaleH,i.width/t.scaleW,i.height/t.scaleH),Yi.addFnt(t.face,t.size,a.id,a)}}verification(){if(this.data)return!0;throw new Error("Method not implemented.")}async parseString(e){let t=this.getNewLine(e),r=e,i=new zu;r.trim().split(t).forEach((a,s)=>{if(s<2)Lr.readLineProperty(a,i);else if(s<i.pages+2){let o=new Wu;Lr.readLineProperty(a,o),i.fontPage.push(o)}else if(s<i.pages+3)Lr.readLineProperty(a,i);else if(i.count>0){let o=new Ju;Lr.readLineProperty(a,o),i.fontChar[o.id]=o,i.count--}}),r="",this.data=i,await this.loadFontTextures()}getNewLine(e){return e.indexOf(`\r
7558
7558
  `)!=-1?`\r
7559
7559
  `:e.indexOf("\r")!=-1?"\r":`
7560
- `}async loadFontTextures(){let e=[],t=this.data;for(const r of t.fontPage){let i=this.baseUrl+r.file;await A.res.loadTexture(i,null,!0);let a=A.res.getTexture(i),s=new ri(a);e.push(s)}Lr.parseSprite(e,t),t.fontChar[" "]||Lr.insertSpaceChar(t,e[0])}static insertSpaceChar(e,t){let r=new Zi,i=e.size*.5,a=e.lineHeight*.5;r.id=" ",r.offsetSize.set(0,0,e.size,e.size),r.trimSize.set(i,a),r.width=i,r.height=a,r.xadvance=0,r.xoffset=0,r.yoffset=0,r.guiTexture=t,r.uvRec.set(0,0,1e-6,1e-6),Yi.addFnt(e.face,e.size,r.id,r)}static readLineProperty(e,t){e.trim().split(" ").forEach((r,i)=>{let a=r.split("=");if(a.length>1){let s=a[0],o=a[1];Object.prototype.hasOwnProperty.call(t,s)&&(o.indexOf('"')==-1?t[s]=parseFloat(a[1]):t[s]=o.replace('"',"").replace('"',""))}})}}function jg(n,e){let t=new Zi;return t.id=n,t.offsetSize.set(0,0,e.width,e.height),t.trimSize.set(e.width,e.height),t.width=e.width,t.height=e.height,t.xadvance=0,t.xoffset=0,t.yoffset=0,t.guiTexture=new ri(e),t.uvRec.set(0,0,1,1),e.isVideoTexture||(e.flipY=!0),t}function Zu(n,e,t){let r=new Zi;r.guiTexture=n,r.id=e,r.uvRec.copyFrom(t.textureRect),r.trimSize.x=t.textureRect.z,r.trimSize.y=t.textureRect.w,r.offsetSize.x=t.textureRectOffset.x,r.offsetSize.y=t.textureRectOffset.y,r.offsetSize.z=t.size.x,r.offsetSize.w=t.size.y,r.width=t.size.x,r.height=t.size.y;let i=1/n.width,a=1/n.height;r.uvRec.set(r.uvRec.x*i,r.uvRec.y*a,r.uvRec.z*i,r.uvRec.w*a);let s=.1;return t.border.x<=s&&t.border.y<=s&&t.border.z<=s&&t.border.x<=s?r.isSliced=!1:(r.borderSize.copyFrom(t.border),r.uvBorder.copyFrom(t.border),r.uvBorder.x-=t.textureRectOffset.x,r.uvBorder.y-=t.textureRectOffset.y,r.uvBorder.z=t.border.z-(t.size.x-t.textureRect.z-t.textureRectOffset.x),r.uvBorder.w=t.border.w-(t.size.y-t.textureRect.w-t.textureRectOffset.y),r.uvBorder.x/=t.textureRect.z,r.uvBorder.z/=t.textureRect.z,r.uvBorder.y/=t.textureRect.w,r.uvBorder.w/=t.textureRect.w,r.isSliced=!0),r}class Yu{_spriteMap=new Map;_spriteList=[];textureSize=new j;name;constructor(e){this.textureSize.set(e.x,e.y)}setTexture(e,t,r){let i=Zu(e,t,r);return this._spriteMap.set(i.id,i),this._spriteList.push(i),i}getSprite(e){return this._spriteMap.get(e)}get spriteList(){return this._spriteList}}class Xu extends at{static format=Ge.TEXT;_json;_texture;async parseString(e){this._json=JSON.parse(e);let t=this.userData.replace(".json",".png");this._texture=await A.res.loadTexture(t,null,!0),this.data={json:this._json,texture:this._texture},this.parseAtlas()}verification(){if(this.data)return!0;throw new Error("verify failed.")}parseAtlas(){let e=new Yu(this._json.size),t=new ri(this._texture),r=this._json.atlas;for(const i in r)e.setTexture(t,i,r[i]);A.res.addAtlas(this.baseUrl,e),this.data=e}}var Vt=Uint8Array,Xi=Uint16Array,Kg=Int32Array,Hu=new Vt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ju=new Vt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),qg=new Vt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ku=function(n,e){for(var t=new Xi(31),r=0;r<31;++r)t[r]=e+=1<<n[r-1];for(var i=new Kg(t[30]),r=1;r<30;++r)for(var a=t[r];a<t[r+1];++a)i[a]=a-t[r]<<5|r;return{b:t,r:i}},qu=Ku(Hu,2),$u=qu.b,$g=qu.r;$u[28]=258,$g[258]=28;for(var em=Ku(ju,0),tm=em.b,Vn=new Xi(32768),Ee=0;Ee<32768;++Ee){var ii=(Ee&43690)>>1|(Ee&21845)<<1;ii=(ii&52428)>>2|(ii&13107)<<2,ii=(ii&61680)>>4|(ii&3855)<<4,Vn[Ee]=((ii&65280)>>8|(ii&255)<<8)>>1}for(var va=(function(n,e,t){for(var r=n.length,i=0,a=new Xi(e);i<r;++i)n[i]&&++a[n[i]-1];var s=new Xi(e);for(i=1;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;var o;if(t){o=new Xi(1<<e);var l=15-e;for(i=0;i<r;++i)if(n[i])for(var h=i<<4|n[i],u=e-n[i],f=s[n[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)o[Vn[f]>>l]=h}else for(o=new Xi(r),i=0;i<r;++i)n[i]&&(o[i]=Vn[s[n[i]-1]++]>>15-n[i]);return o}),Ca=new Vt(288),Ee=0;Ee<144;++Ee)Ca[Ee]=8;for(var Ee=144;Ee<256;++Ee)Ca[Ee]=9;for(var Ee=256;Ee<280;++Ee)Ca[Ee]=7;for(var Ee=280;Ee<288;++Ee)Ca[Ee]=8;for(var ec=new Vt(32),Ee=0;Ee<32;++Ee)ec[Ee]=5;var rm=va(Ca,9,1),im=va(ec,5,1),kn=function(n){for(var e=n[0],t=1;t<n.length;++t)n[t]>e&&(e=n[t]);return e},lr=function(n,e,t){var r=e/8|0;return(n[r]|n[r+1]<<8)>>(e&7)&t},Ln=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},am=function(n){return(n+7)/8|0},On=function(n,e,t){return(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length),new Vt(n.subarray(e,t))},sm=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xt=function(n,e,t){var r=new Error(e||sm[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Xt),!t)throw r;return r},nm=function(n,e,t,r){var i=n.length,a=r?r.length:0;if(!i||e.f&&!e.l)return t||new Vt(0);var s=!t,o=s||e.i!=2,l=e.i;s&&(t=new Vt(i*3));var h=function(wt){var Tt=t.length;if(wt>Tt){var Lt=new Vt(Math.max(Tt*2,wt));Lt.set(t),t=Lt}},u=e.f||0,f=e.p||0,d=e.b||0,m=e.l,p=e.d,U=e.m,B=e.n,v=i*8;do{if(!m){u=lr(n,f,1);var C=lr(n,f+1,3);if(f+=3,C)if(C==1)m=rm,p=im,U=9,B=5;else if(C==2){var b=lr(n,f,31)+257,R=lr(n,f+10,15)+4,T=b+lr(n,f+5,31)+1;f+=14;for(var Q=new Vt(T),w=new Vt(19),N=0;N<R;++N)w[qg[N]]=lr(n,f+N*3,7);f+=R*3;for(var O=kn(w),Z=(1<<O)-1,$=va(w,O,1),N=0;N<T;){var he=$[lr(n,f,Z)];f+=he&15;var x=he>>4;if(x<16)Q[N++]=x;else{var ee=0,fe=0;for(x==16?(fe=3+lr(n,f,3),f+=2,ee=Q[N-1]):x==17?(fe=3+lr(n,f,7),f+=3):x==18&&(fe=11+lr(n,f,127),f+=7);fe--;)Q[N++]=ee}}var ve=Q.subarray(0,b),te=Q.subarray(b);U=kn(ve),B=kn(te),m=va(ve,U,1),p=va(te,B,1)}else Xt(1);else{var x=am(f)+4,F=n[x-4]|n[x-3]<<8,_=x+F;if(_>i){l&&Xt(0);break}o&&h(d+F),t.set(n.subarray(x,_),d),e.b=d+=F,e.p=f=_*8,e.f=u;continue}if(f>v){l&&Xt(0);break}}o&&h(d+131072);for(var q=(1<<U)-1,ae=(1<<B)-1,Ae=f;;Ae=f){var ee=m[Ln(n,f)&q],Ce=ee>>4;if(f+=ee&15,f>v){l&&Xt(0);break}if(ee||Xt(2),Ce<256)t[d++]=Ce;else if(Ce==256){Ae=f,m=null;break}else{var Fe=Ce-254;if(Ce>264){var N=Ce-257,Me=Hu[N];Fe=lr(n,f,(1<<Me)-1)+$u[N],f+=Me}var Se=p[Ln(n,f)&ae],Pe=Se>>4;Se||Xt(3),f+=Se&15;var te=tm[Pe];if(Pe>3){var Me=ju[Pe];te+=Ln(n,f)&(1<<Me)-1,f+=Me}if(f>v){l&&Xt(0);break}o&&h(d+131072);var vt=d+Fe;if(d<te){var xr=a-te,_r=Math.min(te,vt);for(xr+d<0&&Xt(3);d<_r;++d)t[d]=r[xr+d]}for(;d<vt;++d)t[d]=t[d-te]}}e.l=m,e.p=Ae,e.b=d,e.f=u,m&&(u=1,e.m=U,e.d=p,e.n=B)}while(!u);return d!=t.length&&s?On(t,0,d):t.subarray(0,d)},om=new Vt(0),Ur=function(n,e){return n[e]|n[e+1]<<8},hr=function(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16|n[e+3]<<24)>>>0},Gn=function(n,e){return hr(n,e)+hr(n,e+4)*4294967296};function lm(n,e){return nm(n,{i:2},e&&e.out,e&&e.dictionary)}var zn=typeof TextDecoder<"u"&&new TextDecoder,hm=0;try{zn.decode(om,{stream:!0}),hm=1}catch{}var um=function(n){for(var e="",t=0;;){var r=n[t++],i=(r>127)+(r>223)+(r>239);if(t+i>n.length)return{s:e,r:On(n,t-1)};i?i==3?(r=((r&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,e+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?e+=String.fromCharCode((r&31)<<6|n[t++]&63):e+=String.fromCharCode((r&15)<<12|(n[t++]&63)<<6|n[t++]&63):e+=String.fromCharCode(r)}};function tc(n,e){if(e){for(var t="",r=0;r<n.length;r+=16384)t+=String.fromCharCode.apply(null,n.subarray(r,r+16384));return t}else{if(zn)return zn.decode(n);var i=um(n),a=i.s,t=i.r;return t.length&&Xt(8),a}}var cm=function(n,e){return e+30+Ur(n,e+26)+Ur(n,e+28)},fm=function(n,e,t){var r=Ur(n,e+28),i=tc(n.subarray(e+46,e+46+r),!(Ur(n,e+8)&2048)),a=e+46+r,s=hr(n,e+20),o=t&&s==4294967295?dm(n,a):[s,hr(n,e+24),hr(n,e+42)],l=o[0],h=o[1],u=o[2];return[Ur(n,e+10),l,h,i,a+Ur(n,e+30)+Ur(n,e+32),u]},dm=function(n,e){for(;Ur(n,e)!=1;e+=4+Ur(n,e+2));return[Gn(n,e+12),Gn(n,e+4),Gn(n,e+20)]};function gm(n,e){for(var t={},r=n.length-22;hr(n,r)!=101010256;--r)(!r||n.length-r>65558)&&Xt(13);var i=Ur(n,r+8);if(!i)return{};var a=hr(n,r+16),s=a==4294967295||i==65535;if(s){var o=hr(n,r-12);s=hr(n,o)==101075792,s&&(i=hr(n,o+32),a=hr(n,o+48))}for(var l=0;l<i;++l){var h=fm(n,a,s),u=h[0],f=h[1],d=h[2],m=h[3],p=h[4],U=h[5],B=cm(n,U);a=p,u?u==8?t[m]=lm(n.subarray(B,B+f),{out:new Vt(d)}):Xt(14,"unknown compression type "+u):t[m]=On(n,B,B+f)}return t}class _t extends St{constructor(){super(),this.shader=new c.UnLitShader,this.baseMap=A.res.whiteTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}class Si extends De{shape_vertices=[];shape_indices=[];radius;widthSegments;heightSegments;phiStart;phiLength;thetaStart;thetaLength;constructor(e,t,r,i,a,s,o){super(),this.radius=e,this.widthSegments=t,this.heightSegments=r,this.phiStart=i,this.phiLength=a,this.thetaStart=s,this.thetaLength=o,this.buildGeometry()}buildGeometry(){var e,t,r=0;let i=this.heightSegments,a=this.widthSegments,s=this.radius;var o=(i+1)*(a+1);let l=new Float32Array(o*3),h=new Float32Array(o*3),u=new Float32Array(o*2),f=new Uint16Array(a*i*2*3),d=0,m=0,p=0;for(t=0;t<=i;++t){var U=Math.PI*t/i,B=s*Math.cos(U),v=s*Math.sin(U);for(e=0;e<=a;++e){var C=2*Math.PI*e/a,x=v*Math.cos(C),F=v*Math.sin(C),_=1/Math.sqrt(x*x+B*B+F*F);if(l[d++]=x,l[d++]=B,l[d++]=F,h[m++]=x*_,h[m++]=B*_,h[m++]=F*_,u[p++]=e/a,u[p++]=t/i,e>0&&t>0){var b=(a+1)*t+e,R=(a+1)*t+e-1,T=(a+1)*(t-1)+e-1,Q=(a+1)*(t-1)+e;t==i?(f[r++]=b,f[r++]=T,f[r++]=Q):t==1?(f[r++]=b,f[r++]=R,f[r++]=T):(f[r++]=b,f[r++]=R,f[r++]=T,f[r++]=b,f[r++]=T,f[r++]=Q)}}}this.setIndices(f),this.setAttribute(V.position,l),this.setAttribute(V.normal,h),this.setAttribute(V.uv,u),this.setAttribute(V.TEXCOORD_1,u),this.addSubGeometry({indexStart:0,indexCount:f.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0}),this.bounds=new be(g.ZERO,new g(this.radius*2,this.radius*2,this.radius*2))}}class Sa extends c.Object3D{static register3DRepresentation=null;positionIndex=-1;positionValid=!1;marker;constructor(e){super(),this.parsePlacemark(e),this.setup3DRepresentation()}parsePlacemark(e){if(!e.slamPositionInfo){console.warn("WayPoint3D: slamPositionInfo is not found");return}const t=e.slamPositionInfo.slamPosition.split(",").map(Number);this.localPosition=new g(t[0],t[1],t[2]),this.positionIndex=Number(e.slamPositionInfo.slamPositionIndex),this.positionValid=e.slamPositionInfo.slamPositionValid==="1"}setup3DRepresentation(){if(this.marker&&(this.removeChild(this.marker),this.marker=null),Sa.register3DRepresentation)this.marker=Sa.register3DRepresentation(this),this.marker&&this.addChild(this.marker);else{this.marker=new c.Object3D;const e=this.marker.addComponent(c.MeshRenderer);e.geometry=new Si(.1,32,16),e.material=new nr,e.material.baseColor=this.positionValid?new k(0,1,0,1):new k(1,0,0,1),this.addChild(this.marker),this.marker.name="WayPoint3DMarker"}}}class xa extends c.Object3D{static register3DRepresentation=null;line;constructor(e){super(),this.parseWayLineFile(e),this.setup3DRepresentation()}parseWayLineFile(e){for(const t of e.Folder.Placemark){const r=new Sa(t);this.addChild(r)}this.entityChildren=this.entityChildren.sort((t,r)=>t.positionIndex-r.positionIndex)}setup3DRepresentation(){this.line&&(this.removeChild(this.line),this.line=null),xa.register3DRepresentation?(this.line=xa.register3DRepresentation(this),this.line&&this.addChild(this.line)):(this.line=this.createMultiLine(this.entityChildren.map(e=>e.localPosition),new k(1,1,1,1)),this.addChild(this.line),this.line.name="WayLines3DLine")}createMultiLine(e,t){if(e.length<2)return null;const r=new De,i=new Float32Array(e.length*3);for(let h=0;h<e.length;h++)i[h*3]=e[h].x,i[h*3+1]=e[h].y,i[h*3+2]=e[h].z;const a=new Uint16Array((e.length-1)*2);for(let h=0;h<e.length-1;h++)a[h*2]=h,a[h*2+1]=h+1;r.setIndices(a),r.setAttribute(V.position,i),r.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});const s=new c.Object3D,o=s.addComponent(c.MeshRenderer),l=new _t;return l.topology="line-list",l.baseColor=t,l.blendMode=se.ADD,l.castReflection=!1,o.geometry=r,o.material=l,s}}class rc extends at{static format=Ge.BIN;parseBuffer(e){try{const t={template:null,waylines:null},r=gm(new Uint8Array(e));for(const a in r){const s=r[a],l=new DOMParser().parseFromString(tc(s),"application/xml"),h={};this.parseNode(l,h);const u=a.replace("wpmz/","").split(".")[0];Object.assign(t,{[u]:h["#document"].kml.Document})}const i=new xa(t.waylines);this.data=i}catch(t){this.parserError(`KMZ parsing failed: ${t}`,-1)}}parseNode(e,t){const r=["Placemark","actionGroup","action"],i=e.nodeName.replace("wpml:","");if(!e.childNodes.length)t[i]=void 0;else{let a=null,s=!1;for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];if(l.nodeType==Node.TEXT_NODE){const h=l.nodeValue?.trim();h&&h.length>0&&(a=h)}else l.nodeType==Node.ELEMENT_NODE&&(s=!0)}if(a&&!s)t[i]=a;else if(s){r.includes(i)?t[i]?.length?t[i].push({}):t[i]=[{}]:t[i]={};for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];l.nodeType==Node.ELEMENT_NODE&&this.parseNode(l,Array.isArray(t[i])?t[i].at(-1):t[i])}}else t[i]=void 0}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class ic{_texturePool;_materialPool;_prefabPool;_gltfPool;_geometryPool;_atlasList;_obj;constructor(){this._texturePool=new Map,this._materialPool=new Map,this._prefabPool=new Map,this._geometryPool=new Map,this._gltfPool=new Map,this._atlasList=new Map,this._obj=new Map}getGltf(e){return this._gltfPool.get(e)}addObj(e,t){this._obj.set(e,t)}getObj(e){return this._obj.get(e)}addTexture(e,t){this._texturePool.set(e,t)}getTexture(e){return this._texturePool.get(e)}addGeometry(e,t){this._geometryPool.set(e,t)}getGeometry(e){return this._geometryPool.get(e)}addMat(e,t){return this._materialPool.set(e,t)}getMat(e){return this._materialPool.get(e)}addPrefab(e,t){this._prefabPool.set(e,t)}getPrefab(e){return this._prefabPool.get(e).instantiate()}addAtlas(e,t){t.name=e,this._atlasList.set(e,t)}getAtlas(e){return this._atlasList.get(e)}getGUISprite(e){for(let t of this._atlasList.values()){let r=t.getSprite(e);if(r)return r}return null}async load(e,t,r){return(await new pt().load(e,t,r)).data}async loadGltf(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let r,i=e.substring(e.lastIndexOf(".")).toLowerCase(),a=new pt;i==".gltf"?r=await a.load(e,At,t):r=await a.load(e,bn,t);let s=r.data;return this._prefabPool.set(e,s),this._gltfPool.set(e,r.gltf),s}async loadObj(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let r,i=e.substring(e.lastIndexOf(".")).toLowerCase(),a=new pt;i==".obj"&&(r=await a.load(e,Su,t));let s=r.data;return this._prefabPool.set(e,s),s}async loadB3DM(e,t,r){if(this._prefabPool.has(e))return this._prefabPool.get(e);let s=(await new pt().load(e,Du,t,r)).data;return this._prefabPool.set(e,s),s}async loadI3DM(e,t,r){if(this._prefabPool.has(e))return this._prefabPool.get(e);let s=(await new pt().load(e,Lu,t,r)).data;return this._prefabPool.set(e,s),s}async loadTexture(e,t,r){if(this._texturePool.has(e))return this._texturePool.get(e);let i=new Vr;return i.flipY=r,await i.load(e,t),this._texturePool.set(e,i),i}async loadTextureCount(e,t,r,i){return new Promise(async(a,s)=>{let o=0,l=[];t==0&&a(l);for(let h=0;h<t;h++){const u=e.shift();this.loadTexture(u,r,i).then(f=>{l.push(f),o++,o==t&&a(l)})}})}async loadBitmapTextures(e,t=5,r,i){let a=[],s=Math.floor(e.length/t)+1,o=Math.floor(e.length%t);for(let l=0;l<s;l++){let h=await this.loadTextureCount(e,l==s-1?o:t,r,i);a.push(...h)}return a}async loadHDRTexture(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new In;return r=await r.load(e,t),this._texturePool.set(e,r),r}async loadHDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new hs;return r=await r.load(e,t),this._texturePool.set(e,r),r}async loadLDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new cs;return r=await r.load(e,t),this._texturePool.set(e,r),r}async loadTextureCubeMaps(e){let t=e[0];if(this._texturePool.has(t))return this._texturePool.get(t);let r=new Rn;return await r.load(e),this._texturePool.set(e[0],r),r}async loadTextureCubeStd(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new Rn;return await r.loadStd(e),r}async loadJSON(e,t){return await new pt().loadJson(e,t).then(async r=>r).catch(r=>{console.log(r)})}async loadFont(e,t,r){let a=await new pt().load(e,Lr,t,r),s=a.data;return Yi.addFontData(s.face,s.size,s),a.data}async loadAtlas(e,t){return(await new pt().load(e,Xu,t,e)).data}async loadKMZ(e,t){return(await new pt().load(e,rc,t)).data}normalTexture;maskTexture;whiteTexture;blackTexture;redTexture;blueTexture;greenTexture;yellowTexture;grayTexture;defaultSky;defaultGUITexture;defaultGUISprite;defaultMaterial;createTexture(e,t,r,i,a,s,o){let l=32,h=32,u=new Uint8Array(l*h*4);this.fillColor(u,e,t,r,i,a,s);let f=new rn;return f.name=o,f.create(16,16,u,!0),o&&this.addTexture(o,f),f}fillColor(e,t,r,i,a,s,o){for(let l=0;l<t;l++)for(let h=0;h<r;h++){let u=h*t+l;e[u*4+0]=i,e[u*4+1]=a,e[u*4+2]=s,e[u*4+3]=o}}initDefault(){this.normalTexture=this.createTexture(32,32,255*.5,255*.5,255,255,"default-normalTexture"),this.maskTexture=this.createTexture(32,32,255,255*.5,255,255,"default-maskTexture"),this.whiteTexture=this.createTexture(32,32,255,255,255,255,"default-whiteTexture"),this.blackTexture=this.createTexture(32,32,0,0,0,255,"default-blackTexture"),this.redTexture=this.createTexture(32,32,255,0,0,255,"default-redTexture"),this.blueTexture=this.createTexture(32,32,0,0,255,255,"default-blueTexture"),this.greenTexture=this.createTexture(32,32,0,255,0,255,"default-greenTexture"),this.yellowTexture=this.createTexture(32,32,0,255,255,255,"default-yellowTexture"),this.grayTexture=this.createTexture(32,32,128,128,128,255,"default-grayTexture");let t=new Gu().generateBRDFLUTTexture(),r=t.name="BRDFLUT";this.addTexture(r,t),this.defaultSky=new hs,this.defaultSky.createFromTexture(128,this.blackTexture),me.getInstance().attached(this.defaultSky,this),me.getInstance().attached(t,this),me.getInstance().attached(this.normalTexture,this),me.getInstance().attached(this.maskTexture,this),me.getInstance().attached(this.whiteTexture,this),me.getInstance().attached(this.blackTexture,this),me.getInstance().attached(this.redTexture,this),me.getInstance().attached(this.blueTexture,this),me.getInstance().attached(this.greenTexture,this),me.getInstance().attached(this.yellowTexture,this),me.getInstance().attached(this.grayTexture,this),this.defaultGUITexture=new ri(this.whiteTexture),this.defaultGUISprite=new Zi(this.defaultGUITexture),this.defaultGUISprite.trimSize.set(4,4),this.defaultMaterial=new nr}}class ac extends Ne{_postList;init(e){this._postList=new Map}start(){}stop(){}onEnable(){this.activePost()}onDisable(){this.unActivePost()}activePost(){let e=this.transform.view3D,t=A.getRenderJob(e);this._postList.forEach(r=>{t.addPost(r)})}unActivePost(){let e=this.transform.view3D,t=A.getRenderJob(e);this._postList.forEach(r=>{t.removePost(r)})}addPost(e){if(this._postList.has(e))return;let t=new e;return this._postList.set(e,t),this._enable&&this.activePost(),t}removePost(e){if(!this._postList.has(e))return;let t=this._postList.get(e);this._postList.delete(e);let r=this.transform.view3D;A.getRenderJob(r).removePost(t)}getPost(e){return this._postList.has(e)?this._postList.get(e):null}}const mm="1.0.7";class A{static res;static inputSystem;static views;static _frameRateValue=0;static _frameRate=360;static _time=0;static _beforeRender;static _renderLoop;static _lateRender;static _requestAnimationFrameID=0;static get frameRate(){return this._frameRate}static set frameRate(e){this._frameRate=e,this._frameRateValue=1e3/e,e>=360&&(this._frameRateValue=0)}static get size(){return I.presentationSize}static get aspect(){return I.aspect}static get width(){return I.windowWidth}static get height(){return I.windowHeight}static setting={doublePrecision:!1,occlusionQuery:{enable:!0,debug:!1},pick:{enable:!0,mode:"bound",detail:"mesh"},render:{debug:!1,renderPassState:4,renderState_left:5,renderState_right:5,renderState_split:.5,quadScale:1,hdrExposure:1.5,debugQuad:-1,maxPointLight:1e3,maxDirectLight:4,maxSportLight:1e3,drawOpMin:0,drawOpMax:Number.MAX_SAFE_INTEGER,drawTrMin:0,drawTrMax:Number.MAX_SAFE_INTEGER,zPrePass:!1,useLogDepth:!1,useCompressGBuffer:!1,gi:!1,postProcessing:{bloom:{downSampleStep:3,downSampleBlurSize:9,downSampleBlurSigma:1,upSampleBlurSize:9,upSampleBlurSigma:1,luminanceThreshole:1,bloomIntensity:1,hdr:1},globalFog:{debug:!1,enable:!1,fogType:0,fogHeightScale:.1,start:400,end:10,density:.02,ins:.5,skyFactor:.5,skyRoughness:.4,overrideSkyFactor:.8,fogColor:new k(96/255,117/255,133/255,1),falloff:.7,rayLength:200,scatteringExponent:2.7,dirHeightLine:10},godRay:{blendColor:!0,rayMarchCount:16,scatteringExponent:5,intensity:.5},ssao:{enable:!1,radius:.15,bias:-.1,aoPower:2,debug:!0},outline:{enable:!1,strength:1,groupCount:4,outlinePixel:2,fadeOutlinePixel:4,textureScale:1,useAddMode:!1,debug:!0},taa:{enable:!1,jitterSeedCount:8,blendFactor:.1,sharpFactor:.6,sharpPreBlurFactor:.5,temporalJitterScale:.13,debug:!0},gtao:{enable:!1,darkFactor:1,maxDistance:5,maxPixel:50,rayMarchSegment:6,multiBounce:!1,usePosFloat32:!0,blendColor:!0,debug:!0},ssr:{enable:!1,pixelRatio:1,fadeEdgeRatio:.2,rayMarchRatio:.5,fadeDistanceMin:600,fadeDistanceMax:2e3,roughnessThreshold:.5,powDotRN:.2,mixThreshold:.1,debug:!0},fxaa:{enable:!1},depthOfView:{enable:!1,iterationCount:3,pixelOffset:1,near:150,far:300}}},shadow:{enable:!0,type:"HARD",pointShadowBias:5e-4,shadowSize:2048,pointShadowSize:1024,shadowSoft:.005,shadowBound:100,shadowBias:.05,needUpdate:!0,autoUpdate:!0,updateFrameRate:2,csmMargin:.1,csmScatteringExp:.7,csmAreaScale:.4,debug:!1},gi:{enable:!1,offsetX:0,offsetY:0,offsetZ:0,probeSpace:64,probeXCount:4,probeYCount:2,probeZCount:4,probeSize:32,probeSourceTextureSize:2048,octRTMaxSize:2048,octRTSideSize:16,maxDistance:64*1.73,normalBias:.25,depthSharpness:1,hysteresis:.98,lerpHysteresis:.01,irradianceChebyshevBias:.01,rayNumber:144,irradianceDistanceBias:32,indirectIntensity:1,ddgiGamma:2.2,bounceIntensity:.025,probeRoughness:1,realTimeGI:!1,debug:!1,autoRenderProbe:!1},sky:{type:"HDRSKY",sky:null,skyExposure:1,defaultFar:65536,defaultNear:1},light:{maxLight:4096},material:{materialChannelDebug:!1,materialDebug:!1},loader:{numConcurrent:20},reflectionSetting:{reflectionProbeMaxCount:8,reflectionProbeSize:256,width:256*6,height:8*256,enable:!0}};static renderJobs;static async init(e={}){console.log("Rings Version",mm),window.isSecureContext||console.warn("WebGPU is only supported in secure contexts (HTTPS or localhost)"),this.setting={...this.setting,...e.engineSetting},await ge.init(E.allocCount,this.setting.doublePrecision),await I.init(e.canvasConfig),this.setting.reflectionSetting.width=this.setting.reflectionSetting.reflectionProbeSize*6,this.setting.reflectionSetting.height=this.setting.reflectionSetting.reflectionProbeSize*this.setting.reflectionSetting.reflectionProbeMaxCount,ne.getGBufferFrame(ne.reflections_GBuffer,this.setting.reflectionSetting.width,this.setting.reflectionSetting.height,!1),z.init(),Nr.init(),oe.init(),gt.init(),Qt.init(),this.res=new ic,this.res.initDefault(),this._beforeRender=e.beforeRender,this._renderLoop=e.renderLoop,this._lateRender=e.lateRender,this.inputSystem=new vo,this.inputSystem.initCanvas(I.canvas)}static startRenderJob(e){let t=new $h(e);return this.renderJobs.set(e,t),this.setting.pick.mode=="pixel"&&e.scene.getOrAddComponent(ac).addPost(dn),(this.setting.pick.mode=="pixel"||this.setting.pick.mode=="bound")&&(e.enablePick=!0),t}static startRenderView(e){this.renderJobs||=new Map,this.views=[e];let t=this.startRenderJob(e);return this.resume(),t}static startRenderViews(e){this.renderJobs||=new Map,this.views=e;for(let t=0;t<e.length;t++)this.startRenderJob(e[t]);this.resume()}static getRenderJob(e){return this.renderJobs.get(e)}static pause(){this._requestAnimationFrameID!==0&&(cancelAnimationFrame(this._requestAnimationFrameID),this._requestAnimationFrameID=0)}static resume(){this._requestAnimationFrameID===0&&(this._requestAnimationFrameID=requestAnimationFrame(e=>this.render(e)))}static async render(e){if(this._frameRateValue>0){let t=e-this._time;if(t<this._frameRateValue){let r=performance.now();await new Promise(i=>{setTimeout(()=>{e+=performance.now()-r,i(!0)},this._frameRateValue-t)})}this._time=e}await this.updateFrame(e),this._requestAnimationFrameID=0,this.resume()}static async updateFrame(e){ye.delta=e-ye.time,ye.time=e,ye.frame+=1,ti.tick(ye.delta);let t=this.views,r=0;for(r=0;r<t.length;r++){const s=t[r];s.scene.waitUpdate();let[o,l]=I.presentationSize;s.camera.viewPort.setTo(0,0,o,l)}this._beforeRender&&await this._beforeRender();for(const s of xe.componentsBeforeUpdateList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o)}}let i=I.device.createCommandEncoder();for(const s of xe.componentsComputeList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o,i)}}I.device.queue.submit([i.finish()]);for(const s of xe.componentsUpdateList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o)}}for(const s of xe.graphicComponent){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];o&&u.enable&&f(o)}}this._renderLoop&&await this._renderLoop(),ge.updateAllContinueTransform(0,E.useCount,16),oe.modelMatrixBindGroup.writeBuffer(E.useCount*16),this.renderJobs.forEach((s,o)=>{s.renderState||s.start(),s.renderFrame()});for(const s of xe.componentsLateUpdateList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o)}}this._lateRender&&await this._lateRender()}}let fs=`
7560
+ `}async loadFontTextures(){let e=[],t=this.data;for(const r of t.fontPage){let i=this.baseUrl+r.file;await A.res.loadTexture(i,null,!0);let a=A.res.getTexture(i),s=new ri(a);e.push(s)}Lr.parseSprite(e,t),t.fontChar[" "]||Lr.insertSpaceChar(t,e[0])}static insertSpaceChar(e,t){let r=new Zi,i=e.size*.5,a=e.lineHeight*.5;r.id=" ",r.offsetSize.set(0,0,e.size,e.size),r.trimSize.set(i,a),r.width=i,r.height=a,r.xadvance=0,r.xoffset=0,r.yoffset=0,r.guiTexture=t,r.uvRec.set(0,0,1e-6,1e-6),Yi.addFnt(e.face,e.size,r.id,r)}static readLineProperty(e,t){e.trim().split(" ").forEach((r,i)=>{let a=r.split("=");if(a.length>1){let s=a[0],o=a[1];Object.prototype.hasOwnProperty.call(t,s)&&(o.indexOf('"')==-1?t[s]=parseFloat(a[1]):t[s]=o.replace('"',"").replace('"',""))}})}}function jg(n,e){let t=new Zi;return t.id=n,t.offsetSize.set(0,0,e.width,e.height),t.trimSize.set(e.width,e.height),t.width=e.width,t.height=e.height,t.xadvance=0,t.xoffset=0,t.yoffset=0,t.guiTexture=new ri(e),t.uvRec.set(0,0,1,1),e.isVideoTexture||(e.flipY=!0),t}function Zu(n,e,t){let r=new Zi;r.guiTexture=n,r.id=e,r.uvRec.copyFrom(t.textureRect),r.trimSize.x=t.textureRect.z,r.trimSize.y=t.textureRect.w,r.offsetSize.x=t.textureRectOffset.x,r.offsetSize.y=t.textureRectOffset.y,r.offsetSize.z=t.size.x,r.offsetSize.w=t.size.y,r.width=t.size.x,r.height=t.size.y;let i=1/n.width,a=1/n.height;r.uvRec.set(r.uvRec.x*i,r.uvRec.y*a,r.uvRec.z*i,r.uvRec.w*a);let s=.1;return t.border.x<=s&&t.border.y<=s&&t.border.z<=s&&t.border.x<=s?r.isSliced=!1:(r.borderSize.copyFrom(t.border),r.uvBorder.copyFrom(t.border),r.uvBorder.x-=t.textureRectOffset.x,r.uvBorder.y-=t.textureRectOffset.y,r.uvBorder.z=t.border.z-(t.size.x-t.textureRect.z-t.textureRectOffset.x),r.uvBorder.w=t.border.w-(t.size.y-t.textureRect.w-t.textureRectOffset.y),r.uvBorder.x/=t.textureRect.z,r.uvBorder.z/=t.textureRect.z,r.uvBorder.y/=t.textureRect.w,r.uvBorder.w/=t.textureRect.w,r.isSliced=!0),r}class Yu{_spriteMap=new Map;_spriteList=[];textureSize=new j;name;constructor(e){this.textureSize.set(e.x,e.y)}setTexture(e,t,r){let i=Zu(e,t,r);return this._spriteMap.set(i.id,i),this._spriteList.push(i),i}getSprite(e){return this._spriteMap.get(e)}get spriteList(){return this._spriteList}}class Xu extends at{static format=Ge.TEXT;_json;_texture;async parseString(e){this._json=JSON.parse(e);let t=this.userData.replace(".json",".png");this._texture=await A.res.loadTexture(t,null,!0),this.data={json:this._json,texture:this._texture},this.parseAtlas()}verification(){if(this.data)return!0;throw new Error("verify failed.")}parseAtlas(){let e=new Yu(this._json.size),t=new ri(this._texture),r=this._json.atlas;for(const i in r)e.setTexture(t,i,r[i]);A.res.addAtlas(this.baseUrl,e),this.data=e}}var Vt=Uint8Array,Xi=Uint16Array,Kg=Int32Array,Hu=new Vt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ju=new Vt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),qg=new Vt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ku=function(n,e){for(var t=new Xi(31),r=0;r<31;++r)t[r]=e+=1<<n[r-1];for(var i=new Kg(t[30]),r=1;r<30;++r)for(var a=t[r];a<t[r+1];++a)i[a]=a-t[r]<<5|r;return{b:t,r:i}},qu=Ku(Hu,2),$u=qu.b,$g=qu.r;$u[28]=258,$g[258]=28;for(var em=Ku(ju,0),tm=em.b,Vn=new Xi(32768),Ee=0;Ee<32768;++Ee){var ii=(Ee&43690)>>1|(Ee&21845)<<1;ii=(ii&52428)>>2|(ii&13107)<<2,ii=(ii&61680)>>4|(ii&3855)<<4,Vn[Ee]=((ii&65280)>>8|(ii&255)<<8)>>1}for(var va=(function(n,e,t){for(var r=n.length,i=0,a=new Xi(e);i<r;++i)n[i]&&++a[n[i]-1];var s=new Xi(e);for(i=1;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;var o;if(t){o=new Xi(1<<e);var l=15-e;for(i=0;i<r;++i)if(n[i])for(var h=i<<4|n[i],u=e-n[i],f=s[n[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)o[Vn[f]>>l]=h}else for(o=new Xi(r),i=0;i<r;++i)n[i]&&(o[i]=Vn[s[n[i]-1]++]>>15-n[i]);return o}),Ca=new Vt(288),Ee=0;Ee<144;++Ee)Ca[Ee]=8;for(var Ee=144;Ee<256;++Ee)Ca[Ee]=9;for(var Ee=256;Ee<280;++Ee)Ca[Ee]=7;for(var Ee=280;Ee<288;++Ee)Ca[Ee]=8;for(var ec=new Vt(32),Ee=0;Ee<32;++Ee)ec[Ee]=5;var rm=va(Ca,9,1),im=va(ec,5,1),kn=function(n){for(var e=n[0],t=1;t<n.length;++t)n[t]>e&&(e=n[t]);return e},lr=function(n,e,t){var r=e/8|0;return(n[r]|n[r+1]<<8)>>(e&7)&t},Ln=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},am=function(n){return(n+7)/8|0},On=function(n,e,t){return(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length),new Vt(n.subarray(e,t))},sm=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xt=function(n,e,t){var r=new Error(e||sm[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Xt),!t)throw r;return r},nm=function(n,e,t,r){var i=n.length,a=r?r.length:0;if(!i||e.f&&!e.l)return t||new Vt(0);var s=!t,o=s||e.i!=2,l=e.i;s&&(t=new Vt(i*3));var h=function(wt){var Tt=t.length;if(wt>Tt){var Lt=new Vt(Math.max(Tt*2,wt));Lt.set(t),t=Lt}},u=e.f||0,f=e.p||0,d=e.b||0,m=e.l,p=e.d,U=e.m,B=e.n,v=i*8;do{if(!m){u=lr(n,f,1);var C=lr(n,f+1,3);if(f+=3,C)if(C==1)m=rm,p=im,U=9,B=5;else if(C==2){var b=lr(n,f,31)+257,R=lr(n,f+10,15)+4,T=b+lr(n,f+5,31)+1;f+=14;for(var Q=new Vt(T),w=new Vt(19),N=0;N<R;++N)w[qg[N]]=lr(n,f+N*3,7);f+=R*3;for(var O=kn(w),Z=(1<<O)-1,$=va(w,O,1),N=0;N<T;){var he=$[lr(n,f,Z)];f+=he&15;var x=he>>4;if(x<16)Q[N++]=x;else{var ee=0,fe=0;for(x==16?(fe=3+lr(n,f,3),f+=2,ee=Q[N-1]):x==17?(fe=3+lr(n,f,7),f+=3):x==18&&(fe=11+lr(n,f,127),f+=7);fe--;)Q[N++]=ee}}var ve=Q.subarray(0,b),te=Q.subarray(b);U=kn(ve),B=kn(te),m=va(ve,U,1),p=va(te,B,1)}else Xt(1);else{var x=am(f)+4,F=n[x-4]|n[x-3]<<8,_=x+F;if(_>i){l&&Xt(0);break}o&&h(d+F),t.set(n.subarray(x,_),d),e.b=d+=F,e.p=f=_*8,e.f=u;continue}if(f>v){l&&Xt(0);break}}o&&h(d+131072);for(var q=(1<<U)-1,ae=(1<<B)-1,Ae=f;;Ae=f){var ee=m[Ln(n,f)&q],Ce=ee>>4;if(f+=ee&15,f>v){l&&Xt(0);break}if(ee||Xt(2),Ce<256)t[d++]=Ce;else if(Ce==256){Ae=f,m=null;break}else{var Fe=Ce-254;if(Ce>264){var N=Ce-257,Me=Hu[N];Fe=lr(n,f,(1<<Me)-1)+$u[N],f+=Me}var Se=p[Ln(n,f)&ae],Pe=Se>>4;Se||Xt(3),f+=Se&15;var te=tm[Pe];if(Pe>3){var Me=ju[Pe];te+=Ln(n,f)&(1<<Me)-1,f+=Me}if(f>v){l&&Xt(0);break}o&&h(d+131072);var vt=d+Fe;if(d<te){var xr=a-te,_r=Math.min(te,vt);for(xr+d<0&&Xt(3);d<_r;++d)t[d]=r[xr+d]}for(;d<vt;++d)t[d]=t[d-te]}}e.l=m,e.p=Ae,e.b=d,e.f=u,m&&(u=1,e.m=U,e.d=p,e.n=B)}while(!u);return d!=t.length&&s?On(t,0,d):t.subarray(0,d)},om=new Vt(0),Ur=function(n,e){return n[e]|n[e+1]<<8},hr=function(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16|n[e+3]<<24)>>>0},Gn=function(n,e){return hr(n,e)+hr(n,e+4)*4294967296};function lm(n,e){return nm(n,{i:2},e&&e.out,e&&e.dictionary)}var zn=typeof TextDecoder<"u"&&new TextDecoder,hm=0;try{zn.decode(om,{stream:!0}),hm=1}catch{}var um=function(n){for(var e="",t=0;;){var r=n[t++],i=(r>127)+(r>223)+(r>239);if(t+i>n.length)return{s:e,r:On(n,t-1)};i?i==3?(r=((r&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,e+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?e+=String.fromCharCode((r&31)<<6|n[t++]&63):e+=String.fromCharCode((r&15)<<12|(n[t++]&63)<<6|n[t++]&63):e+=String.fromCharCode(r)}};function tc(n,e){if(e){for(var t="",r=0;r<n.length;r+=16384)t+=String.fromCharCode.apply(null,n.subarray(r,r+16384));return t}else{if(zn)return zn.decode(n);var i=um(n),a=i.s,t=i.r;return t.length&&Xt(8),a}}var cm=function(n,e){return e+30+Ur(n,e+26)+Ur(n,e+28)},fm=function(n,e,t){var r=Ur(n,e+28),i=tc(n.subarray(e+46,e+46+r),!(Ur(n,e+8)&2048)),a=e+46+r,s=hr(n,e+20),o=t&&s==4294967295?dm(n,a):[s,hr(n,e+24),hr(n,e+42)],l=o[0],h=o[1],u=o[2];return[Ur(n,e+10),l,h,i,a+Ur(n,e+30)+Ur(n,e+32),u]},dm=function(n,e){for(;Ur(n,e)!=1;e+=4+Ur(n,e+2));return[Gn(n,e+12),Gn(n,e+4),Gn(n,e+20)]};function gm(n,e){for(var t={},r=n.length-22;hr(n,r)!=101010256;--r)(!r||n.length-r>65558)&&Xt(13);var i=Ur(n,r+8);if(!i)return{};var a=hr(n,r+16),s=a==4294967295||i==65535;if(s){var o=hr(n,r-12);s=hr(n,o)==101075792,s&&(i=hr(n,o+32),a=hr(n,o+48))}for(var l=0;l<i;++l){var h=fm(n,a,s),u=h[0],f=h[1],d=h[2],m=h[3],p=h[4],U=h[5],B=cm(n,U);a=p,u?u==8?t[m]=lm(n.subarray(B,B+f),{out:new Vt(d)}):Xt(14,"unknown compression type "+u):t[m]=On(n,B,B+f)}return t}class _t extends St{constructor(){super(),this.shader=new c.UnLitShader,this.baseMap=A.res.whiteTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}class Si extends De{shape_vertices=[];shape_indices=[];radius;widthSegments;heightSegments;phiStart;phiLength;thetaStart;thetaLength;constructor(e,t,r,i,a,s,o){super(),this.radius=e,this.widthSegments=t,this.heightSegments=r,this.phiStart=i,this.phiLength=a,this.thetaStart=s,this.thetaLength=o,this.buildGeometry()}buildGeometry(){var e,t,r=0;let i=this.heightSegments,a=this.widthSegments,s=this.radius;var o=(i+1)*(a+1);let l=new Float32Array(o*3),h=new Float32Array(o*3),u=new Float32Array(o*2),f=new Uint16Array(a*i*2*3),d=0,m=0,p=0;for(t=0;t<=i;++t){var U=Math.PI*t/i,B=s*Math.cos(U),v=s*Math.sin(U);for(e=0;e<=a;++e){var C=2*Math.PI*e/a,x=v*Math.cos(C),F=v*Math.sin(C),_=1/Math.sqrt(x*x+B*B+F*F);if(l[d++]=x,l[d++]=B,l[d++]=F,h[m++]=x*_,h[m++]=B*_,h[m++]=F*_,u[p++]=e/a,u[p++]=t/i,e>0&&t>0){var b=(a+1)*t+e,R=(a+1)*t+e-1,T=(a+1)*(t-1)+e-1,Q=(a+1)*(t-1)+e;t==i?(f[r++]=b,f[r++]=T,f[r++]=Q):t==1?(f[r++]=b,f[r++]=R,f[r++]=T):(f[r++]=b,f[r++]=R,f[r++]=T,f[r++]=b,f[r++]=T,f[r++]=Q)}}}this.setIndices(f),this.setAttribute(V.position,l),this.setAttribute(V.normal,h),this.setAttribute(V.uv,u),this.setAttribute(V.TEXCOORD_1,u),this.addSubGeometry({indexStart:0,indexCount:f.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0}),this.bounds=new be(g.ZERO,new g(this.radius*2,this.radius*2,this.radius*2))}}class Sa extends c.Object3D{static register3DRepresentation=null;positionIndex=-1;positionValid=!1;marker;constructor(e){super(),this.parsePlacemark(e),this.setup3DRepresentation()}parsePlacemark(e){if(!e.slamPositionInfo){console.warn("WayPoint3D: slamPositionInfo is not found");return}const t=e.slamPositionInfo.slamPosition.split(",").map(Number);this.localPosition=new g(t[0],t[1],t[2]),this.positionIndex=Number(e.slamPositionInfo.slamPositionIndex),this.positionValid=e.slamPositionInfo.slamPositionValid==="1"}setup3DRepresentation(){if(this.marker&&(this.removeChild(this.marker),this.marker=null),Sa.register3DRepresentation)this.marker=Sa.register3DRepresentation(this),this.marker&&this.addChild(this.marker);else{this.marker=new c.Object3D;const e=this.marker.addComponent(c.MeshRenderer);e.geometry=new Si(.1,32,16),e.material=new nr,e.material.baseColor=this.positionValid?new k(0,1,0,1):new k(1,0,0,1),this.addChild(this.marker),this.marker.name="WayPoint3DMarker"}}}class xa extends c.Object3D{static register3DRepresentation=null;line;constructor(e){super(),this.parseWayLineFile(e),this.setup3DRepresentation()}parseWayLineFile(e){for(const t of e.Folder.Placemark){const r=new Sa(t);this.addChild(r)}this.entityChildren=this.entityChildren.sort((t,r)=>t.positionIndex-r.positionIndex)}setup3DRepresentation(){this.line&&(this.removeChild(this.line),this.line=null),xa.register3DRepresentation?(this.line=xa.register3DRepresentation(this),this.line&&this.addChild(this.line)):(this.line=this.createMultiLine(this.entityChildren.map(e=>e.localPosition),new k(1,1,1,1)),this.addChild(this.line),this.line.name="WayLines3DLine")}createMultiLine(e,t){if(e.length<2)return null;const r=new De,i=new Float32Array(e.length*3);for(let h=0;h<e.length;h++)i[h*3]=e[h].x,i[h*3+1]=e[h].y,i[h*3+2]=e[h].z;const a=new Uint16Array((e.length-1)*2);for(let h=0;h<e.length-1;h++)a[h*2]=h,a[h*2+1]=h+1;r.setIndices(a),r.setAttribute(V.position,i),r.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});const s=new c.Object3D,o=s.addComponent(c.MeshRenderer),l=new _t;return l.topology="line-list",l.baseColor=t,l.blendMode=se.ADD,l.castReflection=!1,o.geometry=r,o.material=l,s}}class rc extends at{static format=Ge.BIN;parseBuffer(e){try{const t={template:null,waylines:null},r=gm(new Uint8Array(e));for(const a in r){const s=r[a],l=new DOMParser().parseFromString(tc(s),"application/xml"),h={};this.parseNode(l,h);const u=a.replace("wpmz/","").split(".")[0];Object.assign(t,{[u]:h["#document"].kml.Document})}const i=new xa(t.waylines);this.data=i}catch(t){this.parserError(`KMZ parsing failed: ${t}`,-1)}}parseNode(e,t){const r=["Placemark","actionGroup","action"],i=e.nodeName.replace("wpml:","");if(!e.childNodes.length)t[i]=void 0;else{let a=null,s=!1;for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];if(l.nodeType==Node.TEXT_NODE){const h=l.nodeValue?.trim();h&&h.length>0&&(a=h)}else l.nodeType==Node.ELEMENT_NODE&&(s=!0)}if(a&&!s)t[i]=a;else if(s){r.includes(i)?t[i]?.length?t[i].push({}):t[i]=[{}]:t[i]={};for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];l.nodeType==Node.ELEMENT_NODE&&this.parseNode(l,Array.isArray(t[i])?t[i].at(-1):t[i])}}else t[i]=void 0}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class ic{_texturePool;_materialPool;_prefabPool;_gltfPool;_geometryPool;_atlasList;_obj;constructor(){this._texturePool=new Map,this._materialPool=new Map,this._prefabPool=new Map,this._geometryPool=new Map,this._gltfPool=new Map,this._atlasList=new Map,this._obj=new Map}getGltf(e){return this._gltfPool.get(e)}addObj(e,t){this._obj.set(e,t)}getObj(e){return this._obj.get(e)}addTexture(e,t){this._texturePool.set(e,t)}getTexture(e){return this._texturePool.get(e)}addGeometry(e,t){this._geometryPool.set(e,t)}getGeometry(e){return this._geometryPool.get(e)}addMat(e,t){return this._materialPool.set(e,t)}getMat(e){return this._materialPool.get(e)}addPrefab(e,t){this._prefabPool.set(e,t)}getPrefab(e){return this._prefabPool.get(e).instantiate()}addAtlas(e,t){t.name=e,this._atlasList.set(e,t)}getAtlas(e){return this._atlasList.get(e)}getGUISprite(e){for(let t of this._atlasList.values()){let r=t.getSprite(e);if(r)return r}return null}async load(e,t,r){return(await new pt().load(e,t,r)).data}async loadGltf(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let r,i=e.substring(e.lastIndexOf(".")).toLowerCase(),a=new pt;i==".gltf"?r=await a.load(e,At,t):r=await a.load(e,bn,t);let s=r.data;return this._prefabPool.set(e,s),this._gltfPool.set(e,r.gltf),s}async loadObj(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let r,i=e.substring(e.lastIndexOf(".")).toLowerCase(),a=new pt;i==".obj"&&(r=await a.load(e,Su,t));let s=r.data;return this._prefabPool.set(e,s),s}async loadB3DM(e,t,r){if(this._prefabPool.has(e))return this._prefabPool.get(e);let s=(await new pt().load(e,Du,t,r)).data;return this._prefabPool.set(e,s),s}async loadI3DM(e,t,r){if(this._prefabPool.has(e))return this._prefabPool.get(e);let s=(await new pt().load(e,Lu,t,r)).data;return this._prefabPool.set(e,s),s}async loadTexture(e,t,r){if(this._texturePool.has(e))return this._texturePool.get(e);let i=new Vr;return i.flipY=r,await i.load(e,t),this._texturePool.set(e,i),i}async loadTextureCount(e,t,r,i){return new Promise(async(a,s)=>{let o=0,l=[];t==0&&a(l);for(let h=0;h<t;h++){const u=e.shift();this.loadTexture(u,r,i).then(f=>{l.push(f),o++,o==t&&a(l)})}})}async loadBitmapTextures(e,t=5,r,i){let a=[],s=Math.floor(e.length/t)+1,o=Math.floor(e.length%t);for(let l=0;l<s;l++){let h=await this.loadTextureCount(e,l==s-1?o:t,r,i);a.push(...h)}return a}async loadHDRTexture(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new In;return r=await r.load(e,t),this._texturePool.set(e,r),r}async loadHDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new hs;return r=await r.load(e,t),this._texturePool.set(e,r),r}async loadLDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new cs;return r=await r.load(e,t),this._texturePool.set(e,r),r}async loadTextureCubeMaps(e){let t=e[0];if(this._texturePool.has(t))return this._texturePool.get(t);let r=new Rn;return await r.load(e),this._texturePool.set(e[0],r),r}async loadTextureCubeStd(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new Rn;return await r.loadStd(e),r}async loadJSON(e,t){return await new pt().loadJson(e,t).then(async r=>r).catch(r=>{console.log(r)})}async loadFont(e,t,r){let a=await new pt().load(e,Lr,t,r),s=a.data;return Yi.addFontData(s.face,s.size,s),a.data}async loadAtlas(e,t){return(await new pt().load(e,Xu,t,e)).data}async loadKMZ(e,t){return(await new pt().load(e,rc,t)).data}normalTexture;maskTexture;whiteTexture;blackTexture;redTexture;blueTexture;greenTexture;yellowTexture;grayTexture;defaultSky;defaultGUITexture;defaultGUISprite;defaultMaterial;createTexture(e,t,r,i,a,s,o){let l=32,h=32,u=new Uint8Array(l*h*4);this.fillColor(u,e,t,r,i,a,s);let f=new rn;return f.name=o,f.create(16,16,u,!0),o&&this.addTexture(o,f),f}fillColor(e,t,r,i,a,s,o){for(let l=0;l<t;l++)for(let h=0;h<r;h++){let u=h*t+l;e[u*4+0]=i,e[u*4+1]=a,e[u*4+2]=s,e[u*4+3]=o}}initDefault(){this.normalTexture=this.createTexture(32,32,255*.5,255*.5,255,255,"default-normalTexture"),this.maskTexture=this.createTexture(32,32,255,255*.5,255,255,"default-maskTexture"),this.whiteTexture=this.createTexture(32,32,255,255,255,255,"default-whiteTexture"),this.blackTexture=this.createTexture(32,32,0,0,0,255,"default-blackTexture"),this.redTexture=this.createTexture(32,32,255,0,0,255,"default-redTexture"),this.blueTexture=this.createTexture(32,32,0,0,255,255,"default-blueTexture"),this.greenTexture=this.createTexture(32,32,0,255,0,255,"default-greenTexture"),this.yellowTexture=this.createTexture(32,32,0,255,255,255,"default-yellowTexture"),this.grayTexture=this.createTexture(32,32,128,128,128,255,"default-grayTexture");let t=new Gu().generateBRDFLUTTexture(),r=t.name="BRDFLUT";this.addTexture(r,t),this.defaultSky=new hs,this.defaultSky.createFromTexture(128,this.blackTexture),me.getInstance().attached(this.defaultSky,this),me.getInstance().attached(t,this),me.getInstance().attached(this.normalTexture,this),me.getInstance().attached(this.maskTexture,this),me.getInstance().attached(this.whiteTexture,this),me.getInstance().attached(this.blackTexture,this),me.getInstance().attached(this.redTexture,this),me.getInstance().attached(this.blueTexture,this),me.getInstance().attached(this.greenTexture,this),me.getInstance().attached(this.yellowTexture,this),me.getInstance().attached(this.grayTexture,this),this.defaultGUITexture=new ri(this.whiteTexture),this.defaultGUISprite=new Zi(this.defaultGUITexture),this.defaultGUISprite.trimSize.set(4,4),this.defaultMaterial=new nr}}class ac extends Ne{_postList;init(e){this._postList=new Map}start(){}stop(){}onEnable(){this.activePost()}onDisable(){this.unActivePost()}activePost(){let e=this.transform.view3D,t=A.getRenderJob(e);this._postList.forEach(r=>{t.addPost(r)})}unActivePost(){let e=this.transform.view3D,t=A.getRenderJob(e);this._postList.forEach(r=>{t.removePost(r)})}addPost(e){if(this._postList.has(e))return;let t=new e;return this._postList.set(e,t),this._enable&&this.activePost(),t}removePost(e){if(!this._postList.has(e))return;let t=this._postList.get(e);this._postList.delete(e);let r=this.transform.view3D;A.getRenderJob(r).removePost(t)}getPost(e){return this._postList.has(e)?this._postList.get(e):null}}const mm="1.0.8";class A{static res;static inputSystem;static views;static _frameRateValue=0;static _frameRate=360;static _time=0;static _beforeRender;static _renderLoop;static _lateRender;static _requestAnimationFrameID=0;static get frameRate(){return this._frameRate}static set frameRate(e){this._frameRate=e,this._frameRateValue=1e3/e,e>=360&&(this._frameRateValue=0)}static get size(){return I.presentationSize}static get aspect(){return I.aspect}static get width(){return I.windowWidth}static get height(){return I.windowHeight}static setting={doublePrecision:!1,occlusionQuery:{enable:!0,debug:!1},pick:{enable:!0,mode:"bound",detail:"mesh"},render:{debug:!1,renderPassState:4,renderState_left:5,renderState_right:5,renderState_split:.5,quadScale:1,hdrExposure:1.5,debugQuad:-1,maxPointLight:1e3,maxDirectLight:4,maxSportLight:1e3,drawOpMin:0,drawOpMax:Number.MAX_SAFE_INTEGER,drawTrMin:0,drawTrMax:Number.MAX_SAFE_INTEGER,zPrePass:!1,useLogDepth:!1,useCompressGBuffer:!1,gi:!1,postProcessing:{bloom:{downSampleStep:3,downSampleBlurSize:9,downSampleBlurSigma:1,upSampleBlurSize:9,upSampleBlurSigma:1,luminanceThreshole:1,bloomIntensity:1,hdr:1},globalFog:{debug:!1,enable:!1,fogType:0,fogHeightScale:.1,start:400,end:10,density:.02,ins:.5,skyFactor:.5,skyRoughness:.4,overrideSkyFactor:.8,fogColor:new k(96/255,117/255,133/255,1),falloff:.7,rayLength:200,scatteringExponent:2.7,dirHeightLine:10},godRay:{blendColor:!0,rayMarchCount:16,scatteringExponent:5,intensity:.5},ssao:{enable:!1,radius:.15,bias:-.1,aoPower:2,debug:!0},outline:{enable:!1,strength:1,groupCount:4,outlinePixel:2,fadeOutlinePixel:4,textureScale:1,useAddMode:!1,debug:!0},taa:{enable:!1,jitterSeedCount:8,blendFactor:.1,sharpFactor:.6,sharpPreBlurFactor:.5,temporalJitterScale:.13,debug:!0},gtao:{enable:!1,darkFactor:1,maxDistance:5,maxPixel:50,rayMarchSegment:6,multiBounce:!1,usePosFloat32:!0,blendColor:!0,debug:!0},ssr:{enable:!1,pixelRatio:1,fadeEdgeRatio:.2,rayMarchRatio:.5,fadeDistanceMin:600,fadeDistanceMax:2e3,roughnessThreshold:.5,powDotRN:.2,mixThreshold:.1,debug:!0},fxaa:{enable:!1},depthOfView:{enable:!1,iterationCount:3,pixelOffset:1,near:150,far:300}}},shadow:{enable:!0,type:"HARD",pointShadowBias:5e-4,shadowSize:2048,pointShadowSize:1024,shadowSoft:.005,shadowBound:100,shadowBias:.05,needUpdate:!0,autoUpdate:!0,updateFrameRate:2,csmMargin:.1,csmScatteringExp:.7,csmAreaScale:.4,debug:!1},gi:{enable:!1,offsetX:0,offsetY:0,offsetZ:0,probeSpace:64,probeXCount:4,probeYCount:2,probeZCount:4,probeSize:32,probeSourceTextureSize:2048,octRTMaxSize:2048,octRTSideSize:16,maxDistance:64*1.73,normalBias:.25,depthSharpness:1,hysteresis:.98,lerpHysteresis:.01,irradianceChebyshevBias:.01,rayNumber:144,irradianceDistanceBias:32,indirectIntensity:1,ddgiGamma:2.2,bounceIntensity:.025,probeRoughness:1,realTimeGI:!1,debug:!1,autoRenderProbe:!1},sky:{type:"HDRSKY",sky:null,skyExposure:1,defaultFar:65536,defaultNear:1},light:{maxLight:4096},material:{materialChannelDebug:!1,materialDebug:!1},loader:{numConcurrent:20},reflectionSetting:{reflectionProbeMaxCount:8,reflectionProbeSize:256,width:256*6,height:8*256,enable:!0}};static renderJobs;static async init(e={}){console.log("Rings Version",mm),window.isSecureContext||console.warn("WebGPU is only supported in secure contexts (HTTPS or localhost)"),this.setting={...this.setting,...e.engineSetting},await ge.init(E.allocCount,this.setting.doublePrecision),await I.init(e.canvasConfig),this.setting.reflectionSetting.width=this.setting.reflectionSetting.reflectionProbeSize*6,this.setting.reflectionSetting.height=this.setting.reflectionSetting.reflectionProbeSize*this.setting.reflectionSetting.reflectionProbeMaxCount,ne.getGBufferFrame(ne.reflections_GBuffer,this.setting.reflectionSetting.width,this.setting.reflectionSetting.height,!1),z.init(),Nr.init(),oe.init(),gt.init(),Qt.init(),this.res=new ic,this.res.initDefault(),this._beforeRender=e.beforeRender,this._renderLoop=e.renderLoop,this._lateRender=e.lateRender,this.inputSystem=new vo,this.inputSystem.initCanvas(I.canvas)}static startRenderJob(e){let t=new $h(e);return this.renderJobs.set(e,t),this.setting.pick.mode=="pixel"&&e.scene.getOrAddComponent(ac).addPost(dn),(this.setting.pick.mode=="pixel"||this.setting.pick.mode=="bound")&&(e.enablePick=!0),t}static startRenderView(e){this.renderJobs||=new Map,this.views=[e];let t=this.startRenderJob(e);return this.resume(),t}static startRenderViews(e){this.renderJobs||=new Map,this.views=e;for(let t=0;t<e.length;t++)this.startRenderJob(e[t]);this.resume()}static getRenderJob(e){return this.renderJobs.get(e)}static pause(){this._requestAnimationFrameID!==0&&(cancelAnimationFrame(this._requestAnimationFrameID),this._requestAnimationFrameID=0)}static resume(){this._requestAnimationFrameID===0&&(this._requestAnimationFrameID=requestAnimationFrame(e=>this.render(e)))}static async render(e){if(this._frameRateValue>0){let t=e-this._time;if(t<this._frameRateValue){let r=performance.now();await new Promise(i=>{setTimeout(()=>{e+=performance.now()-r,i(!0)},this._frameRateValue-t)})}this._time=e}await this.updateFrame(e),this._requestAnimationFrameID=0,this.resume()}static async updateFrame(e){ye.delta=e-ye.time,ye.time=e,ye.frame+=1,ti.tick(ye.delta);let t=this.views,r=0;for(r=0;r<t.length;r++){const s=t[r];s.scene.waitUpdate();let[o,l]=I.presentationSize;s.camera.viewPort.setTo(0,0,o,l)}this._beforeRender&&await this._beforeRender();for(const s of xe.componentsBeforeUpdateList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o)}}let i=I.device.createCommandEncoder();for(const s of xe.componentsComputeList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o,i)}}I.device.queue.submit([i.finish()]);for(const s of xe.componentsUpdateList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o)}}for(const s of xe.graphicComponent){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];o&&u.enable&&f(o)}}this._renderLoop&&await this._renderLoop(),ge.updateAllContinueTransform(0,E.useCount,16),oe.modelMatrixBindGroup.writeBuffer(E.useCount*16),this.renderJobs.forEach((s,o)=>{s.renderState||s.start(),s.renderFrame()});for(const s of xe.componentsLateUpdateList){let o=s[0],l=s[1];for(const h of l){let u=h[0],f=h[1];u.enable&&f(o)}}this._lateRender&&await this._lateRender()}}let fs=`
7561
7561
  struct BloomCfg{
7562
7562
  downSampleStep: f32,
7563
7563
  downSampleBlurSize: f32,