import{C as d,aG as p,aH as u}from"./index-T8LZyOXI.js";import{GLTFLoader as c}from"./glTFLoader-f5CXkgzs.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 i="KHR_materials_unlit";class m{constructor(e){this.name=i,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,r,t){return c.LoadExtensionAsync(e,r,this.name,async()=>await this._loadUnlitPropertiesAsync(e,r,t))}_loadUnlitPropertiesAsync(e,r,t){const o=this._loader._getOrCreateMaterialAdapter(t),l=new Array,s=r.pbrMetallicRoughness;return s&&(s.baseColorFactor&&(o.baseColor=d.FromArray(s.baseColorFactor),o.geometryOpacity=s.baseColorFactor[3]),s.baseColorTexture&&l.push(this._loader.loadTextureInfoAsync(`${e}/baseColorTexture`,s.baseColorTexture,n=>{n.name=`${t.name} (Base Color)`,o.baseColorTexture=n}))),o.isUnlit=!0,r.doubleSided&&(o.backFaceCulling=!1,o.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,r,t),Promise.all(l).then(()=>{})}}p(i);u(i,!0,a=>new m(a));export{m as KHR_materials_unlit};
