@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.38 kB
JavaScript
import{bM as e,bJ as s,bI as o}from"./index-Bw2N6w1y.esm.min.js";import{GLTFLoader as t}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 r="KHR_materials_anisotropy";class n{constructor(e){this.name=r,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(r)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,o){return t.LoadExtensionAsync(e,s,this.name,(async(t,r)=>{const n=new Array;n.push(this._loader.loadMaterialPropertiesAsync(e,s,o)),n.push(this._loadIridescencePropertiesAsync(t,r,o)),await Promise.all(n)}))}async _loadIridescencePropertiesAsync(s,o,t){if(!(t instanceof e))throw new Error(`${s}: Material type not supported`);const r=new Array;t.anisotropy.isEnabled=!0,t.anisotropy.intensity=o.anisotropyStrength??0,t.anisotropy.angle=o.anisotropyRotation??0,o.anisotropyTexture&&(o.anisotropyTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${s}/anisotropyTexture`,o.anisotropyTexture,(e=>{e.name=`${t.name} (Anisotropy Intensity)`,t.anisotropy.texture=e})))),await Promise.all(r)}}s(r),o(r,!0,(e=>new n(e)));export{n as KHR_materials_anisotropy};
//# sourceMappingURL=KHR_materials_anisotropy-BhJyfh9c.esm.min.js.map