UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 775 B
import{o as e,q as t,ak as i}from"./index-B8IgtevW.esm.min.js";import{generateMipmaps as r}from"./generate-mipmaps-Cs76X4rW.esm.min.js";async function s(s,a){const o=a._recoverySource;if(!o||"dynamic"!==o.kind)return;const{width:c,height:m,format:u,levels:p,samplerDesc:l}=o,n=s._device.createTexture({size:{width:c,height:m},format:u,mipLevelCount:p,usage:e.TEXTURE_BINDING|e.COPY_DST|e.RENDER_ATTACHMENT});if(o.source)try{s._device.queue.copyExternalImageToTexture({source:o.source,flipY:o.flipY},{texture:n,premultipliedAlpha:o.premultipliedAlpha},[c,m]),p>1&&r(s,n)}catch{o.source=null}a.texture=n,a.view=n.createView(),a.sampler=t(s,l),a.width=c,a.height=m,i(a)}export{s as rebuildDynamicTexture2D}; //# sourceMappingURL=dynamic-texture-recovery-B991ikvi.esm.min.js.map