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) 1.45 kB
import{b as e}from"./glTFLoader.pure-CKqF36p0.esm.min.js";import{bo as s,bp as r}from"./index-OM-TXt9s.esm.min.js";import"./morphTargetManager-DVR41bOb.esm.min.js";import"./bone.pure-DxlM4RQF.esm.min.js";import"./skeleton-CVVbMGoG.esm.min.js";import"./assetContainer-BpKLnjKZ.esm.min.js";import"./objectModelMapping-DA3c5cv8.esm.min.js";import"./spotLight.pure-guqQj5Iw.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-BdQFOqIS.esm.min.js.map