import{GLTFLoader as d}from"./glTFLoader-f5CXkgzs.js";import{aG as o,aH as h}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 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};
