/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{SliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{terrainDepthTest as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.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{Float2PassUniform as s}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 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 t}from"../views/webgl/ShaderBuilder.js";function n(n){const c=new t,{vertex:v,fragment:g,varyings:u}=c;return c.fragment.include(e,n),c.include(o,n),c.include(d,n),i(v,n),c.attributes.add("position","vec3"),c.attributes.add("uv0","vec2"),u.add("vUV","vec2"),u.add("vpos","vec3"),v.main.add(a`vUV = uv0;
vpos = position;
forwardViewPosDepth((view * vec4(position, 1.0)).xyz);
gl_Position = proj * view * vec4(position, 1.0);`),g.uniforms.add(new s("size",e=>e.size)),g.uniforms.add(new l("color1",e=>e.color1)),g.uniforms.add(new l("color2",e=>e.color2)),g.include(r),g.main.add(a`discardByTerrainDepth();
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(fragColor, vpos, fragColor.rgb);`),c}const c=Object.freeze(Object.defineProperty({__proto__:null,build:n},Symbol.toStringTag,{value:"Module"}));export{c as C,n as b};
