aboutsummaryrefslogtreecommitdiffstats
path: root/config/cava/shaders
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2024-05-10 10:55:49 +0900
committerGitHub <noreply@github.com>2024-05-10 10:55:49 +0900
commitf233063b8a85422d4e2898918d78d5321db882eb (patch)
tree30e9177c8361a275709e5053414829f5edbc4bd7 /config/cava/shaders
parent04a693a9eaf5edac5e7c1d4b5424ef31158c676d (diff)
parente6643cb12158f84f056742080f20dd394d5abd9d (diff)
Merge pull request #252 from JaKooLit/development-wallust
Merging - Wallust Branch to Development Branch..
Diffstat (limited to 'config/cava/shaders')
-rw-r--r--config/cava/shaders/northern_lights.frag34
1 files changed, 34 insertions, 0 deletions
diff --git a/config/cava/shaders/northern_lights.frag b/config/cava/shaders/northern_lights.frag
new file mode 100644
index 00000000..ecd859a7
--- /dev/null
+++ b/config/cava/shaders/northern_lights.frag
@@ -0,0 +1,34 @@
+#version 330
+
+in vec2 fragCoord;
+out vec4 fragColor;
+
+// bar values. defaults to left channels first (low to high), then right (high to low).
+uniform float bars[512];
+
+uniform int bars_count; // number of bars (left + right) (configurable)
+
+uniform vec3 u_resolution; // window resolution, not used here
+
+//colors, configurable in cava config file
+uniform vec3 bg_color; // background color(r,g,b) (0.0 - 1.0), not used here
+uniform vec3 fg_color; // foreground color, not used here
+
+void main()
+{
+ // find which bar to use based on where we are on the x axis
+ int bar = int(bars_count * fragCoord.x);
+
+ float bar_y = 1.0 - abs((fragCoord.y - 0.5)) * 2.0;
+ float y = (bars[bar]) * bar_y;
+
+ float bar_x = (fragCoord.x - float(bar) / float(bars_count)) * bars_count;
+ float bar_r = 1.0 - abs((bar_x - 0.5)) * 2;
+
+ bar_r = bar_r * bar_r * 2;
+
+ // set color
+ fragColor.r = fg_color.x * y * bar_r;
+ fragColor.g = fg_color.y * y * bar_r;
+ fragColor.b = fg_color.z * y * bar_r;
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage