@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.62 kB
JavaScript
import{b as e}from"./glTFLoader.pure-Bdyl6AcK.esm.min.js";import{bo as o,bp as s}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 t="KHR_materials_anisotropy";class r{constructor(e){this.name=t,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(o,s,t){return e.LoadExtensionAsync(o,s,this.name,async(e,r)=>{const n=new Array;n.push(this._loader.loadMaterialPropertiesAsync(o,s,t)),n.push(this._loadAnisotropyPropertiesAsync(e,r,t)),await Promise.all(n)})}async _loadAnisotropyPropertiesAsync(e,o,s){const t=this._loader._getOrCreateMaterialAdapter(s),r=new Array,n=o.anisotropyStrength??0,i=o.anisotropyRotation??0;t.specularRoughnessAnisotropy=n,t.geometryTangentAngle=i;const a=o.extensions??{};a.EXT_materials_anisotropy_openpbr&&a.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled||t.configureGltfStyleAnisotropy(!0),o.anisotropyTexture&&(o.anisotropyTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${e}/anisotropyTexture`,o.anisotropyTexture,e=>{e.name=`${s.name} (Anisotropy Intensity)`,t.geometryTangentTexture=e}))),await Promise.all(r)}}let n=!1;function i(){n||(n=!0,o(t),s(t,!0,e=>new r(e)))}i();export{r as KHR_materials_anisotropy,i as RegisterKHR_materials_anisotropy};
//# sourceMappingURL=KHR_materials_anisotropy-fVYsPb6g.esm.min.js.map