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