@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.45 kB
JavaScript
import{b as e}from"./glTFLoader.pure-Bdyl6AcK.esm.min.js";import{bo as s,bp as r}from"./index-BPURObVq.esm.min.js";import"./morphTargetManager-CdEb1BHc.esm.min.js";import"./bone.pure-BcPT5kCP.esm.min.js";import"./skeleton-DinTjF3y.esm.min.js";import"./assetContainer-CAncviZo.esm.min.js";import"./objectModelMapping-ClgDmo5Q.esm.min.js";import"./spotLight.pure-5s2DDDIt.esm.min.js";const o="KHR_materials_diffuse_roughness";class t{constructor(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,r,o){return e.LoadExtensionAsync(s,r,this.name,async(e,t)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(s,r,o)),i.push(this._loadDiffuseRoughnessPropertiesAsync(e,t,o)),await Promise.all(i).then(()=>{})})}_loadDiffuseRoughnessPropertiesAsync(e,s,r){const o=this._loader._getOrCreateMaterialAdapter(r),t=new Array;return o.baseDiffuseRoughness=s.diffuseRoughnessFactor??0,s.diffuseRoughnessTexture&&t.push(this._loader.loadTextureInfoAsync(`${e}/diffuseRoughnessTexture`,s.diffuseRoughnessTexture,e=>{e.name=`${r.name} (Diffuse Roughness)`,o.baseDiffuseRoughnessTexture=e})),Promise.all(t).then(()=>{})}}let i=!1;function n(){i||(i=!0,s(o),r(o,!0,e=>new t(e)))}n();export{t as KHR_materials_diffuse_roughness,n as RegisterKHR_materials_diffuse_roughness};
//# sourceMappingURL=KHR_materials_diffuse_roughness-CJ7GsxTX.esm.min.js.map