summaryrefslogtreecommitdiff
path: root/src/shader/line.fragment.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader/line.fragment.glsl')
-rw-r--r--src/shader/line.fragment.glsl17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/shader/line.fragment.glsl b/src/shader/line.fragment.glsl
index 8064e5c733..6cef488633 100644
--- a/src/shader/line.fragment.glsl
+++ b/src/shader/line.fragment.glsl
@@ -1,9 +1,6 @@
-// shared
uniform float u_debug;
uniform vec2 u_linewidth;
uniform vec4 u_color;
-uniform float u_point;
-uniform float u_gamma;
uniform vec2 u_dasharray;
@@ -12,23 +9,21 @@ varying float v_linesofar;
void main() {
// Calculate the distance of the pixel from the line in pixels.
- float dist = length(v_normal) * (1.0 - u_point) + u_point * length(gl_PointCoord * 2.0 - 1.0);
-
- dist *= u_linewidth.s;
+ float dist = length(v_normal) * u_linewidth.s;
// Calculate the antialiasing fade factor. This is either when fading in
// the line in case of an offset line (v_linewidth.t) or when fading out
// (v_linewidth.s)
- float alpha = clamp(min(dist - (u_linewidth.t - 1.0), u_linewidth.s - dist) * u_gamma, 0.0, 1.0);
+ float alpha = clamp(min(dist - (u_linewidth.t - 1.0), u_linewidth.s - dist), 0.0, 1.0);
// Calculate the antialiasing fade factor based on distance to the dash.
// Only affects alpha when line is dashed
float pos = mod(v_linesofar, u_dasharray.x + u_dasharray.y);
alpha *= max(step(0.0, -u_dasharray.y), clamp(min(pos, u_dasharray.x - pos), 0.0, 1.0));
- gl_FragColor = u_color * alpha;
-
if (u_debug > 0.0) {
- gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = u_color;
+ } else {
+ gl_FragColor = u_color * alpha;
}
-}
+} \ No newline at end of file