/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{signal as e}from"../core/signal.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{FloatPassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as l}from"../views/webgl/ShaderBuilder.js";class f extends c{constructor(){super(...arguments),this.effect=0,this.fadeFactor=e(1)}}function i(){const e=new l;return e.include(o),e.outputs.add("fragColor","vec4",0),e.fragment.uniforms.add(new t("colorTexture",e=>e.color),new t("focusArea",e=>e.focusArea),new a("focusAreaEffectMode",e=>e.effect),new r("fadeFactor",e=>e.fadeFactor.value)).main.add(s`
      float mask = texture( focusArea, uv, 0.0 ).r;
      vec4 color = texture( colorTexture, uv, 0.0 );
      vec4 colorDeSaturate = vec4(color.r * 0.25 + color.g * 0.5 + color.b * 0.25);
      if (focusAreaEffectMode == ${s.int(0)}) {
        fragColor = mask > 0.0 ? color : mix(color, 0.55 * colorDeSaturate + 0.45, fadeFactor);
      } else {
        fragColor = mask > 0.0 ? color : mix(color, 0.33 * color, fadeFactor);
      }
  `),e}const n=Object.freeze(Object.defineProperty({__proto__:null,FocusAreaColorPassParameters:f,build:i},Symbol.toStringTag,{value:"Module"}));export{f as F,n as a,i as b};
