import{GLTFLoader as i}from"./glTFLoader-Bp7IfGPK.js";import{C as n,aG as p,aH as d}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_specular";class m{constructor(s){this.name=t,this.order=190,this._loader=s,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,e,o){return i.LoadExtensionAsync(s,e,this.name,async(l,a)=>{const r=new Array;r.push(this._loader.loadMaterialPropertiesAsync(s,e,o)),r.push(this._loadSpecularPropertiesAsync(l,a,o));const c=this._loader._getOrCreateMaterialAdapter(o);return a.extensions&&a.extensions.EXT_materials_specular_edge_color&&a.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&c.enableSpecularEdgeColor(!0),await Promise.all(r).then(()=>{})})}_loadSpecularPropertiesAsync(s,e,o){const l=this._loader._getOrCreateMaterialAdapter(o),a=new Array;return l.specularWeight=e.specularFactor??1,l.specularColor=e.specularColorFactor!==void 0?n.FromArray(e.specularColorFactor):new n(1,1,1),e.specularTexture&&(e.specularTexture.nonColorData=!0,a.push(this._loader.loadTextureInfoAsync(`${s}/specularTexture`,e.specularTexture,r=>{r.name=`${o.name} (Specular)`,l.specularWeightTexture=r}))),e.specularColorTexture&&a.push(this._loader.loadTextureInfoAsync(`${s}/specularColorTexture`,e.specularColorTexture,r=>{r.name=`${o.name} (Specular Color)`,l.specularColorTexture=r})),Promise.all(a).then(()=>{})}}p(t);d(t,!0,u=>new m(u));export{m as KHR_materials_specular};
