blob: 2c13284cf3466a8894962640c91a62a728abdc67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/* Same code as 2D version actually, maybe we should deduplicate that? */
#if __VERSION__ == 120
noperspective varying float distance_along_line;
#define fragColor gl_FragColor
#else
noperspective in float distance_along_line;
out vec4 fragColor;
#endif
uniform float dash_width;
uniform float dash_width_on;
uniform vec4 color1;
uniform vec4 color2;
void main()
{
if (mod(distance_along_line, dash_width) <= dash_width_on) {
fragColor = color1;
} else {
fragColor = color2;
}
}
|