/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as i}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as r}from"./OITDimTechnique.js";import{ColorAttachment2 as s,ColorAttachment1 as n}from"../../../../webgl/enums.js";class o{constructor(s){this._techniques=s,this._parameters=new e,this._configuration=new i,s.precompile(t,this._configuration),this._configuration.hasEmitters=!0,s.precompile(t,this._configuration),s.precompile(r)}blend(e,i,o,a,h,c){if(this._configuration.hasEmitters=h,this._parameters.colorTexture=i.getTexture(),this._parameters.alphaTexture=i.getTexture(h?s:n),this._parameters.frontFaceTexture=o.getTexture(),h){if(c){const t=this._techniques.get(r);e.bindTechnique(t,a,this._parameters),e.screen.draw()}this._parameters.emissionTexture=i.getTexture(n),this._parameters.emissionFrontFaceTexture=o.getTexture(n)}const u=this._techniques.get(t,this._configuration);e.bindTechnique(u,a,this._parameters),e.screen.draw()}}export{o as OITBlend};
