/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{SliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as o}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ColorConversion as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as t,glsl as a}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{outputColorHighlightOLID as n}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{NoParameters as d}from"../views/webgl/NoParameters.js";import{ShaderBuilder as g}from"../views/webgl/ShaderBuilder.js";class v extends d{}function m(d){const v=new g,{vertex:m,fragment:p,varyings:c}=v,{output:u,perspectiveInterpolation:f,emissionDimmingPass:b}=d;return i(m,d),v.include(o),v.fragment.include(e,d),v.fragment.code.add(a`void outputObjectAndLayerIdColor() {
    ${t(11===u,"fragColor = vec4(0, 0, 0, 1);")}
    }`),v.include(n,d),v.attributes.add("position","vec3"),v.attributes.add("uv0","vec2"),f&&v.attributes.add("perspectiveDivide","float"),m.main.add(a`
    vpos = position;
    vTexCoord = uv0;
    gl_Position = transformPosition(proj, view, vpos);
    ${t(f,"gl_Position *= perspectiveDivide;")}`),c.add("vpos","vec3",{invariant:!0}),c.add("vTexCoord","vec2"),p.include(r),p.uniforms.add(new s("opacity",e=>e.opacity),new l("tex",e=>e.texture)).main.add(a`
    discardBySlice(vpos);
    vec4 finalColor = texture(tex, vTexCoord) * opacity;
    ${t(b,"if (finalColor.a > 0.0) { finalColor.rgb /= finalColor.a; }")}
    outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),v}const p=Object.freeze(Object.defineProperty({__proto__:null,ImageMaterialPassParameters:v,build:m},Symbol.toStringTag,{value:"Module"}));export{p as I,v as a,m as b};
