import{C as d,aG as p,aH as u}from"./index-CDrXokXW.js";import{GLTFLoader as c}from"./glTFLoader-Bp7IfGPK.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 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};
