@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) • 1.37 kB
JavaScript
import{t as e,f as t,g as r,S as i}from"./index-DFZFpUG-.esm.min.js";const n=[{arrayStride:12,attributes:[{shaderLocation:0,offset:0,format:"float32x3"}]}],a=new Map,o=new Map;let l=null;function s(s,c,d){function u(e){const t=e._device;l!==t&&(a.clear(),o.clear(),l=t);const r=o.get(s);if(r)return r;const n=t.createBindGroupLayout({label:`${s}-material`,entries:[{binding:0,visibility:i.VERTEX|i.FRAGMENT,buffer:{type:"uniform"}},{binding:1,visibility:i.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube"}},{binding:2,visibility:i.FRAGMENT,sampler:{type:"filtering"}}]});return o.set(s,n),n}return{getPipeline(i,p){const f=i._device;l!==f&&(a.clear(),o.clear(),l=f);const b=`${s}|${e(p)}`,m=a.get(b);if(m)return m;const _=f.createShaderModule({code:c,label:`${s}-vert`}),g=f.createShaderModule({code:d,label:`${s}-frag`}),v=f.createRenderPipeline(t({_label:`${s}-pipeline`,_engine:i,_bgls:[r(i),u(i)],_vertModule:_,_fragModule:g,_vertexBuffers:n,_format:p._colorFormat,_depthStencilFormat:p._depthStencilFormat,_depthCompare:p._depthCompare,_msaaSamples:p._sampleCount,_depthWriteEnabled:!1}));return a.set(b,v),v},createBindGroup:(e,t,r,i)=>e._device.createBindGroup({layout:u(e),entries:[{binding:0,resource:{buffer:t}},{binding:1,resource:r},{binding:2,resource:i}]})}}export{s as c};
//# sourceMappingURL=cubemap-skybox-material-Dv1ZF8tN.esm.min.js.map