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.74 kB
import{b as e}from"./glTFLoader.pure-Bdyl6AcK.esm.min.js";import{i as s,bo as o,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 n="KHR_materials_sheen";class t{constructor(e){this.name=n,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,o,r){return e.LoadExtensionAsync(s,o,this.name,async(e,n)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(s,o,r)),t.push(this._loadSheenPropertiesAsync(e,n,r)),await Promise.all(t).then(()=>{})})}_loadSheenPropertiesAsync(e,o,r){const n=this._loader._getOrCreateMaterialAdapter(r),t=new Array;n.configureFuzz();const a=void 0!==o.sheenColorFactor?s.FromArray(o.sheenColorFactor):s.Black(),i=void 0!==o.sheenRoughnessFactor?o.sheenRoughnessFactor:0;return n.fuzzWeight=1,n.fuzzColor=a,n.fuzzRoughness=i,o.sheenColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${e}/sheenColorTexture`,o.sheenColorTexture,e=>{e.name=`${r.name} (Sheen Color)`,n.fuzzColorTexture=e})),o.sheenRoughnessTexture&&(o.sheenRoughnessTexture.nonColorData=!0,t.push(this._loader.loadTextureInfoAsync(`${e}/sheenRoughnessTexture`,o.sheenRoughnessTexture,e=>{e.name=`${r.name} (Sheen Roughness)`,n.fuzzRoughnessTexture=e}))),Promise.all(t).then(()=>{})}}let a=!1;function i(){a||(a=!0,o(n),r(n,!0,e=>new t(e)))}i();export{t as KHR_materials_sheen,i as RegisterKHR_materials_sheen}; //# sourceMappingURL=KHR_materials_sheen-DJsFoVl3.esm.min.js.map