🎉 Add support for alpha channel in color of TV Effect, TV Glitch, and Glitch

This commit is contained in:
Simon Schneegans
2023-01-23 17:15:47 +01:00
parent 50780eba46
commit 28d6531a87
19 changed files with 35 additions and 32 deletions
+3 -2
View File
@@ -14,7 +14,7 @@
// The content from common.glsl is automatically prepended to each shader effect.
uniform vec3 uColor;
uniform vec4 uColor;
const float BLUR_WIDTH = 0.01; // Width of the gradients.
const float TB_TIME = 0.7; // Relative time for the top/bottom animation.
@@ -56,7 +56,8 @@ void main() {
float mask = tbMask * lrMask * ffMask;
vec4 oColor = getInputColor(coords);
oColor.rgb = mix(oColor.rgb, uColor * oColor.a, smoothstep(0.0, 1.0, prog));
oColor.rgb =
mix(oColor.rgb, uColor.rgb * oColor.a, uColor.a * smoothstep(0.0, 1.0, prog));
oColor.a *= mask;
// These are pretty useful for understanding how this works.