/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/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 o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{VertexColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VisualVariables as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.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{Float4PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{glsl as a}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{outputColorHighlightOLID as d}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as g}from"../views/webgl/ShaderBuilder.js";function u(u){const c=new g,{vertex:b,fragment:v,attributes:m,varyings:p}=c,{hasVVColor:w,hasVertexColors:f}=u;return m.add("position","vec3"),b.inputs.add("position",()=>"position"),t(b,u),c.include(r),c.include(i,u),c.include(l,u),c.include(o,u),v.include(e,u),c.include(d,u),w&&m.add("colorFeatureAttribute","float"),f||p.add("vColor","vec4"),p.add("vpos","vec3",{invariant:!0}),b.uniforms.add(new n("uColor",e=>e.color)),b.main.add(a`
      vpos = position;
      forwardVertexColor();
      forwardObjectAndLayerIdColor();

      ${f?"vColor *= uColor;":w?"vColor = uColor * interpolateVVColor(colorFeatureAttribute);":"vColor = uColor;"}
      gl_Position = transformPosition(proj, view, vpos);`),v.include(s),v.main.add(a`discardBySlice(vpos);
outputColorHighlightOLID(applySlice(vColor, vpos), vColor.rgb);`),c}const c=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));export{c as C,u as b};
