import{GLTFLoader as d}from"./glTFLoader-Bp7IfGPK.js";import{C as i,aG as m,aH as c}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";import"./bone-z620UXj2.js";import"./skeleton-3aE04lM6.js";import"./rawTexture-DYLCXHMF.js";import"./assetContainer-D7EiOqw6.js";import"./objectModelMapping-CGWnurZP.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};
