@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.49 kB
JavaScript
import{bM as s,C as e,bJ as o,bI as r}from"./index-Bw2N6w1y.esm.min.js";import{GLTFLoader as n}from"./glTFLoader-DEYqxGxH.esm.min.js";import"./bone-BwMp7T0B.esm.min.js";import"./skeleton-CkTZwWbM.esm.min.js";import"./rawTexture-CPAqHIA7.esm.min.js";import"./assetContainer-21j7tcC8.esm.min.js";import"./objectModelMapping-DX92iJ8M.esm.min.js";const i="EXT_materials_diffuse_roughness";class t{constructor(s){this.name=i,this.order=190,this._loader=s,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,e,o){return n.LoadExtensionAsync(s,e,this.name,(async(r,n)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(s,e,o)),i.push(this._loadDiffuseRoughnessPropertiesAsync(r,n,o)),await Promise.all(i).then((()=>{}))}))}_loadDiffuseRoughnessPropertiesAsync(o,r,n){if(!(n instanceof s))throw new Error(`${o}: Material type not supported`);const i=new Array;return n.brdf.baseDiffuseModel=e.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR,null!=r.diffuseRoughnessFactor?n.baseDiffuseRoughness=r.diffuseRoughnessFactor:n.baseDiffuseRoughness=0,r.diffuseRoughnessTexture&&i.push(this._loader.loadTextureInfoAsync(`${o}/diffuseRoughnessTexture`,r.diffuseRoughnessTexture,(s=>{s.name=`${n.name} (Diffuse Roughness)`,n.baseDiffuseRoughnessTexture=s}))),Promise.all(i).then((()=>{}))}}o(i),r(i,!0,(s=>new t(s)));export{t as EXT_materials_diffuse_roughness};
//# sourceMappingURL=EXT_materials_diffuse_roughness-BSgkoJ7x.esm.min.js.map