Make joining optional

This commit is contained in:
Theo Müller
2019-01-30 20:26:35 +01:00
parent a39a1324e1
commit 91530dfc49
2 changed files with 6 additions and 0 deletions

View File

@@ -22,6 +22,8 @@
#define ANTI_ALIAS 0 #define ANTI_ALIAS 0
/* outline color */ /* outline color */
#define OUTLINE #262626 #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 */ /* 1 to invert (vertically), 0 otherwise */
#define INVERT 0 #define INVERT 0

View File

@@ -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 */ /* 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); 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 */ fact = pow(fact, 1.8); /* To avoid spikes */
s = fact * s + (1 - fact) * middle; 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); s *= clamp((min(gl_FragCoord.x, screen.x - gl_FragCoord.x) / screen.x) * 48, 0.0F, 1.0F);