import{GLTFLoader as m}from"./glTFLoader-Bp7IfGPK.js";import{C as f,aG as d,aH as l}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_diffuse_transmission";class T{constructor(r){this.name=t,this.order=174,this._loader=r,this.enabled=this._loader.isExtensionUsed(t),this.enabled&&(r.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,n,o){return m.LoadExtensionAsync(r,n,this.name,async(s,e)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(r,n,o)),i.push(this._loadTranslucentPropertiesAsync(s,n,o,e)),await Promise.all(i).then(()=>{})})}_loadTranslucentPropertiesAsync(r,n,o,s){const e=this._loader._getOrCreateMaterialAdapter(o);e.configureSubsurface(),e.subsurfaceWeight=s.diffuseTransmissionFactor??0,e.subsurfaceColor=s.diffuseTransmissionColorFactor!==void 0?f.FromArray(s.diffuseTransmissionColorFactor):f.White();const i=new Array;return s.diffuseTransmissionTexture&&(s.diffuseTransmissionTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTransmissionTexture`,s.diffuseTransmissionTexture).then(a=>{a.name=`${o.name} (Diffuse Transmission)`,e.subsurfaceWeightTexture=a}))),s.diffuseTransmissionColorTexture&&i.push(this._loader.loadTextureInfoAsync(`${r}/diffuseTransmissionColorTexture`,s.diffuseTransmissionColorTexture).then(a=>{a.name=`${o.name} (Diffuse Transmission Color)`,e.subsurfaceColorTexture=a})),Promise.all(i).then(()=>{})}}d(t);l(t,!0,u=>new T(u));export{T as KHR_materials_diffuse_transmission};
