[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Add "Factory" visualiser

Kasper (Oct 2, 2025, 11:46 PM +0200) d2975cd0 12bb9346

+48
+48
src/lib/visualizer/Visualizer.svelte
··· 96 96 } 97 97 `, 98 98 }, 99 + { 100 + name: 'Factory', 101 + author: 'yozic', 102 + shader: ` 103 + #define BALLS 15. 104 + #define PI 3.14159265359 105 + #define zoom 47.379 106 + #define rotation 0.874 107 + #define yOuter 0.626 108 + #define yDivider 278.913 109 + #define xOuter 0.626 110 + #define xDivider 194.847 111 + #define multiplier 706.071 112 + #define radius 32.912 113 + #define ballSize 2.178 114 + #define contrast 2.529 115 + 116 + mat2 rotate2d(float _angle){ 117 + return mat2(cos(_angle), -sin(_angle), sin(_angle), cos(_angle)); 118 + } 119 + 120 + void mainImage (out vec4 fragColor, in vec2 fragCoord) { 121 + vec2 uv = 2. * fragCoord/iResolution.xy - 1.; 122 + uv.x *= iResolution.x / iResolution.y; 123 + uv *= zoom; 124 + fragColor = vec4(0.); 125 + 126 + uv = normalize(abs(uv) + sin(abs(uv) - iStream)) * length(uv); 127 + uv *= rotate2d(rotation); 128 + 129 + for (float i = 0.; i < BALLS; i++) { 130 + float dist = length(uv); 131 + uv.y += yOuter * sin(uv.y/yDivider + iStream/5.) / 1. * sin(uv.x/1. - iStream/3.); 132 + uv.x -= xOuter * sin(uv.x/xDivider - iStream/5.) / 1. * sin(uv.x/1.1 + iStream/1.); 133 + 134 + float t = i * PI / BALLS * (5. + 1.) + iStream/5000.; 135 + float _multiplier = dist * multiplier * sin(uv.x); 136 + vec2 p = vec2(radius * -2. * tan(t * multiplier), 2. * radius * sin(t * multiplier)); 137 + 138 + vec3 col = cos(vec3(0, 1, -1) * PI * 2. / 3. + PI * (iStream / 20. + i / 5.)) * 0.5 + 0.5; 139 + fragColor += vec4(pow(iVolume, 1.3) * ballSize / length(uv - p * 0.9) * col, contrast); 140 + } 141 + 142 + fragColor.xyz = pow(fragColor.xyz, vec3(contrast)); 143 + fragColor.w = 1.0; 144 + } 145 + `, 146 + }, 99 147 ] 100 148 101 149 const image_shader = `