import{GLTFLoader as d}from"./glTFLoader-f5CXkgzs.js";import{C as i,aG as m,aH as c}from"./index-T8LZyOXI.js";import"./index-BkylzejB.js";import"./bone-DGunMt7J.js";import"./skeleton-00tPGJ0X.js";import"./rawTexture-Duv-4ySK.js";import"./assetContainer-DNTqZfyb.js";import"./objectModelMapping-D1pI71RW.js";const a="KHR_materials_sheen";class g{constructor(o){this.name=a,this.order=190,this._loader=o,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null}loadMaterialPropertiesAsync(o,e,n){return d.LoadExtensionAsync(o,e,this.name,async(s,r)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(o,e,n)),t.push(this._loadSheenPropertiesAsync(s,r,n)),await Promise.all(t).then(()=>{})})}_loadSheenPropertiesAsync(o,e,n){const s=this._loader._getOrCreateMaterialAdapter(n),r=new Array;s.configureFuzz();const t=e.sheenColorFactor!==void 0?i.FromArray(e.sheenColorFactor):i.Black(),l=e.sheenRoughnessFactor!==void 0?e.sheenRoughnessFactor:0;return s.fuzzWeight=1,s.fuzzColor=t,s.fuzzRoughness=l,e.sheenColorTexture&&r.push(this._loader.loadTextureInfoAsync(`${o}/sheenColorTexture`,e.sheenColorTexture,h=>{h.name=`${n.name} (Sheen Color)`,s.fuzzColorTexture=h})),e.sheenRoughnessTexture&&(e.sheenRoughnessTexture.nonColorData=!0,r.push(this._loader.loadTextureInfoAsync(`${o}/sheenRoughnessTexture`,e.sheenRoughnessTexture,h=>{h.name=`${n.name} (Sheen Roughness)`,s.fuzzRoughnessTexture=h}))),Promise.all(r).then(()=>{})}}m(a);c(a,!0,u=>new g(u));export{g as KHR_materials_sheen};
