<!-- SOLUV · part 637 -->
TEXTURE_CUBE_MAP,O.__webglTexture,s.TEXTURE0+y)}let Dt={[dr]:s.REPEAT,[tn]:s.CLAMP_TO_EDGE,[fr]:s.MIRRORED_REPEAT},wt={[Ee]:s.NEAREST,[Nu]:s.NEAREST_MIPMAP_NEAREST,[ks]:s.NEAREST_MIPMAP_LINEAR,[ve]:s.LINEAR,[jr]:s.LINEAR_MIPMAP_NEAREST,[Vn]:s.LINEAR_MIPMAP_LINEAR},se={[op]:s.NEVER,[dp]:s.ALWAYS,[lp]:s.LESS,[cc]:s.LEQUAL,[cp]:s.EQUAL,[hc]:s.GEQUAL,[hp]:s.GREATER,[up]:s.NOTEQUAL};function Qt(w,y){if(y.type===Ze&&t.has("OES_texture_float_linear")===!1&&(y.magFilter===ve||y.magFilter===jr||y.magFilter===ks||y.magFilter===Vn||y.minFilter===ve||y.minFilter===jr||y.minFilter===ks||y.minFilter===Vn)&&ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(w,s.TEXTURE_WRAP_S,Dt[y.wrapS]),s.texParameteri(w,s.TEXTURE_WRAP_T,Dt[y.wrapT]),(w===s.TEXTURE_3D||w===s.TEXTURE_2D_ARRAY)&&s.texParameteri(w,s.TEXTURE_WRAP_R,Dt[y.wrapR]),s.texParameteri(w,s.TEXTURE_MAG_FILTER,wt[y.magFilter]),s.texParameteri(w,s.TEXTURE_MIN_FILTER,wt[y.minFilter]),y.compareFunction&&(s.texParameteri(w,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(w,s.TEXTURE_COMPARE_FUNC,se[y.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(y.magFilter===Ee||y.minFilter!==ks&&y.minFilter!==Vn||y.type===Ze&&t.has("OES_texture_float_linear")===!1)return;if(y.anisotropy>1||n.get(y).__currentAnisotropy){let O=t.get("EXT_texture_filter_anisotropic");s.texParameterf(w,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(y.anisotropy,i.getMaxAnisotropy())),n.get(y).__currentAnisotropy=y.anisotropy}}}function ne(w,y){let O=!1;w.__webglInit===void 0&&(w.__webglInit=!0,y.addEventListener("dispose",R));let G=y.source,Y=f.get(G);Y===void 0&&(Y={},f.set(G,Y));let lt=W(y);if(lt!==w.__cacheKey){Y[lt]===void 0&&(Y[lt]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,O=!0),Y[lt].usedTimes++;let ct=Y[w.__cacheKey];ct!==void 0&&(Y[w.__cacheKey].usedTimes--,ct.usedTimes===0&&I(y)),w.__cacheKey=lt,w.__webglTexture=Y[lt].texture}return O}function J(w,y,O){return Math.floor(Math.floor(w/O)/y)}function j(w,y,O,G){let lt=w.updateRanges;if(lt.length===0)e.texSubImage2D(s.TEXTURE_2D,0,0,0,y.width,y.height,O,G,y.data);else{lt.sort((Nt,gt)=>Nt.start-gt.start);let ct=0;for(let Nt=1;Nt<lt.length;Nt++){let gt=lt[ct],ft=lt[Nt],Ut=gt.start+gt.count,zt=J(ft.start,y.width,4),Zt=J(gt.start,y.width,4);ft.start<=Ut+1&&zt===Zt&&J(ft.start+ft.count-1,y.width,4)===zt?gt.count=Math.max(gt.count,ft.start+ft.count-gt.start):(++ct,lt[ct]=ft)}lt.length=ct+1;let Z=e.getParameter(s.UNPACK_ROW_LENGTH),K=e.getParameter(s.UNPACK_SKIP_PIXELS),dt=e.getParameter(s.UNPACK_SKIP_ROWS);e.pixelStorei(s.UNPACK_ROW_LENGTH,y.width);for(let Nt=0,gt=lt.length;Nt<gt;Nt++){let ft=lt[Nt],Ut=Math.floor(ft.start/4),zt=Math.ceil(ft.count/4),Zt=Ut%y.width,U=Math.floor(Ut/y.width),pt=zt,$=1;e.pixelStorei(s.UNPACK_SKIP_PIXELS,Zt),e.pixelStorei(s.UNPACK_SKIP_ROWS,U),e.texSubImage2D(s.TEXTURE_2D,0,Zt,U,pt,$,O,G,y.data)}w.clearUpdateRanges(),e.pixelStorei(s.UNPACK_ROW_LENGTH,Z),e.pixelStorei(s.UNPACK_SKIP_PIXELS,K),e.pixelStorei(s.UNPACK_SKIP_ROWS,dt)}}function xt(w,y,O){let G=s.TEXTURE_2D;(y.isDataArrayTexture||y.isCompressedArrayTexture)&&(G=s.TEXTURE_2D_ARRAY),y.isData3DTexture&&(G=s.TEXTURE_3D);let Y=ne(w,y),lt=y.source;e.bindTexture(G,w.__webglTexture,s.TEXTURE0+O);let ct=n.get(lt);if(lt.version!==ct.__version||Y===!0){if(e.activeTexture(s.TEXTURE0+O),(typeof ImageBitmap<"u"&&y.image instanceof ImageBitmap)===!1){let $=ee.getPrimaries(ee.workingColorSpace),mt=y.colorSpace===ni?null:ee.getPrimaries(y.colorSpace),St=y.colorSpace===ni||$===mt?s.NONE:s.BROWSER_DEFAULT_WEBGL;e.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y.flipY),e.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y.premultiplyAlpha),e.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,St)}e.pixelStorei(s.UNPACK_ALIGNMENT,y.unpackAlignment);let K=g(y.image,!1,i.maxTextureSize);K=ae(y,K);let dt=r.convert(y.format,y.colorSpace),Nt=r.convert(y.type),gt=x(y.internalFormat,dt,Nt,y.normalized,y.colorSpace,y.isVideoTexture);Qt(G,y);let ft,Ut=y.mipmaps,zt=y.isVideoTexture!==!0,Zt=ct.__version===void 0||Y===!0,U=lt.dataReady,pt=T(y,K);if(y.isDepthTexture)gt=E(y.format===Si,y.type),Zt&&(zt?e.texStorage2D(s.TEXTURE_2D,1,gt,K.width,K.height):e.texImage2D(s.TEXTURE_2D,0,gt,K.width,K.height,0,dt,Nt,null));else if(y.isDataTexture)if(Ut.length>0){zt&&Zt&&e.texStorage2D(s.TEXTURE_2D,pt,gt,Ut[0].width,Ut[0].height);for(let $=0,mt=Ut.length;$<mt;$++)ft=Ut[$],zt?U&&e.texSubImage2D(s.TEXTURE_2D,$,0,0,ft.width,ft.height,dt,Nt,ft.data):e.texImage2D(s.TEXTURE_2D,$,gt,ft.width,ft.height,0,dt,Nt,ft.data);y.generateMipmaps=!1}else zt?(Zt&&e.texStorage2D(s.TEXTURE_2D,pt,gt,K.width,K.height),U&&j(y,K,dt,Nt)):e.texImage2D(s.TEXTURE_2D,0,gt,K.width,K.height,0,dt,Nt,K.data);else if(y.isCompressedTexture)if(y.isCompressedArrayTexture){zt&&Zt&&e.texStorage3D(s.TEXTURE_2D_ARRAY,pt,gt,Ut[0].width,Ut[0].height,K.depth);for(let $=0,mt=Ut.length;$<mt;$++)if(ft=Ut[$],y.fo