flat in vec2 startPos; in vec2 vertPos; out vec4 fragColor; uniform vec4 color; uniform float dashSize; uniform float gapSize; void main() { vec2 dir = (vertPos.xy - startPos.xy); float dist = length(dir); if (fract(dist / (dashSize + gapSize)) > dashSize/(dashSize + gapSize)) discard; fragColor = color; }