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