"use strict";
/*
 * This file copies sigma/src/rendering/webgl/shaders/edge.frag.glsl, but with a some changes
 * difference: added a dash-gap pattern to the edge
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.fragmentShaderSource = void 0;
exports.fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_position; // our addition - the position along the line\n\nconst float feather = 0.001;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float u_dashSize = 0.01; // our addition\nconst float u_gapSize = 0.005; // our addition\n\nvoid main(void) {\n  float dist = length(v_normal) * v_thickness;\n\n  float t = smoothstep(\n    v_thickness - feather,\n    v_thickness,\n    dist\n  );\n\n  // our additions\n  float totalSize = u_dashSize + u_gapSize;\n  float positionInDashGap = mod(v_position, totalSize);\n  float dashGapRatio = positionInDashGap / u_dashSize;\n  // end additions (dashGapRatio is used below in if)\n\n  if (dashGapRatio < 1.0) {\n    gl_FragColor = mix(v_color, transparent, t);\n  } else {\n    discard;\n  }\n}\n";
