<!-- SOLUV · part 639 -->
P_POSITIVE_X+it,Ft,Zt,It.width,It.height,0,It.data):ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):U?$&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,Ft,0,0,It.width,It.height,Ut,zt,It.data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,Ft,Zt,It.width,It.height,0,Ut,zt,It.data)}}}else{if(St=y.mipmaps,U&&pt){St.length>0&&mt++;let it=jt(gt[0]);e.texStorage2D(s.TEXTURE_CUBE_MAP,mt,Zt,it.width,it.height)}for(let it=0;it<6;it++)if(Nt){U?$&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,gt[it].width,gt[it].height,Ut,zt,gt[it].data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,Zt,gt[it].width,gt[it].height,0,Ut,zt,gt[it].data);for(let Ft=0;Ft<St.length;Ft++){let ge=St[Ft].image[it].image;U?$&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,Ft+1,0,0,ge.width,ge.height,Ut,zt,ge.data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,Ft+1,Zt,ge.width,ge.height,0,Ut,zt,ge.data)}}else{U?$&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Ut,zt,gt[it]):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,Zt,Ut,zt,gt[it]);for(let Ft=0;Ft<St.length;Ft++){let It=St[Ft];U?$&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,Ft+1,0,0,Ut,zt,It.image[it]):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+it,Ft+1,Zt,Ut,zt,It.image[it])}}}m(y)&&S(s.TEXTURE_CUBE_MAP),lt.__version=Y.version,y.onUpdate&&y.onUpdate(y)}w.__version=y.version}function bt(w,y,O,G,Y,lt){let ct=r.convert(O.format,O.colorSpace),Z=r.convert(O.type),K=x(O.internalFormat,ct,Z,O.normalized,O.colorSpace),dt=n.get(y),Nt=n.get(O);if(Nt.__renderTarget=y,!dt.__hasExternalTextures){let gt=Math.max(1,y.width>>lt),ft=Math.max(1,y.height>>lt);Y===s.TEXTURE_3D||Y===s.TEXTURE_2D_ARRAY?e.texImage3D(Y,lt,K,gt,ft,y.depth,0,ct,Z,null):e.texImage2D(Y,lt,K,gt,ft,0,ct,Z,null)}e.bindFramebuffer(s.FRAMEBUFFER,w),qt(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,G,Y,Nt.__webglTexture,0,Ht(y)):(Y===s.TEXTURE_2D||Y>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&Y<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,G,Y,Nt.__webglTexture,lt),e.bindFramebuffer(s.FRAMEBUFFER,null)}function Gt(w,y,O){if(s.bindRenderbuffer(s.RENDERBUFFER,w),y.depthBuffer){let G=y.depthTexture,Y=G&&G.isDepthTexture?G.type:null,lt=E(y.stencilBuffer,Y),ct=y.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;qt(y)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Ht(y),lt,y.width,y.height):O?s.renderbufferStorageMultisample(s.RENDERBUFFER,Ht(y),lt,y.width,y.height):s.renderbufferStorage(s.RENDERBUFFER,lt,y.width,y.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,ct,s.RENDERBUFFER,w)}else{let G=y.textures;for(let Y=0;Y<G.length;Y++){let lt=G[Y],ct=r.convert(lt.format,lt.colorSpace),Z=r.convert(lt.type),K=x(lt.internalFormat,ct,Z,lt.normalized,lt.colorSpace);qt(y)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Ht(y),K,y.width,y.height):O?s.renderbufferStorageMultisample(s.RENDERBUFFER,Ht(y),K,y.width,y.height):s.renderbufferStorage(s.RENDERBUFFER,K,y.width,y.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function he(w,y,O){let G=y.isWebGLCubeRenderTarget===!0;if(e.bindFramebuffer(s.FRAMEBUFFER,w),!(y.depthTexture&&y.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");let Y=n.get(y.depthTexture);if(Y.__renderTarget=y,(!Y.__webglTexture||y.depthTexture.image.width!==y.width||y.depthTexture.image.height!==y.height)&&(y.depthTexture.image.width=y.width,y.depthTexture.image.height=y.height,y.depthTexture.needsUpdate=!0),G){if(Y.__webglInit===void 0&&(Y.__webglInit=!0,y.depthTexture.addEventListener("dispose",R)),Y.__webglTexture===void 0){Y.__webglTexture=s.createTexture(),e.bindTexture(s.TEXTURE_CUBE_MAP,Y.__webglTexture),Qt(s.TEXTURE_CUBE_MAP,y.depthTexture);let dt=r.convert(y.depthTexture.format),Nt=r.convert(y.depthTexture.type),gt;y.depthTexture.format===Dn?gt=s.DEPTH_COMPONENT24:y.depthTexture.format===Si&&(gt=s.DEPTH24_STENCIL8);for(let ft=0;ft<6;ft++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ft,0,gt,y.width,y.height,0,dt,Nt,null)}}else st(y.depthTexture,0);let lt=Y.__webglTexture,ct=Ht(y),Z=G?s.TEXTURE_CUBE_MAP_POSITIVE_X+O:s.TEXTURE_2D,K=y.depthTexture.format===Si?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(y.depthTexture.format===Dn)qt(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,K,Z,lt,0,ct):s.framebufferTexture2D(s.FRAMEBUFFER,K,Z,lt,0);else if(y.depthTexture.format===Si)qt(y)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,K,Z,lt,0,ct):s.framebufferTexture2D(s.FRAMEBUFFER,K,Z,lt,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function tt(w){let y=n.get(w),O=w.isWebGLCubeRenderTarget===!0;if(y.__boundDepthTexture!==w.depthTexture){let G=w.depthTexture;if(y.__depthDisposeCallback&&y.__depthDisposeCallback(),G){let Y=()=>{delete y.__boundDepthTexture,delete y.__depthDisposeCallback,G.removeEventListener("dispose",Y)};G.addEventListener("dispose",Y),y.__depthDisposeCallbac