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