import{GLTFLoader as d}from"./glTFLoader-Bp7IfGPK.js";import{aG as o,aH as h}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 t="KHR_materials_iridescence";class m{constructor(n){this.name=t,this.order=195,this._loader=n,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(n,e,r){return d.LoadExtensionAsync(n,e,this.name,async(s,c)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(n,e,r)),i.push(this._loadIridescencePropertiesAsync(s,c,r)),await Promise.all(i).then(()=>{})})}_loadIridescencePropertiesAsync(n,e,r){const s=this._loader._getOrCreateMaterialAdapter(r),c=new Array;return s.thinFilmWeight=e.iridescenceFactor??0,s.thinFilmIor=e.iridescenceIor??e.iridescenceIOR??1.3,s.thinFilmThicknessMinimum=e.iridescenceThicknessMinimum??100,s.thinFilmThicknessMaximum=e.iridescenceThicknessMaximum??400,e.iridescenceTexture&&c.push(this._loader.loadTextureInfoAsync(`${n}/iridescenceTexture`,e.iridescenceTexture,i=>{i.name=`${r.name} (Iridescence)`,s.thinFilmWeightTexture=i})),e.iridescenceThicknessTexture&&c.push(this._loader.loadTextureInfoAsync(`${n}/iridescenceThicknessTexture`,e.iridescenceThicknessTexture,i=>{i.name=`${r.name} (Iridescence Thickness)`,s.thinFilmThicknessTexture=i})),Promise.all(c).then(()=>{})}}o(t);h(t,!0,a=>new m(a));export{m as KHR_materials_iridescence};
