diff --git a/shaders/graph.glsl b/shaders/graph.glsl index 846fb89..1906195 100644 --- a/shaders/graph.glsl +++ b/shaders/graph.glsl @@ -22,6 +22,8 @@ #define ANTI_ALIAS 0 /* outline color */ #define OUTLINE #262626 +/* 1 to join the two channels together in the middle, 0 to clamp both down to zero */ +#define JOIN_CHANNELS 0 /* 1 to invert (vertically), 0 otherwise */ #define INVERT 0 diff --git a/shaders/graph/1.frag b/shaders/graph/1.frag index afdf2c4..04839d8 100644 --- a/shaders/graph/1.frag +++ b/shaders/graph/1.frag @@ -91,8 +91,12 @@ float get_line_height(in sampler1D tex, float idx) { /* clamp far ends of the screen down to make the ends of the graph smoother */ float fact = clamp((abs((screen.x / 2) - gl_FragCoord.x) / screen.x) * 48, 0.0F, 1.0F); + #if JOIN_CHANNELS > 0 fact = pow(fact, 1.8); /* To avoid spikes */ s = fact * s + (1 - fact) * middle; + #else + s *= fact; + #endif s *= clamp((min(gl_FragCoord.x, screen.x - gl_FragCoord.x) / screen.x) * 48, 0.0F, 1.0F);