Added fg/bg pipe defaults, fixed parsing bugs, fixed broken smoothing defaults

This commit is contained in:
Jarcode
2019-04-03 01:20:45 -07:00
parent d72deb8fae
commit c766c574a6
9 changed files with 40 additions and 44 deletions

View File

@@ -536,10 +536,8 @@ void ext_process(struct glsl_ext* ext, const char* f) {
} else parse_error(line, f, "Unexpected `--pipe` binding name '@%s' while parsing GLSL." } else parse_error(line, f, "Unexpected `--pipe` binding name '@%s' while parsing GLSL."
" Try assigning a default or binding the value.", parsed_name); " Try assigning a default or binding the value.", parsed_name);
} }
state = at == '\n' ? LINE_START : GLSL; state = GLSL;
if (bbuf_idx >= sizeof(bbuf) - 1) continue;
continue;
else goto copy; /* copy character if it ended the sequence */
} }
} }
} }

View File

@@ -2,25 +2,23 @@
/* Center line thickness (pixels) */ /* Center line thickness (pixels) */
#define C_LINE 1 #define C_LINE 1
/* Width (in pixels) of each bar */ /* Width (in pixels) of each bar */
#define BAR_WIDTH 4 #define BAR_WIDTH 5
/* Width (in pixels) of each bar gap */ /* Width (in pixels) of each bar gap */
#define BAR_GAP 2 #define BAR_GAP 1
/* Outline color */
#define BAR_OUTLINE #262626
/* Outline width (in pixels, set to 0 to disable outline drawing) */ /* Outline width (in pixels, set to 0 to disable outline drawing) */
#define BAR_OUTLINE_WIDTH 0 #define BAR_OUTLINE_WIDTH 1
/* Amplify magnitude of the results each bar displays */ /* Amplify magnitude of the results each bar displays */
#define AMPLIFY 300 #define AMPLIFY 300
/* Whether the current settings use the alpha channel; /* Whether the current settings use the alpha channel;
enabling this is required for alpha to function enabling this is required for alpha to function
correctly on X11 with `"native"` transparency */ correctly on X11 with `"native"` transparency */
#define USE_ALPHA 0 #define USE_ALPHA 0
/* How strong the gradient changes */ /* How quickly the gradient transitions, in pixels */
#define GRADIENT_POWER 60 #define GRADIENT 80
/* Bar color changes with height */ /* Bar color. By default this provides a blue-white gradient. */
#define GRADIENT (d / GRADIENT_POWER + 1) #define COLOR @fg:mix(#3366b2, #a0a0b2, clamp(d / GRADIENT, 0, 1))
/* Bar color */ /* Outline color. By default this provides a 'glint' outline based on the bar color */
#define COLOR (#3366b2 * GRADIENT) #define BAR_OUTLINE @bg:vec4(COLOR.rgb * 1.5, COLOR.a)
/* Direction that the bars are facing, 0 for inward, 1 for outward */ /* Direction that the bars are facing, 0 for inward, 1 for outward */
#define DIRECTION 0 #define DIRECTION 0
/* Whether to switch left/right audio buffers */ /* Whether to switch left/right audio buffers */

View File

@@ -3,7 +3,7 @@
/* center line thickness (pixels) */ /* center line thickness (pixels) */
#define C_LINE 1.5 #define C_LINE 1.5
/* outline color */ /* outline color */
#define OUTLINE #333333 #define OUTLINE @fg:#333333
/* Amplify magnitude of the results each bar displays */ /* Amplify magnitude of the results each bar displays */
#define AMPLIFY 150 #define AMPLIFY 150
/* Angle (in radians) for how much to rotate the visualizer */ /* Angle (in radians) for how much to rotate the visualizer */

View File

@@ -5,10 +5,10 @@
#define DIRECTION 1 #define DIRECTION 1
/* Color gradient scale, (optionally) used in `COLOR` macro */ /* Color gradient scale, (optionally) used in `COLOR` macro */
#define GRADIENT_SCALE 75 #define GRADIENT 75
/* Color definition. By default this is a gradient formed by mixing two colors. /* Color definition. By default this is a gradient formed by mixing two colors.
`pos` represents the pixel position relative to the visualizer baseline. */ `pos` represents the pixel position relative to the visualizer baseline. */
#define COLOR mix(#802A2A, #4F4F92, clamp(pos / GRADIENT_SCALE, 0, 1)) #define COLOR @fg:mix(#802A2A, #4F4F92, clamp(pos / GRADIENT, 0, 1))
/* 1 to draw outline, 0 to disable */ /* 1 to draw outline, 0 to disable */
#define DRAW_OUTLINE 0 #define DRAW_OUTLINE 0
/* 1 to draw edge highlight, 0 to disable */ /* 1 to draw edge highlight, 0 to disable */
@@ -18,7 +18,7 @@
Note: requires `xroot` or `none` opacity to be set */ Note: requires `xroot` or `none` opacity to be set */
#define ANTI_ALIAS 0 #define ANTI_ALIAS 0
/* outline color */ /* outline color */
#define OUTLINE #262626 #define OUTLINE @bg:#262626
/* 1 to join the two channels together in the middle, 0 to clamp both down to zero */ /* 1 to join the two channels together in the middle, 0 to clamp both down to zero */
#define JOIN_CHANNELS 0 #define JOIN_CHANNELS 0
/* 1 to invert (vertically), 0 otherwise */ /* 1 to invert (vertically), 0 otherwise */

View File

@@ -108,10 +108,11 @@ void render_side(in sampler1D tex, float idx) {
/* and finally set fragment color if we are in range */ /* and finally set fragment color if we are in range */
#if INVERT > 0 #if INVERT > 0
float pos = float(screen.y) - gl_FragCoord.y; float d = float(screen.y) - gl_FragCoord.y;
#else #else
float pos = gl_FragCoord.y; float d = gl_FragCoord.y;
#endif #endif
#define pos d
if (pos + 1.5 <= s) { if (pos + 1.5 <= s) {
fragment = COLOR; fragment = COLOR;
} else { } else {

View File

@@ -4,19 +4,17 @@
/* center line thickness (pixels) */ /* center line thickness (pixels) */
#define C_LINE 2 #define C_LINE 2
/* outline color */ /* outline color */
#define OUTLINE #333333 #define OUTLINE @bg:#333333
/* number of bars (use even values for best results) */ /* number of bars (use even values for best results) */
#define NBARS 180 #define NBARS 160
/* width (in pixels) of each bar*/ /* width (in pixels) of each bar*/
#define BAR_WIDTH 3.5 #define BAR_WIDTH 4.5
/* outline color */
#define BAR_OUTLINE OUTLINE
/* outline width (in pixels, set to 0 to disable outline drawing) */
#define BAR_OUTLINE_WIDTH 0
/* Amplify magnitude of the results each bar displays */ /* Amplify magnitude of the results each bar displays */
#define AMPLIFY 300 #define AMPLIFY 300
/* Bar color */ /* How quickly the gradient transitions, in pixels */
#define COLOR (#cc3333 * ((d / 40) + 1)) #define GRADIENT 95
/* Bar color. This is a gradient by default. */
#define COLOR @fg:mix(#cc3333, #cca0a0, clamp(d / GRADIENT, 0, 1))
/* Angle (in radians) for how much to rotate the visualizer */ /* Angle (in radians) for how much to rotate the visualizer */
#define ROTATE (PI / 2) #define ROTATE (PI / 2)
/* Whether to swap left/right audio buffers, set to 1 to enable */ /* Whether to swap left/right audio buffers, set to 1 to enable */
@@ -34,6 +32,10 @@
/* Gravity step, override from `smooth_parameters.glsl` */ /* Gravity step, override from `smooth_parameters.glsl` */
#request setgravitystep 5.0 #request setgravitystep 5.0
/* Smoothing factor, override from `smooth_parameters.glsl` */ /* Smoothing factor, override from `smooth_parameters.glsl` */
#request setsmoothfactor 0.02 #request setsmoothfactor 0.02
/* (DEPRECATED) outline color */
#define BAR_OUTLINE OUTLINE
/* (DEPRECATED) outline width (in pixels, set to 0 to disable outline drawing) */
#define BAR_OUTLINE_WIDTH 0

View File

@@ -65,7 +65,8 @@ void main() {
if (dir > PI) if (dir > PI)
idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */ idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */
#if INVERT == 0 #if INVERT == 0
idx = -idx; /* Invert if needed */ idx = -idx; /* Invert if needed */
#endif
float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */ float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */
#define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */ #define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */
float v; float v;

View File

@@ -39,7 +39,7 @@
/* The frequency range to sample. 1.0 would be the entire FFT output, /* The frequency range to sample. 1.0 would be the entire FFT output,
and lower values reduce the displayed frequencies in a log-like and lower values reduce the displayed frequencies in a log-like
scale. */ scale. */
#define SAMPLE_RANGE 1.5 #define SAMPLE_RANGE 0.9
/* Factor for how to scale higher frequencies. Used in a linear equation /* Factor for how to scale higher frequencies. Used in a linear equation
which is multiplied by the result of the fft transformation. */ which is multiplied by the result of the fft transformation. */

View File

@@ -1,14 +1,10 @@
/* min (vertical) line thickness */ /* Min (vertical) line thickness */
#define MIN_THICKNESS 1 #define MIN_THICKNESS 1
/* Max (vertical) line thickness */
/* max (vertical) line thickness */
#define MAX_THICKNESS 6 #define MAX_THICKNESS 6
/* Base color to use, distance from center will multiply the RGB components */
/* base color to use, distance from center will multiply the RGB components */ #define BASE_COLOR @fg:vec4(0.7, 0.2, 0.45, 1)
#define BASE_COLOR vec4(0.7, 0.2, 0.45, 1) /* Amplitude */
/* amplitude */
#define AMPLIFY 500 #define AMPLIFY 500
/* Outline color */
/* outline color */ #define OUTLINE @bg:vec4(0.15, 0.15, 0.15, 1)
#define OUTLINE vec4(0.15, 0.15, 0.15, 1)