/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{O as i}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as e}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as t}from"./OITBlendTechniqueConfiguration.js";import{ColorAttachment2 as s,ColorAttachment1 as r}from"../../../../webgl/enums.js";class n{constructor(s){this._techniques=s,this._parameters=new i,this._configuration=new t,s.precompile(e,this._configuration),this._configuration.hasEmitters=!0,s.precompile(e,this._configuration),this._configuration.dimEmissive=!0,s.precompile(e,this._configuration),this._configuration.dimEmissive=!1,this._configuration.hasEmitters=!1}blend(i,t,n,o,a,h){if(this._configuration.hasEmitters=a,this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(a?s:r),this._parameters.frontFaceTexture=n.getTexture(),a){if(h){this._configuration.dimEmissive=!0;const t=this._techniques.get(e,this._configuration);i.bindTechnique(t,o,this._parameters),i.screen.draw(),this._configuration.dimEmissive=!1}this._parameters.emissionTexture=t.getTexture(r),this._parameters.emissionFrontFaceTexture=n.getTexture(r)}const c=this._techniques.get(e,this._configuration);i.bindTechnique(c,o,this._parameters),i.screen.draw()}}export{n as OITBlend};
