diff --git a/render.c b/render.c index 3e9c746..2e06a6f 100644 --- a/render.c +++ b/render.c @@ -922,6 +922,7 @@ struct renderer* rd_new(const char** paths, const char* entry, { .name = "nativeonly", .fmt = "b", .handler = RHANDLER(name, args, { + fprintf(stderr, "WARNING: `nativeonly` is deprecated, use `#if PREMULTIPLY_ALPHA == 1`!\n"); if (current) current->nativeonly = *(bool*) args[0]; else { @@ -1698,7 +1699,7 @@ bool rd_update(struct renderer* r, float* lb, float* rb, size_t bsz, bool modifi case STDIN_TYPE_VEC4: glUniform4f(current->stdin_uniform, stdin_parsed.f[0], stdin_parsed.f[1], - stdin_parsed.f[2], stdin_parsed.f[4]); + stdin_parsed.f[2], stdin_parsed.f[3]); break; default: break; } diff --git a/shaders/bars.glsl b/shaders/bars.glsl index 3c2bc23..6e6a7b0 100644 --- a/shaders/bars.glsl +++ b/shaders/bars.glsl @@ -11,14 +11,16 @@ #define BAR_OUTLINE_WIDTH 0 /* Amplify magnitude of the results each bar displays */ #define AMPLIFY 300 -/* Alpha channel for bars color */ -#define ALPHA 0.7 +/* Whether the current settings use the alpha channel; + enabling this is required for alpha to function + correctly on X11 with `"native"` transparency. */ +#define USE_ALPHA 0 /* How strong the gradient changes */ #define GRADIENT_POWER 60 /* Bar color changes with height */ #define GRADIENT (d / GRADIENT_POWER + 1) /* Bar color */ -#define COLOR (#3366b2 * GRADIENT * ALPHA) +#define COLOR (#3366b2 * GRADIENT) /* Direction that the bars are facing, 0 for inward, 1 for outward */ #define DIRECTION 0 /* Whether to switch left/right audio buffers */ diff --git a/shaders/util/premultiply.frag b/shaders/util/premultiply.frag index ec0e9f9..9595bcf 100644 --- a/shaders/util/premultiply.frag +++ b/shaders/util/premultiply.frag @@ -1,5 +1,7 @@ -#request nativeonly true +#if PREMULTIPLY_ALPHA == 0 +#error __distablestage +#endif #request uniform "prev" tex uniform sampler2D tex;