File: inhibitor.glsl

package info (click to toggle)
python-vispy 0.15.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,868 kB
  • sloc: python: 59,799; javascript: 6,800; makefile: 69; sh: 6
file content (26 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * Copyright (c) Vispy Development Team
 * Distributed under the (new) BSD License. See LICENSE.txt for more info.
 *
 * This files contains the code for drawing curved arrow heads.
 */

#include "arrowheads/util.glsl"


float arrow_inhibitor_round(vec2 texcoord, float size,
                            float linewidth, float antialias)
{
    vec2 c = vec2(size/2.0, 0.0);
    float radius = size/2.0;
    float radius_inner = radius - linewidth/6.0;

    float d1 = length(texcoord - c) - radius;
    float d2 = length(texcoord - c) - radius_inner;
    float d3 = texcoord.x - (size/2.5);

    return max(d3, max(d1, -d2));
    //return max(d1, -d2);
}