/* 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{ColorConversion as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{outputColorHighlightOLID as a}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as d}from"../views/webgl/ShaderBuilder.js";function t(t){const n=new d,{vertex:c,fragment:v,varyings:g}=n;return n.fragment.include(e,t),n.include(a,t),r(c,t),n.attributes.add("position","vec3"),n.attributes.add("uv0","vec2"),g.add("vUV","vec2"),g.add("vpos","vec3"),c.main.add(s`vUV = uv0;
vpos = position;
gl_Position = proj * view * vec4(position, 1.0);`),v.uniforms.add(new i("size",e=>e.size)),v.uniforms.add(new l("color1",e=>e.color1)),v.uniforms.add(new l("color2",e=>e.color2)),v.include(o),v.main.add(s`vec2 uvScaled = vUV / (2.0 * size);
vec2 uv = fract(uvScaled - 0.25);
vec2 ab = clamp((abs(uv - 0.5) - 0.25) / fwidth(uvScaled), -0.5, 0.5);
float fade = smoothstep(0.25, 0.5, max(fwidth(uvScaled.x), fwidth(uvScaled.y)));
float t = mix(abs(ab.x + ab.y), 0.5, fade);
fragColor = mix(color2, color1, t);
outputColorHighlightOLID(applySlice(fragColor, vpos), fragColor.rgb);`),n}const n=Object.freeze(Object.defineProperty({__proto__:null,build:t},Symbol.toStringTag,{value:"Module"}));export{n as C,t as b};
